Instrument control equipment data interaction handshake method

文档序号:1861106 发布日期:2021-11-19 浏览:18次 中文

阅读说明:本技术 一种仪控设备数据交互握手方法 (Instrument control equipment data interaction handshake method ) 是由 何小鹏 陈杰 张洧川 刘立新 何正熙 赵阳 肖鹏 周玲 熊彦 李伟 唐涛 简一 于 2021-08-26 设计创作,主要内容包括:本发明公开了一种仪控设备数据交互握手方法,包括以下步骤:握手发起装置发送握手请求消息,所述握手请求消息包括握手请求标识;所述握手发起装置接收握手应答消息;所述握手应答消息由握手响应装置发送,所述握手应答消息包括握手应答标识,且所述握手应答标识根据所述握手请求标识获取;所述握手发起装置对所述握手应答标识进行判断,当所述握手应答标识与预设握手应答标识一致时,所述握手发起装置与所述握手响应装置建立通信连接。本发明的目的在于提供一种仪控设备数据交互握手方法,实现设备中CPU板卡和功能板卡间的类型识别和通信同步,以保证CPU板卡和功能板卡间数据交互的准确性。(The invention discloses an instrument control equipment data interaction handshake method, which comprises the following steps: the handshake initiating device sends a handshake request message, wherein the handshake request message comprises a handshake request identifier; the handshake initiating device receives a handshake response message; the handshake response message is sent by a handshake response device, the handshake response message comprises a handshake response identifier, and the handshake response identifier is obtained according to the handshake request identifier; the handshake initiating device judges the handshake response identification, and when the handshake response identification is consistent with a preset handshake response identification, the handshake initiating device establishes communication connection with the handshake responding device. The invention aims to provide a data interaction handshake method for instrument control equipment, which realizes type identification and communication synchronization between a CPU board card and a function board card in the equipment so as to ensure the accuracy of data interaction between the CPU board card and the function board card.)

1. A data interaction handshake method for instrument control equipment is characterized by comprising the following steps:

the handshake initiating device sends a handshake request message, wherein the handshake request message comprises a handshake request identifier;

the handshake initiating device receives a handshake response message; the handshake response message is sent by a handshake response device, the handshake response message comprises a handshake response identifier, and the handshake response identifier is obtained according to the handshake request identifier;

the handshake initiating device judges the handshake response identification, and when the handshake response identification is consistent with a preset handshake response identification, the handshake initiating device establishes communication connection with the handshake responding device.

2. The instrument control device data interaction handshake method according to claim 1, wherein the handshake request identification is obtained by the following formula:

Y=0x30|boardNum;

wherein Y represents a handshake request identifier, 0x30 represents a handshake request, | represents or, and boardNum represents a number of a handshake initiating device.

3. The instrument control device data interaction handshake method according to claim 1, wherein the handshake reply identifier is obtained by the following formula:

N=0x50|boardNum;

where N denotes a handshake response identifier, 0x50 denotes a response request, | denotes a number of a handshake initiator, or, a boordnum denotes a number of a handshake initiator.

4. The instrument control device data interaction handshake method according to claim 1, wherein after the handshake initiating means establishes a communication connection with the handshake responding means, data providing direction writes interaction data in a shared memory, the interaction data including a data status bit that identifies whether the interaction data is valid;

the data provider is the handshake initiating device or the handshake responding device.

5. The instrument control device data interaction handshake method according to claim 4, wherein after the handshake initiating device establishes a communication connection with the handshake responding device, a data acquirer judges whether the interaction data is valid through the data status bit, and reads the interaction data when the interaction data is valid;

the data acquirer is the handshake initiating device or the handshake responding device.

6. The instrument control device data interaction handshake method according to claim 1, wherein the handshake responding means is a CPU board.

7. The instrument control device data interaction handshake method according to any one of claims 1 to 6, characterized in that the handshake initiating means is a functional board.

8. The instrument control device data interaction handshaking method of claim 7, wherein the functional boards comprise input-class boards and output-class boards.

9. The instrument control device data interaction handshake method according to claim 8, wherein when the functional board is the input board, the input board writes at least one time of valid interaction data into the shared memory before the input board sends the handshake request message.

10. The instrument control device data interaction handshake method according to claim 8, wherein when the functional board is the output-class board, the handshake responding means writes at least one time of valid interaction data into a shared memory before the handshake responding means responds to handshake.

Technical Field

The invention relates to the technical field of nuclear energy system instruments and control, in particular to an instrument control equipment data interaction handshake method.

Background

