Communication configuration method and system for different plane communication and master station ip
By adding a routing table to the rt_tables file of the Linux system and setting priority, the communication instability problem of remote power devices in the substation automation system when communicating with the same main station IP through multiple planes, realizing stable communication on multiple planes at the same time.
Patent Information
- Application Number
- CN202510763366.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-08-12
AI Technical Summary
In substation automation systems, when the remote device communicates with the same main station IP through double planes or multiple planes, it is often the case that only one plane can communicate normally while other planes are not connected.
By adding routing tables corresponding to each plane in the rt_tables file of the Linux system, and adding specific routing items to these routing tables, ensuring that the priority of the newly added routing table is higher than that of the main route table, and configuring an independent communication channel between each plane and the same master station IP.
It realizes that different planes can communicate with the same main station IP at the same time, avoiding the situation where only some planes can communicate normally while others are blocked, ensuring the communication independence and stability of each plane.
Smart Images

Figure CN120474907A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of substation telecontrol, and in particular relates to a communication configuration method and system for different plane communications with the same master station IP. Background Art
[0002] In substation automation systems, telecontrol devices (also known as data communication gateways, hereinafter referred to as telecontrol) are communication devices that serve as a link between upstream and downstream protocol conversion, enabling communication between substation systems and the dispatching master station system. Telecontrol devices communicate with substation protection, measurement, and control devices, acquiring measurement data. They also communicate with the dispatching master station system, transmitting station-wide measurement data. They also receive control commands from the master station and forward them to the station's protection, measurement, and control devices, thus enabling remote control of the master station.
[0003] Currently, power system dispatching systems are divided into multiple levels, primarily local, provincial, network, and national. Each level of dispatching system is divided into primary and backup dispatching systems. Multiple systems from different manufacturers may also operate in parallel. Therefore, substation telecontrol systems often require simultaneous communication with multiple redundant master stations for multiple dispatches. In current substation automation systems, two dispatching data networks, commonly referred to as dual-plane dispatching data networks (hereinafter referred to as dual-plane), typically exist simultaneously to facilitate communication routing between station telecontrol systems and dispatching master stations at all levels. In some substation automation systems, three or more dispatching data networks (hereinafter referred to as multi-plane) may also exist simultaneously.
[0004] To meet the requirement of simultaneous communication between multiple master stations and multiple systems across two or more planes, telecontrol systems typically employ network proxies or internal mapping (i.e., iptables NAT technology). However, these two methods require that the master station IP addresses of each plane be unique. If these methods are still used in special situations where communication with the same master station IP address across two or more planes is required, communication may fail on only one plane while the others remain blocked. Summary of the Invention
[0005] The purpose of the present invention is to provide a communication configuration method and system for different planes communicating with the same master station IP, which is used to solve the problem in the prior art that when telecontrol communicates with the same master station IP through dual planes or multiple planes, only one plane can communicate normally while the other plane cannot.
[0006] To achieve the above-mentioned object, the present invention provides a communication configuration method for different planes communicating with the same master station IP, comprising: when it is necessary to communicate with the same master station IP through more than two planes, adding routing tables corresponding to each plane in the rt_tables file of the Linux system, adding specific routing items to each newly added routing table and activating the newly added routing table with the specific routing items added to perform routing configuration, so as to utilize the routing configuration results to communicate between different planes and the same master station IP; each specific routing item added to each newly added routing table includes a master station IP address that the plane corresponding to the routing table needs to communicate with, and also includes the gateway of the plane, the network card of the plane and the IP address of the plane; The priority of each newly added routing table is higher than the priority of the main routing table of the Linux system.
[0007] Furthermore, the different specific routing items added in each newly added routing table respectively contain different master station IP addresses that the plane corresponding to this routing table needs to communicate; the master station IP addresses in all specific routing items added in each routing table contain all master station IP addresses that the plane corresponding to this routing table needs to communicate.
[0008] Furthermore, the method of setting the priority of each newly added routing table to be higher than the priority of the main routing table of the Linux system includes: When adding routing tables corresponding to different planes in the rt_tables file of the Linux system, set the numbers of the newly added routing tables to be smaller than the number of the main routing table of the Linux system.
[0009] Furthermore, the methods for adding specific routing entries to the newly added routing table include: First, the newly added routing table is cleared, and then specific routing entries are added to the newly added routing table after the clearing process.
[0010] Furthermore, adding a specific routing entry to each newly added routing table is achieved through the ip route add command.
[0011] Furthermore, activating the newly added routing table for adding specific routing entries is achieved through the ip rule command.
[0012] Furthermore, the newly added routing table is cleared through the ip route flush command.
[0013] The above technical solution of the present invention provides a new communication configuration method for different plane communications with the same master station IP, and its beneficial effects include: Routing configuration is performed through the routing table in the Linux system rt_tables file to configure the routing channel for each plane to communicate with the same master station IP. Then, each plane communicates with the same master station IP according to the routing configuration information, so that the communication of each plane is carried out according to the routing channel preset by the routing configuration. The routing channel of each plane contains the gateway, network card and IP address of the plane itself. Therefore, the communication channel between each plane and the same master station IP is relatively independent and will not interfere with each other. This ensures that different planes can communicate with the same master station IP at the same time, thereby avoiding the situation where only one plane can communicate normally while other planes cannot when different planes communicate with the same master station IP.
[0014] The present invention also provides a communication configuration system for different plane communications with the master station IP, including a processor, wherein the processor stores executable program instructions, and the executable program instructions are used to be executed to implement the communication configuration method for different plane communications with the master station IP as described above.
[0015] The technical solution of the communication configuration system for different plane communications with the master station IP of the present invention can achieve the same beneficial effects as the communication configuration method for different plane communications with the master station IP. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flowchart of the communication configuration method for different plane communications with the master station IP in the embodiment of the present invention; Figure 2 This is an example diagram of communication channels corresponding to the final configuration result obtained by the communication configuration method for different plane communications with the master station IP in the implementation method of the present invention. DETAILED DESCRIPTION
[0017] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and implementation methods.
[0018] Implementation method for configuring communication between different planes and the same master station IP This embodiment provides a technical solution for a communication configuration method for different planes communicating with the same master station IP. Routing configuration is performed through the routing table in the Linux system rt_tables file to configure a routing channel for each plane to communicate with the same master station IP, ensuring that different planes can communicate with the same master station IP at the same time, thereby avoiding the situation where only one plane can communicate normally while other planes cannot when different planes communicate with the same master station IP.
[0019] Reference Figure 1The communication configuration method specifically includes: when it is necessary to communicate with the same master station IP through more than two planes, adding respective routing tables corresponding to respective planes in the rt_tables file of the Linux system, adding specific routing entries to each newly added routing table and activating the newly added routing table with the specific routing entries to perform routing configuration, so as to utilize the routing configuration results to enable communication between different planes and the same master station IP; each specific routing entry added to each newly added routing table includes a master station IP address that the plane corresponding to the routing table needs to communicate with, as well as the gateway of the plane, the network card of the plane, and the IP address of the plane; The priority of each newly added routing table is higher than the priority of the main routing table of the Linux system.
[0020] Therefore, the priority routing technology of rt_tables in the Linux system is utilized, and routing configuration is performed through the routing table in the rt_tables file of the Linux system to configure the routing channel for each plane to communicate with the same master station IP. According to the information of the routing configuration, each plane communicates with the same master station IP, so that the communication of each plane is carried out according to the routing channel preset by the routing configuration. The routing channel of each plane contains the gateway, network card and IP address of the plane itself. Therefore, the communication channel between each plane and the same master station IP is relatively independent and will not interfere with each other, which can ensure that different planes can communicate with the same master station IP at the same time, thereby avoiding the situation where when different planes communicate with the same master station IP, only one plane can communicate normally while other planes cannot.
[0021] Specifically, the different specific routing entries added to each newly added routing table each contain the different master station IP addresses that the plane corresponding to this routing table needs to communicate with. The master station IP addresses in all specific routing entries added to each routing table include all master station IP addresses that the plane corresponding to this routing table needs to communicate with. In other words, all specific routing entries in each routing table can cover all master station IP addresses that the plane corresponding to this routing table needs to communicate with. For example, if there are four master station IP addresses that the plane needs to communicate with (10.75.1.11 / 12 / 13 / 14), then each routing table contains a specific routing entry containing the master station IP address 10.75.1.11, a specific routing entry containing the master station IP address 10.75.1.12, a specific routing entry containing the master station IP address 10.75.1.13, and a specific routing entry containing the master station IP address 10.75.1.14.
[0022] In addition, considering that the rt_tables file of the Linux system uses numbers to distinguish each routing table, the priority of these routing tables is that the smaller the number, the higher the priority. When the Linux system searches the routing table, it starts from the routing table with a smaller number to the routing table with a larger number, and stops searching when a match is found. The following methods can be used to set the priority of each newly added routing table to be higher than the priority of the main routing table of the Linux system: When adding routing tables corresponding to different planes in the rt_tables file of the Linux system, set the numbers of the newly added routing tables to be smaller than the number of the main routing table of the Linux system.
[0023] Since the rt_tables file of the Linux system supports a maximum of 255 tables, and the Linux system usually maintains 4 routing tables, their numbers and descriptions are as follows: 0: system reserved table; 253: default routing table, generally stores the default route; 254: main routing table, which is also the traditional routing table. If ip route does not specify a table, table 254 is used. When the routing configuration of the routing table in the rt_tables file is used for communication, the routes viewed with the route command are also the routes set in this table. 255: local local routing table, which stores the local interface address, broadcast address, and NAT address. The local table is automatically maintained by the system and cannot be operated by users.
[0024] The numerical number of each newly added routing table in the communication configuration method of this embodiment can be selected from the numerical numbers of the routing tables 1 to 252 in the rt_tables file; in one embodiment, for the case of communicating with the same main station IP through more than two planes, two new routing tables are added, and the numerical numbers of these two routing tables are 251 and 252 respectively. It can be seen that the numerical numbers of the newly added routing tables are smaller than the numerical numbers of the main routing table, default routing table and local routing table of the Linux system.
[0025] To ensure that the process of adding specific routing entries to the newly added routing table and the subsequent use of the routing configuration for communication between different planes and the same master IP address are not affected by other irrelevant data, the method for adding specific routing entries to the newly added routing table includes first clearing the newly added routing table and then adding the specific routing entries to the cleared routing table. This completely removes data in the newly added routing table that is irrelevant to the communication configuration between different planes and the same master IP address, avoiding any negative impact.
[0026] The method for configuring communication between different planes and the master station IP address in this embodiment can be implemented using the ip route command set in a preset script. The ip route command set is part of iproute2 technology, a modern and powerful interface for advanced network management tools under Linux that configures the network protocol stack via rtnetlinksockets. Specifically, in this embodiment, adding specific routing entries to each newly added routing table is implemented using the ip route add command; activating the newly added routing table with the added specific routing entry is implemented using the ip rule command; and clearing the newly added routing table is implemented using the ip route flush command.
[0027] Taking specific operation steps as an example, the operation steps of implementing the communication configuration method of this embodiment are mainly as follows: 1) First create a script file, such as creating an iproute.sh file in / home / root.
[0028] 2) In the script file, add commands to add routing tables to the / etc / iproute2 / rt_tables file. For example, add two routing tables numbered 251 (named net1) and 252 (named net2).
[0029] 3) In the script file, add commands to clear the newly added routing tables in step 2). Use the ip route flush command to clear these routing tables. For example: ip route flush table net1 and ip route flush table net2 4) In the script file, add commands for adding specific routing entries to each newly added routing table that was cleared in step 3). Use the ip route add command to add specific routing entries to each newly added routing table. The number of routing entries added depends on the specific application. For each routing table, the basic command rules for adding specific routing entries are as follows: ip route add (destination IP address) via (gateway address of the plane corresponding to the routing table) dev (network interface card of the plane corresponding to the routing table) src (IP address of the plane corresponding to the routing table) table (routing table name); The brackets in the basic command rules in this step indicate the content to be configured. The content within the brackets needs to be configured according to the routing table's own configuration information (such as the name configured for the routing table, the actual situation of the plane corresponding to the routing table, or the IP address of the master station that the plane corresponding to the routing table needs to communicate with). The destination IP address refers to the IP address of a master station that the plane corresponding to this routing table needs to communicate with. It should be noted that the gateway addresses of different planes are different. Similarly, the network cards of different planes are also different, and the plane IP addresses of different planes are also different.
[0030] 5) In the script file, add commands to activate the routing tables after adding specific routing entries. Specifically, use the ip rule command to activate the routing tables after adding specific routing entries to make them take effect. For example: ip rule add from (the flat IP address corresponding to the routing table) table routing table name The brackets in the basic command rules in this step also represent the content to be configured. The content in the brackets needs to be configured according to the IP address of the plane actually corresponding to the routing table.
[0031] 6) Add the script after adding the above command to the random startup file, for example, add a line to / etc / rc.local to run this file, so that different planes can communicate with the same master IP address by using the routing configuration results.
[0032] In a specific embodiment, for the four IP addresses (10.75.1.11 / 12 / 13 / 14) of the master station, each IP address must communicate with the telecontrol system simultaneously through two planes. The specific examples of the above-mentioned operation steps 1) to 6) of the communication configuration method of this embodiment are as follows: 1) Create the iproute.sh file in / home / root.
[0033] 2) Add the following commands to the iproute.sh file to add routing tables to the / etc / iproute2 / rt_tables file: NUM=$(grep -c -i "251 net2" / etc / iproute2 / rt_tables) if [[ $NUM -eq 0 ]]; then echo "251 net2">> / etc / iproute2 / rt_tables fi NUM=$(grep -c -i "252 net3" / etc / iproute2 / rt_tables) if [[ $NUM -eq 0 ]];then echo "252 net3">> / etc / iproute2 / rt_tables fi 3) Add commands to the iproute.sh file to clear the two routing tables. The commands are as follows: ip route flush table net2 ip route flush table net3 4) Add commands to the iproute.sh file for adding specific routing entries to each newly added routing table that has been cleared, so as to add specific routing entries (i.e. specific routing entries) to these two routing tables. The commands are as follows: ip route add 10.75.1.11 via 10.238.60.14 dev eth3 src 10.238.60.3table net2 ip route add 10.75.1.12 via 10.238.60.14 dev eth3 src 10.238.60.3table net2 ip route add 10.75.1.13 via 10.238.60.14 dev eth3 src 10.238.60.3table net2 ip route add 10.75.1.14 via 10.238.60.14 dev eth3 src 10.238.60.3table net2 ip route add 10.75.1.11 via 20.238.60.14 dev eth4 src 20.238.60.3table net3 ip route add 10.75.1.12 via 20.238.60.14 dev eth4 src 20.238.60.3table net3 ip route add 10.75.1.13 via 20.238.60.14 dev eth4 src 20.238.60.3table net3 ip route add 10.75.1.14 via 20.238.60.14 dev eth4 src 20.238.60.3table net3 Among them, 10.238.60.14 is the gateway address of the plane corresponding to routing table net2 (also called the first plane or plane 1), eth3 is the network card of the plane corresponding to routing table net2, and 10.238.60.3 is the IP address of the plane corresponding to routing table net2; 20.238.60.14 is the gateway address of the plane corresponding to routing table net3 (also called the second plane or plane 2), eth4 is the network card of the plane corresponding to routing table net3, and 20.238.60.3 is the IP address of the plane corresponding to routing table net3.
[0034] 5) Add the following commands to the iproute.sh file to activate the routing tables after adding specific routing items to activate these two routing tables and make them take effect: ip rule add from 10.238.60.3 table net2 ip rule add from 20.238.60.3 table net3 6) Randomly start the iproute.sh file script, for example, add a line to the end of the / etc / rc.local file: sh iproute.sh In this embodiment, the specific operations corresponding to the above-mentioned operation steps 1)-6) are explained by using the remote control to communicate with the same master station IP through dual planes. If the actual application is that the communication device communicates with the same master station IP through more planes, the communication configuration method of different planes communicating with the same master station IP in this embodiment is also applicable.
[0035] Reference for demonstration of the final configuration results obtained from 1)-6) above Figure 2 The test machine simulates a master station with four IP addresses (10.75.1.11 / 12 / 13 / 14). Each IP address communicates with the telecontrol system simultaneously over two planes. The first plane's IP address is 10.238.60.3, and the second plane's IP address is 20.238.60.3. The simulated router with a gateway of 10.238.60.14 simulates the gateway for the first plane, while the simulated router with a gateway of 20.238.60.14 simulates the gateway for the second plane. By configuring the router, the same master station IP address can communicate with the telecontrol system simultaneously over different planes.
[0036] Implementation method of communication configuration system for different plane communications with the same master station IP This embodiment provides a technical solution for a communication configuration system for different plane communications with the same master station IP. The communication configuration system includes a processor, which stores executable program instructions. The executable program instructions are used to be executed to implement the communication configuration method for different plane communications with the same master station IP as described in the above-mentioned communication configuration method implementation method.
[0037] Since the specific working mode and working principle of the communication configuration system for different plane communications with the master station IP in this embodiment have been described in detail in the above-mentioned communication configuration method implementation method for different plane communications with the master station IP, they will not be repeated here.
[0038] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention.
Claims
1. A communication configuration method for different plane communications with the same master station IP, characterized in that: include: When it is necessary to communicate with the same master station IP through more than two planes, add new routing tables corresponding to each plane in the rt_tables file of the Linux system, add specific routing items to each newly added routing table and activate the newly added routing table with the specific routing items to perform routing configuration, so as to use the routing configuration results to communicate between different planes and the same master station IP; each specific routing item added to each newly added routing table contains a master station IP address that the plane corresponding to this routing table needs to communicate with, as well as the gateway of the plane, the network card of the plane and the IP address of the plane; The priority of each newly added routing table is higher than the priority of the main routing table of the Linux system.
2. The communication configuration method for different plane communications with the master station IP according to claim 1 is characterized in that: The different specific routing items added in each newly added routing table respectively contain the different master station IP addresses that the plane corresponding to this routing table needs to communicate; the master station IP addresses in all specific routing items added in each routing table contain all master station IP addresses that the plane corresponding to this routing table needs to communicate.
3. The communication configuration method for different plane communications with the master station IP according to claim 1 or 2, characterized in that: Methods for setting the priority of each newly added routing table to be higher than the priority of the main routing table of the Linux system include: When adding routing tables corresponding to different planes in the rt_tables file of the Linux system, set the numbers of the newly added routing tables to be smaller than the number of the main routing table of the Linux system.
4. The communication configuration method for different plane communications with the master station IP according to claim 1 or 2, characterized in that: Methods for adding specific routing entries to the newly added routing table include: First, the newly added routing table is cleared, and then specific routing entries are added to the newly added routing table after the clearing process.
5. The communication configuration method for different plane communications with the master station IP according to claim 1 or 2, characterized in that: Adding specific routing entries to each newly added routing table is achieved through the ip route add command.
6. The communication configuration method for different plane communications with the master station IP according to claim 1 or 2, characterized in that: Activate the newly added routing table to add specific routing entries through the ip rule command.
7. The communication configuration method for different plane communications with the master station IP according to claim 4 is characterized in that: The newly added routing table is cleared through the ip route flush command.
8. A communication configuration system for different plane communications with the same master station IP, comprising a processor, wherein the processor stores executable program instructions, characterized in that: The executable program instructions are used to be executed to implement the communication configuration method for different plane communications with the master station IP as described in any one of claims 1-7.