A power communication link management model and management method

CN117938685BActive Publication Date: 2026-09-25DONGFANG ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410212492.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-27
Publication Date
2026-09-25
Estimated Expiration
2044-02-27

AI Technical Summary

Technical Problem

[0007]本发明为了解决现有的电力通信链路管理方法系统多任务间的耦合性高、多设备高并发接入时命令转发不及时的缺陷,提供了一种能够同时应对多设备多连接高并发的数据链路、数据处理效率高、命令转发效率快的电力通信链路管理模型和管理方法

Benefits of technology

[0040](1)相较于以往技术,在电力系统自动化通信中没有通信链路管理模型的概念,本发明提出了电力通信链路管理模型,建立端口识别模块,系统内建立逻辑端口的体系,根据实际工作环境构建预处理规则逻辑,提高了数据处理和命令转发效率;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117938685B_ABST
    Figure CN117938685B_ABST
Patent Text Reader

Abstract

The application discloses a power communication link management model and a management method, and relates to the field of power system automation. In order to solve the defects of high coupling between multiple tasks and untimely command forwarding when multiple devices are accessed in high concurrency in the existing power communication link management method, the application adopts the following steps: a communication link management model is established; multiple connection instances are created, and the multiple connection instances form a data link layer task; preprocessing rules are constructed for the communication link management model according to an actual working environment, and a data link layer task and an application layer task are initialized; the data link layer task and the application layer task are decoupled; events, messages and pointer functions are defined according to a to-be-transmitted data type; the application layer task and the data link layer task communicate according to the events and the messages, and data interaction is performed according to the called pointer functions. The application is mainly used for managing high-concurrency multiple-device power communication links.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system automation, and more particularly to a power communication link management model and management method. Background Technology

[0002] With the continuous advancement of new power system construction, the application areas of substation automation systems are constantly expanding, and the demand for various advanced applications is increasing. The number and scale of substations are continuously expanding, the number of power equipment is constantly increasing, and the operation, maintenance, and management of power systems are becoming increasingly complex. In application scenarios such as substation automation, network security monitoring, and new energy access, the requirements for the accuracy, real-time performance, and security of data acquisition, processing, analysis, and transmission are becoming increasingly stringent, highlighting the growing importance of substation automation systems.

[0003] In practical applications, communication scenarios are complex and varied. How to meet the needs of multiple physical device port access, multiple data access, and real-time command forwarding, improve data transmission and reception efficiency, shorten data latency, improve command forwarding real-time performance, and achieve efficient management of communication link data during large-scale data interaction is an urgent problem to be solved.

[0004] Current implementations have poor real-time performance in data processing and command forwarding, high coupling between tasks in the system, and poor scalability and maintainability.

[0005] Patent CN101039309B discloses a link-sharing service device and communication method, mainly providing a link-sharing service device and communication method capable of completing the same communication task using multiple links. It is primarily used for multiple links to complete the same internet access request. This device requires multiple network interfaces capable of simultaneous internet access, and the protocols that can be executed distributedly include HTTP, FTP, and SMTP. Currently, substation automation systems do not connect to the internet, and for security reasons, communication protocols such as FTP, TELNET, HTTP, and HTTPS are disabled. This solution also does not consider commonly used power system communication protocols such as IEC60870-5-104, IEC60870-5-103, and MODBUS, and does not address the real-time performance and security of data acquisition and processing. Patent CN101039309B only considers client-side acquisition of internet webpage data; it cannot act as a server to provide data externally and does not support the forwarding of command data.

[0006] To address this issue, a power communication link management model and method are needed that can reduce the coupling between multiple tasks in the system and improve the real-time performance of data processing and command forwarding. Summary of the Invention

[0007] To address the shortcomings of existing power communication link management methods, such as high coupling between multiple tasks and untimely command forwarding when multiple devices access the system concurrently, this invention provides a power communication link management model and method that can simultaneously handle high-concurrency data links with multiple devices and connections, and features high data processing efficiency and fast command forwarding efficiency.