The digital instrument control equipment comprises a main controller (CPU board), a function board, a power supply, a back board, a case and the like. In the equipment, a CPU board card and a function board card are arranged on different slots of a back plate of the same case, and data interaction is carried out through a back plate bus which is interconnected among the slots; running an equipment application program in the CPU board card to realize the functions of equipment calculation, processing, control and the like; the function board card comprises various types, such as switching value input/output, analog value input/output, rotating speed measurement, temperature acquisition, CAN communication, Ethernet communication and the like, and is used for realizing various special functions so as to meet various application requirements of an instrument control field.

In the digital instrument control device architecture, a typical shared memory mechanism is designed to realize asynchronous data interaction between a CPU board card and a function board card, namely, a dual-port SRAM (hereinafter referred to as dual-port RAM) externally hung on a Microprocessor (MCU) on the function board card is used as a shared memory, and the CPU board card accesses the dual-port RAM on each function board card through a backboard bus so as to realize data interaction with the MCU on each function board card.

In practical engineering application, due to the fact that the starting durations of the CPU board card and the functional board card are inconsistent, the board cards run independently and asynchronously after being powered on, and the situations of board card hot plug, self-checking reset and the like exist, the situation that data in the CPU board card and the functional board card are read from the dual-port RAM by a data acquisition party in a certain time after equipment is powered on or the board cards are reset occurs, and therefore the equipment is in an uncontrolled state.

In order to ensure the effectiveness and reliability of communication in an asynchronous system, a handshake mechanism is usually used to achieve synchronization between two communication parties. The conventional "request/acknowledge" type handshake mechanism is generally: after the function board card is started, actively writing a handshake request into the onboard double-port RAM, wherein the identification is ready; and after the CPU board card recognizes the request, writing a handshake response into the double-port RAM of the corresponding function board card so as to establish communication connection. In this way, communication synchronization can be established between the CPU board and the function board. However, the request/response mechanism cannot identify the board card type, and cannot realize accurate handshake and interaction.

Disclosure of Invention

The invention aims to provide a data interaction handshake method for instrument control equipment, which realizes type identification and communication synchronization between a CPU board card and a function board card in the equipment so as to ensure the accuracy of data interaction between the CPU board card and the function board card.

The invention is realized by the following technical scheme:

a data interaction handshake method for instrument control equipment comprises the following steps:

the handshake initiating device sends a handshake request message, wherein the handshake request message comprises a handshake request identifier;

the handshake initiating device receives a handshake response message; the handshake response message is sent by a handshake response device, the handshake response message comprises a handshake response identifier, and the handshake response identifier is obtained according to the handshake request identifier;

the handshake initiating device judges the handshake response identification, and when the handshake response identification is consistent with a preset handshake response identification, the handshake initiating device establishes communication connection with the handshake responding device.

The conventional "request/acknowledge" type handshake mechanism is generally: after the function board card is started, actively writing a handshake request into the onboard double-port RAM, wherein the identification is ready; and after the CPU board card recognizes the request, writing a handshake response into the double-port RAM of the corresponding function board card so as to establish communication connection. In this way, communication synchronization can be established between the CPU board and the function board. However, the request/response mechanism cannot identify the type of the functional board card, cannot realize accurate handshake and interaction, and is prone to handshake errors, which is absolutely not allowed in the field of nuclear industry. Based on this, after long-term research, the inventor provides a data interaction handshake method for instrument control equipment, and although in the handshake method, a request/response mode is still adopted between a CPU board card and a function board card for communication handshake, the difference is that in the method, an independent and unique type number is set for each type of function board card, and a handshake request identifier and a handshake response identifier uniquely corresponding to each type of function board card are designed accordingly, so that identification and precise interaction of each function board card are realized, and safe and reliable operation of the instrument control equipment is ensured.

Preferably, the handshake request identification is obtained by:

Y=0x30|boardNum;

wherein Y represents a handshake request identifier, 0x30 represents a handshake request, | represents or, and boardNum represents a number of a handshake initiating device.

Preferably, the handshake reply identification is obtained by:

N=0x50|boardNum;

where N denotes a handshake response identifier, 0x50 denotes a response request, | denotes a number of a handshake initiator, or, a boordnum denotes a number of a handshake initiator.

Preferably, after the handshake initiating device establishes a communication connection with the handshake responding device, interactive data is written in the shared memory by the data providing direction, where the interactive data includes a data status bit that identifies whether the interactive data is valid;

the data provider is the handshake initiating device or the handshake responding device.

Preferably, after the handshake initiating device establishes communication connection with the handshake responding device, the data acquirer judges whether the interaction data is valid through the data status bit, and reads the interaction data when the interaction data is valid;

the data acquirer is the handshake initiating device or the handshake responding device.

Preferably, the handshake responding device is a CPU board card.

Preferably, the handshake initiating device is a functional board card.

Preferably, the functional board includes an input board and an output board.

