CN117768267A - Method and device for processing controller local area network bus message for energy storage - Google Patents

Method and device for processing controller local area network bus message for energy storage Download PDF

Info

Publication number
CN117768267A
CN117768267A CN202311817946.2A CN202311817946A CN117768267A CN 117768267 A CN117768267 A CN 117768267A CN 202311817946 A CN202311817946 A CN 202311817946A CN 117768267 A CN117768267 A CN 117768267A
Authority
CN
China
Prior art keywords
frame
message
definition table
data
frame definition
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.)
Pending
Application number
CN202311817946.2A
Other languages
Chinese (zh)
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.)
Huaqing Chuchuang Technology Co ltd
Huaneng Moli Dawa New Energy Co ltd
Huaneng Clean Energy Research Institute
Huaneng Laiwu Power Generation Co Ltd
Original Assignee
Huaqing Chuchuang Technology Co ltd
Huaneng Moli Dawa New Energy Co ltd
Huaneng Clean Energy Research Institute
Huaneng Laiwu Power Generation 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 Huaqing Chuchuang Technology Co ltd, Huaneng Moli Dawa New Energy Co ltd, Huaneng Clean Energy Research Institute, Huaneng Laiwu Power Generation Co Ltd filed Critical Huaqing Chuchuang Technology Co ltd
Priority to CN202311817946.2A priority Critical patent/CN117768267A/en
Publication of CN117768267A publication Critical patent/CN117768267A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure provides a method and a device for processing a Controller Area Network (CAN) bus message for energy storage, and relates to the technical fields of data processing and CAN message processing. The method comprises the following steps: acquiring a Controller Area Network (CAN) communication protocol point table of a controller area network bus generated by data acquisition equipment, and acquiring a preset CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table; respectively configuring a CAN communication protocol point table to a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table; receiving a first CAN message for energy storage, and respectively carrying out message processing on the first CAN message based on a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table to obtain a second CAN message; and sending the second CAN message to preset terminal equipment. The CAN communication message CAN be rapidly analyzed, analysis data CAN be intuitively output, different frames and different devices CAN be compatible, development requirements are reduced, and the flexibility of CAN data analysis is improved.

Description