[0008] The power communication link management method of the present invention includes the following steps:

[0009] S1: Establish a communication link management model; use multiple logical ports to communicate with one physical port; the logical ports are bidirectionally connected to the application layer tasks, the application layer tasks are bidirectionally connected to the data link layer tasks, and the data link layer tasks are bidirectionally connected to the network layer tasks; create multiple connection instances, and the multiple connection instances constitute a data link layer task;

[0010] S2: Based on the actual working environment, construct preprocessing rules for the communication link management model and initialize data link layer tasks and application layer tasks;

[0011] S3: The data link layer tasks are decoupled from the application layer tasks.

[0012] S31: Define event, message, and pointer functions according to the data type to be transmitted;

[0013] S32: The application layer task and the data link layer task communicate based on the events and messages, and perform data interaction based on the called pointer functions.

[0014] Further: In S2, the preprocessing rules include:

[0015] Configure communication parameters. When the application layer task acts as a server, configure the listening port of this software and initialize the state and initial value of the logical port. When the application layer task acts as a client, configure the communication port of the external software and initialize the state and initial value of the data link layer task. The communication parameters include, but are not limited to, connection parameters, remote port parameters, backup port parameters, application layer parameters, send / receive buffers, working mode, and packet information.

[0016] The initialization data link layer task and application layer task include:

[0017] Configure connection instance parameters. When the application layer task acts as a server, allocate memory according to the actual number of logical port communication connections and initialize the connection instance according to the configured communication parameters. When the application layer task acts as a client, actively establish a connection with the other side port according to the pre-configured connection instance parameters and the other side port parameters.

[0018] Furthermore: In S3, data processing on the same data link includes:

[0019] Network interface card (NIC) guardian task: When the application layer task acts as a server, the NIC guardian task maintains the connection status of the logical ports identified by the port identification module and closes the connection channels with closure requests; when the application layer task acts as a client, it monitors the data of the data link layer task, maintains the connection instance status, and closes the connection channels corresponding to connection instances with data timeouts.

[0020] Network connection task: When the application layer task acts as a server, this software acts as the connected end, creating a connection instance to the application layer task and initializing the connection properties; when the application layer task acts as a client, it creates a connection with external software and initializes its connection properties, and connects to the communication ports of all external software, including opening and closing connections, and responding to the application layer task's open and close requests.

[0021] Data processing tasks: Send and receive data from network layer tasks or application layer tasks through multiplexing functions, monitor all connection channels through the select mechanism, and update the list of monitored connection instances periodically.

[0022] Furthermore: In S3, the application layer task and the data link layer task, based on the channel state, adopt the operating system's semaphore mechanism to build their own message buffers and implement a message notification mechanism for state interaction between different tasks, specifically including:

[0023] When the idle time for sending and receiving data in the data link layer task is greater than the preset time, the data link layer task sends a message notification to the application layer task that the current channel is in an idle state.

[0024] When the idle time for data transmission of a data link layer task exceeds a preset idle time, the data link layer task sends a message notification to the application layer task that the current channel is in an idle state.

[0025] When the amount of data to be sent by the data link layer task is less than the preset lower threshold, the data link layer task sends a message notification to the application layer task that the current channel is in a state where new messages can be written.

[0026] When a data link layer task has started sending data but has not yet finished sending it, and the sending buffer is not full, the data link layer task sends a message notification to the application layer task that the current channel can continue to send new messages.

[0027] When a data link layer task reads valid data, it first stores the data in the data link layer buffer, and at the same time sends a channel read message to the application layer task to read the data from the data link layer.

[0028] Further: In S1, each logical port is matched with a unique logical port identifier, which includes a port type and a type number. The port type corresponds one-to-one with the physical port, and the type number is the logical number of the logical port in the port identification module.

