Method for changing characteristic data of general message and calculating correction code to keep checksum unchanged

By adding and modifying the characteristic data and correction code of the data packet in the intelligent substation communication equipment, and only using the previous data and feature data to calculate the checksum, the resource consumption problem caused by frequent calculation of the checksum in the prior art is solved. Improves the real-time and reliability of the equipment.

CN116015556BActive Publication Date: 2025-02-11NANJING GUODIAN NANZI POWER GRID AUTOMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310000832.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-03
Publication Date
2025-02-11
Estimated Expiration
2043-01-03

AI Technical Summary

Technical Problem

When data packets pass through each communication device, existing intelligent substation communication equipment need to frequently calculate the checksum, resulting in excessive consumption of system resources, affecting real-time and reliability.

Method used

By adding and modifying feature data and correction codes in the data packet, and forwarding data using the switching chip, only the front data and feature data of the message are used to calculate the checksum, and CRC is not calculated when removing feature data and correction codes, and keeping The checksum remains unchanged.

Benefits of technology

It improves the real-time and reliability of smart substation communication equipment, reduces the consumption of system resources, and achieves more efficient data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116015556B_ABST
    Figure CN116015556B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for changing characteristic data of a general message and calculating a correction code so that the checksum remains unchanged. The power device sends an original message MDR to a single communication device; the single communication device processes the original message to obtain a data message; the single communication device forwards the data message to an intermediate communication device; the checksum of the front-end data in the data message is calculated; based on the checksum of the front-end data M in the data message, the checksum of the front-end data and characteristic data in the data message is calculated; the checksum of the front-end data and characteristic data in the data message is XORed to generate a correction code x 1; change the correction code x 1 is added to the data message and sent to the network. The present invention enables the intelligent substation communication device to add or modify characteristic data, and the input data used for the calculation of the correction code is only the front-end data and characteristic data of the message. When the characteristic data and the correction code are removed, no CRC calculation is required, thereby improving the real-time performance and reliability of the intelligent substation communication device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for changing characteristic data of a general message and calculating a correction code to keep a checksum unchanged, and belongs to the technical field of intelligent substation communication. Background Art

[0002] Generally, communication equipment in smart substations basically provides the function of calculating the checksum (CRC). In order to better meet the requirements of real-time reliability of smart substation communication, when the data message changes the data message through each communication device, the CRC must be recalculated, especially when the same communication device changes the data message in the receiving module and the sending module, the number of times the checksum is calculated can even reach three times, which greatly consumes system resources, making the biggest processing of the data message on the communication forwarding path is the calculation of the checksum. Therefore, improving the method of calculating the checksum of the communication device whose data changes at each hop is very meaningful to improve the real-time and reliability of the smart substation. Summary of the invention

[0003] The technical problem to be solved by the present invention is to overcome the defects of the prior art, provide a method for changing the characteristic data of a general message and calculating a correction code so that the checksum remains unchanged, configure an address forwarding table (multicast / unicast), access data messages, add, modify or delete characteristic data and correction codes, and send the data messages forwarded by the switching chip to the subnet.

[0004] To achieve the above object, the present invention provides a method for changing the characteristic data of a general message and calculating a correction code so that the checksum remains unchanged, comprising:

[0005] The power device sends the original message mdr to a single communication device;

[0006] A single communication device processes the original message to obtain the data message;

[0007] A single communication device forwards data messages to an intermediate communication device;

[0008] Calculate and obtain the checksum of the first segment of data m in the data message;

[0009] Based on the checksum of the first segment data m in the data message, the checksum of the first segment data m and the characteristic data p1 in the data message is calculated;

[0010] The checksum of the front data m and the characteristic data p1 in the data message is XORed to generate the correction code x1:

[0011]

[0012] Add the correction code x1 to the data message and send it to the network.

[0013] Preferably, if the intermediate communication device forwards the data message to another intermediate communication device, the front data m, the back data d and the original checksum value r of the message in the data message are not changed;

[0014] Perform an XOR operation on the characteristic data p1 and the characteristic data p2 to obtain a first checksum;

[0015] The correction code x1 and the first checksum are XORed to generate a new correction code x2, and a new data message is obtained;

[0016] Forward new data packets to the network.

[0017] Preferably, if the intermediate communication device finds that the destination address of the message is the port of the intermediate communication device to which it is directly connected, it changes the characteristic data p1 in the data message to characteristic data p2, and changes the correction code x1 in the data message to correction code x2, otherwise it replaces the data message with the original message.

[0018] Preferably, a single communication device processes the original message and obtains the data message, which is achieved by the following steps:

[0019] A single communication device adds characteristic data p1 to the front data m of the original message to obtain a data message;