Method and device for processing controller local area network bus message for energy storage
Technical Field
The disclosure relates to the technical field of data processing and CAN message processing, in particular to a method and a device for processing a controller area network bus message for energy storage.
Background
The controller area network bus (Controller Area Network, CAN) has high performance and reliability and is widely used in industrial automation, ships, medical equipment, industrial equipment, and the like. However, the data content of the CAN is hexadecimal data, which may affect the recognition efficiency, and in the related art, the CAN message analysis host computer system CAN only receive and transmit CAN messages, such as voltage and current information commonly used in a Battery Management System (BMS), and the CAN communication message CAN obtain a true value through multiple transformations by using a calculator, a protocol document and the like. When the data is changed quickly, it may take several hours or more for one minute of data to be analyzed, which is inefficient.
The energy storage EMS is also called an energy management system and generally comprises functions of data acquisition, monitoring and the like. The common protocol of the energy storage battery BMS system is CAN, and the data format of each frame of message is different due to the particularity of the CAN protocol, so that the number of messages of various devices is also different, and therefore, how to be compatible with different frames and different devices reduces development requirements, increases the flexibility of CAN data analysis, rapidly identifies CAN message content, realizes online analysis, and becomes one of important research directions.
Disclosure of Invention
The present disclosure aims to solve, at least to some extent, one of the technical problems in the related art. It is therefore an object of the present disclosure to provide a method for processing a controller area network bus message for storing energy.
A second object of the present disclosure is to provide a processing device for a controller area network bus packet for storing energy.
A third object of the present disclosure is to propose an electronic device.
A fourth object of the present disclosure is to propose a non-transitory computer readable storage medium.
A fifth object of the present disclosure is to propose a computer programme product.
To achieve the above objective, an embodiment of a first aspect of the present disclosure provides a method for processing a controller area network bus packet for storing energy, including:
acquiring a Controller Area Network (CAN) communication protocol point table of a controller area network bus generated by data acquisition equipment, and acquiring a preset CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table;
respectively configuring a CAN communication protocol point table to a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table;
receiving a first CAN message for energy storage, and respectively carrying out message processing on the first CAN message based on a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table to obtain a second CAN message;
and sending the second CAN message to preset terminal equipment.
In some embodiments, the CAN message includes a CAN transmit frame and a CAN receive frame;
in some embodiments, the CAN frame definition table is used for defining all CAN frames under any remote terminal RTU participating in CAN mode communication, the CAN frames include CAN transmission frames and CAN reception frames, and the table structure of the CAN frame definition table has a first field including a first RTU number, a first frame packet identifier ID, a first frame sequence number, a first transmission period, and a first frame type.
In some embodiments, the CAN receive frame definition table is used to define any data in any CAN receive frame, and the second field of the table structure of the CAN receive frame definition table includes a second RTU number, a second frame packet ID, a first start bit, a first data bit length, an offset, a first forwarding coefficient, and a data description.
In some embodiments, the CAN transmission frame definition table is used for defining any data in any CAN transmission frame, and a third field included in a table structure of the CAN transmission frame definition table includes a third RTU number, a third frame packet ID, a second start bit, a second data bit length, a forwarding data RTU number, a forwarding data sequence number, a data type, and a second forwarding coefficient.
In some embodiments, the data types include telemetry, fixed values, cyclic redundancy check, CRC8, values, telemetry.
In some embodiments, after receiving the first CAN packet for energy storage, the method further includes:
the first initial bit of the CAN receiving frame definition table is used as an index of a full data information array of the CAN receiving frame, or the second initial bit of the CAN transmitting frame definition table is used as an index of the full data information array of the CAN transmitting frame, so that the data information of the first CAN message is initialized;
and ordering the full data information list of the CAN receiving frames of the RTU from small to large according to the frame sequence number frmno, and generating the acquisition sequence number of the CAN receiving frames.
In some embodiments, any data segment in the first CAN packet includes n bits, where 1 n is less than or equal to 64, and the total data information of any CAN receiving frame includes basic data of 64 CAN receiving frames at maximum, and the total data information of any CAN transmitting frame includes basic data of 64 CAN transmitting frames at maximum.
In some embodiments, after receiving the first CAN packet for energy storage, the method further includes:
extracting and analyzing a second frame message ID from the CAN receiving frame;
and searching all data information of the CAN receiving frame according to the analyzed second frame message ID, and assigning values according to the CAN receiving frame.
In some embodiments, sending the second CAN message to the preset terminal device includes:
traversing the CAN transmission frame of the second CAN message, and determining a target CAN transmission frame currently traversed;
determining whether the target CAN transmission frame reaches the current transmission time according to the transmission period of the target CAN transmission frame and the last transmission time;
framing the second CAN message reaching the current sending time, and sending the framed second CAN message to preset terminal equipment.
To achieve the above object, an embodiment of a second aspect of the present disclosure provides a processing device for a controller area network bus packet for storing energy, including:
the acquisition module is used for acquiring a CAN communication protocol point table generated by the data acquisition equipment and acquiring a preset CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table;
the configuration module is used for respectively configuring the CAN communication protocol point table to a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table;
the processing module is used for receiving a first CAN message for energy storage, and respectively processing the first CAN message based on a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table to obtain a second CAN message;
and the sending module is used for sending the second CAN message to preset terminal equipment.
In some embodiments, the CAN message includes a CAN transmit frame and a CAN receive frame.
In some embodiments, the CAN frame definition table is used for defining all CAN frames under any remote terminal RTU participating in CAN mode communication, the CAN frames include CAN transmission frames and CAN reception frames, and the table structure of the CAN frame definition table has a first field including a first RTU number, a first frame packet identifier ID, a first frame sequence number, a first transmission period, and a first frame type.
In some embodiments, the CAN receive frame definition table is used to define any data in any CAN receive frame, and the second field of the table structure of the CAN receive frame definition table includes a second RTU number, a second frame packet ID, a first start bit, a first data bit length, an offset, a first forwarding coefficient, and a data description.
In some embodiments, the CAN transmission frame definition table is used for defining any data in any CAN transmission frame, and a third field included in a table structure of the CAN transmission frame definition table includes a third RTU number, a third frame packet ID, a second start bit, a second data bit length, a forwarding data RTU number, a forwarding data sequence number, a data type, and a second forwarding coefficient.
In some embodiments, the data types include telemetry, fixed values, cyclic redundancy check, CRC8, values, telemetry.
In some embodiments, the processing module is further to:
the first initial bit of the CAN receiving frame definition table is used as an index of a full data information array of the CAN receiving frame, or the second initial bit of the CAN transmitting frame definition table is used as an index of the full data information array of the CAN transmitting frame, so that the data information of the first CAN message is initialized;
and ordering the full data information list of the CAN receiving frames of the RTU from small to large according to the frame sequence number frmno, and generating the acquisition sequence number of the CAN receiving frames.
In some embodiments, any data segment in the first CAN packet includes n bits, where 1 n is less than or equal to 64, and the total data information of any CAN receiving frame includes basic data of 64 CAN receiving frames at maximum, and the total data information of any CAN transmitting frame includes basic data of 64 CAN transmitting frames at maximum.
In some embodiments, the processing module is further to:
extracting and analyzing a second frame message ID from the CAN receiving frame;
and searching all data information of the CAN receiving frame according to the analyzed second frame message ID, and assigning values according to the CAN receiving frame.
In some embodiments, sending the second CAN message to the preset terminal device includes:
traversing the CAN transmission frame of the second CAN message, and determining a target CAN transmission frame currently traversed;
determining whether the target CAN transmission frame reaches the current transmission time according to the transmission period of the target CAN transmission frame and the last transmission time;
framing the second CAN message reaching the current sending time, and sending the framed second CAN message to preset terminal equipment.
To achieve the above object, an embodiment of a third aspect of the present disclosure provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method for processing a controller area network bus message for energy storage provided in an embodiment of the first aspect of the present disclosure.
To achieve the above object, an embodiment of a fourth aspect of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, where the computer instructions are configured to cause a computer to perform a method for processing a controller area network bus packet for energy storage according to the embodiment of the first aspect of the present disclosure.
To achieve the above object, an embodiment of a fifth aspect of the present disclosure proposes a computer program product, including a computer program, which when executed by a processor implements a method for processing a controller area network bus packet for energy storage provided in an embodiment of the first aspect of the present disclosure.
In the embodiment of the disclosure, a CAN communication protocol point table is respectively configured to a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table; receiving a first CAN message for energy storage, and respectively carrying out message processing on the first CAN message based on a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table to obtain a second CAN message; and sending the second CAN message to preset terminal equipment. The embodiment of the disclosure formats the received CAN communication message in a standard manner by defining the CAN frame definition table, the CAN receiving frame definition table and the CAN transmitting frame definition table, has high data analysis speed and high analysis efficiency, CAN rapidly analyze the CAN communication message and intuitively output analysis data, CAN be compatible with different frames and different devices, reduces development requirements, and increases the flexibility of CAN data analysis.
Drawings
FIG. 1 is a flow chart of a method of processing a controller area network bus message for energy storage according to one embodiment of the present disclosure;
FIG. 2 is a flow chart of a method of processing a controller area network bus message for energy storage according to one embodiment of the present disclosure;
FIG. 3 is a flow chart of a method of receiving a data message according to one embodiment of the present disclosure;
FIG. 4 is a flow chart of sending a data message according to one embodiment of the present disclosure;
FIG. 5 is a flow chart of a method for processing a controller area network bus message for energy storage according to one embodiment of the present disclosure;
FIG. 6 is a block diagram of a processing device for a controller area network bus message for energy storage according to one embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present disclosure and are not to be construed as limiting the present disclosure.
The following describes a method and a device for processing a controller area network bus message for energy storage according to an embodiment of the present disclosure with reference to the accompanying drawings.
Fig. 1 is a flowchart of a method for processing a controller area network bus message for energy storage according to an embodiment of the present disclosure, as shown in fig. 1, the method includes the steps of:
s101, acquiring a CAN communication protocol point table generated by data acquisition equipment, and acquiring a preset CAN frame definition table, a preset CAN receiving frame definition table and a preset CAN transmitting frame definition table.
The CAN message includes two basic types of frames: CAN transmit frames and CAN receive frames. These two frame types are used for data communication over the CAN bus.
The CAN communication protocol point table is a configuration document for describing communication among all nodes in the CAN network.
In the embodiment of the disclosure, the CAN frame definition table is used for defining all CAN frames under any remote terminal RTU participating in CAN mode communication, the CAN frames include CAN transmission frames and CAN reception frames, and a first field included in a table structure of the CAN frame definition table includes a first RTU number, a first frame message identifier ID, a first frame sequence number, a first transmission period, and a first frame type. By way of example, the table structure of the CAN frame definition table is shown in table 1:
TABLE 1
In table 1, the acquisition RTU number of the EMS refers to a unique identification code for each remote terminal communicating using the CAN protocol.
In an embodiment of the disclosure, the CAN receive frame definition table is used for defining any data in any CAN receive frame, and a second field included in a table structure of the CAN receive frame definition table includes a second RTU number, a second frame packet ID, a first start bit, a first data bit length, an offset, a first forwarding coefficient, and a data description. For example, the table structure of the CAN reception frame definition table is shown in table 2:
TABLE 2
In an embodiment of the disclosure, the CAN transmission frame definition table is used for defining any data in any CAN transmission frame, and a third field included in a table structure of the CAN transmission frame definition table includes a third RTU number, a third frame packet ID, a second start bit, a second data bit length, a forwarding data RTU number, a forwarding data sequence number, a data type, and a second forwarding coefficient. For example, the table structure of the CAN transmission frame definition table is shown in table 3:
TABLE 3 Table 3
In table 3, the data types include telemetry, fixed value, cyclic redundancy check CRC8 value, telemetry. For example, the data type may be represented as a number from 0 to 6, with an association between the number and the data type, 0 being telemetry; 1 is remote signaling; 3 is a fixed value (the value is the value of the second factor); 4 is a cyclic value (starting value 0); 5 is a CRC8 value (a second factor of 0 indicates that byte 0 of the frame is a CRC8 value, and a value of 1 indicates that byte 7 of the frame is a CRC8 value); 6 indicates remote modulation, where zfno_is the remote modulation number (or address).
S102, respectively configuring the CAN communication protocol point table to a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table.
The CAN communication protocol point table contains the information such as the identifier, the data type, the data length and the like of each node and the message transmission relation among the nodes. The CAN communication protocol point table has the main function of defining the communication rule of each node in the CAN network and ensuring that each node CAN exchange data correctly and efficiently. In the point table, each node is assigned a unique identifier for distinguishing between different nodes. Meanwhile, the point table also prescribes information such as data types, data lengths and the like which can be transmitted and received by each node, and communication parameters such as a transmission period, a priority and the like of the message.
In the embodiment of the disclosure, a CAN communication protocol point table is respectively configured to a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table, and field information of the CAN frame definition table, the CAN receiving frame definition table and the CAN transmitting frame definition table is determined.
S103, receiving a first CAN message for energy storage, and respectively carrying out message processing on the first CAN message based on a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table to obtain a second CAN message.
And analyzing the identifier of the first CAN message based on the CAN frame definition table, and determining the message type and the sender node to which the message belongs. According to the CAN receiving frame definition table, searching CAN receiving frame definition information corresponding to the message type and the sender node, including information of a second field, analyzing a data field of the first CAN message, obtaining effective data in the data field, and converting and processing the effective data based on the offset and the first forwarding coefficient to obtain the data field content of the second CAN message. And constructing a frame format of a second CAN message according to a third field of the CAN transmission frame definition table, wherein the frame format comprises a third RTU number, a third frame message ID, a second initial bit, a second data bit length, a forwarding data RTU number, a forwarding data sequence number, a data type, a second forwarding coefficient and other fields, and setting the data field as effective data processed in the CAN receiving frame definition table to obtain a second CAN message.
It should be noted that, in the embodiment of the present disclosure, any data segment in the first CAN packet includes n bits, where n is 1-64, and the total data information of any CAN receiving frame includes basic data of 64 CAN receiving frames at maximum, and the total data information of any CAN transmitting frame includes basic data of 64 CAN transmitting frames at maximum.
S104, the second CAN message is sent to preset terminal equipment.
And sending the second CAN message to preset terminal equipment. Alternatively, the terminal device may be a presentation terminal device.
In the embodiment of the disclosure, a CAN communication protocol point table is respectively configured to a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table; receiving a first CAN message for energy storage, and respectively carrying out message processing on the first CAN message based on a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table to obtain a second CAN message; and sending the second CAN message to preset terminal equipment. The embodiment of the disclosure formats the received CAN communication message in a standard manner by defining the CAN frame definition table, the CAN receiving frame definition table and the CAN transmitting frame definition table, has high data analysis speed and high analysis efficiency, CAN rapidly analyze the CAN communication message and intuitively output analysis data, CAN be compatible with different frames and different devices, reduces development requirements, and increases the flexibility of CAN data analysis.
Fig. 2 is a flowchart of a method for processing a controller area network bus message for energy storage according to an embodiment of the present disclosure, as shown in fig. 2, the method includes the steps of:
s201, acquiring a CAN communication protocol point table generated by data acquisition equipment, and acquiring a preset CAN frame definition table, a preset CAN receiving frame definition table and a preset CAN transmitting frame definition table.
S202, respectively configuring the CAN communication protocol point table to a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table.
S203, a first CAN message for energy storage is received.
The description of step S201 to step S203 may refer to the relevant content in the above embodiment, and will not be repeated here.
S204, the first initial bit of the CAN receiving frame definition table is used as an index of the full data information array of the CAN receiving frame, or the second initial bit of the CAN transmitting frame definition table is used as an index of the full data information array of the CAN transmitting frame, so as to initialize the data information of the first CAN message.
Initializing data information of a first CAN message by taking a startbit of the CanRxFrmPara or the CanTxFrmPara as an index subscript of a frame sequence number frmdata array of the corresponding CanRxSetData or CanTxSetData. Wherein, canRxFrmPara represents a CAN receiving frame definition structure, canTxFrmPara represents a CAN transmitting frame definition structure, and CanTxSetData represents all data information of any CAN transmitting frame.
S205, ordering the full data information list of the CAN receiving frames of the RTU from small to large according to the frame sequence number frmno, and generating the acquisition sequence number of the CAN receiving frames.
And ordering the CanRxSetData list of the RTU from small to large according to the frmno frame sequence number, and generating the acquisition sequence number of the CAN receiving frame.
S206, respectively processing the first CAN message based on the CAN frame definition table, the CAN receiving frame definition table and the CAN transmitting frame definition table to obtain a second CAN message.
The description of step S206 may be referred to the relevant content in the above embodiment, and will not be repeated here.
It should be noted that, in the embodiment of the present application, the second frame message ID is extracted and parsed from the CAN receiving frame of the first CAN message, full data information of the CAN receiving frame is searched according to the parsed second frame message ID, and assignment is performed according to the CAN receiving frame. Fig. 3 is a flowchart of a data packet receiving method according to an embodiment of the present disclosure, as shown in fig. 3, that is, searching for corresponding CanRxSetData according to a second frame packet ID of a CAN receiving frame, and finally assigning a value to basic data in the CanRxSetData according to the frame packet. Wherein, canRxSetData represents the full data information of any CAN receiving frame.
Optionally, after extracting the second frame message ID from the CAN receiving frame of the first CAN message, determining whether the second frame message ID exists in the CAN frame definition table, where the second frame message ID may be, for example, an integer, and if the second frame message ID exists in the CAN frame definition table, it indicates that the CAN receiving frame to which the second frame message ID belongs is a valid frame.
S207, traversing the CAN transmission frame of the second CAN message, and determining the currently traversed target CAN transmission frame.
S208, determining whether the target CAN transmission frame reaches the current transmission time according to the transmission period of the target CAN transmission frame and the last transmission time.
And acquiring the time difference between the current time and the last transmission time of the target CAN transmission frame, and judging that the current transmission time is reached if the time difference is greater than or equal to the transmission period of the target CAN transmission frame.
S209, framing the second CAN message reaching the current sending time, and sending the framed second CAN message to preset terminal equipment.
Fig. 4 is a flowchart of transmitting a data packet according to an embodiment of the present disclosure, and as shown in fig. 4, a second CAN packet after framing is transmitted to a preset terminal device according to a CAN transmission frame framing packet reaching a current transmission time.
In the embodiment of the application, a first initial bit of a CAN receiving frame definition table is used as an index of a full data information array of a CAN receiving frame, or a second initial bit of a CAN transmitting frame definition table is used as an index of a full data information array of a CAN transmitting frame so as to initialize data information of a first CAN message, a full data information list of the CAN receiving frame of an RTU is ordered from small to large according to a frame sequence number frrno, and acquisition sequence numbers of the CAN receiving frames are generated to rapidly identify content and analyze on line. Traversing the CAN transmission frame of the second CAN message, determining the currently traversed target CAN transmission frame, determining whether the target CAN transmission frame reaches the current transmission time according to the transmission period and the last transmission time of the target CAN transmission frame, framing the second CAN message reaching the current transmission time, and transmitting the framed second CAN message to preset terminal equipment, so that the flexibility of CAN data analysis CAN be increased.
Fig. 5 is a flow chart of a processing method of a controller area network bus message for energy storage according to an embodiment of the present disclosure, as shown in fig. 5, in this embodiment of the present disclosure, three definition tables, that is, a CAN frame definition table, a CAN receive frame definition table and a CAN transmit frame definition table, which are edited in advance, are obtained, and the CAN frame definition table, the CAN receive frame definition table and the CAN transmit frame definition table are respectively configured according to a CAN communication protocol point table, and after the three definition tables are uploaded and validated, the received first CAN message CAN be parsed in real time according to the definition table, real-time data is generated, and a second CAN message to be transmitted is obtained.
Fig. 6 is a block diagram of a processing apparatus for a stored energy wlan bus message according to an embodiment of the present disclosure, and as shown in fig. 6, a processing apparatus 600 for a stored energy wlan bus message includes:
the acquiring module 610 is configured to acquire a CAN communication protocol point table generated by the data acquisition device, and acquire a preset CAN frame definition table, a CAN receiving frame definition table, and a CAN transmitting frame definition table;
the configuration module 620 is configured to configure the CAN communication protocol point table to a CAN frame definition table, a CAN reception frame definition table, and a CAN transmission frame definition table, respectively;
the processing module 630 is configured to receive a first CAN packet for storing energy, and process the first CAN packet based on a CAN frame definition table, a CAN reception frame definition table, and a CAN transmission frame definition table, to obtain a second CAN packet;
and the sending module 640 is configured to send the second CAN packet to a preset terminal device.
In some embodiments, the CAN message includes a CAN transmit frame and a CAN receive frame.
In some embodiments, the CAN frame definition table is used for defining all CAN frames under any remote terminal RTU participating in CAN mode communication, the CAN frames include CAN transmission frames and CAN reception frames, and the table structure of the CAN frame definition table has a first field including a first RTU number, a first frame packet identifier ID, a first frame sequence number, a first transmission period, and a first frame type.
In some embodiments, the CAN receive frame definition table is used to define any data in any CAN receive frame, and the second field of the table structure of the CAN receive frame definition table includes a second RTU number, a second frame packet ID, a first start bit, a first data bit length, an offset, a first forwarding coefficient, and a data description.
In some embodiments, the CAN transmission frame definition table is used for defining any data in any CAN transmission frame, and a third field included in a table structure of the CAN transmission frame definition table includes a third RTU number, a third frame packet ID, a second start bit, a second data bit length, a forwarding data RTU number, a forwarding data sequence number, a data type, and a second forwarding coefficient.
In some embodiments, the data types include telemetry, fixed values, cyclic redundancy check, CRC8, values, telemetry.
In some implementations, the processing module 630 is further configured to:
the first initial bit of the CAN receiving frame definition table is used as an index of a full data information array of the CAN receiving frame, or the second initial bit of the CAN transmitting frame definition table is used as an index of the full data information array of the CAN transmitting frame, so that the data information of the first CAN message is initialized;
and ordering the full data information list of the CAN receiving frames of the RTU from small to large according to the frame sequence number frmno, and generating the acquisition sequence number of the CAN receiving frames.
In some embodiments, any data segment in the first CAN packet includes n bits, where 1 n is less than or equal to 64, and the total data information of any CAN receiving frame includes basic data of 64 CAN receiving frames at maximum, and the total data information of any CAN transmitting frame includes basic data of 64 CAN transmitting frames at maximum.
In some implementations, the processing module 630 is further configured to:
extracting and analyzing a second frame message ID from the CAN receiving frame;
and searching all data information of the CAN receiving frame according to the analyzed second frame message ID, and assigning values according to the CAN receiving frame.
In some embodiments, the sending module 640 is further configured to:
traversing the CAN transmission frame of the second CAN message, and determining a target CAN transmission frame currently traversed;
determining whether the target CAN transmission frame reaches the current transmission time according to the transmission period of the target CAN transmission frame and the last transmission time;
framing the second CAN message reaching the current sending time, and sending the framed second CAN message to preset terminal equipment.
In the embodiment of the disclosure, a CAN communication protocol point table is respectively configured to a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table; receiving a first CAN message for energy storage, and respectively carrying out message processing on the first CAN message based on a CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table to obtain a second CAN message; and sending the second CAN message to preset terminal equipment. The embodiment of the disclosure formats the received CAN communication message in a standard manner by defining the CAN frame definition table, the CAN receiving frame definition table and the CAN transmitting frame definition table, has high data analysis speed and high analysis efficiency, CAN rapidly analyze the CAN communication message and intuitively output analysis data, CAN be compatible with different frames and different devices, reduces development requirements, and increases the flexibility of CAN data analysis.
Based on the same application conception, the embodiment of the disclosure also provides electronic equipment.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. As shown in fig. 7, the electronic device 700 includes a memory 701, a processor 702, and a computer program product stored in the memory 701 and capable of running on the processor 702, where the processor implements the aforementioned method for processing a controller area network bus message for storing energy when executing the computer program.
In order to implement the foregoing embodiments, the disclosure further proposes a computer-readable storage medium, in which computer-executable instructions are stored, where the computer-executable instructions, when executed by a processor, are configured to implement the method for processing a controller area network bus packet for energy storage provided in the foregoing embodiments.
In order to implement the above embodiments, the disclosure further proposes a computer program product, which includes a computer program, where the computer program when executed by a processor implements the method for processing a controller area network bus message for storing energy provided in the foregoing embodiments.
The processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user involved in the present disclosure all conform to the regulations of the relevant laws and regulations and do not violate the public order colloquial.
It should be noted that personal information from users should be collected for legitimate and reasonable uses and not shared or sold outside of these legitimate uses. In addition, such collection/sharing should be performed after receiving user informed consent, including but not limited to informing the user to read user agreements/user notifications and signing agreements/authorizations including authorization-related user information before the user uses the functionality. In addition, any necessary steps are taken to safeguard and ensure access to such personal information data and to ensure that other persons having access to the personal information data adhere to their privacy policies and procedures.
The present disclosure contemplates embodiments that may provide a user with selective prevention of use or access to personal information data. That is, the present disclosure contemplates that hardware and/or software may be provided to prevent or block access to such personal information data. Once personal information data is no longer needed, risk can be minimized by limiting data collection and deleting data. In addition, personal identification is removed from such personal information, as applicable, to protect the privacy of the user.
In the foregoing descriptions of embodiments, descriptions of the terms "one embodiment," "some embodiments," "examples," "particular examples," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the disclosure. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, the meaning of "a plurality" is at least two, such as two, three, etc., unless explicitly specified otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present disclosure in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
Furthermore, each functional unit in the embodiments of the present disclosure may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. Although embodiments of the present disclosure have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the present disclosure, and that variations, modifications, alternatives, and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the present disclosure.