[0029] Further: In S1, the connection instance is created by the connection class according to the actual working environment and the data to be transmitted. The configuration of the connection instance includes connection handle, port number, working status, working mode and interface function. The connection parameters include the local connection IP, local connection mask and local connection port number. The peer port parameters include the peer IP, peer mask and peer port number. The backup port parameters include backup port status flag. The application layer parameters include application layer task ID, application layer management status and application layer task type. The working mode includes TCP client, TCP server, UDP broadcast, UDP one-to-one, multicast, VPN client and VPN server.

[0030] Furthermore: In S2, when initializing the data link layer task and the application layer task, it is first necessary to determine whether the communication peer port meets the preset conditions of the communication link. If it does, a connection is established and the relevant configuration is recorded.

[0031] The power communication link management model of the present invention includes a port identification module, a data link layer task module, an application layer task module, and a message notification module;

[0032] The port identification module includes multiple logical ports, at least one of which is communicatively connected to the same physical port, and is used to identify and communicate with the data transmitted by the physical port;

[0033] The data link layer task module and the application layer task module are connected bidirectionally for data exchange.

[0034] The data link layer task module includes a network interface card (NIC) protection task module, a network connection task module, and a data processing task module. The NIC protection task module is used to manage the connection status of physical ports or monitor the transmission and reception of data at the data link layer. The network connection task module is used to create network connections for clients or respond to application layer task shutdown requests. The data processing task module processes the data on the physical ports.

[0035] The message notification module is communicatively connected to the application layer task module and is used to send messages to the application layer task module according to the amount of data sent in the current communication link layer and the preset message classification.

[0036] Furthermore: a unique port number is assigned to each logical port and physical port connection relationship; the system's data management is device-centric, the database locates devices through ports, each task can manage several logical ports, and each logical port can connect to multiple devices.

[0037] Furthermore, the network connection task module uses non-blocking operations to handle network connections and uses an event loop to drive event processing for network connections.

[0038] The beneficial effects of this invention are:

[0039] Compared with the prior art, the present invention has the following beneficial effects:

[0040] (1) Compared with previous technologies, there is no concept of communication link management model in power system automation communication. This invention proposes a power communication link management model, establishes a port identification module, establishes a logical port system within the system, and constructs preprocessing rule logic according to the actual working environment, thereby improving the efficiency of data processing and command forwarding.

[0041] (2) For data on the same link, the present invention adopts a method in which the network card guardian task module completes the connection status management, the network connection task module completes the network connection work, and the data processing task module completes the data sending and receiving work. The select mechanism monitors all connection channels and updates the list of monitored connection instances periodically (less than 10 milliseconds). Changes in connection status can be processed in a timely manner. The data processing and command forwarding time is less than 50 milliseconds, which is better than the data processing and command forwarding time of the prior art and has lower resource consumption.

[0042] (3) The present invention uses a message notification mechanism to quickly send the channel status from the data link layer task module to the application layer task module. The application layer task module determines the processing action according to the channel status. It adopts the semaphore mechanism of the operating system, builds its own message buffer, and implements the message notification mechanism between different tasks to perform status interaction. The status interaction time is less than 1 millisecond, and the data processing has low latency, high efficiency, and high real-time performance.

[0043] (4) The data link layer task module and the application layer task module are decoupled in this invention. A series of events and messages and a series of pointer functions are defined, so that the data can be decoupled quickly and accurately according to the defined events, messages and pointer functions during the decoupling process. This solves the problem of high coupling in real-time multi-task systems. In addition, multiple connections can apply different types of application layer protocols. The data link layer does not need to care about the application layer protocol type, which is highly flexible, easy to manage and saves maintenance costs. Attached Figure Description

[0044] Figure 1This is a schematic diagram of a communication link management model;

[0045] Figure 2 Here is the main flowchart for the communication link management method;

[0046] Figure 3 Flowchart for network card protection tasks;

[0047] Figure 4 A flowchart for network connection tasks;

[0048] Figure 5 A flowchart for data processing tasks;

