CN112134904B - Frame packer, method and metering chip for inter-chip data frame protocol processing - Google Patents

Frame packer, method and metering chip for inter-chip data frame protocol processing Download PDF

Info

Publication number
CN112134904B
CN112134904B CN202011301398.4A CN202011301398A CN112134904B CN 112134904 B CN112134904 B CN 112134904B CN 202011301398 A CN202011301398 A CN 202011301398A CN 112134904 B CN112134904 B CN 112134904B
Authority
CN
China
Prior art keywords
data
frame
data frame
value
metering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011301398.4A
Other languages
Chinese (zh)
Other versions
CN112134904A (en
Inventor
陈钰哲
胡毅
张彤
杨小坤
刘畅
李德建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Information and Telecommunication Co Ltd
Beijing Smartchip Microelectronics Technology Co Ltd
Original Assignee
State Grid Information and Telecommunication Co Ltd
Beijing Smartchip Microelectronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Information and Telecommunication Co Ltd, Beijing Smartchip Microelectronics Technology Co Ltd filed Critical State Grid Information and Telecommunication Co Ltd
Priority to CN202011301398.4A priority Critical patent/CN112134904B/en
Publication of CN112134904A publication Critical patent/CN112134904A/en
Application granted granted Critical
Publication of CN112134904B publication Critical patent/CN112134904B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

The invention provides a frame packer, a method and a metering chip for inter-chip data frame protocol processing. The frame packer includes: the frame setting module is used for setting the values of a start character, an end character, a length character, a sequence number character and a command character of the data frame and transmitting the values to the first data selector; the buffer is used for buffering the metering value carried by the DMA from the metering value register of the metering chip; the state machine is used for carrying out state transition according to a set data frame format and controlling the first data selector to acquire and output corresponding data; the first data selector is used for acquiring and outputting corresponding data according to the current state of the state machine to generate a data frame; the checking module is used for generating a checking value according to the command symbol, the length symbol, the sequence number symbol and the data of the data field output by the first data selector and transmitting the checking value to the first data selector; and the bus protocol processing module is used for converting the generated data frame into a data frame conforming to a bus protocol of the communication peripheral and transmitting the data frame to the communication peripheral.

Description

Frame packer, method and metering chip for inter-chip data frame protocol processing
Technical Field
The invention relates to the field of measurement data transmission, in particular to a frame packer for inter-chip data frame protocol processing, a frame packing method for inter-chip data frame protocol processing, a metering chip and a method for transmitting a metering value to a management core.
Background
With the proposal of the International proposal of the IR46 (International Recommendation 46) electric energy meter, the scheme of the 'double-core' intelligent electric meter becomes the main direction of the solution of the next generation intelligent electric meter in China. "Dual core" means a metering core and a management core. The metering core is only responsible for metering and cannot be upgraded; the management chip is responsible for upgrading the software of the non-metering part but not responsible for the metering part. The two are independent of each other and do not influence each other, and data transmission can only be carried out through the serial peripheral interface SPI. In the process, usually, after voltage and current signals are sampled in a metering chip, a metering value is obtained through calculation of a legal metering algorithm, the metering value is converted into a transmission format conforming to a data frame protocol, and the transmission format is sent to a management core through an SPI (serial peripheral interface).
The metering chip stores a plurality of metering values obtained by a metering algorithm in a plurality of electric Energy Metering Units (EMUs) at intervals, and the metering values must be read and stored quickly, otherwise, the metering values are covered by the next set of metering values, and the sampled data is lost. In the prior art, one DMA (Direct Memory Access) needs to be used to transport these measurement values to an SRAM (Static Random Access Memory) for storage, and another DMA is used to transport the data in the SRAM to a high-speed communication peripheral such as an SPI (Serial peripheral Interface) or a UART (Universal Asynchronous Receiver/Transmitter) for transmission, and the communication peripheral also needs to have a function of adding and configuring symbols other than a data domain. The whole process needs the cooperation of 2 DMA, if only one DMA is directly carried from the EMU register to the communication peripheral equipment, the loss of the sampling value can be caused. Because only one path of DMA is used, if the trigger signal of the DMA work needs to be set as a ready signal of a metering value of a metering chip, data loss may be caused because the sending request cannot be processed in time during the transmission of the peripheral or other reasons in the process of carrying. On the contrary, if the DMA operation trigger signal is set as the ready signal of the communication peripheral, the metering value may not be taken in time.
In the prior art, when the application scenario is implemented, taking an external communication as SPI as an example, the metering chip needs 2 DMA channels to complete data transfer operation during operation, one DMA channel is responsible for timely carrying a metering value in the EMU to the SRAM, and the other DMA channel is responsible for carrying data in the SRAM to the special SPI for transmission. In this case, a lot of resources of the chip are occupied, the flexibility of program development is reduced, and the operating power consumption of the chip is increased. In addition, the prior art needs a special SRAM for storing the metering value of the metering chip in time, which results in a corresponding increase in chip area and cost. Meanwhile, in order to make the output data conform to the data frame protocol, the prior art needs to use a special SPI or other special high-speed communication peripherals, which can accurately process and add symbols except for the data field in real time, and the communication peripheral needs to be redesigned when replaced, which can affect the survivability of the chip and seriously delay the development cycle of the chip. A schematic diagram of a prior art application scheme is shown in fig. 1.
Disclosure of Invention
The invention aims to provide a frame packer, a method and a metering chip for inter-chip data frame protocol processing, wherein the frame packer is used for data packing, the work use of SRAM and one path of DMA is reduced, the work power consumption of the chip is reduced, the flexibility of program development is increased, and only common SPI or UART is needed as a communication peripheral to be matched with and send a data frame conforming to a protocol, so that the application scene that metering data of the metering chip is converted into a data frame and sent to a management chip is completed.
In order to achieve the above object, a first aspect of the present invention provides a frame packer for inter-chip data frame protocol processing, the frame packer comprising:
the frame setting module is used for setting the values of a start character, an end character, a length character, a sequence number character and a command character of the data frame and transmitting the values to the first data selector;
the buffer is used for buffering the metering value carried by the DMA from the metering value register of the metering chip and waiting for the reading of the first data selector;
the state machine is used for carrying out state transition according to a set data frame format and controlling the first data selector to acquire and output corresponding data;
the first data selector is used for acquiring and outputting corresponding data according to the current state of the state machine to generate a data frame;
the checking module is used for generating a checking value according to the command symbol, the length symbol, the sequence symbol and the data of the data field output by the first data selector and transmitting the checking value to the first data selector; and
and the bus protocol processing module is used for converting the generated data frame into a data frame conforming to a communication peripheral bus protocol and transmitting the data frame to the communication peripheral. The frame packer uses the state machine and the first data selector to finish the value taking of the currently sent frame data, so that the data packing is realized, the work use of the SRAM and one path of DMA is reduced, the work power consumption of a chip is reduced, and the flexibility of program development is increased.
Further, the frame setting module includes:
the frame parameter configuration module is used for configuring the values of a start character, an end character and a command character of a data frame according to the received metering value and transmitting the values to the first data selector;
the frame length calculation module is used for calculating the length value of a data frame according to the metering value to be sent and transmitting the length value to the first data selector; and
and the frame sequence number counting module is used for counting the sequence number value of the current frame and transmitting the sequence number value to the first data selector.
Optionally, the frame packer further comprises:
the module configuration module is used for configuring data selection parameters of the second data selector;
and the second data selector is used for outputting the data frame or the bus data conforming to the communication peripheral bus protocol according to the data selection parameters. The configuration module configures parameters of the second data selector to control the data type output by the second data selector, so that the frame packer can be used for outputting data frames and can also be used for directly transmitting bus data to communication peripherals, and various requirements of data transmission are met.
Further, the commander represents the type of the metering value, and the type of the metering value includes voltage, current, electric quantity, and the like.
Further, the check module is a cyclic redundancy check module.
Furthermore, the buffer is a first-in first-out type buffer, the storage requirement of a metering value is met, meanwhile, the depth of the first-in first-out type register can be adjusted according to the actual requirement, and the buffer is more flexible than direct memories such as an SRAM/FLASH and the like, small in area and low in power consumption.
Optionally, the communication peripheral includes a serial peripheral interface and a universal asynchronous receiver transmitter. The communication peripheral can only use common communication peripheral, so that the design cost of the chip is saved, the existing communication peripheral of the existing metering chip is fully utilized, and the inheritability of the chip is reserved.
Further, the data frame generated by the first data selector comprises a start character, a command character, a length character, a sequence number character, a data field, a check character and an end character.
The second aspect of the present invention provides a frame packing method for inter-chip data frame protocol processing, which is applied to the frame packer for inter-chip data frame protocol processing, and the frame packing method includes:
the frame parameter configuration module configures a start character, an end character and a command character of a data frame according to the received metering value and transmits the start character, the end character and the command character to the first data selector;
the frame length calculating module calculates the length of a data frame according to the metering value to be sent and transmits the length to the first data selector;
the frame sequence number counting module counts the sequence number of the current frame and transmits the sequence number to the first data selector;
the buffer caches the metering value carried by the DMA from the metering value register of the metering chip and waits for the reading of the first data selector;
the state machine receives a ready signal sent by the communication peripheral equipment and judges whether data frame sending can be carried out or not;
if not, the state machine stays at the current state and waits for the data frame to be sent;
if yes, the state machine carries out state transition according to a set data frame format, and controls the first data selector to acquire and output corresponding data according to the current state of the state machine to generate a data frame;
the checking module generates a checking value according to the command symbol, the length symbol, the sequence symbol and the data of the data field output by the first data selector and transmits the checking value to the first data selector;
and the bus protocol processing module converts the generated data frame into a data frame conforming to a communication peripheral bus protocol and transmits the data frame to the communication peripheral. The data frame packing is realized through the frame packer, the work use of an SRAM and a DMA is effectively reduced, the work power consumption of a chip is reduced, and the flexibility of program development is increased.
Optionally, the method further includes:
configuring data selection parameters of the second data selector,
if the configuration is the output of a frame packer, outputting the data frame conforming to the bus protocol of the communication peripheral to the communication peripheral by the second data selector when the data frame can be sent;
if configured as a peripheral bus output, the second data selector outputs bus data directly to the communication peripheral. The data type output by the second data selector is controlled by configuring the parameters of the second data selector, so that the frame packer can be used for outputting data frames and can also be used for directly transmitting bus data to communication peripherals, and various requirements of data transmission are met.
The third aspect of the invention provides a metering chip, which comprises the frame packer for inter-chip data frame protocol processing. The metering chip uses the frame packer to pack data frames, and the buffer replaces an SRAM (static random access memory) to store a metering value updated in real time, so that the metering value in a register of a fixed address of the metering chip can be ensured not to be lost, and the SRAM and one path of DMA (direct memory access) can be reduced, thereby reducing the area and the cost of the chip and reducing the working power consumption of the metering chip.
A fourth aspect of the present invention provides a method of transferring a metric to a management core, the method comprising:
the DMA carries the metering value stored in the EMU register to a frame packer;
the frame packer packs the metering value into a data frame which accords with a communication peripheral bus protocol and transmits the data frame to a communication peripheral;
the communication peripheral transmits the data frame to a management core. The frame packer packs the data into data frames and transmits the data frames to the management core, so that the working use of the SRAM and one path of DMA is reduced, and the working power consumption of the metering chip is reduced.
According to the technical scheme, the frame packer, the method and the metering chip for inter-chip data frame protocol processing are provided, the frame packer is used for data packing, the work use of SRAM and one path of DMA is reduced, the work power consumption of the chip is reduced, the flexibility of program development is increased, and only common SPI or UART is needed to be used as a communication peripheral device to be matched with and send the data frame which conforms to the protocol, so that the metering data of the metering chip is converted into the application scene of the data frame which is sent to the management core.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the embodiments of the invention without limiting the embodiments of the invention. In the drawings:
FIG. 1 is a schematic diagram of a prior art metrology chip data transfer process;
FIG. 2 is a schematic diagram of a data frame format;
FIG. 3 is a block diagram of a frame packer for inter-chip data frame protocol processing according to an embodiment of the invention;
FIG. 4 is a block diagram of a frame packer for inter-chip data frame protocol processing according to another embodiment of the invention;
fig. 5 is a schematic diagram of a data transmission process using a frame packer.
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present invention, are given by way of illustration and explanation only, not limitation.
In the field of smart meters, a common data frame format is shown in fig. 2, and includes a start symbol, a command symbol, a length symbol, a sequence number symbol, a data field, a check symbol and an end symbol. The start and end symbols are typically fixed values that can be configured. The command symbol represents the type of value of the data field, such as current, voltage, charge, etc. The length field represents the length of the data field. The sequence number symbol represents the sequence number of the current frame. The Check symbol is typically a Cyclic Redundancy Check (CRC) value for the data of the command symbol to data field. The data field is the metering value of the metering chip. Except that the length of the data field can be configured into N bytes according to the length field, other symbols are fixed length, such as 1 byte. The frame packer is used for processing the metering value into a data frame conforming to a data frame format, converting the data frame into data conforming to a protocol corresponding to the communication peripheral equipment and transmitting the data to the management core.
Example one
Fig. 3 is a block diagram of a frame packer for inter-chip data frame protocol processing according to an embodiment of the present invention. As shown in fig. 3, the frame packer includes:
the frame parameter configuration module is used for configuring the values of a start character, an end character and a command character of a data frame according to the received metering value and transmitting the values to the first data selector;
the frame length calculation module is used for calculating the length value of the data frame according to the metering value to be sent and transmitting the length value to the first data selector;
the frame serial number counting module is used for counting the serial number value of the current frame and transmitting the serial number value to the first data selector and the checking module;
the buffer is used for buffering the metering value carried by the DMA from the metering value register of the metering chip and waiting for the reading of the first data selector;
the state machine is used for carrying out state transition according to a set data frame format and controlling the first data selector to acquire and output corresponding data;
the first data selector is used for acquiring and outputting corresponding data according to the current state of the state machine to generate a data frame;
the checking module is used for generating a checking value according to the command symbol, the length symbol, the sequence number symbol and the data of the data field output by the first data selector and transmitting the checking value to the first data selector; and
and the bus protocol processing module is used for converting the generated data frame into a data frame conforming to a communication peripheral bus protocol and transmitting the data frame to the communication peripheral. The frame packer uses the state machine and the first data selector to finish the value taking of the currently sent frame data, so that the data packing is realized, the work use of the SRAM and one path of DMA is reduced, the work power consumption of a chip is reduced, and the flexibility of program development is increased.
Optionally, the communication peripheral includes a serial peripheral interface and a universal asynchronous receiver transmitter. The communication peripheral can only use common communication peripheral, so that the design cost of the chip is saved, the existing communication peripheral of the existing metering chip is fully utilized, and the inheritability of the chip is reserved.
Furthermore, the buffer is a first-in first-out type buffer, the storage requirement of a metering value is met, meanwhile, the depth of the first-in first-out type register can be adjusted according to the actual requirement, and the buffer is more flexible than direct memories such as an SRAM/FLASH and the like, small in area and low in power consumption.
The frame packer for inter-chip data frame protocol processing provided by the above embodiment corresponds to a frame packing method for inter-chip data frame protocol processing, and the frame packing method includes:
the frame parameter configuration module configures the values of a start character, an end character and a command character of a data frame according to the received metering value and transmits the values to the first data selector;
the frame length calculation module calculates the length value of the data frame according to the metering value to be sent and transmits the length value to the first data selector;
the frame sequence number counting module counts the sequence number value of the current frame and transmits the sequence number value to the first data selector;
the buffer caches the metering value carried by the DMA from the metering value register of the metering chip and waits for the reading of the first data selector;
the state machine receives a ready signal sent by the communication peripheral equipment and judges whether data frame sending can be carried out or not;
if not, the state machine stays at the current state and waits for the data frame to be sent;
if yes, the state machine carries out state transition according to a set data frame format, and controls the first data selector to acquire and output corresponding data according to the current state of the state machine to generate a data frame;
the checking module generates a checking value according to the command symbol, the length symbol, the sequence symbol and the data of the data field output by the first data selector and transmits the checking value to the first data selector;
and the bus protocol processing module converts the generated data frame into a data frame conforming to a communication peripheral bus protocol and transmits the data frame to the communication peripheral. The data frame packing is realized through the frame packer, the work use of an SRAM and a DMA is effectively reduced, the work power consumption of a chip is reduced, and the flexibility of program development is increased.
Example two
Fig. 4 is a block diagram of a frame packer for inter-chip data frame protocol processing according to another embodiment of the present invention. As shown in fig. 4, the frame packer includes:
the frame parameter configuration module is used for configuring the values of a start character, an end character and a command character of a data frame according to the received metering value and transmitting the values to the first data selector;
the frame length calculation module is used for calculating the length value of the data frame according to the metering value to be sent and transmitting the length value to the first data selector;
the frame serial number counting module is used for counting the serial number value of the current frame and transmitting the serial number value to the first data selector and the checking module;
the buffer is used for buffering the metering value carried by the DMA from the metering value register of the metering chip and waiting for the reading of the first data selector;
the state machine is used for carrying out state transition according to a set data frame format and controlling the first data selector to acquire and output corresponding data;
the first data selector is used for acquiring and outputting corresponding data according to the current state of the state machine to generate a data frame;
the checking module is used for generating a checking value according to the command symbol, the length symbol, the sequence number symbol and the data of the data field output by the first data selector and transmitting the checking value to the first data selector;
the bus protocol processing module is used for converting the generated data frame into a data frame conforming to a communication peripheral bus protocol and transmitting the data frame to the communication peripheral;
the module configuration module is used for configuring data selection parameters of the second data selector; and
and the second data selector is used for outputting the data frame or the bus data conforming to the communication peripheral bus protocol according to the data selection parameters. The frame packer uses the state machine and the first data selector to finish the value taking of the currently sent frame data, so that the data packing is realized, the work use of the SRAM and one path of DMA is reduced, the work power consumption of a chip is reduced, and the flexibility of program development is increased. The configuration module configures parameters of the second data selector to control the data type output by the second data selector, so that the frame packer can be used for outputting data frames and can also be used for directly transmitting bus data to communication peripherals, and various requirements of data transmission are met.
Optionally, the communication peripheral includes a serial peripheral interface and a universal asynchronous receiver transmitter. The communication peripheral can only use common communication peripheral, so that the design cost of the chip is saved, the existing communication peripheral of the existing metering chip is fully utilized, and the inheritability of the chip is reserved.
Furthermore, the buffer is a first-in first-out type buffer, namely FIFO, which meets the storage requirement of the metering value, and the depth of the first-in first-out type register can be adjusted according to the actual requirement, so that the buffer has more flexibility than direct SRAM/FLASH and other memories, and is small in area and low in power consumption.
As shown in fig. 4, in the present embodiment, the interface of the frame Packer (PACK) will include the bus of SPI and the bus of itself (PACK). When the PACK does not work, the SPI _ mux =0 of the PACK can be configured by the module configuration module, so that the SPI normally works through the bus 1; when the PACK works, SPI _ mux =1 of the PACK can be configured by the module configuration module, so that the SPI works through the bus 2, the SPI is occupied at this time, the address of the bus 2 is a data sending address of the SPI, data of the bus 2 is a data frame conforming to a transmission protocol format, and a bus command received by the SPI at this time is a data frame command sending the data frame conforming to the transmission protocol. The length symbol of the data frame is obtained by calculating through a frame length calculating module, the sequence symbol is obtained by calculating through a frame sequence number counting module, and the value of the data field is obtained by transferring the data field from a metering value register of a metering chip to FIFO of a PACK through DMA.
The frame packer for inter-chip data frame protocol processing provided by the above embodiment corresponds to a frame packing method for inter-chip data frame protocol processing, and the frame packing method includes:
the frame parameter configuration module configures the values of a start character, an end character and a command character of a data frame according to the received metering value and transmits the values to the first data selector;
the frame length calculation module calculates the length value of the data frame according to the metering value to be sent and transmits the length value to the first data selector;
the frame sequence number counting module counts the sequence number value of the current frame and transmits the sequence number value to the first data selector and the checking module;
the buffer caches the metering value carried by the DMA from the metering value register of the metering chip and waits for the reading of the first data selector;
configuring data selection parameters of a second data selector;
if the data selection parameter configured with the second data selector is output by the frame packer, the state machine receives a ready signal sent by the communication peripheral equipment and judges whether data frame sending can be carried out or not;
if not, the state machine stays at the current state and waits for the data frame to be sent;
if yes, the state machine carries out state transition according to a set data frame format, and controls the first data selector to acquire and output corresponding data according to the current state of the state machine to form a data frame;
the checking module generates a checking value according to the command symbol, the length symbol, the sequence symbol and the data of the data field output by the first data selector and transmits the checking value to the first data selector;
the bus protocol processing module converts the generated data frame into a data frame conforming to a communication peripheral bus protocol and transmits the data frame to the communication peripheral by the second data selector;
and if the data selection parameter of the second data selector is configured to be the peripheral bus output, directly outputting the bus data to the communication peripheral by the second data selector.
When ready sent by the communication peripheral is high, namely the communication peripheral sends idle or the communication peripheral sends FIFO (first in first out) is not full, the state opportunity sequentially enters the states of an initial symbol, a command symbol, a length symbol, a sequence number symbol, a data field, a check symbol and an end symbol according to the format of a data frame, and enters the next state after data is sent to a bus protocol processing module; when the state machine reaches the data field, taking out the corresponding number of metering values from the FIFO of the PACK according to the value of the length symbol; when the state machine reaches the check symbol, the state machine outputs a command symbol to the CRC value of the data field; when the state machine reaches the end symbol, the serial number symbol value will add 1, the check symbol value returns to the initial value, and the state machine will enter the start symbol of the next frame or end the PACK work according to the register configuration judgment. When the sending ready of the communication peripheral is low, namely the communication peripheral sends busy or the communication peripheral sends FIFO full, the state opportunity stays at the current state, and the waiting ready is high.
The data frame packing is realized through the frame packer, the work use of an SRAM and a DMA is effectively reduced, the work power consumption of a chip is reduced, and the flexibility of program development is increased. The data type output by the second data selector is controlled by configuring the parameters of the second data selector, so that the frame packer can be used for outputting data frames and can also be used for directly transmitting bus data to communication peripherals, and various requirements of data transmission are met. The communication peripheral of the frame packer provided by the application can send the data frame meeting the transmission protocol without any change, and the communication peripheral can be changed into any communication peripheral meeting the APB or AHB bus protocol, so that the communication peripheral has high survivability and high replacement flexibility.
The third aspect of the invention provides a metering chip, which comprises the frame packer for inter-chip data frame protocol processing. The metering chip uses the frame packer to pack data frames, and the buffer replaces an SRAM (static random access memory) to store a metering value updated in real time, so that the metering value in a register of a fixed address of the metering chip can be ensured not to be lost, and the SRAM and one path of DMA (direct memory access) can be reduced, thereby reducing the area and the cost of the chip and reducing the working power consumption of the metering chip.
A fourth aspect of the present invention provides a method of transferring a metric to a management core, the method comprising:
the DMA carries the metering value stored in the EMU register to a frame packer;
the frame packer packs the metering value into a data frame which accords with a communication peripheral bus protocol and transmits the data frame to a communication peripheral;
the communication peripheral transmits the data frame to the management core. As shown in fig. 5, the frame packer packs the data into data frames and transmits the data frames to the management core, so that the work use of the SRAM and one path of DMA is reduced, and the work power consumption of the metering chip is reduced.
Those skilled in the art will appreciate that all or part of the steps in the method for implementing the above embodiments may be implemented by a program, which is stored in a storage medium and includes several instructions to enable a single chip, a chip, or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
While the embodiments of the present invention have been described in detail with reference to the accompanying drawings, the embodiments of the present invention are not limited to the details of the above embodiments, and various simple modifications can be made to the technical solution of the embodiments of the present invention within the technical idea of the embodiments of the present invention, and the simple modifications are within the scope of the embodiments of the present invention. It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, the embodiments of the present invention will not be described separately for the various possible combinations.
In addition, any combination of the various embodiments of the present invention is also possible, and the same should be considered as disclosed in the embodiments of the present invention as long as it does not depart from the spirit of the embodiments of the present invention.

Claims (12)

1. A frame packer for inter-chip data frame protocol processing, the frame packer comprising:
the frame setting module is used for setting the values of a start character, an end character, a length character, a sequence number character and a command character of the data frame and transmitting the values to the first data selector;
the buffer is used for caching the metering value carried by the DMA from the metering value register of the metering chip and waiting for the reading of the first data selector;
the state machine is used for carrying out state transition according to a set data frame format and controlling the first data selector to acquire and output corresponding data;
the first data selector is used for acquiring and outputting corresponding data according to the current state of the state machine to generate a data frame;
the checking module is used for generating a checking value according to the command symbol, the length symbol, the sequence symbol and the data of the data field output by the first data selector and transmitting the checking value to the first data selector; and
and the bus protocol processing module is used for converting the generated data frame into a data frame conforming to a communication peripheral bus protocol and transmitting the data frame to the communication peripheral.
2. The frame packer for inter-chip data frame protocol processing of claim 1, wherein the frame setup module comprises:
a frame parameter configuration module, configured to configure values of a start symbol, an end symbol and a command symbol of a data frame according to the received metering value, and transmit the values to the first data selector;
the frame length calculation module is used for calculating the length value of a data frame according to the metering value to be sent and transmitting the length value to the first data selector; and
and the frame sequence number counting module is used for counting the sequence number value of the current frame and transmitting the sequence number value to the first data selector.
3. The frame packer for inter-chip data frame protocol processing of claim 2, wherein the frame packer further comprises:
the module configuration module is used for configuring data selection parameters of the second data selector;
and the second data selector is used for outputting the data frame or the bus data conforming to the communication peripheral bus protocol according to the data selection parameters.
4. The frame packer for inter-chip data frame protocol processing of claim 1, wherein the commander represents a type of the metric value.
5. The frame packer for inter-chip data frame protocol processing of claim 1, wherein the check module is a cyclic redundancy check module.
6. The frame packer for inter-chip data frame protocol processing of claim 1, wherein the buffer is a first-in-first-out type buffer.
7. The frame packetizer for interchip data frame protocol processing in accordance with claim 1 wherein said communication peripherals include a serial peripheral interface and a universal asynchronous receiver transmitter.
8. The frame packer of claim 1, wherein the data frame generated by the first data selector comprises a start symbol, a command symbol, a length symbol, a sequence symbol, a data field, a check symbol, and an end symbol.
9. A frame packing method for inter-chip data frame protocol processing, which is applied to the frame packer for inter-chip data frame protocol processing of claim 3, the frame packing method comprising:
the frame parameter configuration module configures the values of a start character, an end character and a command character of a data frame according to the received metering value and transmits the values to the first data selector;
the frame length calculation module calculates the length value of the data frame according to the metering value to be sent and transmits the length value to the first data selector;
the frame sequence number counting module counts the sequence number value of the current frame and transmits the sequence number value to the first data selector;
the buffer caches the metering value carried by the DMA from the metering value register of the metering chip and waits for the reading of the first data selector;
the state machine receives a ready signal sent by the communication peripheral equipment and judges whether data frame sending can be carried out or not;
if not, the state machine stays at the current state and waits for the data frame to be sent;
if yes, the state machine carries out state transition according to a set data frame format, and controls the first data selector to acquire and output corresponding data according to the current state of the state machine to generate a data frame;
the checking module generates a checking value according to the command symbol, the length symbol, the sequence symbol and the data of the data field output by the first data selector and transmits the checking value to the first data selector;
and the bus protocol processing module converts the generated data frame into a data frame conforming to a communication peripheral bus protocol and transmits the data frame to the communication peripheral.
10. The method of claim 9, wherein the method further comprises:
configuring data selection parameters of the second data selector,
if the configuration is the output of a frame packer, outputting the data frame conforming to the bus protocol of the communication peripheral to the communication peripheral by the second data selector when the data frame can be sent;
if configured as a peripheral bus output, the second data selector outputs bus data directly to the communication peripheral.
11. A metering chip comprising the frame packer of any of claims 1-8 for inter-chip data frame protocol processing.
12. A method of transferring metering values to a management core, the method comprising:
the DMA carries the metering value stored in the electric energy metering unit EMU to a frame packer;
the frame packer packs the metering value into a data frame which accords with a communication peripheral bus protocol and transmits the data frame to a communication peripheral;
the communication peripheral transmits the data frame to a management core.
CN202011301398.4A 2020-11-19 2020-11-19 Frame packer, method and metering chip for inter-chip data frame protocol processing Active CN112134904B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011301398.4A CN112134904B (en) 2020-11-19 2020-11-19 Frame packer, method and metering chip for inter-chip data frame protocol processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011301398.4A CN112134904B (en) 2020-11-19 2020-11-19 Frame packer, method and metering chip for inter-chip data frame protocol processing

Publications (2)

Publication Number Publication Date
CN112134904A CN112134904A (en) 2020-12-25
CN112134904B true CN112134904B (en) 2021-02-19

Family

ID=73852091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011301398.4A Active CN112134904B (en) 2020-11-19 2020-11-19 Frame packer, method and metering chip for inter-chip data frame protocol processing

Country Status (1)

Country Link
CN (1) CN112134904B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113341198B (en) * 2021-06-01 2023-03-17 青岛东软载波科技股份有限公司 Power line wave recording method and system based on metering chip register

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101620777A (en) * 2009-08-03 2010-01-06 电子科技大学 Communication device of remote meter reading system
CN109979184A (en) * 2019-04-29 2019-07-05 深圳芯珑电子技术有限公司 A kind of Intelligent carrier copy controller of power meter reading system
CN110441570A (en) * 2019-07-19 2019-11-12 中国电力科学研究院有限公司 A kind of Power Quality Monitor Device and method having Load-Aware function

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7093023B2 (en) * 2002-05-21 2006-08-15 Washington University Methods, systems, and devices using reprogrammable hardware for high-speed processing of streaming data to find a redefinable pattern and respond thereto
US7471666B2 (en) * 2002-06-04 2008-12-30 Winbond Electronics Corporation Message-type data communication apparatus used in a DECT system
US20110280314A1 (en) * 2010-05-12 2011-11-17 Texas Instruments Incorporated Slice encoding and decoding processors, circuits, devices, systems and processes

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101620777A (en) * 2009-08-03 2010-01-06 电子科技大学 Communication device of remote meter reading system
CN109979184A (en) * 2019-04-29 2019-07-05 深圳芯珑电子技术有限公司 A kind of Intelligent carrier copy controller of power meter reading system
CN110441570A (en) * 2019-07-19 2019-11-12 中国电力科学研究院有限公司 A kind of Power Quality Monitor Device and method having Load-Aware function

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于S3C6410和ADV7180的嵌入式视频采集系统设计与实现;吴君钦 等;《计算机工程与科学》;20190420;第34卷(第12期);第115-119页 *

Also Published As

Publication number Publication date
CN112134904A (en) 2020-12-25

Similar Documents

Publication Publication Date Title
US8352628B2 (en) Method for transferring data from a source target to a destination target, and corresponding network interface
US7570646B2 (en) Apparatus and method for an interface unit for data transfer between a host processing unit and a multi-target digital signal processing unit in an asynchronous transfer mode
CN106131056B (en) Industrial wireless adapter and working method thereof
CN110334040B (en) Satellite-borne solid-state storage system
CN104991880B (en) A kind of FC AE ASM Communication Cards based on PCI E interfaces
CN112395230A (en) UART interface extension circuit based on programmable logic device
CN113190291B (en) Configurable protocol conversion system and method based on network-on-chip data acquisition
CN106598889A (en) SATA (Serial Advanced Technology Attachment) master controller based on FPGA (Field Programmable Gate Array) sandwich plate
CN108595350A (en) A kind of data transmission method and device based on AXI
CN112134904B (en) Frame packer, method and metering chip for inter-chip data frame protocol processing
CN108462620B (en) Gilbert-level SpaceWire bus system
CN105573711A (en) Data caching methods and apparatuses
CN114490467B (en) Message processing DMA system and method of multi-core network processor
CN101447988A (en) A FPGA-based kilomega data communication card
CN101064697B (en) Apparatus and method for realizing asynchronous transmission mode network service quality control
CN106294225A (en) A kind of method for reading data, opposite equip. and controller
CN108614792B (en) 1394 transaction layer data packet storage management method and circuit
CN102299861B (en) A kind of message flux control method
CN114666289B (en) Data transmission method and system based on electromagnetic shielding body
CN112702313B (en) High-speed UDP data transmission system and method
CN101938453A (en) Device and method for realizing data transmission between central processing unit and Ethernet
CN112653536B (en) FPGA-based SpaceFibre satellite-borne network node testing system and method
CN115237829A (en) Apparatus, method and storage medium for processing data
CN113676253A (en) FlexRay bus optical fiber communication module based on FPGA
CN114385544A (en) UART chip and FPGA chip

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant