WO2021072981A1 - Blockchain-based energy data linking method and apparatus - Google Patents

Blockchain-based energy data linking method and apparatus Download PDF

Info

Publication number
WO2021072981A1
WO2021072981A1 PCT/CN2019/130251 CN2019130251W WO2021072981A1 WO 2021072981 A1 WO2021072981 A1 WO 2021072981A1 CN 2019130251 W CN2019130251 W CN 2019130251W WO 2021072981 A1 WO2021072981 A1 WO 2021072981A1
Authority
WO
WIPO (PCT)
Prior art keywords
energy
modbus
message
data
slave
Prior art date
Application number
PCT/CN2019/130251
Other languages
French (fr)
Chinese (zh)
Inventor
徐逸宁
Original Assignee
广东绿腾新能源服务有限公司
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 广东绿腾新能源服务有限公司 filed Critical 广东绿腾新能源服务有限公司
Publication of WO2021072981A1 publication Critical patent/WO2021072981A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • 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

Definitions

  • the present invention relates to the field of new energy and blockchain technology, and in particular to a method and device for linking energy data based on a blockchain.
  • the purpose of the present invention is to provide a blockchain-based energy data link method and device, which are easy to install, have strong compatibility, and have a strong fault tolerance rate.
  • one aspect of the present invention provides a blockchain-based energy data link method, which adopts the Modbus serial communication protocol, in which,
  • the server runs as a Modbus master device, and the energy harvester runs as a Modbus slave device; any node on the blockchain is corresponding to an energy harvester.
  • the master station device and the slave station device are configured through ModbusRTU format or ModbusTcp format, and the physical layer communication mode adopts serial port RS485 or Ethernet; according to the received message request sent by the master station device, In response to the sending message, the slave station device packs and sends the currently changed register address and register code value to the master station device.
  • the method of sending messages from the station device is a heartbeat packet
  • a heartbeat packet includes a character string; the data bit of the character string is 8 bits, the stop bit is 1 bit, and the check mode is none. check.
  • the register code value includes peak-level-valley coefficient information, user level information, power generation type information, and user type information.
  • the method includes the following steps:
  • the master station equipment determines the register distribution of the slave station equipment according to the field application
  • the slave device sends a heartbeat packet message
  • the master station device determines the range of the change data register of the slave station device according to needs, determines the function code, and writes it into the register configured for sending the message;
  • the master station device receives the change data message from the slave station device, analyzes the register code value and address contained in the information, and makes corresponding processing.
  • step S1 the following steps are further included:
  • a block chain-based energy data link device which includes:
  • RTU RTU includes a data acquisition communication module, a main controller, and an upper communication processing module that are connected in sequence; the data acquisition communication module communicates with several groups of energy collectors, and the main controller includes several one-to-one correspondences with several groups of energy collectors. Modbus address table, the upper communication processing module is connected with the monitoring upper computer.
  • the device further includes a Modbus gateway.
  • the Modbus gateway includes ModbusRTU transparent transmission, ModbusASCII transparent transmission, protocol mutual conversion between ModbusRTU and ModbusTCP, Modbus polling, and serial port active query.
  • the monitoring host computer includes a transparent transmission cloud server and a transparent transmission cloud management system
  • the energy data is uploaded to the transparent transmission cloud
  • the transparent transmission cloud management system is used to configure and manage slave devices and serial port parameters .
  • the monitoring host computer further includes a user terminal, and the user terminal is an APP or a WeChat applet.
  • the present invention has the following beneficial effects:
  • the present invention adopts serial communication protocol, which is easy to install, has strong compatibility and strong fault tolerance;
  • Serial gateway technology which interconnects all node energy equipment in a blockchain to ensure data communication between nodes
  • FIG. 1 is a schematic diagram of the framework of the method for linking energy data based on blockchain in Embodiment 1;
  • FIG. 2 is a reference table of functional code domains of the energy data link method based on blockchain in Embodiment 1;
  • FIG. 3 is a reference table of the message reading data format of the energy data link method based on the blockchain of Embodiment 1;
  • FIG. 4 is a register reference table of the energy data link method based on the blockchain of Embodiment 1;
  • FIG. 5 is a reference table of the message writing data format of the energy data link method based on the blockchain of the embodiment 1;
  • FIG. 6 is a schematic diagram of the Modbus gateway operation of the energy data link method based on the blockchain of Embodiment 1.
  • FIG. 6 is a schematic diagram of the Modbus gateway operation of the energy data link method based on the blockchain of Embodiment 1.
  • a blockchain-based energy data link method is provided, as shown in Figure 1-6, which adopts the Modbus serial communication protocol, in which the server operates as a Modbus master device, and the energy collection The device operates as a Modbus slave device; any node on the blockchain is corresponding to an energy harvester.
  • the nodes of the blockchain include: capacity nodes, energy consumption nodes, and energy storage nodes; among them, the capacity nodes are individual new energy capacity users, both as merchants, which produce new energy and transmit the new energy to the storage through the Internet of Things transmission method.
  • Energy nodes; energy-consuming nodes are users who need to use new energy, and when they need to use new energy to supply power, they send energy-use requests; energy-storage nodes are the national grid and receive new energy transmitted by production nodes; and according to the energy demand of energy-using nodes Send new energy to user nodes through the transmission of the Internet of Things; each production node, each energy consuming node, and energy storage node has a wallet address for receiving and sending tokens in the blockchain network; production node According to the preset merchant transaction contract, execute transaction and settlement with the energy storage node in the blockchain network; the energy consumption node executes transaction and settlement with the energy storage node in the blockchain network according to the preset user transaction contract; this The capacity node in the embodiment can also become an energy consuming no
  • the transaction and settlement between production nodes, energy consumption nodes, and energy storage nodes are carried out through the blockchain network, which can facilitate the user operation and use of energy nodes, facilitate the power output and transaction settlement of production nodes, and facilitate the work of energy storage nodes Personnel management and settlement improve the transaction efficiency, fairness and transparency between the capacity end and the energy end.
  • the blockchain network is equivalent to the role of an information channel, including all roles involved in energy transactions: production nodes, energy use nodes, and energy storage nodes. It enables users of each node to track the source and consumption of each degree, and further includes where the electricity comes from, when it is used and when it is consumed, and the ledger is shared globally, and the ledger data is more comprehensive, accurate and clear.
  • Each node corresponds to a slave device; the master device and the slave device are configured through ModbusRTU format or ModbusTcp format, and the physical layer communication method uses serial port RS485 or Ethernet; according to the received message request sent by the master device, In response to the sending message, the slave station device packs and sends the currently changed register address and register code value to the master station device.
  • the mode of sending messages from the station equipment is the heartbeat packet mode.
  • a heartbeat packet includes a character string; the data bit of the character string is 8 bits, the stop bit is 1 bit, and the check mode is no check.
  • the register code value includes peak-level-valley coefficient information, user level information, power generation type information, and user type information.
  • energy data needs to be converted into settlement data according to the settlement method; it adopts a linear settlement method for settlement, the formula is as follows:
  • Q is the token value
  • i is the i-th energy meter
  • FR is a positive and negative parameter, and FR is -1,0,1, which is used to distinguish between capacity nodes and energy consumption nodes;
  • CP is the meter reading data at the end of the settlement cycle
  • PP is the meter reading data at the end of the previous settlement cycle
  • the user settlement coefficient distinguishes settlement according to the preferential and discount given to the user by the user level or preferential policy; it is convenient for different users to enjoy different preferential and discount.
  • TC is the power generation type coefficient, which is differentiated and settled according to the power generation type of new energy, including traditional power grid power generation and new energy power generation; for example, traditional power grid power generation is 1, and new energy power generation is 50%; it is conducive to promoting new energy power generation according to promotion policies.
  • EC is the user type, and the settlement is differentiated according to the market application layer, including: civil, commercial, industrial, and agricultural electricity;
  • VC is the peak-level-valley coefficient, which distinguishes and settles the time of each day according to the peak energy consumption and the energy consumption low valley; for example, it can be divided into four time periods, peak time: 8:00 ⁇ 11:00, 18:00 ⁇ 21:00 ; Flat 1 time: 6:00 ⁇ 8:00, 11:00 ⁇ 13:00, 15:00 ⁇ 18:00, 21:00 ⁇ 22:00; Flat 2 time: 13:00 ⁇ 15:00; Valley Time period: 22:00 ⁇ 6:00; different coefficient values are used for settlement in different time periods, which is conducive to reasonable control of peak electricity consumption.
  • AC is a dynamic constant
  • the default is 0, usually a difference constant, that is, the settlement difference with the power supply bureau, and this factor is reasonably taken into consideration.
  • the user settlement coefficient, power generation type coefficient, user type, and peak-flat-valley coefficient are taken into account, so that the settlement formula is suitable for different settlement situations, and the coefficient is adjusted according to the settlement situation, which is convenient for preferential discounts and new energy support Promotion and promotion of policies.
  • the peak-level-valley coefficient information, user level information, power generation type information, and user type information are written into the register; so that after reading the register code value, the settlement can be directly analyzed and processed, and the settlement result can be obtained quickly.
  • the positive direction represents the user outputting electrical energy to the State Grid (energy storage node), and the reverse represents the output electrical energy of the State Grid (energy storage node) to the user for use;
  • the power tip, power peak, power level, and power valley are respectively
  • the four time periods representing the peak, flat, and valley coefficients are used for different time periods for energy settlement with different coefficients.
  • the time period can be increased or decreased, and the register code value can be set correspondingly according to the time period; similarly, You can also define more registers, which are used to define user settlement coefficients, power generation type coefficients, and user type coefficients, so that after reading the register code value, you can directly settle the settlement according to the linear settlement formula.
  • the master station equipment determines the register distribution of the slave station equipment according to the field application
  • the slave device sends a heartbeat packet message
  • the master station device determines the range of the change data register of the slave station device according to needs, determines the function code, and writes it into the register configured for sending the message;
  • the master station device receives the change data message from the slave station device, analyzes the register code value and address contained in the information, and makes corresponding processing.
  • the slave device sends a data message in the form of a heartbeat packet. After the master device receives the message request, it determines the required register address according to the message request. During Modbus polling, when the corresponding register address is read, the corresponding register address is received. The message of the register address, and analyze and process.
  • step S1 It also includes the following steps before step S1:
  • All RS485 loop communications in this embodiment follow the master/slave mode.
  • the master refers to the master device, that is, the server, and the slave refers to the slave device, that is, all energy harvester hardware.
  • data information and message information are transmitted between a single master station and a maximum of 32 slave stations (monitoring equipment); the master station will initialize and control all the information transmitted on the RS485 communication loop; the information on the RS485 loop Communication takes place in the form of "heartbeat packets".
  • a message is a character string (8 bits per character string), and a message can contain up to 255 bytes. The bytes that make up this message constitute standard asynchronous serial data, and are transmitted in the form of 8 data bits, 1 stop bit, and no parity bit.
  • the serial data stream is generated by a device similar to that used in RS232C.
  • Each Modbus message consists of the following parts: address domain, function code domain, data domain, and check domain.
  • the address field refers to: the length of the Modbus slave address field is one byte, including the slave address of the message transmission. The valid slave address ranges from 1 to 247. If the slave station receives a message in which the address domain information of the slave station matches its own address, it should execute the command contained in the message. This field in the message from the slave station is its own address. Because the display module will be able to communicate with the controller of any address, the address field in the request frame sent by the display module is the corresponding sequence, such as 1.
  • the function code domain refers to: the length of the function domain in the Modbus message is one byte, which is used to inform the slave station what operation should be performed.
  • the response message from the slave station shall contain the same functional domain byte of the operation requested by the master station. Refer to the table shown in Figure 1 for the function codes of the equipment.
  • the data field refers to the length of the Modbus data field is variable, depending on its specific function.
  • the Modbus data field adopts the "BIGINDIAN" mode, that is, the high-order byte is in front and the low-order byte is in the back.
  • the check domain refers to: Modbus-RTU mode adopts 16-bit CRC check.
  • the sending device should perform CRC16 calculation on each data in the message, and store the final result in the inspection domain.
  • the receiving device should also perform CRC16 calculation on each data (except the check field) in the message, and compare the result field with the check field. Only the same message can be accepted.
  • the transmission of messages on the RS485 network needs to follow the following principles of time: the minimum time between the end of the request message of the master station and the start of the response message of the slave station is 0 milliseconds, the maximum is 250 milliseconds, and the typical value is 60 milliseconds; the slave station responds The time between the end of the message and the start of the next request message of the master station is typically 100 milliseconds; the maximum time between two adjacent bytes in the message varies according to the communication baud rate, generally the largest word The section time is 3 times the byte transmission time.
  • Modbus supports two function codes, compatible with the standard Modbus protocol 16-bit data mode, which means that the maximum transmission of any measured value is 65535.
  • the communication message part mainly describes the command of the relay control, the format of the device's read data message and response message, and the format of the device's write data message and response message.
  • Reading a register is a message sent by the master station requesting the device to respond to all valid registers, and keep the registers.
  • the message read data format is shown in Figure 3.
  • the register code value is consulted as shown in Fig. 4.
  • Use function code 04 to read When using the 04 function code to read, send it as a 4-byte integer, and divide the message value by 100 to correspond to the actual value (where: the energy value in the serial number is equal to the value of the register and needs to be divided by 10000).
  • the device address is 1, read all the information of the first block table in 4-byte integer format: 01040000001A71C1.
  • the format of the write register message is: host -> device, and the response format is: device -> host.
  • the registers written by the device must be continuous from the first register.
  • Figure 5 shows the format of the write data register. Among them, each byte has 8 bits of binary code. When transmitting, a start bit (0), an even parity bit and a stop bit (1) are added for a total of 11 bits. The transmission sequence is shown in Figure 1. D0 is the least significant bit of the byte, and D7 is the most significant bit of the byte. Pass the low position first, then the high position.
  • the byte check is even check
  • the frame check is the vertical information checksum. Regardless of whether the receiver detects an even check error or a vertical information checksum error, the message frame will be placed and no response will be given.
  • the master station To change the transmission rate, the master station first sends a rate change request to the slave station at the initial rate, and the slave station sends an acknowledgement response frame or a negative response frame at the initial rate. After receiving the confirmation frame from the slave station, the two parties will communicate with each other at the confirmed new rate, and return to the initial rate after the end of the communication; if the communication link is not established within 500ms, both parties will return to the initial rate. Only one communication rate can be changed in each communication. Among them: the maximum transmission rate is limited by the excuse of the photoelectric head or the tariff device, and is also limited by the working clock frequency in the data processing unit of the tariff device.
  • a blockchain-based energy data link device which includes: an RTU.
  • the RTU includes a data acquisition communication module, a main controller, and a higher-level communication processing module that are sequentially communicated and connected; data acquisition communication
  • the module communicates with several groups of energy collectors
  • the main controller includes several Modbus address tables corresponding to several groups of energy collectors
  • the upper communication processing module communicates with the monitoring upper computer.
  • the device also includes a Modbus gateway.
  • the Modbus gateway includes ModbusRTU transparent transmission, ModbusASCII transparent transmission, protocol mutual conversion between ModbusRTU and ModbusTCP, Modbus polling and serial port active query. Through the Modbus gateway setting, the conversion from Modbus serial protocol to Modbus network protocol is realized.
  • the monitoring host computer includes a transparent transmission cloud server and a transparent transmission cloud management system.
  • the energy data is uploaded to the transparent transmission cloud.
  • the transparent transmission cloud management system is used to configure and manage slave devices and serial port parameters. Through the transparent transmission cloud to realize the mutual communication and transparent transmission of data between the equipment and the device and the upper computer, the access equipment can be connected to realize the remote transparent transmission of data without modification.
  • Energy data can be compatible with multiple communication modes such as NB-IOT, LoRa, WiFi, Ethernet, and GPRS.
  • the monitoring host computer also includes the user terminal, which is an APP or WeChat applet; the user can conveniently view energy data and operate and send electricity demand through the user terminal, and it is also convenient for third-party companies to call.
  • the user terminal which is an APP or WeChat applet

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Cardiology (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Medical Informatics (AREA)
  • Computer Security & Cryptography (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Remote Monitoring And Control Of Power-Distribution Networks (AREA)

Abstract

The present invention provides a blockchain-based energy data linking method. A Modbus serial communication protocol is used in the method. A server operates as a Modbus master station device. An energy collector operates as a Modbus slave station device. Any one node on a blockchain is correspondingly provided with the energy collector. The present invention further provides a corresponding apparatus that achieves the collection and monitoring of the energy data of any one node on the blockchain. The present invention is easy to install and strong in compatibility, and has a high fault tolerance rate.

Description

一种基于区块链的能源数据链接方法、及装置Method and device for linking energy data based on blockchain 技术领域Technical field
本发明涉及新能源领域和区块链技术领域,具体涉及一种基于区块链的能源数据链接方法、及装置。The present invention relates to the field of new energy and blockchain technology, and in particular to a method and device for linking energy data based on a blockchain.
背景技术Background technique
传统电力系统中,主要由火电、水电等发电,在传统能源供应日趋紧张,环境保护压力加大的背景下,新能源成为全世界的重要能源战略。光伏、风力、再生能源等一批新能源技术愈发成熟,伴随市场规模的不断壮大,分散个体产能用户随之增加,新能源市场交易已成为市场需求。In the traditional power system, thermal power, hydropower, etc. are mainly generated. Under the background of increasingly tight supply of traditional energy and increasing pressure on environmental protection, new energy has become an important energy strategy for the world. A number of new energy technologies such as photovoltaics, wind power, and renewable energy have become more mature. With the continuous growth of the market scale, the number of users of scattered individual production capacity has increased, and new energy market transactions have become market demands.
但是由于现有的能源结算模式采用的为单一的中心化管理方式,其难以针对用电情况、以及新能源的推广促进做出相应的改善,以使交易和结算过程更快捷;从而阻碍了新能源市场的推动。However, because the existing energy settlement model uses a single centralized management method, it is difficult to make corresponding improvements to the electricity consumption and the promotion of new energy to make the transaction and settlement process faster; thus hindering the new The promotion of the energy market.
在区块链技术快速发展和日趋成熟的环境下,将能源数据写入区块链的节点上,实现去中心化管理成为可能;并且使用物联网技术可以大幅度降低通讯成本和人力,尤其在新能源普及率越来越高当下,新能源汽车等交通工具更加频繁,伴随着5G的到来,能源数据物联上传的已成为技术市场刚需。With the rapid development and maturity of blockchain technology, it is possible to write energy data to the nodes of the blockchain to achieve decentralized management; and the use of Internet of Things technology can greatly reduce communication costs and manpower, especially in The penetration rate of new energy is getting higher and higher. Nowadays, new energy vehicles and other vehicles are becoming more frequent. With the advent of 5G, the upload of energy data and IoT has become a rigid demand in the technology market.
发明内容Summary of the invention
针对现有技术的缺点,本发明的目的是提供一种基于区块链的能源 数据链接方法、及装置,其安装容易,兼容性强,具有较强容错率。In view of the shortcomings of the prior art, the purpose of the present invention is to provide a blockchain-based energy data link method and device, which are easy to install, have strong compatibility, and have a strong fault tolerance rate.
为了实现上述目的,本发明的一方面,提供了一种基于区块链的能源数据链接方法,其采用Modbus串行通信协议,其中,In order to achieve the above objective, one aspect of the present invention provides a blockchain-based energy data link method, which adopts the Modbus serial communication protocol, in which,
服务端作为Modbus主站设备运行,能源采集器作为Modbus从站设备运行;区块链上的任一节点对应设置能源采集器。The server runs as a Modbus master device, and the energy harvester runs as a Modbus slave device; any node on the blockchain is corresponding to an energy harvester.
根据本发明另一具体实施方式,主站设备和从站设备通过ModbusRTU格式或ModbusTcp格式进行配置,物理层通讯方式采用串口RS485或以太网;根据接收到的主站设备发送来的报文请求,子站设备响应发送报文,将当前发生变化的寄存器地址及寄存器码值打包发送给主站设备。According to another specific embodiment of the present invention, the master station device and the slave station device are configured through ModbusRTU format or ModbusTcp format, and the physical layer communication mode adopts serial port RS485 or Ethernet; according to the received message request sent by the master station device, In response to the sending message, the slave station device packs and sends the currently changed register address and register code value to the master station device.
根据本发明又一具体实施方式,从站设备发送报文的方式为心跳包方式,一个心跳包包括一个字符串;字符串的数据位为8位,停止位为1位,校验方式为无校验。According to another specific embodiment of the present invention, the method of sending messages from the station device is a heartbeat packet, and a heartbeat packet includes a character string; the data bit of the character string is 8 bits, the stop bit is 1 bit, and the check mode is none. check.
根据本发明又一具体实施方式,寄存器码值包括峰平谷系数信息、用户等级信息、发电类型信息、用户类型信息。According to another specific embodiment of the present invention, the register code value includes peak-level-valley coefficient information, user level information, power generation type information, and user type information.
根据本发明又一具体实施方式,方法包括如下步骤:According to another specific embodiment of the present invention, the method includes the following steps:
S1、主站设备根据现场应用来确定从站设备的寄存器分布,S1, the master station equipment determines the register distribution of the slave station equipment according to the field application,
S2、从站设备发送心跳包报文;S2. The slave device sends a heartbeat packet message;
S3、主站设备根据需要确定从站设备的变化数据寄存器范围,并确定功能码,写入发送报文所配置的寄存器;S3. The master station device determines the range of the change data register of the slave station device according to needs, determines the function code, and writes it into the register configured for sending the message;
S4、主站设备接收来自从站设备的变化数据报文,解析该信息中包含的寄存器码值及地址,并做出相应处理。S4. The master station device receives the change data message from the slave station device, analyzes the register code value and address contained in the information, and makes corresponding processing.
根据本发明再一具体实施方式,步骤S1之前还包括如下步骤:According to still another specific embodiment of the present invention, before step S1, the following steps are further included:
S00、对主站和从站设备进行格式配置;S00. Perform format configuration on the master station and slave station equipment;
S01、主站设备完成初始化后,进行从站设备数据的轮询。S01. After the master device completes the initialization, polling of the slave device data is performed.
本发明的另一方面,提供了一种基于区块链的能源数据链接装置,其包括:In another aspect of the present invention, a block chain-based energy data link device is provided, which includes:
RTU,RTU包括依次通信连接的数据采集通讯模块、主控制器和上位通讯处理模块;数据采集通讯模块与若干组能源采集器通信连接,主控制器包括若干个与若干组能源采集器一一对应的Modbus地址表,上位通讯处理模块与监控上位机通信连接。RTU, RTU includes a data acquisition communication module, a main controller, and an upper communication processing module that are connected in sequence; the data acquisition communication module communicates with several groups of energy collectors, and the main controller includes several one-to-one correspondences with several groups of energy collectors. Modbus address table, the upper communication processing module is connected with the monitoring upper computer.
根据本发明另一具体实施方式,装置还包括Modbus网关,Modbus网关包括ModbusRTU透传、ModbusASCII透传、ModbusRTU与ModbusTCP的协议相互转换、Modbus轮询和串口主动查询。According to another specific embodiment of the present invention, the device further includes a Modbus gateway. The Modbus gateway includes ModbusRTU transparent transmission, ModbusASCII transparent transmission, protocol mutual conversion between ModbusRTU and ModbusTCP, Modbus polling, and serial port active query.
根据本发明另一具体实施方式,监控上位机包括透传云服务器和透传云管理系统,能源数据上传至透传云,透传云管理系统用于对从站设备、串口参数进行配置和管理。According to another specific embodiment of the present invention, the monitoring host computer includes a transparent transmission cloud server and a transparent transmission cloud management system, the energy data is uploaded to the transparent transmission cloud, and the transparent transmission cloud management system is used to configure and manage slave devices and serial port parameters .
根据本发明又一具体实施方式,监控上位机还包括用户端,用户端为APP或微信小程序。According to another specific embodiment of the present invention, the monitoring host computer further includes a user terminal, and the user terminal is an APP or a WeChat applet.
与现有技术相比,本发明具有如下有益效果:Compared with the prior art, the present invention has the following beneficial effects:
1、本发明采用串行通讯协议,安装容易,兼容性强,较强容错率;1. The present invention adopts serial communication protocol, which is easy to install, has strong compatibility and strong fault tolerance;
2、串行网关技术,将一个区块链内的节点能源设备全部物联化,保证节点间的数据通讯;2. Serial gateway technology, which interconnects all node energy equipment in a blockchain to ensure data communication between nodes;
3、能源数据通过透传云技术,实现数据上公有云端,并通过心跳包技术,保障数据同步性。3. Through the transparent transmission of cloud technology, energy data is realized on the public cloud, and the heartbeat packet technology is used to ensure data synchronization.
下面结合附图对本发明作进一步的详细说明。The present invention will be further described in detail below in conjunction with the accompanying drawings.
附图说明Description of the drawings
图1是实施例1的基于区块链的能源数据链接方法的框架示意图;FIG. 1 is a schematic diagram of the framework of the method for linking energy data based on blockchain in Embodiment 1;
图2是实施例1的基于区块链的能源数据链接方法的功能码域参照表;FIG. 2 is a reference table of functional code domains of the energy data link method based on blockchain in Embodiment 1;
图3是实施例1的基于区块链的能源数据链接方法的报文读数据格式参照表;FIG. 3 is a reference table of the message reading data format of the energy data link method based on the blockchain of Embodiment 1;
图4是实施例1的基于区块链的能源数据链接方法的寄存器参照表;FIG. 4 is a register reference table of the energy data link method based on the blockchain of Embodiment 1;
图5是实施例1的基于区块链的能源数据链接方法的报文写数据格式参照表;FIG. 5 is a reference table of the message writing data format of the energy data link method based on the blockchain of the embodiment 1;
图6是实施例1的基于区块链的能源数据链接方法的Modbus网关工作示意图。FIG. 6 is a schematic diagram of the Modbus gateway operation of the energy data link method based on the blockchain of Embodiment 1. FIG.
具体实施方式Detailed ways
实施例1Example 1
本实施例的一方面,提供了一种基于区块链的能源数据链接方法,如图1-6所示,其采用Modbus串行通信协议,其中,服务端作为Modbus主站设备运行,能源采集器作为Modbus从站设备运行;区块链上的任一节点对应设置能源采集器。In one aspect of this embodiment, a blockchain-based energy data link method is provided, as shown in Figure 1-6, which adopts the Modbus serial communication protocol, in which the server operates as a Modbus master device, and the energy collection The device operates as a Modbus slave device; any node on the blockchain is corresponding to an energy harvester.
区块链的节点包括:产能节点、用能节点和储能节点;其中产能节点为个体新能源产能用户,同为商户,其生产新能源,并将新能源通过物联网传输的方式传输至储能节点;用能节点为需要使用新能源的用户,需要使用新能源供电时,发送用能请求;储能节点为国家电网,接收产能节点传送的新能源;并根据用能节点的用能需求通过物联网传输的方式发送新能源至用户节点;每个产能节点、每个用能节点、以及储能节点均拥有一个钱包地址,用于接收和发送区块链网络中的代币;产能节点根据预设的商户交易合约,与区块链网络中的储能节点执行交易和结算;用能节点根据预设的用户交易合约,与区块链网络中的储能节点执行交易和结算;本 实施例中的产能节点在需要用电的时候也可成为用能节点,根据用户交易合约与储能节点执行交易和结算。产能节点、用能节点、以及储能节点之间通过区块链网络进行交易和结算,能够方便用能节点的用户操作和使用,方便产能节点的电能输出和交易结算,方便储能节点的工作人员管理和结算,提高产能端和用能端之间的交易效率、以及公平与透明度。区块链网络相当于一个信息通道的角色,包含涉及能源交易的所有角色:产能节点、用能节点、以及储能节点。使得每一个节点的用户都能追踪每一度的来源和消耗,进一步地包括该电能来自哪里,在什么应用小号和什么时候消耗,全局共享账本,账本数据更全面、准确和清晰。The nodes of the blockchain include: capacity nodes, energy consumption nodes, and energy storage nodes; among them, the capacity nodes are individual new energy capacity users, both as merchants, which produce new energy and transmit the new energy to the storage through the Internet of Things transmission method. Energy nodes; energy-consuming nodes are users who need to use new energy, and when they need to use new energy to supply power, they send energy-use requests; energy-storage nodes are the national grid and receive new energy transmitted by production nodes; and according to the energy demand of energy-using nodes Send new energy to user nodes through the transmission of the Internet of Things; each production node, each energy consuming node, and energy storage node has a wallet address for receiving and sending tokens in the blockchain network; production node According to the preset merchant transaction contract, execute transaction and settlement with the energy storage node in the blockchain network; the energy consumption node executes transaction and settlement with the energy storage node in the blockchain network according to the preset user transaction contract; this The capacity node in the embodiment can also become an energy consuming node when electricity is needed, and perform transactions and settlements with the energy storage node according to the user transaction contract. The transaction and settlement between production nodes, energy consumption nodes, and energy storage nodes are carried out through the blockchain network, which can facilitate the user operation and use of energy nodes, facilitate the power output and transaction settlement of production nodes, and facilitate the work of energy storage nodes Personnel management and settlement improve the transaction efficiency, fairness and transparency between the capacity end and the energy end. The blockchain network is equivalent to the role of an information channel, including all roles involved in energy transactions: production nodes, energy use nodes, and energy storage nodes. It enables users of each node to track the source and consumption of each degree, and further includes where the electricity comes from, when it is used and when it is consumed, and the ledger is shared globally, and the ledger data is more comprehensive, accurate and clear.
每一个节点对应一个从站设备;主站设备和从站设备通过ModbusRTU格式或ModbusTcp格式进行配置,物理层通讯方式采用串口RS485或以太网;根据接收到的主站设备发送来的报文请求,子站设备响应发送报文,将当前发生变化的寄存器地址及寄存器码值打包发送给主站设备。Each node corresponds to a slave device; the master device and the slave device are configured through ModbusRTU format or ModbusTcp format, and the physical layer communication method uses serial port RS485 or Ethernet; according to the received message request sent by the master device, In response to the sending message, the slave station device packs and sends the currently changed register address and register code value to the master station device.
从站设备发送报文的方式为心跳包方式,一个心跳包包括一个字符串;字符串的数据位为8位,停止位为1位,校验方式为无校验。The mode of sending messages from the station equipment is the heartbeat packet mode. A heartbeat packet includes a character string; the data bit of the character string is 8 bits, the stop bit is 1 bit, and the check mode is no check.
寄存器码值包括峰平谷系数信息、用户等级信息、发电类型信息、用户类型信息。区块链网络中需要将能源数据根据结算方法换算成结算数据;其采用线性结算方法进行结算,公式如下:The register code value includes peak-level-valley coefficient information, user level information, power generation type information, and user type information. In the blockchain network, energy data needs to be converted into settlement data according to the settlement method; it adopts a linear settlement method for settlement, the formula is as follows:
Figure PCTCN2019130251-appb-000001
Figure PCTCN2019130251-appb-000001
其中,Q,为代币值;Among them, Q is the token value;
i,为第i个能源表;i, is the i-th energy meter;
FR,为正反向参数,FR为-1,0,1,用于区分产能节点和用能节点;FR is a positive and negative parameter, and FR is -1,0,1, which is used to distinguish between capacity nodes and energy consumption nodes;
CP,为结算周期末的读表数据;CP is the meter reading data at the end of the settlement cycle;
PP,为上一结算周期末的读表数据;PP is the meter reading data at the end of the previous settlement cycle;
MP,为综合倍率,能源表转换参数,(本期示数-上期示数)*综合倍率=能源用量,即:(CP-PP)*MP;MP, is the comprehensive magnification, the conversion parameter of the energy meter, (the number shown in the current period-the number shown in the previous period) * comprehensive magnification = energy consumption, that is: (CP-PP)*MP;
SC,为用户结算系数,根据用户等级或者优惠政策给予用户的优惠和折扣区分结算;便于不同的用户享受不同的优惠和折扣。SC, the user settlement coefficient, distinguishes settlement according to the preferential and discount given to the user by the user level or preferential policy; it is convenient for different users to enjoy different preferential and discount.
TC,为发电类型系数,根据新能源的发电类型区分结算,包括传统电网发电、新能源发电;例如传统电网发电是1,新能源是50%;有利于根据推广政策推广新能源发电。TC is the power generation type coefficient, which is differentiated and settled according to the power generation type of new energy, including traditional power grid power generation and new energy power generation; for example, traditional power grid power generation is 1, and new energy power generation is 50%; it is conducive to promoting new energy power generation according to promotion policies.
EC,为用户类型,根据市场应用层区分结算,包括:民用、商用、工业用电、农业用电;EC is the user type, and the settlement is differentiated according to the market application layer, including: civil, commercial, industrial, and agricultural electricity;
VC,为峰平谷系数,将每一天的时间根据用能高峰和用能低谷进行区分结算;可分为例如四个时段,峰时段:8:00~11:00、18:00~21:00;平1时段:6:00~8:00、11:00~13:00、15:00~18:00、21:00~22:00;平2时段:13:00~15:00;谷时段:22:00~6:00;不同的时段采用不同的系数值结算,有利于合理控制用电高峰的用电情况。VC is the peak-level-valley coefficient, which distinguishes and settles the time of each day according to the peak energy consumption and the energy consumption low valley; for example, it can be divided into four time periods, peak time: 8:00~11:00, 18:00~21:00 ; Flat 1 time: 6:00~8:00, 11:00~13:00, 15:00~18:00, 21:00~22:00; Flat 2 time: 13:00~15:00; Valley Time period: 22:00~6:00; different coefficient values are used for settlement in different time periods, which is conducive to reasonable control of peak electricity consumption.
AC,为动态常数,默认为0,通常为差值常量,即与供电局的结算差值,将这一因素合理考虑进去。AC is a dynamic constant, the default is 0, usually a difference constant, that is, the settlement difference with the power supply bureau, and this factor is reasonably taken into consideration.
通过线性的结算方法,将用户结算系数、发电类型系数、用户类型、峰平谷系数考虑进去,使得,该结算公式适用于不同的结算情况,根据结算情况进行系数调整,便于优惠折扣和新能源扶持政策的推广、促进。本实施例通过将峰平谷系数信息、用户等级信息、发电类型信息、用户类型信息写入寄存器;使得读取寄存器码值后,能够直接分析处理结算,快速获得结算结果。参见图4,正向代表用户向国家电网(储能节点)输出电能,反向代表国家电网(储能节点)向用户输出电能,供用户使用;功尖、功 峰、功平、功谷分别代表峰平谷系数的四种时间段,用于对不同的时间段进行不同系数的电能结算,根据实际应用需求,可增加或减少时间段,根据时间段对应地设置寄存器码值;同理地,还可以定义更多的寄存器,分别用于定义用户结算系数,发电类型系数,用户类型系数,以便读取寄存器码值后,直接按照线性结算公式结算。Through the linear settlement method, the user settlement coefficient, power generation type coefficient, user type, and peak-flat-valley coefficient are taken into account, so that the settlement formula is suitable for different settlement situations, and the coefficient is adjusted according to the settlement situation, which is convenient for preferential discounts and new energy support Promotion and promotion of policies. In this embodiment, the peak-level-valley coefficient information, user level information, power generation type information, and user type information are written into the register; so that after reading the register code value, the settlement can be directly analyzed and processed, and the settlement result can be obtained quickly. Refer to Figure 4, the positive direction represents the user outputting electrical energy to the State Grid (energy storage node), and the reverse represents the output electrical energy of the State Grid (energy storage node) to the user for use; the power tip, power peak, power level, and power valley are respectively The four time periods representing the peak, flat, and valley coefficients are used for different time periods for energy settlement with different coefficients. According to actual application requirements, the time period can be increased or decreased, and the register code value can be set correspondingly according to the time period; similarly, You can also define more registers, which are used to define user settlement coefficients, power generation type coefficients, and user type coefficients, so that after reading the register code value, you can directly settle the settlement according to the linear settlement formula.
本实施例中的方法包括如下步骤:The method in this embodiment includes the following steps:
S1、主站设备根据现场应用来确定从站设备的寄存器分布,S1, the master station equipment determines the register distribution of the slave station equipment according to the field application,
S2、从站设备发送心跳包报文;S2. The slave device sends a heartbeat packet message;
S3、主站设备根据需要确定从站设备的变化数据寄存器范围,并确定功能码,写入发送报文所配置的寄存器;S3. The master station device determines the range of the change data register of the slave station device according to needs, determines the function code, and writes it into the register configured for sending the message;
S4、主站设备接收来自从站设备的变化数据报文,解析该信息中包含的寄存器码值及地址,并做出相应处理。从站设备以心跳包的方式发送数据报文,主站设备接收报文请求后,根据报文请求确定所需的寄存器地址,在Modbus轮询时,读取到对应的寄存器地址时,接收相应的寄存器地址的报文,并分析处理。S4. The master station device receives the change data message from the slave station device, analyzes the register code value and address contained in the information, and makes corresponding processing. The slave device sends a data message in the form of a heartbeat packet. After the master device receives the message request, it determines the required register address according to the message request. During Modbus polling, when the corresponding register address is read, the corresponding register address is received. The message of the register address, and analyze and process.
步骤S1之前还包括如下步骤:It also includes the following steps before step S1:
S00、对主站和从站设备进行格式配置;S00. Perform format configuration on the master station and slave station equipment;
S01、主站设备完成初始化后,进行从站设备数据的轮询。S01. After the master device completes the initialization, polling of the slave device data is performed.
通过Modbus轮询,对数据进行实时监控,提高容错率,保障运行稳定。Through Modbus polling, real-time monitoring of data can improve fault tolerance and ensure stable operation.
本实施例的所有RS485回路通信遵照主/从方式,主是指的是主站设备,即服务端,从是指从站设备,即所有能源采集器硬件。在这种方式下,数据信息和报文资料在单个主站和最多32个从站(监控设备)之间传递;主站将初始化和控制所有在RS485通信回路上传递的信息;RS485环路上的通 信都以"心跳包"方式发生。一个报文就是一个字符串(每个字符串8位),一个报文中最多可含255个字节。组成这个报文的字节构成标准异步串行资料,并按8位资料位,1位停止位,无校验位的方式传递。串行数据流由类似于RS232C中使用的设备产生。All RS485 loop communications in this embodiment follow the master/slave mode. The master refers to the master device, that is, the server, and the slave refers to the slave device, that is, all energy harvester hardware. In this way, data information and message information are transmitted between a single master station and a maximum of 32 slave stations (monitoring equipment); the master station will initialize and control all the information transmitted on the RS485 communication loop; the information on the RS485 loop Communication takes place in the form of "heartbeat packets". A message is a character string (8 bits per character string), and a message can contain up to 255 bytes. The bytes that make up this message constitute standard asynchronous serial data, and are transmitted in the form of 8 data bits, 1 stop bit, and no parity bit. The serial data stream is generated by a device similar to that used in RS232C.
每个Modbus报文均由以下部分组成:地址域、功能码域、数据域、校验域。其中地址域指的是:Modbus的从站地址域长度为一个字节,包含报文传送的从站地址。有效的从站地址范围从1~247。从站如果接收到一帧从站地址域信息与自身地址相符合的报文时,应当执行报文中所包含的命令。从站所响应的报文中该域为自身地址。因为显示模块将可以和任何地址的控制器连接通讯,在显示模块发送的请求帧中地址域为对应序列,比如1。Each Modbus message consists of the following parts: address domain, function code domain, data domain, and check domain. The address field refers to: the length of the Modbus slave address field is one byte, including the slave address of the message transmission. The valid slave address ranges from 1 to 247. If the slave station receives a message in which the address domain information of the slave station matches its own address, it should execute the command contained in the message. This field in the message from the slave station is its own address. Because the display module will be able to communicate with the controller of any address, the address field in the request frame sent by the display module is the corresponding sequence, such as 1.
功能码域指的是:Modbus报文中功能域长度为一个字节,用以通知从站应当执行何操作。从站响应报文中应当包含主站所请求操作的相同功能域字节。有关设备的功能码参照图1所示的表格进行。The function code domain refers to: the length of the function domain in the Modbus message is one byte, which is used to inform the slave station what operation should be performed. The response message from the slave station shall contain the same functional domain byte of the operation requested by the master station. Refer to the table shown in Figure 1 for the function codes of the equipment.
数据域指的是:Modbus数据域长度不定,依据其具体功能而定。Modbus数据域采用"BIGINDIAN"模式,即是高位字节在前,低位字节在后。The data field refers to the length of the Modbus data field is variable, depending on its specific function. The Modbus data field adopts the "BIGINDIAN" mode, that is, the high-order byte is in front and the low-order byte is in the back.
校验域指的是:Modbus-RTU模式采用16位CRC校验。发送设备应当对报文中的每一个资料都进行CRC16计算,最后结果存放入检验域中。接收设备也应当对报文中的每一个资料(除校验域以外)进行CRC16计算,将结果域校验域进行比较。只有相同的报文才可以被接受。The check domain refers to: Modbus-RTU mode adopts 16-bit CRC check. The sending device should perform CRC16 calculation on each data in the message, and store the final result in the inspection domain. The receiving device should also perform CRC16 calculation on each data (except the check field) in the message, and compare the result field with the check field. Only the same message can be accepted.
在RS485网络上传送报文需要遵循以下时间的原则:主站请求报文结束到从站响应报文开始之间的时间最小为0毫秒,最大为250毫秒,典型值为60毫秒;从站响应报文结束到主站下一请求报文开始之间的时间典型值为100毫秒;报文中相邻两个字节之间的最大时间依据通讯波特率不同而不同,一般来说最大字节时间为3倍的字节发送时间。The transmission of messages on the RS485 network needs to follow the following principles of time: the minimum time between the end of the request message of the master station and the start of the response message of the slave station is 0 milliseconds, the maximum is 250 milliseconds, and the typical value is 60 milliseconds; the slave station responds The time between the end of the message and the start of the next request message of the master station is typically 100 milliseconds; the maximum time between two adjacent bytes in the message varies according to the communication baud rate, generally the largest word The section time is 3 times the byte transmission time.
Modbus支持两种功能码,兼容标准的Modbus协议16位资料模式,也就说传输任何测量值最大为65535。Modbus supports two function codes, compatible with the standard Modbus protocol 16-bit data mode, which means that the maximum transmission of any measured value is 65535.
通讯报文部分主要描述了继电器控制的命令,设备的读数据报文及响应报文的格式,设备写数据报文及响应报文的格式。The communication message part mainly describes the command of the relay control, the format of the device's read data message and response message, and the format of the device's write data message and response message.
读寄存器是由主站机发送的报文请求设备响应所有有效的寄存器,保留寄存器中。报文读数据格式如图3所示。其中寄存器码值参照如图4所示。使用功能码04读取。采用04功能码读取时,以4字节整型上送,将报文值除以100对应实际值(其中:序号中的电能值等于寄存器的值需除以10000)。例如:设备地址为1,以4字节整型格式读取第1块表所有信息为:01040000001A71C1。Reading a register is a message sent by the master station requesting the device to respond to all valid registers, and keep the registers. The message read data format is shown in Figure 3. Among them the register code value is consulted as shown in Fig. 4. Use function code 04 to read. When using the 04 function code to read, send it as a 4-byte integer, and divide the message value by 100 to correspond to the actual value (where: the energy value in the serial number is equal to the value of the register and needs to be divided by 10000). For example: the device address is 1, read all the information of the first block table in 4-byte integer format: 01040000001A71C1.
写寄存器报文格式是:主机->设备,而响应格式是:设备->主机。其中设备写入的寄存器从第一个寄存器开始一定是连续的。写数据寄存器格式图5所示。其中每字节8位二进制码,传输时加上一个起始位(0)、一个偶校验位和一个停止位(1)共11位。其传输序列如图1。D0是字节的最低有效位,D7是字节的最高有效位。先传低位,后传高位。The format of the write register message is: host -> device, and the response format is: device -> host. The registers written by the device must be continuous from the first register. Figure 5 shows the format of the write data register. Among them, each byte has 8 bits of binary code. When transmitting, a start bit (0), an even parity bit and a stop bit (1) are added for a total of 11 bits. The transmission sequence is shown in Figure 1. D0 is the least significant bit of the byte, and D7 is the most significant bit of the byte. Pass the low position first, then the high position.
在发送帧信息之前,先发送0-4个字节FEH,以唤醒接收方。传输次序所有数据项均先传送低位字节,后传送高位传输响应每次通信都是由主站按信息帧地址域选择的从站发出请求命令帧开始,被请求的从站根据命令帧中控制码的要求作出响应。Before sending the frame information, send 0-4 bytes FEH to wake up the receiver. All data items in the transmission order are first transmitted low byte, then high transmission response. Each communication starts with the request command frame sent by the slave station selected by the master station according to the information frame address field, and the requested slave station is controlled according to the command frame Respond to the request of the code.
收到命令帧后的响应延时Td:20ms≤Td≤500ms。字节之间停顿时间Tb:Tb≤500ms。Response delay Td after receiving the command frame: 20ms≤Td≤500ms. Pause time between bytes Tb:Tb≤500ms.
差错控制中字节校验为偶校验,帧校验为纵向信息校验和,按收方无论检测到偶校验出错或纵向信息校验和出错,均放该信息帧,不予响应。In error control, the byte check is even check, and the frame check is the vertical information checksum. Regardless of whether the receiver detects an even check error or a vertical information checksum error, the message frame will be placed and no response will be given.
初始数率:1200bpsInitial number rate: 1200bps
标准数率:300,600,1200,2400,4800,9600bps。而在1200bps时,Z=0。修改速率时特征字Z仅在一个二进制位为1时有效。Standard number rate: 300, 600, 1200, 2400, 4800, 9600bps. At 1200 bps, Z=0. When modifying the rate, the characteristic word Z is only valid when one binary bit is 1.
传输速率的变更,首先由主站以初始速率向从站发变更速率请求,从站以初始速率发确认应答帧或否认应答帧。收到从站确认帧后,双方以确认的新的速率进行以后的通信,并在通信结束后恢复到初始速率;若在500ms内未建立起通信链路,则双方均恢复到初始速率。每次通信中只允许改变一次通信速率。其中:最大传输速率受光电头或费率装置关学借口的限制,也受费率装置数据处理单元中工作时钟频率的限制。To change the transmission rate, the master station first sends a rate change request to the slave station at the initial rate, and the slave station sends an acknowledgement response frame or a negative response frame at the initial rate. After receiving the confirmation frame from the slave station, the two parties will communicate with each other at the confirmed new rate, and return to the initial rate after the end of the communication; if the communication link is not established within 500ms, both parties will return to the initial rate. Only one communication rate can be changed in each communication. Among them: the maximum transmission rate is limited by the excuse of the photoelectric head or the tariff device, and is also limited by the working clock frequency in the data processing unit of the tariff device.
本实施例的另一方面,提供了一种基于区块链的能源数据链接装置,其包括:RTU,RTU包括依次通信连接的数据采集通讯模块、主控制器和上位通讯处理模块;数据采集通讯模块与若干组能源采集器通信连接,主控制器包括若干个与若干组能源采集器一一对应的Modbus地址表,上位通讯处理模块与监控上位机通信连接。In another aspect of this embodiment, a blockchain-based energy data link device is provided, which includes: an RTU. The RTU includes a data acquisition communication module, a main controller, and a higher-level communication processing module that are sequentially communicated and connected; data acquisition communication The module communicates with several groups of energy collectors, the main controller includes several Modbus address tables corresponding to several groups of energy collectors, and the upper communication processing module communicates with the monitoring upper computer.
装置还包括Modbus网关,Modbus网关包括ModbusRTU透传、ModbusASCII透传、ModbusRTU与ModbusTCP的协议相互转换、Modbus轮询和串口主动查询。通过Modbus网关设置,实现Modbus串口协议到Modbus网络协议的转换。The device also includes a Modbus gateway. The Modbus gateway includes ModbusRTU transparent transmission, ModbusASCII transparent transmission, protocol mutual conversion between ModbusRTU and ModbusTCP, Modbus polling and serial port active query. Through the Modbus gateway setting, the conversion from Modbus serial protocol to Modbus network protocol is realized.
监控上位机包括透传云服务器和透传云管理系统,能源数据上传至透传云,透传云管理系统用于对从站设备、串口参数进行配置和管理。通过透传云实现设备与设备、设备与上位机之间相互通信和透传数据,接入设备几乎不需做修改便可接入实现远程透传数据。能源数据可以兼容NB-IOT、LoRa、WiFi、以太网和GPRS等多种通讯模式。The monitoring host computer includes a transparent transmission cloud server and a transparent transmission cloud management system. The energy data is uploaded to the transparent transmission cloud. The transparent transmission cloud management system is used to configure and manage slave devices and serial port parameters. Through the transparent transmission cloud to realize the mutual communication and transparent transmission of data between the equipment and the device and the upper computer, the access equipment can be connected to realize the remote transparent transmission of data without modification. Energy data can be compatible with multiple communication modes such as NB-IOT, LoRa, WiFi, Ethernet, and GPRS.
监控上位机还包括用户端,用户端为APP或微信小程序;用户通过用户端可方便地查看能源数据和操作发送用电需求,也方便被第三方公司调 用。The monitoring host computer also includes the user terminal, which is an APP or WeChat applet; the user can conveniently view energy data and operate and send electricity demand through the user terminal, and it is also convenient for third-party companies to call.
虽然本发明以较佳实施例揭露如上,但并非用以限定本发明实施的范围。任何本领域的普通技术人员,在不脱离本发明的发明范围内,当可作些许的改进,即凡是依照本发明所做的同等改进,应为本发明的范围所涵盖。Although the present invention is disclosed as above in preferred embodiments, it is not intended to limit the scope of implementation of the present invention. Any person of ordinary skill in the art, without departing from the scope of the present invention, can make some improvements, that is, any equivalent improvement made in accordance with the present invention should be covered by the scope of the present invention.

Claims (10)

  1. 一种基于区块链的能源数据链接方法,其特征在于,所述方法采用Modbus串行通信协议,其中,A blockchain-based energy data link method, characterized in that the method adopts Modbus serial communication protocol, wherein,
    服务端作为Modbus主站设备运行,能源采集器作为Modbus从站设备运行;区块链上的任一节点对应设置能源采集器。The server runs as a Modbus master device, and the energy harvester runs as a Modbus slave device; any node on the blockchain is corresponding to an energy harvester.
  2. 如权利要求1所述的方法,其特征在于,主站设备和从站设备通过ModbusRTU格式或ModbusTcp格式进行配置,物理层通讯方式采用串口RS485或以太网;根据接收到的主站设备发送来的报文请求,子站设备响应发送报文,将当前发生变化的寄存器地址及寄存器码值打包发送给主站设备。The method according to claim 1, wherein the master station device and the slave station device are configured through ModbusRTU format or ModbusTcp format, and the physical layer communication mode adopts serial port RS485 or Ethernet; according to the received master station device sent Message request, the slave station device responds to the message sent, packs and sends the currently changed register address and register code value to the master station device.
  3. 如权利要求2所述的方法,其特征在于,所述从站设备发送报文的方式为心跳包方式,一个所述心跳包包括一个字符串;所述字符串的数据位为8位,停止位为1位,校验方式为无校验。The method according to claim 2, wherein the method of sending the message from the slave station device is a heartbeat packet mode, one of the heartbeat packets includes a character string; the data bit of the character string is 8 bits, stop The bit is 1 bit, and the check method is no check.
  4. 如权利要求2所述的方法,其特征在于,所述寄存器码值包括峰平谷系数信息、用户等级信息、发电类型信息、用户类型信息。The method according to claim 2, wherein the register code value includes peak-level-valley coefficient information, user level information, power generation type information, and user type information.
  5. 如权利要求2所述的方法,其特征在于,所述方法包括如下步骤:3. The method of claim 2, wherein the method comprises the following steps:
    S1、主站设备根据现场应用来确定从站设备的寄存器分布,S1, the master station equipment determines the register distribution of the slave station equipment according to the field application,
    S2、从站设备发送心跳包报文;S2. The slave device sends a heartbeat packet message;
    S3、主站设备根据需要确定从站设备的变化数据寄存器范围,并确定 功能码,写入发送报文所配置的寄存器;S3. The master device determines the range of the change data register of the slave device according to the needs, and determines the function code, and writes it into the register configured for sending the message;
    S4、主站设备接收来自从站设备的变化数据报文,解析该信息中包含的寄存器码值及地址,并做出相应处理。S4. The master station device receives the change data message from the slave station device, analyzes the register code value and address contained in the information, and makes corresponding processing.
  6. 如权利要求5所述的方法,其特征在于,所述步骤S1之前还包括如下步骤:The method according to claim 5, characterized in that, before the step S1, the method further comprises the following steps:
    S00、对主站和从站设备进行格式配置;S00. Perform format configuration on the master station and slave station equipment;
    S01、主站设备完成初始化后,进行从站设备数据的轮询。S01. After the master device completes the initialization, polling of the slave device data is performed.
  7. 一种基于区块链的能源数据链接装置,其特征在于,所述装置包括:A block chain-based energy data linking device, characterized in that, the device includes:
    RTU,所述RTU包括依次通信连接的数据采集通讯模块、主控制器和上位通讯处理模块;所述数据采集通讯模块与若干组能源采集器通信连接,所述主控制器包括若干个与所述若干组能源采集器一一对应的Modbus地址表,所述上位通讯处理模块与监控上位机通信连接。RTU, the RTU includes a data acquisition communication module, a main controller, and a higher-level communication processing module that are sequentially connected in communication; Several groups of energy collectors have one-to-one corresponding Modbus address tables, and the upper communication processing module is in communication connection with the monitoring upper computer.
  8. 如权利要求7所述的装置,其特征在于,所述装置还包括Modbus网关,所述Modbus网关包括ModbusRTU透传、ModbusASCII透传、ModbusRTU与ModbusTCP的协议相互转换、Modbus轮询和串口主动查询。8. The device of claim 7, wherein the device further comprises a Modbus gateway, the Modbus gateway comprising ModbusRTU transparent transmission, ModbusASCII transparent transmission, protocol mutual conversion between ModbusRTU and ModbusTCP, Modbus polling and serial port active query.
  9. 如权利要求7所述的装置,其特征在于,所述监控上位机包括透传云服务器和透传云管理系统,能源数据上传至透传云,所述透传云管理系统用于对从站设备、串口参数进行配置和管理。The device according to claim 7, wherein the monitoring host computer includes a transparent transmission cloud server and a transparent transmission cloud management system, the energy data is uploaded to the transparent transmission cloud, and the transparent transmission cloud management system is used to communicate with the slave station. Configuration and management of equipment and serial port parameters.
  10. 如权利要求9所述的装置,其特征在于,所述监控上位机还包括用户端,所述用户端为APP或微信小程序。The device according to claim 9, wherein the monitoring host computer further comprises a user terminal, and the user terminal is an APP or a WeChat applet.
PCT/CN2019/130251 2019-10-17 2019-12-31 Blockchain-based energy data linking method and apparatus WO2021072981A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910985892.8 2019-10-17
CN201910985892.8A CN110716977A (en) 2019-10-17 2019-10-17 Energy data linking method and device based on block chain

Publications (1)

Publication Number Publication Date
WO2021072981A1 true WO2021072981A1 (en) 2021-04-22

Family

ID=69211741

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/130251 WO2021072981A1 (en) 2019-10-17 2019-12-31 Blockchain-based energy data linking method and apparatus

Country Status (2)

Country Link
CN (1) CN110716977A (en)
WO (1) WO2021072981A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113572782A (en) * 2021-07-30 2021-10-29 广东机电职业技术学院 Internet of things gateway supporting multiple sensor networks and implementation method thereof
CN113938500A (en) * 2021-09-07 2022-01-14 中建三局智能技术有限公司 RS 485-based Modbus protocol packaging method
CN114661231A (en) * 2022-02-18 2022-06-24 南京南瑞继保电气有限公司 Storage synchronization method and device for parameter change records of power grid monitoring master station system
CN116132544A (en) * 2022-12-12 2023-05-16 贵州省矿山安全科学研究院有限公司 Custom development drive design method and system for nonstandard ModBus communication protocol
CN116383110A (en) * 2022-12-29 2023-07-04 孚瑞肯电气(深圳)有限公司 Modbus communication module and communication method
CN117714237A (en) * 2024-02-05 2024-03-15 中国电子信息产业集团有限公司第六研究所 Gateway communication board and data transmission method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116208289B (en) * 2023-04-28 2023-07-21 北京邮电大学 Time synchronization method and device based on white box switch and electronic equipment
CN116938705B (en) * 2023-06-16 2024-05-17 北京天融信网络安全技术有限公司 Terminal management method and device of RS485 bus and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103746783A (en) * 2013-11-29 2014-04-23 国电南瑞科技股份有限公司 Extended communication method based on Modbus communication protocol
CN103763396A (en) * 2014-02-12 2014-04-30 浙江大学 Energy consumption data acquisition unit and method based on multi-protocol parallel acquisition technology
CN108876561A (en) * 2018-07-25 2018-11-23 明阳智慧能源集团股份公司 A kind of energy transaction system based on block chain technology
CN109525429A (en) * 2018-11-15 2019-03-26 洛阳理工学院 A kind of RTU and its communication means suitable for MODBUS agreement
CN109785131A (en) * 2018-12-21 2019-05-21 昆明理工大学 A kind of electricity transaction method based on block chain

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6792337B2 (en) * 1994-12-30 2004-09-14 Power Measurement Ltd. Method and system for master slave protocol communication in an intelligent electronic device
CN110210970A (en) * 2019-05-30 2019-09-06 国网河北省电力有限公司经济技术研究院 Energy method of commerce, device and terminal device based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103746783A (en) * 2013-11-29 2014-04-23 国电南瑞科技股份有限公司 Extended communication method based on Modbus communication protocol
CN103763396A (en) * 2014-02-12 2014-04-30 浙江大学 Energy consumption data acquisition unit and method based on multi-protocol parallel acquisition technology
CN108876561A (en) * 2018-07-25 2018-11-23 明阳智慧能源集团股份公司 A kind of energy transaction system based on block chain technology
CN109525429A (en) * 2018-11-15 2019-03-26 洛阳理工学院 A kind of RTU and its communication means suitable for MODBUS agreement
CN109785131A (en) * 2018-12-21 2019-05-21 昆明理工大学 A kind of electricity transaction method based on block chain

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113572782A (en) * 2021-07-30 2021-10-29 广东机电职业技术学院 Internet of things gateway supporting multiple sensor networks and implementation method thereof
CN113572782B (en) * 2021-07-30 2023-03-10 广东机电职业技术学院 Internet of things gateway supporting multiple sensor networks and implementation method thereof
CN113938500A (en) * 2021-09-07 2022-01-14 中建三局智能技术有限公司 RS 485-based Modbus protocol packaging method
CN113938500B (en) * 2021-09-07 2024-03-22 中建三局智能技术有限公司 Modbus protocol packet method based on RS485
CN114661231A (en) * 2022-02-18 2022-06-24 南京南瑞继保电气有限公司 Storage synchronization method and device for parameter change records of power grid monitoring master station system
CN114661231B (en) * 2022-02-18 2023-08-11 南京南瑞继保电气有限公司 Storage synchronization method and device for parameter change records of power grid monitoring master station system
CN116132544A (en) * 2022-12-12 2023-05-16 贵州省矿山安全科学研究院有限公司 Custom development drive design method and system for nonstandard ModBus communication protocol
CN116383110A (en) * 2022-12-29 2023-07-04 孚瑞肯电气(深圳)有限公司 Modbus communication module and communication method
CN117714237A (en) * 2024-02-05 2024-03-15 中国电子信息产业集团有限公司第六研究所 Gateway communication board and data transmission method
CN117714237B (en) * 2024-02-05 2024-05-03 中国电子信息产业集团有限公司第六研究所 Gateway communication board and data transmission method

Also Published As

Publication number Publication date
CN110716977A (en) 2020-01-21

Similar Documents

Publication Publication Date Title
WO2021072981A1 (en) Blockchain-based energy data linking method and apparatus
WO2020207067A1 (en) Blockchain-based new energy settlement system
CN206532409U (en) A kind of collecting terminal with platform area identification function
CN104732751A (en) Automatic meter reading system and automatic meter reading method based on RF (radio frequency) and GPRS (general packet radio service)/3G (the 3rd generation telecommunication)
CN206332860U (en) LoRa gateways
CN107241382B (en) Data conversion method and device used between serial port and Ethernet
CN101943734A (en) Method for automatically detecting terminals in batch based on IEC62056 protocol
CN107146397A (en) It is a kind of to be used for water meter, ammeter, gas meter, the arrowband Internet of Things centralized procurement system of hotlist
CN204231387U (en) A kind of intelligent micro-grid control system realizing high-speed communication based on FPGA
CN209046673U (en) Matrix type wireless teletransmission Intelligent water meter of Internet of things router
CN101895534A (en) Protocol conversion interface device of substation intelligent device
CN101566661A (en) Electricity quality online monitoring system based on transparent transmission technology
CN109374075A (en) Matrix form NB-IoT remote transmission intelligent water meter
CN207652706U (en) A kind of meter reading repeater based on LORA communications
CN212009322U (en) Intelligent power utilization management system based on ubiquitous Internet of things
CN104678167A (en) Intelligent electric energy meter and public utility meter reading system
CN206991535U (en) Novel intelligent meter reading collecting transmitter
CN206743467U (en) The remote communication devices of power information acquisition terminal
CN103036566B (en) A kind of on-line control controller of analog front-end chip
Zhao et al. Data acquisition and transmission system for building energy consumption monitoring
CN202815088U (en) Smart electric energy meter and meter reading system for public utility instruments
CN201985858U (en) Data transmission module for power collector
CN202939792U (en) Single-phase dual-channel communication module
CN204496480U (en) A kind ofly realize that mobile phone is made out an invoice, certification, printing communication connecting apparatus
CN208968610U (en) Matrix form NB-IoT remote transmission intelligent water meter

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19949170

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19949170

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19949170

Country of ref document: EP

Kind code of ref document: A1