[0049] Figure 6 This is a schematic diagram of the data processing structure for a communication link management model. Detailed Implementation

[0050] The following are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. The embodiments described below are only for explaining the present invention and should not be construed as limiting the present invention. The scope of protection of the present invention should be determined by the scope of the claims. The embodiments of the present invention are described in detail below. In order to facilitate the description of the present invention and simplify the description, the technical terms used in the specification of the present invention should be interpreted broadly, including but not limited to conventional alternatives not mentioned in this application, and including both direct and indirect implementation methods.

[0051] Example 1

[0052] Combination Figure 1 - Figure 6 This embodiment describes a management method for a power communication link management model, comprising:

[0053] S1: Establish a communication link management model, such as Figure 1 The communication link management model includes a logical port system, which comprises multiple logical ports. One physical port can correspond to multiple logical ports, but not all logical ports correspond to a single physical port. The logical port identifier consists of a port type and a type number, represented by a single long character. The high-order bits represent the port type, corresponding one-to-one with the physical port, while the low-order bits represent the port's logical number within the system. The driver for each port type is also divided into two parts: a lower-level driver for that port type and an upper-level driver for the protocol to which that port is connected.

[0054] Specifically, each connection is an instance created by the Csocket class. Each connection communicates independently with the outside world, maintains its own communication state, and interacts with application layer tasks to complete the specific functions of the application.

[0055] Each connection is assigned a unique port number within the process, which is uniformly ordered within the system and is unique. System task management adopts a logical port-centric approach, where tasks are located via logical ports, tasks manage devices, and devices contain data. System data management is device-centric; each application-layer task can manage several logical ports, and each logical port can connect to multiple devices.

[0056] Communication parameters are configured according to the actual working environment to initialize the state and initial values ​​of connection objects. Various indexes are established for different connection objects, and preprocessing rule logic is constructed, such as pre-analyzing and locating the source and destination of data, eliminating the need for repeated searches and location, thus greatly improving processing efficiency. This improves data processing efficiency and system performance while ensuring correct data processing. Communication parameters include: local connection IP, local connection mask, local connection port, peer IP, peer mask, peer port, corresponding application layer task ID (m_wTargetID), local connection port number (m_dwPortID), spare port status flag, application layer management status, application layer task type, send / receive buffer, and working mode. Application layer task ID initialization is achieved through the interface function EthernetOpen(), which is called by the application layer to initialize the application layer task m_wTargetID corresponding to each connection instance, recording the application layer task corresponding to the connection. Working modes include TCP client, TCP server, UDP broadcast, UDP one-to-one, multicast, VPN client, and VPN server modes.

[0057] On the application configuration interface, parameters are configured according to the connection instance. The configuration content includes the application layer task type, working mode, connection configuration, grouping status, etc., corresponding to this connection, for use by the link layer connection attributes.

[0058] S2: Design a communication link management method, the main process is as follows: Figure 2 .

[0059] Based on the actual working environment, preprocessing rules are constructed for the communication link management model to initialize data link layer tasks and application layer tasks; the preprocessing rules include:

[0060] Configure communication parameters. When the application layer task acts as a server, configure the listening port of this software. The "this software" refers to the software where the application layer resides, i.e., the client communicating with it is external software. Initialize the state and initial value of the logical port. When the application layer task acts as a client, configure the communication port of the external software and initialize the state and initial value of the data link layer task. The communication parameters include, but are not limited to, connection parameters, peer port parameters, backup port parameters, application layer parameters, send / receive buffers, working mode, and packet information.

[0061] Specifically, the system initializes link information, including calculating the number of connections on multiple network cards and allocating memory. Using an object-oriented approach, each connection requests a socket object. The socket object contains a set of data, including connection configuration options, connection handle, port number, working status, working mode, and a series of internal interface functions. The indexing process is two independent steps that are repeated at different times and are performed automatically in the program.

[0062] Each connection instance is initialized according to the pre-configured communication parameters. The port number of each connection instance corresponds to a unique logical port of the system, which is a number automatically generated by the software.