Claims (10)

1. A method for processing a controller area network bus message for energy storage, comprising:
acquiring a Controller Area Network (CAN) communication protocol point table of a controller area network bus generated by data acquisition equipment, and acquiring a preset CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table;
respectively configuring the CAN communication protocol point table to the CAN frame definition table, the CAN receiving frame definition table and the CAN transmitting frame definition table;
receiving a first CAN message for energy storage, and respectively carrying out message processing on the first CAN message based on the CAN frame definition table, the CAN receiving frame definition table and the CAN transmitting frame definition table to obtain a second CAN message;
and sending the second CAN message to preset terminal equipment.
2. The method of claim 1, wherein the CAN message comprises a CAN transmit frame and a CAN receive frame;
the CAN frame definition table is used for defining all CAN frames under any remote terminal RTU participating in CAN mode communication, the CAN frames comprise CAN transmission frames and CAN receiving frames, and a first field of the table structure of the CAN frame definition table comprises a first RTU number, a first frame message identification ID, a first frame sequence number, a first transmission period and a first frame type;
the CAN receive frame definition table is used for defining any data in any CAN receive frame, and a second field of the table structure of the CAN receive frame definition table includes a second RTU number, a second frame message ID, a first start bit, a first data bit length, an offset, a first forwarding coefficient, and a data description;
the CAN transmission frame definition table is used for defining any data in any CAN transmission frame, and a third field included in a table structure of the CAN transmission frame definition table includes a third RTU number, a third frame message ID, a second start bit, a second data bit length, a forwarding data RTU number, a forwarding data sequence number, a data type, and a second forwarding coefficient.
3. The method of claim 2, wherein the data type comprises telemetry, fixed value, cyclic redundancy check, CRC8, value, telemetry.
4. The method of claim 1, wherein after receiving the first CAN message for storing energy, further comprising:
taking the first initial bit of the CAN receiving frame definition table as an index of a full data information array of a CAN receiving frame, or taking the second initial bit of the CAN transmitting frame definition table as an index of the full data information array of the CAN transmitting frame, so as to initialize the data information of the first CAN message;
and ordering the full data information list of the CAN receiving frame of the RTU from small to large according to the frame sequence number frmno, and generating the acquisition sequence number of the CAN receiving frame.
5. The method of claim 1 wherein any data segment in the first CAN message comprises n bits, 1 n 64, wherein the total data information of any CAN receive frame contains the maximum of 64 CAN receive frames of base data, and the total data information of any CAN transmit frame contains the maximum of 64 CAN transmit frames of base data.
6. A method according to claim 2 or 3, characterized in that after said receiving the first CAN message for storing energy, further comprising:
extracting and analyzing the second frame message ID from the CAN receiving frame;
and searching all data information of the CAN receiving frame according to the analyzed second frame message ID, and assigning values according to the CAN receiving frame.
7. The method of claim 1, wherein sending the second CAN message to a preset terminal device comprises:
traversing the CAN transmission frame of the second CAN message, and determining a target CAN transmission frame currently traversed;
determining whether the target CAN transmission frame reaches the current transmission time according to the transmission period of the target CAN transmission frame and the last transmission time;
framing the second CAN message reaching the current sending time, and sending the framed second CAN message to the preset terminal equipment.
8. A device for processing a controller area network bus message for energy storage, comprising:
the acquisition module is used for acquiring a CAN communication protocol point table generated by the data acquisition equipment and acquiring a preset CAN frame definition table, a CAN receiving frame definition table and a CAN transmitting frame definition table;
the configuration module is used for respectively configuring the CAN communication protocol point table to the CAN frame definition table, the CAN receiving frame definition table and the CAN transmitting frame definition table;
the processing module is used for receiving a first CAN message for energy storage, and respectively processing the first CAN message based on the CAN frame definition table, the CAN receiving frame definition table and the CAN transmitting frame definition table to obtain a second CAN message;
and the sending module is used for sending the second CAN message to preset terminal equipment.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the steps of the method according to any one of claims 1-7.
CN202311817946.2A 2023-12-25 2023-12-25 Method and device for processing controller local area network bus message for energy storage Pending CN117768267A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311817946.2A CN117768267A (en) 2023-12-25 2023-12-25 Method and device for processing controller local area network bus message for energy storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311817946.2A CN117768267A (en) 2023-12-25 2023-12-25 Method and device for processing controller local area network bus message for energy storage

