Search

CN-121984901-A - Inter-domain heartbeat detection method and device for virtual controller of heat supply network system

CN121984901ACN 121984901 ACN121984901 ACN 121984901ACN-121984901-A

Abstract

The application discloses a method and a device for detecting inter-domain heartbeat of a virtual controller of a heat supply network system, wherein the method comprises the steps of starting an inter-domain heartbeat detection thread of the virtual controller when a process of the virtual controller is started; after entering a heartbeat detection thread, traversing the registration points of the opposite side virtual controllers in a cross-device registration point information list by taking the current virtual controller as a main controller, judging whether heartbeat detection needs to be established, responding to the need to establish the heartbeat detection, sending a heartbeat request message to the opposite side virtual controllers, receiving a heartbeat response message sent by the opposite side virtual controllers, updating network address information and link state information of the opposite side virtual controllers stored on the local side based on the heartbeat response message, and starting the next heartbeat detection period after traversing all the opposite side virtual controllers. The application realizes the mutual synchronization of real-time parameters such as the operation task data of the virtual controller and the operation state of the virtual controller, and ensures the normal transmission of communication data among the virtual controller domains.

Inventors

  • Qu Nanxin
  • GUAN LEI
  • SONG MEIYAN
  • ZHANG JUN
  • LIU CHANG
  • HU BO
  • Zhai Liangjing
  • YANG LIU
  • CHEN FAN
  • WANG KUNLUN

Assignees

  • 西安热工研究院有限公司
  • 华能聊城热电有限公司

Dates

Publication Date
20260505
Application Date
20260327

Claims (10)

  1. 1. The inter-domain heartbeat detection method for the virtual controllers of the heat supply network system is characterized by being applied to a heartbeat detection system, wherein the heartbeat detection system comprises a plurality of virtual controllers and a process manager, and the method comprises the following steps: When the process of the virtual controller is started, starting an inter-domain heartbeat detection thread of the virtual controller, wherein the heartbeat detection thread is provided with a sending buffer area and a receiving buffer area, the sending buffer area is used for sending heartbeat messages, and the receiving buffer area is used for receiving the heartbeat messages; After entering a heartbeat detection thread, traversing the registration points of the opposite-side virtual controllers in the cross-device registration point information list by taking the current virtual controller as a main controller, wherein the opposite-side virtual controllers are other virtual controllers except the current virtual controller; judging whether heartbeat detection needs to be established or not based on the registration points; responding to the need of building heartbeat detection, sending a heartbeat request message to the opposite-side virtual controller by using a process manager, and receiving a heartbeat response message sent by the opposite-side virtual controller; updating the network address information and the link state information of the contralateral virtual controller stored on the local side based on the heartbeat response message; after traversing all contralateral virtual controllers, the next heartbeat detection cycle is started.
  2. 2. The method of claim 1, wherein traversing the registration points of the contralateral virtual controller in the cross-device registration point information list with the current virtual controller as the master controller comprises: Reading a cross-device registration point information list of a current virtual controller, wherein the virtual controllers in the cross-device registration point information list are all provided with a number; traversing the opposite side virtual controller information in the cross-device registration point information list in sequence; and if the number of the currently traversed contralateral virtual controller is the same as the number of the current virtual controller, skipping, and traversing the next virtual controller in the cross-device registration point information list.
  3. 3. The method of claim 1, wherein determining whether heartbeat detection needs to be established based on the registration points comprises: If the number of the registration points of the currently traversed contralateral virtual controller is zero, skipping, and traversing the next virtual controller in the cross-device registration point information list; If the number of the registration points of the currently traversed contralateral virtual controller is not zero, judging that heartbeat detection needs to be established.
  4. 4. The method of claim 1, wherein the sending, with a process manager, a heartbeat request message to the contralateral virtual controller in response to a need to establish a heartbeat probe, comprises: Checking whether the contralateral virtual controller is registered in a local communication node list; if not, the network address of the main network and/or the standby network of the opposite-side virtual controller is obtained and updated to the communication node list through a dynamic address discovery mechanism for sending a broadcast request to the process manager, and if so, a heartbeat request message is sent to the opposite-side virtual controller.
  5. 5. The method according to claim 4, wherein the dynamic address discovery mechanism for sending a broadcast request to the process manager, obtains the network address of the primary and/or backup network of the contralateral virtual controller and updates to the communication node list, comprises: The current virtual controller constructs and broadcasts a discovery request message containing the self number, the target opposite side controller number and the target IP address; The process manager receives the discovery request message, and if the target opposite-side virtual controller is identified to be managed by the process manager, the request message is forwarded to the target opposite-side virtual controller; The opposite side virtual controller responds to the discovery request, packages the network address of the main machine and the standby machine in a response message, and returns to the local side virtual controller through the process manager; the virtual controller at the side analyzes the response message, updates the network address of the virtual controller at the opposite side to a local communication node list, and completes registration establishment of a communication channel.
  6. 6. The method of claim 4, wherein the sending the heartbeat request message includes: Acquiring network addresses of a main machine and a standby machine of the opposite-side virtual controller from a local communication node list; And sending a heartbeat request message to each obtained non-zero effective address in turn.
  7. 7. The method according to claim 1, wherein updating the network address information and the link state information of the contralateral virtual controller stored on the home side based on the heartbeat response message includes: Analyzing the heartbeat response message to obtain the network address of the main machine and the standby machine of the opposite-side virtual controller; comparing the network address of the master and slave machine with the history address stored in the local registration information list; if the address changes, updating the locally stored address and marking the corresponding link state as address change; If the address is unchanged, marking the corresponding link state as the address unchanged; and if the analyzed address is zero, marking the corresponding link state as an address fault.
  8. 8. The method of claim 7, wherein the network address comprises a first address and a second address, and wherein marking the corresponding link state as an address failure comprises: If the first address of the host or the standby is zero and the second address is non-zero, marking the first address as a first address fault; If the second address of the host or the standby is zero and the first address is non-zero, marking the second address as a second address fault; if the first address and the second address of the host or the standby are both zero, the first address and the second address are marked as faults.
  9. 9. The method of claim 1, wherein the header of the heartbeat request message and the header of the heartbeat response message each include: message type, source virtual controller number, target virtual controller number, message length and forwarding port information.
  10. 10. The device is applied to a heartbeat detection system, wherein the heartbeat detection system comprises a plurality of virtual controllers and a process manager, and the device comprises: The system comprises a starting module, a starting module and a receiving module, wherein the starting module is used for starting an inter-domain heartbeat detection thread of a virtual controller when a process of the virtual controller is started, and the heartbeat detection thread is provided with a sending buffer area and a receiving buffer area; The traversing module is used for traversing the registration points of the opposite-side virtual controllers in the cross-device registration point information list by taking the current virtual controller as a main controller after entering the heartbeat detection thread, wherein the opposite-side virtual controllers are other virtual controllers except the current virtual controller; the judging module is used for judging whether the heartbeat detection needs to be established or not based on the registration points; The building module is used for responding to the need of building heartbeat detection, sending a heartbeat request message to the opposite-side virtual controller by using the process manager and receiving a heartbeat response message sent by the opposite-side virtual controller; The updating module is used for updating the network address information and the link state information of the contralateral virtual controller stored on the local side based on the heartbeat response message; and the detection module is used for starting the next heartbeat detection period after traversing all the contralateral virtual controllers.