[0063] The system determines whether the other party meets the access conditions, such as whether the IP address or device address is a pre-configured address. If the other party meets the access conditions, a logical connection is established between this software and the external software, and the relevant configuration is recorded. The client actively connects to the pre-configured IP address and port number of the other party. The server, upon detecting the external connection, determines the terminal access conditions according to pre-configured rules and finally connects to the peer device that meets the access conditions, thus satisfying the differentiated needs of different communication links.

[0064] S3: Application layer tasks are decoupled from data link layer tasks, and application layer tasks and data link layer tasks can be flexibly configured, supporting multiple protocols in parallel.

[0065] S31: Specifically, a series of events and messages are defined, including status notification messages, as well as events such as MEV_LINKBREAK (connection disconnection) and MEV_LINKUPDATE (connection update), which are used for communication between application layer tasks and data link layer tasks.

[0066] Specifically, a series of pointer functions are defined for function calls between application layer tasks and data link layer tasks to exchange data. Different tasks are only responsible for the interface and do not depend on each other. For example, (*ReadComm)(WORD wPortType, WORD wPortNo, BYTE*pBuf, DWORD dwLen) reads the contents of the port receive buffer; (*WriteComm)(WORD wPortType, WORD wPortNo, BYTE*pBuf, DWORD dwLen, DWORD Mode) sends data to the port buffer to write data, etc.

[0067] Data processing for the same connection instance is accomplished by the following tasks, specifically:

[0068] The process of the network card protection task NICTask is as follows: Figure 3 .

[0069] Specifically, it is responsible for maintaining the connection status of all established connection instances, obtaining server close requests by reading the connection status of connection instances, closing server connections with close requests, monitoring data sending and receiving, and closing connections that have timed out.

[0070] Listen on the data link layer listening port, create a listening connection, and initialize its properties;

[0071] The system processes various channel messages, receives port control parameters from application layer tasks, monitors the status of each connection, and generates channel idle messages (MEV_COMMIDLE), channel send idle messages (MEV_COMMTXDIDLE), write messages (MEV_WRITECOMM), and continue writing messages (MEV_WRITECONT) based on the set parameters. These messages are then sent to the specified application layer tasks to notify the link's working status.

[0072] The network connection task ConnectTask has the following process: Figure 4 .

[0073] Specifically, it creates client connections and initializes their properties, supports multicast and VPN methods, and periodically connects to all peer IPs; it also closes client connections that request to be closed, and supports opening or closing connections for application layer tasks.

[0074] The data processing task SRWTask has the following process: Figure 5 .

[0075] Specifically, all connections are monitored using the select mechanism (an I / O multiplexing technique) to read Ethernet data. When data is received, a MEV_READCOMM message is immediately sent to the application layer task (task ID m_wTargetID) to notify of data reception. The application layer task then calls the ReadData() function to read the data and enters the data processing flow. After the application layer task completes its processing, it calls the WriteData() function of the data link layer to send data according to application requirements, completing the data transmission and reception process. The monitored connection instance list is updated periodically (less than 10 milliseconds). Changes in connection status can be handled promptly, with a data response time of less than 10 milliseconds.

[0076] S32: Application layer tasks and data link layer tasks use message notifications to interact in terms of status.

[0077] Specifically, the data link layer task receives port control parameters from the application layer task, such as channel idle time and channel byte count, and determines the next action based on these parameters. These parameters mainly include the channel write byte count (dwChanWrite), channel transmit / receive idle value (dwChanCommBreak), and channel transmit idle value (dwChanTxdBreak). The data link layer adds two counts to each connection: a transmit idle count (dwNotifyTxdBreak) and a receive idle count (dwNotifyCommBreak). These two idle counts are periodically accumulated. After successful data reading, the receive idle count (dwNotifyCommBreak) equals 0; after successful data transmission, the transmit idle count (dwNotifyTxdBreak) equals 0.