[0020] The front data m, the back data d and the original checksum value r of the original message mdr are not changed. Preferably, the correction code x1 is added to the data message and sent to the network, and the correction code x1 is located after the characteristic data p1. An electronic device includes a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of any of the above methods when executing the program.

[0021] A computer-readable storage medium stores a computer program, which implements the steps of any of the above methods when executed by a processor.

[0022] The beneficial effects achieved by the present invention are:

[0023] The present invention ensures that when the intelligent substation communication equipment adds or modifies characteristic data, the input data used for calculating the correction code is only the front-end data and characteristic data of the message. When the characteristic data and the correction code are removed, it is not necessary to calculate any CRC, thereby improving the real-time performance and reliability of the intelligent substation communication equipment. At the same time, the method has universality. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a hardware single board architecture diagram of the present invention;

[0025] Figure 2It is a format diagram of characteristic data and data message of the present invention;

[0026] Figure 3 It is a working principle diagram of characteristic data of the present invention;

[0027] Figure 4 It is a message processing flow chart of the present invention. DETAILED DESCRIPTION

[0028] The following embodiments are only used to more clearly illustrate the technical solutions of the present invention, and are not intended to limit the protection scope of the present invention.

[0029] The invention discloses a device for changing characteristic data of a general message and calculating a correction code so that the checksum remains unchanged, comprising a CPU processor, a switching chip processor, an FPGA chip and a transmission port connected to each power device in an intelligent substation. The CPU processor is integrated with the switching chip processor to realize configuration management of the switching chip processor and the FPGA. The switching chip processor is connected to the FPGA chip, and the FPGA chip is connected to the physical layer PHY of the port. When the communication equipment of the intelligent substation adds or modifies characteristic data, the input data used for calculating the correction code is only the front data and characteristic data of the message. When the characteristic data and the correction code are removed, no CRC needs to be calculated, thereby improving the real-time performance and reliability of the communication equipment of the intelligent substation.

[0030] The switching chip processor adopts CTC7132 switching chip;

[0031] The CPU processor is a dual-core ARM A53.

[0032] The FPGA chips are two pieces of Anlu PH1A00-FG676, including PH1A00 module 1 and PH1A00 module 2.

[0033] The transmission port is an Ethernet electrical port, which is adaptive to 1000M.

[0034] The transmission port is an Ethernet optical fiber port, which is adaptable to 1000M and 1000M.

[0035] The transmission port is any combination of an Ethernet optical fiber port (100M adaptive) or an Ethernet electrical port (100M adaptive).

[0036] There are many models of CPU processors, switch chip processors, FPGA chips, and transmission ports connecting various power devices in smart substations. Technical personnel in this field can choose appropriate models according to actual needs, and this embodiment will not give examples one by one.

[0037] The substation network switch is used in the substation to transmit GOOSE / SV / MMS messages and forward messages according to the pre-configured address forwarding table. In order to make the technical means, creative features, objectives and effects of the present invention easy to understand, the following is further explained in conjunction with the specific implementation method.

[0038] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0039] The PSW-618G autonomous controllable substation network switch uses a low-power, low-cost, high-performance ARM chip A53, with a maximum frequency of 1.2G. The switching chip uses the industry-leading CTC7132 chip from Centec, which is very powerful and can provide 1000M electrical ports, 100M optical ports and 100M ports. The 100M optical port can adapt to become a 100M optical port and access the power device. The operating system uses LINUX, which can be expanded to support a variety of network security functions.

[0040] The power device sends the original message mdr to a single communication device. When the single communication device forwards the data message to other RBs, it adds the characteristic data p1 and the correction code x1. The front data m and the back data d in the data message and the original CRC checksum value r of the message do not change. When the single communication device RB1 and the single communication device RB2 forward data to other RBs, the characteristic data is changed to p2 and the correction code x2 is changed at the same time. Note that only the characteristic data and the correction code are changed at this time, and the front data m and the back data d and the original checksum r of the message do not change.

[0041] If the single communication device RB1 or RB2 finds that the destination address of the message is the non-connected RB device port, it will directly remove the characteristic data p1 and the correction code x1 to restore the original message. At this time, no CRC calculation is required, and the CRB is processed in the same way. Each RB interface can be in three modes: access, forwarding, and sending messages to the power device.

[0042] The present invention has no restriction on the length of the verification data. The highest and lowest bits of the generated polynomial must be 1, and CRC32 is calculated according to the IEEE802.3 polynomial. The length of the data to be verified can be counted by bit, usually in bytes. The data code stream is CRC-calculated in the order of the lowest bit first and the highest bit last, and the last bit corresponds to the highest order item.