Preferably, when the functional board is the input board, before the input board sends the handshake request message, the input board writes at least one time of valid interactive data into the shared memory.

Preferably, when the functional board card is the output board card, before the handshake response device makes a handshake response, the handshake response device writes at least one time of valid interactive data into the shared memory.

Compared with the prior art, the invention has the following advantages and beneficial effects:

1. setting an independent and unique type number for each type of functional board card, and designing a handshake request and a response identifier which are uniquely corresponding to each type of functional board card according to the independent and unique type number so as to realize identity identification and accurate interaction;

2. aiming at the functional characteristics of various functional board cards, different handshaking flows are designed: before a handshake request or response, a data provider writes effective data at least once, and after the CPU board card and each function board card successfully handshake, a data acquirer can read effective interactive data from a shared memory at the first time;

3. and a data state bit is added in the data interaction process of the CPU board card and the function board card to identify whether the interaction data is valid or not, and a data acquisition party reads the data and executes subsequent operation after confirming that the data is valid, so that the reliability of the data interaction between the CPU board card and the function board card is further improved.

Drawings

The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention. In the drawings:

FIG. 1 is a schematic diagram of a data interaction handshake flow of a CPU board card according to the present invention;

FIG. 2 is a schematic diagram of a data interaction handshake process of an input-class board card according to the present invention;

fig. 3 is a schematic diagram of an output board card data interaction handshake flow according to the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to examples and accompanying drawings, and the exemplary embodiments and descriptions thereof are only used for explaining the present invention and are not meant to limit the present invention.

Examples

A data interaction handshake method for instrument control equipment comprises the following steps:

the handshake initiating device sends a handshake request message, wherein the handshake request message comprises a handshake request identifier;

the handshake request identifier in this embodiment is obtained by the following equation:

Y=0x30|boardNum; (1)

wherein Y represents a handshake request identifier, 0x30 represents a handshake request, | represents or, and boardNum represents a number of a handshake initiating device.

It should be noted that the number of the handshake initiating apparatus in this embodiment is preset. For example, in this embodiment, the handshake initiating device is set as a functional board, and the board numbers of the functional boards are shown in table 1;

TABLE 1 functional Board card type numbering

Serial number Card type Plate card number (born dNum)
1 Switching value input 0
2 Switching value output 1
3 Switching value input/output 2
4 Analog input 3
5 Analog output 4
6 Rotational speed measurement 5
7 Temperature acquisition 6
8 RS485 communication 7
9 Ethernet communication 8
10 CAN communication 9

Assuming that the analog input board card needs to send a handshake request message, the analog input board card first calculates a handshake request identifier Y according to formula (1), and as can be seen from table 1, the board number of the analog input board card is 3, so the handshake request identifier of the analog input board card is: and Y is 0x30|3, after the analog input board card acquires the handshake request identifier, the handshake request identifier is sent to a handshake response device, and the handshake response device identifies the handshake request identifier and sends the handshake request identifier to a handshake initiation device according to the handshake request identifier matched with the corresponding handshake response identifier.

The handshake response identifier described in this embodiment is obtained according to the board number of the functional board shown in table 1 and the formula (2):

N=0x50|boardNum; (2)

where N denotes a handshake response identifier, 0x50 denotes a response request, | denotes a number of a handshake initiator, or, a boordnum denotes a number of a handshake initiator. For example, the functional board card that needs to perform "request/response" is the analog input board card, and as can be seen from table 1, the board number of the analog input board card is 3, so the handshake response identifier of the analog input board card is: n ═ 0x50| 3.

Specifically, in this embodiment, the handshake response device is set as a CPU board card, and the CPU board card stores in advance a handshake response identifier matching the handshake request identifier, that is: one handshake request identification corresponds to one handshake answer identification. In the actual operation process, the CPU board polls each functional board to find out whether the functional board sends a handshake request to the CPU board, and when the CPU board recognizes that the functional board sends the handshake request to the functional board, the CPU board obtains a handshake request identifier in the handshake request and sends the handshake request identifier to the functional board according to the handshake request identifier matched with the corresponding handshake response identifier. The specific matching process may be: when the CPU function board card identifies the handshake request identification, extracting the number (board card number) of a handshake initiating device in the handshake request identification; and searching the handshake answer identification with the number of the handshake initiating device in the stored handshake answer identifications according to the number of the handshake initiating device.

And the handshake initiating device receives the handshake response message, judges the handshake response identification, and establishes communication connection with the handshake responding device when the handshake response identification is consistent with the preset handshake response identification.

