Goose communication-based rapid scanning method for measurement point and measurement value change
By dividing the measurement point data into different regions in the PLC system and using memory comparison instructions for batch comparison, the problem of scanning time for measurement changes in large PLC systems is solved, which significantly improves the real-time performance of Goose communication.
Patent Information
- Application Number
- CN202411858810.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-25
AI Technical Summary
Large PLC systems include a large number of measurement points and Goose data sets. The traditional measurement point displacement scanning method takes a long time and affects the real-time performance of Goose communication.
By dividing the measured values and quality data of all measured points into different areas in the PLC running memory according to different Goose data sets, and batch comparison is used for batch comparison using memory comparison instructions or bit OR instructions to determine whether the measured values and quality of measured points have changed. If there is a change, the data will be updated using memory copy instructions.
It greatly reduces the time for scanning the measured value changes, significantly improves the real-time performance of Goose communications in large PLC devices, and meets the demand for high real-time PLC control in the industrial control field.
Smart Images

Figure CN119690864A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial automation control, and in particular to a method for quickly scanning changes in measurement points and values based on Goose communication. Background Art
[0002] The Goose (Generic Object Oriented Substation Event) communication protocol is an important part of the IEC61850 communication standard and was originally designed for substation automation in power systems. Due to its high real-time performance and reliability, the Goose protocol has gradually been extended to the field of industrial control, especially in data interaction between PLCs (Programmable Logic Controllers) or between PLCs and other devices.
[0003] A key feature of Goose communication is its "event-driven" mechanism, that is, when the data of a measuring point changes, all the measuring point data in the data set containing the measuring point is sent immediately. This requires the equipment to be able to detect data changes quickly. In the substation system, since the number of measuring points contained in the equipment (usually no more than a few hundred) and the data set (usually only a few) are small, it is feasible to use polling to scan the position changes of all measuring points in the data set. The scanning process can usually be completed within microseconds, meeting the real-time requirements of Goose communication.
[0004] However, with the application of the Goose protocol in the field of industrial control, especially in large-scale PLC systems, the traditional point displacement scanning method faces challenges. Large PLC systems usually contain thousands or even tens of thousands of measurement points, distributed in dozens or more data sets. The current mainstream Goose communication driver organizes the measurement point related data (such as data type, measurement value, data quality, etc.) into a structure form. Using the polling method to scan the measurement points, in extreme cases, means that the PLC processor has to execute millions of instructions, which usually takes more than a few milliseconds, making it difficult to meet the real-time requirements of Goose communication, and also greatly increases the scanning cycle of the PLC. Summary of the invention
[0005] Purpose of the invention: The purpose of the present invention is to provide a method for quickly scanning changes in measured values of measuring points based on Goose communication, so as to solve the problem that the scanning of changes in measured values of large PLC devices containing a large number of measuring points and Goose data sets takes a long time, affecting the real-time performance of Goose communication.
[0006] Technical solution: The present invention discloses a method for quickly scanning changes in measured values of measuring points based on Goose communication, comprising the following steps: storing the measured values and quality data of all measuring points in different areas in the PLC running memory according to different Goose data sets, using memory comparison instructions or bitwise XOR instructions to batch compare the memory areas storing the measured values and qualities to determine whether the measured values and qualities of the measuring points have changed; using memory copy instructions to update the PLC measured values and quality data, and if there are changes, using memory copy instructions to update the PLC measured values and quality data; wherein the measured value data and quality data of the measuring points in a single Goose data set are respectively and continuously stored in the memory; the measured values of the measuring points include: switch measurement points and analog measurement points.
[0007] Furthermore, the measured values and quality data of the measuring points in a single Goose data set are continuously stored in the current PLC scan cycle data and the previous PLC scan cycle data.
[0008] Furthermore, in different Goose data sets, for switch measurement points, the measured value data is stored bit by bit in the memory continuously, that is, the measured value of the measurement point is represented by 1 bit.
[0009] Furthermore, in different Goose data sets, for the simulated measurement points, the measured value data are continuously stored in the memory according to the actual data width of the measured value.
[0010] Furthermore, the quality data of all the measuring points in the switch measuring point or the analog measuring point are stored continuously in the memory bit by bit, that is, one bit is used to represent the quality of the measured value.
[0011] Furthermore, the measured values and quality data of the M switch measurement points in a Goose switch quantity data set are stored in X bytes, where the value formula of X is as follows: X = (int)((M + L - 1) / L) * ( L / 8) Where L is the word length of the PLC processor, 32 bits or 64 bits; (int) means rounding the value of (M + L - 1) / L; if M is not an integer multiple of the processor word length, the bits that do not store the measured values should be cleared after the Goose model configuration is loaded.
[0012] Furthermore, a memory copy instruction or an XOR instruction is used to compare the memory areas corresponding to the data of the current PLC scan cycle and the data of the previous PLC scan cycle; and the measured values of multiple measuring points are covered by one memory comparison operation.
[0013] Furthermore, the update steps are as follows: after completing the change judgment of the measured value and quality data, use the memory copy instruction to copy the memory data corresponding to the current PLC scan cycle to the memory area corresponding to the data of the previous PLC scan cycle; cover the measured value assignment of multiple measuring points through one memory assignment operation.
[0014] An electronic device described in the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, any one of the methods for quickly scanning changes in measurement points and values based on Goose communication is implemented.
[0015] A storage medium described in the present invention stores a computer program, and when the computer program is executed by a processor, any one of the methods for quickly scanning changes in measurement points and values based on Goose communication is implemented.
[0016] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: the present invention greatly reduces the time for scanning the measured value changes through batch comparison and assignment technology, significantly improves the real-time performance of Goose communication in large PLC devices, and meets the demand for high real-time performance of PLC control in the industrial control field. In addition, although the present invention is mainly aimed at PLC devices, its principle is also applicable to other industrial control equipment using Goose communication, and has good technical scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of the present invention. DETAILED DESCRIPTION
[0018] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0019] like Figure 1 As shown, an embodiment of the present invention provides a method for quickly scanning changes in measurement points based on Goose communication, comprising the following steps: (1) The measured values and quality data of all measuring points are divided into different areas in the PLC running memory according to different Goose data sets. The measured value data and quality data of the measuring points in a single Goose data set are stored continuously in the memory. The measured values of the measuring points include: switch measurement points and analog measurement points. The measured values and quality data of the measuring points in a single Goose data set are stored continuously in the current PLC scan cycle data and the previous PLC scan cycle data.
[0020] In different Goose data sets, for the switch measurement points, the measured value data is stored continuously in the memory bit by bit, that is, the measured value of the measurement point is represented by 1 bit. Among them, the measured values and quality data of M switch measurement points in a Goose switch measurement data set are stored in X bytes, where the value formula of X is as follows: X = (int)((M + L - 1) / L) * ( L / 8) (1) Where L is the word length of the PLC processor, 32 bits or 64 bits; (int) means rounding the value of (M + L - 1) / L; if M is not an integer multiple of the processor word length, the bits that do not store the measured values should be cleared after the Goose model configuration is loaded.
[0021] For analog measurement points, the measured data is stored continuously in the memory according to the actual data width of the measured value.
[0022] The quality data of all the measuring points in the switch measuring point or the analog measuring point are stored continuously in the memory bit by bit, that is, one bit is used to represent the quality of the measured value.
[0023] (2) Use memory comparison instructions or bitwise XOR instructions to perform batch comparison on the memory areas storing measured values and qualities to determine whether the measured values and qualities of the measuring points have changed; specifically: use memory copy instructions or XOR instructions to compare the memory areas corresponding to the data of the current PLC scan cycle and the previous PLC scan cycle; cover the measured values of multiple measuring points through one memory comparison operation.
[0024] (3) Use the memory copy instruction to update the PLC measurement value and quality data. If there is a change, use the memory copy instruction to update the PLC measurement value and quality data; the details are as follows: after completing the change judgment of the measurement value and quality data, use the memory copy instruction to copy the memory data corresponding to the current PLC scan cycle to the memory area corresponding to the data of the previous PLC scan cycle; cover the measurement value assignment of multiple measuring points through one memory assignment operation.
[0025] Assume that the switch measurement points are evenly divided into 100 data sets in the Goose model, and the analog measurement points are also evenly divided into 100 data sets. In this way, each switch Goose data set contains 200 measurement points, and each analog data set contains 50 measurement points. The analog quantity is stored in 2-byte integer. The word length of the PLC processor is 64 (64-bit processor). Specific embodiment:
[0027] S1 is calculated according to formula (1), and the following memory is allocated for each switch data set: The memory for storing the switch measurement data of the current scan cycle of the PLC is 32 bytes in total, recorded as DiMemCx; x = 1~100, indicating 1 to 100 switch data sets The memory for storing the switch measurement value data of the last scan cycle of the PLC is 32 bytes in total, recorded as DiMemLx; The memory for storing the switch quantity quality data of the current scan cycle of the PLC is 32 bytes in total and is recorded as DiQMemCx; The memory for storing the switch quality data of the last scan cycle of PLC, a total of 32 bytes, DiQMemLx; S2 allocates the following memory for each analog data set: The memory for storing the switch measurement data of the current scan cycle of the PLC is 104 bytes in total, recorded as AiMemCx, x=1~50, indicating 1 to 50 analog data sets The memory for storing the switch measurement data of the last scan cycle of the PLC is 104 bytes in total, recorded as AiMemLx The memory for storing the analog quality data of the current scan cycle of the PLC is 8 bytes in total and is recorded as AiQMemCx; The memory for storing the analog quality data of the last scan cycle of the PLC is 8 bytes in total, recorded as AiQMemLx; S3 uses memory comparison instructions to compare DiMemCx and DiMemLx for the measurement of a single Goose data set. Since the processor is 64 bits, one memory comparison instruction can complete the data comparison of 8 bytes of 64 switch measurement points. If the loop mode is used to compare the measurement memory area of a Goose switch data of 32 bytes, it takes about 40 instruction cycles. Similarly, the comparison of the corresponding switch quality data also takes about 40 instruction cycles, so the measurement and quality comparison of 100 Goose switch data sets takes about 8,000 instruction cycles in total.
[0028] S4 uses memory comparison instructions to compare AiMemCx and AiMemLx for the measurement of a single switch Goose data set. One memory comparison instruction can complete the data comparison of 8 bytes of 4 analog measurement points. If the loop mode is used to implement the comparison of the measurement memory area of a Goose analog data occupying 104 bytes, it will take about 130 instruction cycles. Similarly, the comparison of the corresponding analog quality data takes about 10 instruction cycles, so the measurement and quality comparison of 50 Goose analog data sets will take about 7000 instruction cycles in total.
[0029] S5 According to the above steps, when a large PLC including 20,000 switch quantities and 5,000 analog measurement points uses the present invention to scan data changes, it only takes about 15,000 processor instruction cycles, which is much lower than the 500,000 processor instruction cycles required by the traditional polling method. The real-time performance of the PLC based on Goose communication is significantly improved.
[0030] An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, any one of the methods for quickly scanning changes in measurement points based on Goose communication is implemented.
[0031] An embodiment of the present invention further provides a storage medium storing a computer program. When the computer program is executed by a processor, any one of the methods for quickly scanning changes in measurement points based on Goose communication is implemented.
Claims
1. A method for quickly scanning changes in measurement points based on Goose communication, characterized in that: The following steps are involved: The measured values and quality data of all measuring points are divided into different areas in the PLC running memory according to different Goose data sets, and the memory areas storing the measured values and qualities are batch compared using memory comparison instructions or bitwise XOR instructions to determine whether the measured values and qualities of the measuring points have changed; the PLC measured values and quality data are updated using memory copy instructions, and if they have changed, the PLC measured values and quality data are updated using memory copy instructions; the measured value data and quality data of the measuring points in a single Goose data set are stored continuously in the memory respectively; the measured values of the measuring points include: switch measurement points and analog measurement points.
2. According to the method of claim 1, the method is characterized in that: The measured values and quality data of the measurement points in a single Goose data set are continuously stored in the current PLC scan cycle data and the previous PLC scan cycle data.
3. According to the method of claim 1, the method is characterized in that: In different Goose data sets, for switch measurement points, the measured value data is stored bit by bit in the memory continuously, that is, the measured value of the measurement point is represented by 1 bit.
4. According to the method of claim 1, the method is characterized in that: In different Goose data sets, for the simulated measurement points, the measured data are stored continuously in the memory according to the actual data width of the measured values.
5. A method for quickly scanning changes in measurement points based on Goose communication according to claim 3 or 4, characterized in that: The quality data of all the measuring points in the switch measuring point or the analog measuring point are stored continuously in the memory bit by bit, that is, one bit is used to represent the quality of the measured value.
6. The method for quickly scanning the measurement point value changes based on Goose communication according to claim 3 is characterized in that: The measured values and quality data of M switch measurement points in a Goose switch quantity data set are stored in X bytes, where the value of X is as follows: X = (int)((M + L - 1) / L) * ( L / 8) Where L is the word length of the PLC processor, 32 bits or 64 bits; (int) means rounding the value of (M + L - 1) / L; if M is not an integer multiple of the processor word length, the bits that do not store the measured values should be cleared after the Goose model configuration is loaded.
7. According to claim 1, a method for quickly scanning changes in measurement points based on Goose communication is characterized in that: Use memory copy instructions or XOR instructions to compare the memory areas corresponding to the data of the current PLC scan cycle and the previous PLC scan cycle; cover the measured values of multiple measuring points through one memory comparison operation.
8. According to claim 1, a method for quickly scanning changes in measurement points based on Goose communication is characterized in that: The specific update steps are as follows: after completing the change judgment of the measured value and quality data, use the memory copy instruction to copy the memory data corresponding to the current PLC scan cycle to the memory area corresponding to the data of the previous PLC scan cycle; cover the measured value assignment of multiple measuring points through one memory assignment operation.
9. 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 computer program is loaded into the processor, a method for quickly scanning changes in measurement points and values based on Goose communication according to any one of claims 1 to 8 is implemented.
10. A storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, a method for quickly scanning changes in measurement points and values based on Goose communication according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
GOOSE network-based redundant device signal selection method and equipment, and storage medium
CN120729485A