[0078] Channel messages specifically include:

[0079] S321: Channel Idle Message MEV_COMMIDLE. When the data link layer data receiving idle time dwNotifyCommBreak > dwChanCommBreak and the idle count dwNotifyTxdBreak > dwChanCommBreak is sent, a channel idle message is sent to the application layer task (task ID is m_wTargetID) to notify the application layer task that it can send data.

[0080] S322: The channel sends an idle message MEV_COMMTXDIDLE. When the data link layer data transmission idle time dwNotifyTxdBreak > dwChanTxdBreak, the sending channel sends an idle message to the application layer task (task ID m_wTargetID) to notify the application layer task that it can send data.

[0081] S323: Write message MEV_WRITECOMM. When the data link layer data to be sent is less than the specified lower limit dwChanWrite, a write message is sent to the application layer task (task ID is m_wTargetID) to notify the application layer task that it can send data.

[0082] S324: Continue writing message MEV_WRITECONT. When data link layer data has been sent but not completely sent, and the send buffer is not full, it can continue to send data. In this case, a continue writing message is sent to the application layer task (task ID is m_wTargetID) to notify the application layer task that it can send data.

[0083] S325: Channel Read Message MEV_READCOMM. When the data link layer reads valid data, it first stores the data in the data link layer buffer and simultaneously sends a channel read message to the application layer task (task ID is m_wTargetID) to allow the data link layer to read the data, thus completing the data reception.

[0084] S4: Link communication between multiple network cards is protected and managed by different tasks.

[0085] Specifically, multi-NIC link communication includes:

[0086] Each physical network interface card (NIC) is protected by a different task, allowing different NICs to protect the same port. To prevent listening conflicts from multiple connections on the same NIC, for listening tasks on the same port on the NIC, the first connection is designated as the primary listening connection and the m_bFirstSamePort flag is set to prevent listening conflicts. The second and subsequent connections do not perform port listening operations, but can still send and receive data normally.

Claims

1. A power communication link management method, characterized in that, Includes the following steps: S1: Establish a communication link management model; use multiple logical ports to communicate with one physical port; the logical ports are bidirectionally connected to the application layer tasks, the application layer tasks are bidirectionally connected to the data link layer tasks, and the data link layer tasks are bidirectionally connected to the network layer tasks; create multiple connection instances, and the multiple connection instances constitute a data link layer task; S2: Based on the actual working environment, construct preprocessing rules for the communication link management model and initialize data link layer tasks and application layer tasks; S3: The data link layer tasks are decoupled from the application layer tasks. S31: Define event, message, and pointer functions according to the data type to be transmitted; S32: The application layer task and the data link layer task communicate based on the events and messages, and perform data interaction based on the called pointer functions; In S3, data processing on the same data link includes: Network interface card (NIC) guardian task: When the application layer task acts as a server, the NIC guardian task maintains the connection status of the logical ports identified by the port identification module and closes the connection channels with closure requests; when the application layer task acts as a client, it monitors the data of the data link layer task, maintains the connection instance status, and closes the connection channels corresponding to connection instances with data timeouts. Network connection task: When the application layer task acts as a server, this software acts as the connected end, creating a connection instance to the application layer task and initializing the connection properties; when the application layer task acts as a client, it creates a connection with external software and initializes its connection properties, and connects to the communication ports of all external software, including opening and closing connections, and responding to the application layer task's open and close requests. Data processing tasks: Send and receive data from network layer tasks or application layer tasks through multiplexing functions, monitor all connection channels through the select mechanism, and update the list of monitored connection instances periodically.