The conventional "request/acknowledge" type handshake mechanism is generally: after the function board card is started, actively writing a handshake request into the onboard double-port RAM, wherein the identification is ready; and after the CPU board card recognizes the request, writing a handshake response into the double-port RAM of the corresponding function board card so as to establish communication connection. In this way, communication synchronization can be established between the CPU board and the function board. However, the request/response mechanism cannot identify the type of the functional board card, cannot realize accurate handshake and interaction, and is prone to handshake errors, which is absolutely not allowed in the field of nuclear industry. Based on this, after long-term research, the inventor proposes a data interaction handshake method for instrument control equipment, and although in the handshake method, a "request/response" manner is still used for communication handshake between a CPU board card and a function board card, the difference is that in the method, an independent and unique type number (as shown in table 1) is set for each type of function board card, and a handshake request identifier and a handshake response identifier (as shown in formula 1 and formula 2) uniquely corresponding to each type of function board card are designed according to the type of function board card, so as to realize identity identification and precise interaction of each function board card, and ensure safe and reliable operation of the instrument control equipment.

In addition, in this scheme, in order to further improve the reliability of data interaction between the CPU board card and the functional board card, in this embodiment, a data status bit is added in the data interaction process between the CPU board card and the functional board card, and is used to identify the status (valid or invalid) of the interactive data, and the data acquirer reads the data and executes subsequent operations after confirming that the data is valid, specifically, the method includes:

after the handshake initiating device and the handshake responding device establish communication connection, the data providing direction writes interactive data into the shared memory, the written interactive data in this embodiment includes a data status bit in addition to the source data, and the data status bit is used for indicating whether the source data is valid; when the data acquisition party reads the interactive data from the shared memory, whether the source data in the interactive data is valid is judged by identifying the data state bit in the interactive data, and the source data in the interactive data is read when the interactive data is valid.

In this embodiment, the data provider and the data acquirer are function boards or CPU boards.

Further, in this scheme, to the functional characteristics of each function integrated circuit board in the core industry application field, different flow of shaking hands have been designed: before a handshake request or response, at least one time of effective data is written in by a data provider, and after the CPU board card and each function board card are successfully handshake, the data acquirer can read effective data from the shared memory at the first time, so that a data vacuum period is avoided, and the system is ensured to execute effective operation. Namely: for an input type function board card, the input type function board card comprises switching value input, analog value input, rotating speed measurement, temperature acquisition and the like, and before the input type function board card initiates a handshake request to a CPU board card, the input type function board card is required to write at least one time of effective data into a shared memory; for the output functional board card, including the switching value output and the analog value output, before the CPU board card responds to the handshake, the CPU board card should write at least once valid data into the common memory, specifically, as shown in fig. 1 to fig. 3:

fig. 1 is a schematic diagram of a data interaction handshake flow of a CPU board card, and since different handshake flows are designed for the functional characteristics of different functional board cards, when the CPU board card establishes handshake with a functional board card, the CPU board card firstly judges the type of the functional board card: when the judging function board card is an input board card and establishes communication connection with the input board card, the validity of the interactive data is judged firstly instead of directly reading the interactive data from the shared memory, and when the judging function board card is judged to be valid, the interactive data is read, and the valid identifier of the interactive data is eliminated; when the functional board card is judged to be an output board card and is in communication connection with the output board card, writing source data and a data effective signal (data state bit) into the shared memory by the CPU board card, wherein the data effective signal is inserted into the source data; when the functional board card is judged to be the output board card and the communication connection with the output board card is not established, the CPU board card firstly writes at least one time of effective interactive data into the shared memory and then establishes the communication connection with the output board card.

Fig. 2 is a schematic diagram of a data interaction handshake flow of an input board card, before the input board card initiates a handshake to the CPU board card, the input board card writes at least one time of valid interaction data into the shared memory, and then initiates a handshake request to the CPU board card, and after the handshake connection is successful, the input board card sequentially writes valid interaction data and a data valid signal (data status bit) into the shared memory.

Fig. 3 is a schematic diagram of a data interaction handshake flow of the output-type board card, after the output-type board card and the CPU board card establish communication connection, the data validity is determined first instead of directly reading the interaction data from the shared memory, and when the interaction data is determined to be valid, the interaction data is read, and the valid identifier of the interaction data is removed.

In summary, the present application provides an improved data interaction handshake method that can be used between a CPU board and a functional board of a digital instrument control device, and different handshake flows are provided for different types of boards in the instrument control device, and a type code, a "request/response" identifier, and a data status bit are comprehensively used to implement board identification, communication synchronization, and effective data interaction between the CPU board and the functional board, thereby ensuring safe and reliable operation of the instrument control device. The problem that the traditional 'request/response' type handshake mechanism cannot completely meet the requirements of safe and reliable operation of the digital instrument control equipment of the nuclear energy system is solved.

The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种模块化高密度分布式服务器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!