Description

Inter-domain heartbeat detection method and device for virtual controller of heat supply network system Technical Field The present application relates to the field of information processing technologies, and in particular, to a method and an apparatus for detecting inter-domain heartbeat of a virtual controller of a heat supply network system. Background The core design of the modern industrial automation system mainly adopts decentralized control and centralized management, breaks through the limitation of the traditional centralized control, and the decentralized control can divide the whole controlled system into a plurality of subsystems according to specific characteristics. Each independent controller only needs to complete a control function in a relatively small range, and cross-domain control data or communication data is realized through an inter-domain communication technology, so that control logic of the whole system and physical equipment in the system are well decoupled, and the risk of paralysis of the whole system caused by local area faults is reduced. In view of the continuous main ball of the industrial automation field on flexibility and cost effectiveness, a virtual decentralized control system is generated as an important innovative technology in the industrial automation and intelligent manufacturing fields, and the problems of strong dependence on hardware, difficult upgrading and maintenance and the like of the traditional physical controller are solved. In the related art, reliable communication technology is needed for the virtual controllers, so that inter-domain communication and data exchange between the virtual controllers are realized. How to realize normal transmission of communication data between virtual controller domains is a technical problem to be solved. Disclosure of Invention The disclosure provides a method and a device for detecting inter-domain heartbeat of a virtual controller of a heat supply network system, which are used for at least solving the technical problems in the prior art. According to a first aspect of the present application, there is provided a method for inter-domain heartbeat detection of a virtual controller of a heat supply network system, the method being applied to a heartbeat detection system, the heartbeat detection system comprising a plurality of virtual controllers and a process manager, the method comprising: When the process of the virtual controller is started, starting an inter-domain heartbeat detection thread of the virtual controller, wherein the heartbeat detection thread is provided with a sending buffer area and a receiving buffer area, the sending buffer area is used for sending heartbeat messages, and the receiving buffer area is used for receiving the heartbeat messages; After entering a heartbeat detection thread, traversing the registration points of the opposite-side virtual controllers in the cross-device registration point information list by taking the current virtual controller as a main controller, wherein the opposite-side virtual controllers are other virtual controllers except the current virtual controller; judging whether heartbeat detection needs to be established or not based on the registration points; responding to the need of building heartbeat detection, sending a heartbeat request message to the opposite-side virtual controller by using a process manager, and receiving a heartbeat response message sent by the opposite-side virtual controller; updating the network address information and the link state information of the contralateral virtual controller stored on the local side based on the heartbeat response message; after traversing all contralateral virtual controllers, the next heartbeat detection cycle is started. In one embodiment, traversing the registration points of the opposite virtual controller in the cross-device registration point information list with the current virtual controller as the master controller includes: Reading a cross-device registration point information list of a current virtual controller, wherein the virtual controllers in the cross-device registration point information list are all provided with a number; traversing the opposite side virtual controller information in the cross-device registration point information list in sequence; and if the number of the currently traversed contralateral virtual controller is the same as the number of the current virtual controller, skipping, and traversing the next virtual controller in the cross-device registration point information list. In an embodiment, the determining whether the heartbeat detection needs to be established based on the registration points includes: If the number of the registration points of the currently traversed contralateral virtual controller is zero, skipping, and traversing the next virtual controller in the cross-device registration point information list; If the number of the registration points of the