[0043] i,L m ,L p ,L d is a natural number, N is the highest power of the generating polynomial g(x), m={m1',m'2,...,m' Lm} is the front segment data of any length, is a feature data of arbitrary length, x={x1',x'2,...,x' N} is the N-bit correction code, is any subsequent data, r={r1',r2',...,r' N} is the original checksum of the message. Two lowercase letters together indicate that the two vector data streams are combined into a new data stream in sequence, such as

[0044]

[0045]

[0046]

[0047]

[0048]

[0049] Definition 1: The function crc(INITXOR,m) calculates the CRC value with INITXOR as the initial value of the N-bit register and the input data as m.

[0050] Property 1crc(0,md)=crc(crc(0,m),d)(1)

[0051] Nature 2

[0052] Nature 3

[0053] According to the definition of formula (1), CRC is calculated bit by bit from left to right, from the lowest bit to the highest bit. This is true for any two segments of the data stream. This can be proved by long division to find CRC. The CRC program implemented in C language corresponds to this. The first step of the program to solve CRC is to perform an XOR operation on the initial value and the data, which is equivalent to formula (2). These three properties are true for bits and bytes.

[0054] Definition 2: Function crc -1 (0,m) is the inverse calculation data value of the CRC value calculated with 0 as the initial value and input data m.

[0055] According to the definition, crc(0,crc -1 (0,m))=crc(0,m) holds, when crc -1 (0,m) is not unique when the number of digits is greater than N. To simplify crc -1 (0,m) takes an N-digit value. When the m-digit value is less than or equal to N, crc -1 (0,m)=m. There is a one-to-one mapping relationship between CRC and the data to be checked whose length is not greater than N.

[0056] set up XOR The operation has the following characteristics:

[0057] Exchangeability, that is XOR with itself is 0, that is XOR with 0 to itself, that is Combinability, that is These properties also hold true for data bit streams.

[0058] set up

[0059]

[0060] According to equations (1), (4) and (5), for any original message mdr and any feature data p, there exists a correction code x so that after adding feature data p and correction code x to the message, the checksum of mpxdr does not change. Vice versa, when mpxdr removes feature data p and correction code x, the checksum of mdr does not change.

[0061] According to formula (4), we can get:

[0062]

[0063] Formula (7) is used to calculate the correction code x. The specific derivation process is as follows:

[0064]

[0065] set up According to formula (6),

[0066] Therefore, the checksum of the front data m and the characteristic data p in the data message is XORed to generate the correction code x1:

[0067]

[0068] Perform an XOR operation on the characteristic data p1 and the characteristic data p2 to obtain a first checksum;

[0069] The correction code x1 and the first checksum are XORed to generate a new correction code x2 and obtain a new data message:

[0070]

[0071] therefore,

[0072] Generally, the correction code x is calculated using formula (7). It is known that m and p are no more than 20 bytes in total. First, the checksum of m is calculated and then its inverse operation is calculated. The checksum of m is used as the initial value to calculate the checksum of the feature data, and finally the correction code is generated by XOR. Formula (8) shows that when the feature data changes, the correction code only needs to be associated with the changed feature data, and the unchanged part becomes zero due to the XOR operation. This is the XOR operation performed by the intermediate forwarding RB based on the existing correction code and the checksum of the feature data before and after the change. The calculation amount is very small and can be quickly calculated by table lookup. Each time the forwarding TTL is reduced by 1, at most one byte changes, which reduces the calculation complexity and improves the real-time processing.

[0073] The following is the crc -1 (0,m), N is 32 in the smart substation network, CRCPOLY_LE is the IEEE802.3 reverse value 0xedb88320, the highest bit 1 on the right is omitted, and the leftmost bit is 1, which is the reverse one-to-one correspondence of crc(0,m) long division.

[0074]

[0075] like Figure 4 , when the port receives a message, it first determines whether the receiving port mode supports the checksum unchanged algorithm. If not, it directly forwards the data according to the traditional Ethernet mode. If it is enabled, it determines whether the data message contains characteristic data. If it is an original message, it adds the default configuration TTL (message survival time) and the dynamically allocated SeqNo (sequence number) characteristic data to the original message. The switching chip queries the sending port to forward the data message based on the address forwarding table. On the sending side, it determines whether the port is connected to the switch. If so, it updates the data message sent on this port.

[0076] If the data message contains a characteristic number, then if TTL<=0, the data message is discarded, otherwise TTL-1. The receiving destination port is a power device, and a receiving record table is established based on the message source MAC address, SeqNo, and receiving multicast address. The original message is forwarded first, and duplicate messages are discarded.

[0077] The method of adding characteristic data to a general message is universal. The data is divided into two segments. After arbitrarily changing the content of the previous segment, a correction code with the same width as the checksum is added at the end of the previous segment. The original checksum remains unchanged. Ethernet devices and power devices cannot detect such changes when the message length cannot be predicted. This method is also applicable to data files. This method has communication properties. In order to improve the reliability, completely solve the network storm problem, and optimize the network topology, a method of adding characteristic data to a general message is proposed for the second-layer data forwarding of the intelligent substation communication network. The characteristic data is placed in the message header with a fixed length for easy positioning and calculation. In order to improve real-time performance, the concept of checksum inverse operation is proposed, and a checksum inverse operation algorithm program that can be applied in practice is given. The correction code is calculated based on the message header and characteristic data, so that the original checksum remains unchanged after the message is added with characteristic data and correction code; when changing the characteristic data, only a few logical operations are required on the correction code at the original value; when deleting the characteristic data and correction code, no CRC calculation is required when the message is restored to the original message. The method for realizing the universal message characteristic data and correction code to make the checksum unchanged provided by the present invention enables the input data used for the calculation of the correction code to be only the message header and characteristic data when the intelligent substation communication equipment adds or modifies characteristic data, and when the characteristic data and correction code are removed, no CRC needs to be calculated, thereby improving the real-time reliability of the intelligent substation communication equipment. The method enables the communication equipment universal message characteristic data and correction code to make the checksum unchanged, thereby greatly improving the real-time processing of all messages by the intelligent substation, and the characteristic data further guarantees the reliability of the network, better meeting the requirements of the real-time reliability of the intelligent substation communication.

[0078] (1) PRB refers to a single communication device that accesses the power device message, adding a feature code and a correction code;

[0079] (2) CRB is a communication device connected to the power device that ultimately receives the message. When sending the message, the feature code and correction code are removed and the original message is output to the power device.

[0080] (3) RB1, RB2, ... refer to the intermediate communication devices, forwarding the changed characteristic data and updating the correction code;

[0081] (4) In mpxdr, m is the front data stream composed of continuous bits of arbitrary length segments in the whole message; p is the feature data stream composed of continuous bits of arbitrary length segments in the whole message; x is the data stream with the same value as the checksum length, which is usually 32 in Ethernet; d is the back data stream composed of continuous bits of arbitrary length segments in the whole message; r is the original checksum of the message. The arbitrary length segments mentioned in this article refer to the bits excluding the fixed overhead length of the Ethernet message, and the total length does not exceed 1500*8 bits, which can be 0.

[0082] In order to simplify the derivation process, the calculation of the checksum requires a length parameter. In this article, a fixed value is taken in the specific application case. This length parameter can be a parameter of the calculation function.

[0083] Calculating the checksum of the front data m in the data message, and "calculating the checksum of the front data m in the data message and the characteristic data p1 based on the checksum of the front data m in the data message" are steps in the prior art and will not be elaborated in detail in this embodiment.

[0084] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0085] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0086] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0087] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for changing the characteristic data of a general message and calculating a correction code to keep the checksum unchanged, characterized in that: include: The power device sends the original message mdr to a single communication device; A single communication device processes the original message to obtain the data message; Calculate and obtain the checksum of the first segment of data m in the data message; Based on the checksum of the first segment of data m in the data message, calculate and obtain the first segment of data m and characteristic data in the data message The checksum of The front data m and characteristic data in the data message The checksum XOR generates the correction code : , A single communication device will correct the code Added to the data message and forwarded to the intermediate communication device through the network; Among them, a single communication device processes the original message and obtains the data message, which is achieved through the following steps: A single communication device adds characteristic data after the front data m of the original message , obtain the data message; The front data m, the back data d and the original checksum value r of the original message mdr remain unchanged.

2. The method for changing the characteristic data of a general message and calculating the correction code to make the checksum unchanged according to claim 1, characterized in that: If the intermediate communication device forwards the data message to another intermediate communication device, the front data m, the back data d and the original checksum value r of the message will not change; Feature data and feature data Perform an XOR operation to obtain a first checksum; Correction Code XOR operation is performed with the first checksum to generate a new correction code , obtain new data message; The intermediate communication device forwards the new data message to other intermediate communication devices through the network.

3. The method for changing the characteristic data of a general message and calculating the correction code to make the checksum unchanged according to claim 2, characterized in that: If the intermediate communication device finds that the destination address of the message is the port of the intermediate communication device directly connected to it, it will change the characteristic data in the data message. For feature data , change the correction code in the data message Correction code , otherwise the data message is replaced with the original message.

4. The method for changing the characteristic data of a general message and calculating the correction code to make the checksum unchanged according to claim 1, characterized in that: A single communication device will correct the code Added to the data message and forwarded to the intermediate communication device through the network, the correction code Located in feature data after.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 4 are implemented.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Method and device for incrementally calculating network message check sum

    CN102404210A

  • Check information generation method and device and check information verification method and device

    CN112737734A