2. The power communication link management method according to claim 1, characterized in that, In S2, the preprocessing rules include: Configure communication parameters. When the application layer task acts as a server, configure the listening port of this software and initialize the state and initial value of the logical port. When the application layer task acts as a client, configure the communication port of the external software and initialize the state and initial value of the data link layer task. The communication parameters include, but are not limited to, connection parameters, remote port parameters, backup port parameters, application layer parameters, send / receive buffers, working mode, and packet information. The initialization data link layer task and application layer task include: Configure connection instance parameters. When the application layer task acts as a server, allocate memory according to the actual number of logical port communication connections and initialize the connection instance according to the configured communication parameters. When the application layer task acts as a client, actively establish a connection with the other side port according to the pre-configured connection instance parameters and the other side port parameters.

3. The power communication link management method according to claim 1, characterized in that, In S3, the application layer task and the data link layer task use the operating system's semaphore mechanism based on the channel state to build a self-built message buffer and implement a message notification mechanism for state interaction between different tasks, specifically including: When the idle time for sending and receiving data in the data link layer task is greater than the preset time, the data link layer task sends a message notification to the application layer task that the current channel is in an idle state. When the idle time for data transmission of a data link layer task exceeds a preset idle time, the data link layer task sends a message notification to the application layer task that the current channel is in an idle state. When the amount of data to be sent by the data link layer task is less than the preset lower threshold, the data link layer task sends a message notification to the application layer task that the current channel is in a state where new messages can be written. When a data link layer task has started sending data but has not yet finished sending it, and the sending buffer is not full, the data link layer task sends a message notification to the application layer task that the current channel can continue to send new messages. When a data link layer task reads valid data, it first stores the data in the data link layer buffer, and at the same time sends a channel read message to the application layer task to read the data from the data link layer.

4. The power communication link management method according to claim 1, characterized in that, In S1, each logical port is matched with a unique logical port identifier. The logical port identifier includes a port type and a type number. The port type corresponds one-to-one with the physical port, and the type number is the logical number of the logical port in the port identification module.

5. A power communication link management method according to claim 2, characterized in that, In S1, the connection instance is created by the connection class based on the actual working environment and the data to be transmitted. The configuration of the connection instance includes connection handle, port number, working status, working mode, and interface function. The connection parameters include the local connection IP, local connection mask, and local connection port number. The peer port parameters include the peer IP, peer mask, and peer port number. The backup port parameters include a backup port status flag. The application layer parameters include application layer task ID, application layer management status, and application layer task type. The working mode includes TCP client, TCP server, UDP broadcast, UDP one-to-one, multicast, VPN client, and VPN server.

6. The power communication link management method according to claim 2, characterized in that, In S2, when initializing the data link layer task and the application layer task, it is first necessary to determine whether the communication peer port meets the preset conditions of the communication link. If it does, a connection is established and the relevant configuration is recorded.

7. A power communication link management model for implementing the power communication link management method as described in any one of claims 1-6, characterized in that, It includes a port identification module, a data link layer task module, an application layer task module, and a message notification module; The port identification module includes multiple logical ports, at least one of which is communicatively connected to the same physical port, and is used to identify and communicate with the data transmitted by the physical port; The data link layer task module and the application layer task module are connected bidirectionally for data exchange. The data link layer task module includes a network interface card (NIC) protection task module, a network connection task module, and a data processing task module. The NIC protection task module is used to manage the connection status of physical ports or monitor the transmission and reception of data at the data link layer. The network connection task module is used to create network connections for clients or respond to application layer task shutdown requests. The data processing task module processes the data on the physical ports. The message notification module is communicatively connected to the application layer task module and is used to send messages to the application layer task module according to the amount of data sent in the current communication link layer and the preset message classification.

8. A power communication link management model according to claim 7, characterized in that, A unique port number is assigned to each logical port and physical port connection relationship; the system's data management is device-centric, the database locates devices through ports, each task can manage several logical ports, and each logical port can connect to multiple devices.

9. A power communication link management model according to claim 7, characterized in that, The network connection task module uses non-blocking operations to handle network connections and uses an event loop to drive event processing for network connections.

Citation Information

Patent Citations

  • Link sharing service apparatus and communication method thereof

    CN101039309B

  • Power big data platform based on plug-in system structure and use method

    CN116260238A