Publications (1)

Publication Number Publication Date
CN117768267A true CN117768267A (en) 2024-03-26

Family

ID=90316132

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311817946.2A Pending CN117768267A (en) 2023-12-25 2023-12-25 Method and device for processing controller local area network bus message for energy storage

Country Status (1)

Country Link
CN (1) CN117768267A (en)

Similar Documents

Publication Publication Date Title
US8842697B2 (en) Method and device for allocating MAC addresses in a carrier-current communication network
EP3208974A1 (en) Power line carrier communication terminal control device, system and method
CN113301568B (en) Network distribution method and device and intelligent household equipment
CN106713351B (en) Secure communication method and device based on serial server
CN102938683B (en) A kind of method and apparatus of data processing
CN112335203B (en) Processing local area network diagnostic data
CN113992508A (en) Local area network automatic networking method of intelligent equipment and intelligent equipment
CN112616171B (en) Communication method and device based on wireless local area network and computer readable storage medium
CN112688924A (en) Network protocol analysis system
CN117768267A (en) Method and device for processing controller local area network bus message for energy storage
CN110768749B (en) Data transmission method and device and power peak shaving system
CN111225077A (en) Network distribution method, device and system for Internet of things equipment
CN112188456B (en) Bluetooth device data acquisition method and device, storage medium and electronic device
CN106604305B (en) Wireless network configuration method and device and terminal
CN211630177U (en) Equipment data acquisition system
CN117941295A (en) Data transmission method, device and system
CN114726763A (en) Method and system for detecting service identification capability of DPI system
CN112073739A (en) Mobile recording and broadcasting control system and method
CN107493216B (en) Controller area network CAN bus data processing method and device
CN115296943B (en) Message broadcasting method, device, server and storage medium
CN110708208B (en) Monitoring data acquisition method and device, storage medium and terminal
CN114500688B (en) Method, device, terminal and storage medium for identifying equipment protocol
CN111953384B (en) Communication address sending method and device, electric energy meter and storage medium
CN116049174A (en) Electric power internet of things node information forwarding method and device and wireless node
CN118300911A (en) Nonstandard equipment data acquisition method and system based on Ethernet communication

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