Master-slave polling method, equipment, device, storage medium and program product

By determining the identity of the internal device according to the identity of the external device in the same HART communication network and building corresponding communication links, the problem of additional networking in the prior art is solved, and the effect of reducing networking costs and improving data acquisition efficiency is achieved.

CN119341956BActive Publication Date: 2025-04-29TANCY INSTR GRP +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411885546.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-29
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

When the existing master-slave polling method needs to collect indicator data measured by smart instruments, it needs to form an additional network to increase networking costs, reduce data acquisition efficiency, and affect user experience.

Method used

In the same HART communication network, by accessing internal devices and external devices, the identity of internal devices (host or slave) is determined based on the identity of external devices, the corresponding communication link is constructed, and the target query information is determined to realize data collection and transmission.

Benefits of technology

There is no need for additional networking, which reduces networking costs, improves data collection efficiency, and improves user experience, so as to realize that internal devices can query data from external devices as hosts, and can also be queried by external devices as slaves.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119341956B_ABST
    Figure CN119341956B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a master-slave polling method, equipment, device, storage medium and program product. It relates to the field of communication, and is specifically applied to HART communication equipment, including: in response to accessing an internal device and at least one external device, determining the first identity of the internal device according to each external device in turn; the internal device and at least one external device are located in the same HART communication network, and the first identity is a host identity or a slave identity; according to the first identity, a communication link is established between the internal device and the external device, and the target query information is determined; when the first identity is the host identity, the target data in the external device is sent to the internal device according to the communication link and the target query information; when the first identity is the slave identity, the target data in the internal device is sent to the external device according to the communication link and the target query information. This method is used to reduce networking costs, improve acquisition efficiency, and improve user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a master-slave polling method, equipment, device, storage medium and program product. Background Art

[0002] With the continuous development of measurement technology and communication fields, it is necessary to use intelligent instruments, such as flow meters, to measure the index data of multiple transmission media in the urban pipeline network, such as temperature sensors, temperature and pressure transmitters, etc., which involves master-slave polling.

[0003] Currently, when polling the master and slave, it is generally based on the need to measure the index data of each transmission medium, and a network is formed according to the HART (Highway Addressable Remote Transducer) communication protocol, and smart meters are deployed as the host and multiple transmission media as slaves. Based on this network, the smart meters measure the index data of each transmission medium in a specified order.

[0004] However, this master-slave polling method requires additional networking based on the HART communication protocol when it is necessary to collect indicator data measured by smart instruments, and deploy smart instruments as slaves and collection devices as hosts to collect indicator data measured by smart instruments, which increases networking costs, reduces data collection efficiency, and affects user experience. Summary of the invention

[0005] The embodiments of the present application provide a master-slave polling method, device, apparatus, storage medium and program product to reduce networking costs, improve collection efficiency and improve user experience.

[0006] In a first aspect, an embodiment of the present application provides a master-slave polling method, which is applied to a HART communication device, and the method includes: in response to accessing an internal device and at least one external device, determining a first identity of the internal device according to each of the external devices in turn; the internal device and the at least one external device are located in the same HART communication network, and the first identity is a master identity or a slave identity;

[0007] According to the first identity, a communication link is established between the internal device and the external device, and target query information is determined;

[0008] When the first identity is a host identity, sending the target data in the external device to the internal device according to the communication link and the target query information;

[0009] When the first identity is a slave identity, the target data in the internal device is sent to the external device according to the communication link and the target query information.

[0010] In a possible implementation, building a communication link between the internal device and the external device based on the first identity includes: determining a second identity of the external device; the second identity is a HART-supporting identity or a HART-non-supporting identity; and building a communication link between the internal device and the external device based on the first identity of the internal device and the second identity of the external device.

[0011] In a possible implementation, the communication link between the internal device and the external device is established based on the first identity of the internal device and the second identity of the external device, including: when the first identity is a host identity and the second identity is an identity that supports HART, determining the load state required by the external device and matching the corresponding resistance value for the load state; when the first identity is a host identity and the second identity is an identity that does not support HART, controlling the selected interface of the external device to communicate with the built-in interface of the internal device; when the first identity is a slave identity, controlling the selected interface of the external device to communicate with the built-in current interface.

[0012] In a possible implementation manner, before determining the second identity of the external device, the method includes: controlling the channel where the external device is located to communicate with a selected interface of the external device according to an identifier of the channel where the external device is located.

[0013] In a possible implementation, the determining of the target query information includes: when the second identity supports the HART identity, receiving a query instruction, and obtaining the target query information in the query instruction; the target query information includes a plurality of parameters to be queried and a physical quantity to be queried; when the second identity does not support the HART identity, determining the target query information according to the physical properties of the external device; the target query information includes the physical quantity to be queried.

[0014] In one possible implementation, the receiving of the query instruction includes: when the first identity is a host identity, receiving the query instruction sent by the internal device according to multiple parameters to be queried and physical quantities to be queried; when the first identity is a slave identity, receiving the query instruction sent by the external device based on a carrier query signal carrying multiple parameters to be queried and physical quantities to be queried.

[0015] In a possible implementation, when the second identity is a HART-supporting identity, sending the target data in the external device to the internal device according to the communication link and the target query information includes: based on the load state, generating and sending a carrier query signal carrying multiple parameters to be queried and physical quantities to be queried to the external device; receiving and parsing a carrier response signal returned by the external device, carrying multiple parameter data to be queried, and an analog response signal carrying physical quantity data to be queried; and sending multiple parameter data to be queried and physical quantity data to be queried to the internal device.

[0016] In a possible implementation, when the second identity is a HART-unsupported identity, sending the target data in the external device to the internal device based on the communication link and the target query information includes: receiving and parsing an analog response signal sent by the external device according to the physical quantity to be queried and carrying the physical quantity data to be queried through communication between the selected interface of the external device and the built-in interface of the internal device; and sending the physical quantity data to be queried to the internal device.

[0017] In a possible implementation, when the second identity is a HART-supporting identity, sending the target data in the internal device to the external device according to the communication link and the target query information includes: receiving multiple parameter data to be queried and physical quantity data to be queried sent by the internal device according to the multiple parameters to be queried and the physical quantity to be queried through communication between the selected interface of the external device and the built-in current interface; generating and sending a carrier response signal carrying multiple parameter data to be queried and an analog response signal carrying physical quantity data to be queried to the external device, so as to send the multiple parameter data to be queried and the physical quantity data to be queried to the external device.

[0018] In a possible implementation, when the second identity is a HART-unsupported identity, sending the target data in the internal device to the external device based on the communication link and the target query information includes: receiving the physical quantity data to be queried sent by the internal device according to the physical quantity to be queried through communication between the selected interface of the external device and the built-in current interface; generating and sending an analog response signal carrying the physical quantity data to be queried to the external device, so as to send the physical quantity data to be queried to the external device.

[0019] In a second aspect, an embodiment of the present application provides a master-slave polling device, the device comprising: a determination module, for determining a first identity of the internal device in response to accessing an internal device and at least one external device, in turn according to each of the external devices; the internal device and the at least one external device are located in the same HART communication network, and the first identity is a master identity or a slave identity;

[0020] A construction module, configured to construct a communication link between the internal device and the external device according to the first identity;

[0021] The determination module is further used to determine target query information;

[0022] a sending module, configured to send the target data in the external device to the internal device according to the communication link and the target query information when the first identity is a host identity;

[0023] The sending module is further configured to send the target data in the internal device to the external device according to the communication link and the target query information when the first identity is a slave identity.

[0024] In a possible implementation manner, the building module, when building the communication link between the internal device and the external device according to the first identity, is specifically configured to:

[0025] Determine the second identity of the external device; the second identity is a HART-supporting identity or a HART-non-supporting identity; and establish a communication link between the internal device and the external device according to the first identity of the internal device and the second identity of the external device.

[0026] In a possible implementation manner, the construction module, when constructing the communication link between the internal device and the external device according to the first identity of the internal device and the second identity of the external device, is specifically configured to:

[0027] When the first identity is a host identity and the second identity is an identity that supports HART, determine the load state required by the external device and match the corresponding resistance value for the load state; when the first identity is a host identity and the second identity is an identity that does not support HART, control the selected interface of the external device to communicate with the built-in interface of the internal device; when the first identity is a slave identity, control the selected interface of the external device to communicate with the built-in current interface.

[0028] In a possible implementation, the device further includes: a control module;

[0029] The control module is used to control the channel where the external device is located to communicate with the selected interface of the external device according to the channel identifier where the external device is located before the construction module determines the second identity of the external device.

[0030] In a possible implementation manner, the determining module, when determining the target query information, is specifically configured to:

[0031] When the second identity is a HART-supporting identity, a query instruction is received, and the target query information is obtained in the query instruction; the target query information includes multiple parameters to be queried and physical quantities to be queried; when the second identity is a HART-unsupporting identity, the target query information is determined according to the physical properties of the external device; the target query information includes the physical quantity to be queried.

[0032] In a possible implementation manner, the determining module, when receiving the query instruction, is specifically configured to:

[0033] When the first identity is a host identity, receive the query instruction sent by the internal device according to multiple parameters to be queried and physical quantities to be queried; when the first identity is a slave identity, receive the query instruction sent by the external device based on a carrier query signal carrying multiple parameters to be queried and physical quantities to be queried.

[0034] In a possible implementation manner, when the second identity is a HART-supporting identity, the sending module, when sending the target data in the external device to the internal device according to the communication link and the target query information, is specifically used to:

[0035] Based on the load state, a carrier query signal carrying multiple parameters to be queried and physical quantities to be queried is generated and sent to the external device; a carrier response signal carrying multiple parameter data to be queried and an analog response signal carrying physical quantity data to be queried returned by the external device are received and parsed; and the multiple parameter data to be queried and physical quantity data to be queried are sent to the internal device.

[0036] In a possible implementation manner, when the second identity is an identity that does not support HART, the sending module, when sending the target data in the external device to the internal device according to the communication link and the target query information, is specifically used to:

[0037] Through communication between the selected interface of the external device and the built-in interface of the internal device, an analog response signal carrying the physical quantity data to be queried and sent by the external device according to the physical quantity to be queried is received and parsed; and the physical quantity data to be queried is sent to the internal device.

[0038] In a possible implementation manner, when the second identity is a HART-supporting identity, the sending module, when sending the target data in the internal device to the external device according to the communication link and the target query information, is specifically used to:

[0039] Through the communication between the selected interface of the external device and the built-in current interface, multiple parameter data to be queried and physical quantity data to be queried sent by the internal device are received according to the multiple parameters to be queried and the physical quantities to be queried; a carrier response signal carrying the multiple parameter data to be queried and an analog response signal carrying the physical quantity data to be queried are generated and sent to the external device, so as to send the multiple parameter data to be queried and the physical quantity data to be queried to the external device.

[0040] In a possible implementation manner, when the second identity is an identity that does not support HART, the sending module, when sending the target data in the internal device to the external device according to the communication link and the target query information, is specifically used to:

[0041] Through communication between the selected interface of the external device and the built-in current interface, the physical quantity data to be queried sent by the internal device according to the physical quantity to be queried is received; and an analog response signal carrying the physical quantity data to be queried is generated and sent to the external device to send the physical quantity data to be queried to the external device.

[0042] In a third aspect, an embodiment of the present application provides a HART communication device, including: a channel selection component, a load matching and current direction component, a coding and decoding component, a current generating component, and a logic control component;

[0043] The logic control component includes a serial communication interface, which is used to access internal devices; the channel selection component includes at least one HART protocol interface, which is used to access external devices;

[0044] The channel selection component is used to establish a path between the channel where the external device is located and the selected interface of the external device;

[0045] The load matching and current direction component is used to establish a path between the selected interface of the external device and the internal device;

[0046] The encoding and decoding component is used to generate and send a carrier query signal and a carrier response signal, and receive and parse the carrier query signal, the carrier response signal and the analog response signal;

[0047] The current generating component is used to generate and send an analog response signal;

[0048] The logic control component is used to control the channel selection component, load matching and current direction component, encoding and decoding component and current generating component to implement corresponding functions, so as to realize the first aspect and / or various possible implementation methods of the first aspect.

[0049] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0050] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0051] The master-slave polling method, device, apparatus, storage medium and program product provided in the embodiment of the present application, since the internal device and at least one external device are deployed in the same HART communication network, by accessing the internal device and at least one external device, the first identity of the internal device, that is, the host identity or the slave identity, can be determined in turn according to each external device according to the polling rule. And by building a communication link between the internal device and the external device according to the first identity, and determining the target query information, when the first identity is the host identity, the target data in the external device can be sent to the internal device according to the communication link and the target query information, and when the first identity is the slave identity, the target data in the internal device can be sent to the external device according to the communication link and the target query information. As a result, in the same HART communication network, the internal device can act as a host to query data from the external device, and can also act as a slave to be queried by the external device, without the need for additional networking according to the HART communication protocol, reducing the networking cost, improving data acquisition efficiency, and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0053] Figure 1 A schematic diagram of a scenario of a master-slave polling method provided in this application;

[0054] Figure 2 Schematic diagram of the process of the master-slave polling method provided in this application Figure 1 ;

[0055] Figure 3 Schematic diagram of the process of the master-slave polling method provided in this application Figure 2 ;

[0056] Figure 4 A schematic diagram of the structure of the master-slave polling device provided in this application;

[0057] Figure 5 This is a schematic diagram of the structure of the HART communication device provided in this application.

[0058] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0059] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.

[0060] First, the terms involved in this application are explained:

[0061] Carrier signal: the waveform that is modulated to transmit signals, and is the basic signal used to transmit information in communication systems.

[0062] Analog signal: a physical quantity that changes continuously over time, such as temperature, humidity, pressure, length, current, voltage, etc.

[0063] HART communication protocol: an open protocol for communication between field intelligent instruments and control devices.

[0064] HART communication network: that is, HART communication protocol network, which can be implemented in point-to-point mode or multi-point mode. The point-to-point mode is a mode in which one host corresponds to one slave, and the multi-point mode is a mode in which one host corresponds to multiple slaves.

[0065] Master-slave polling: that is, in the above multi-point mode, the master sends queries to the slaves in a certain order, and the slaves passively respond to the above initiation process.

[0066] It should be noted that the polling of the master and slave devices is essentially a process of cyclically executing data queries. In the case of adopting the HART communication protocol, the data query between the master and slave devices is generally transmitted through carrier signals and analog signals, or analog signals, depending on whether the devices support HART communication. That is, the slave device will feed back the carrier signal carrying relevant physical quantity data and relevant attribute data and the analog signal carrying physical quantity data, or the analog signal carrying physical quantity data to the host.

[0067] In the prior art, when the master-slave polling is performed, it is generally performed by the user according to the specific measurement requirements. When it is necessary to use the smart instrument to measure the index data of each transmission medium, for example, when it is necessary to use the flow meter to measure the index data of the temperature sensor, pressure transmitter and other devices, the network is formed according to the HART communication protocol, and the smart instrument is deployed as the host in the network, and the temperature sensor, pressure transmitter and other transmission media are deployed as slaves, so that based on the network, the smart instrument measures the index data of each transmission medium in the specified order. However, under this master-slave polling mode, if it is necessary to use the collection device to collect the index data measured by the smart instrument, for example, it is necessary to use the collection device to collect the index data of the temperature sensor, pressure transmitter and other devices measured by the flow meter, it is also necessary to form a network according to the HART communication protocol, and deploy the collection device as the host in the network, and deploy the smart instrument as the slave, so that based on the network, the collection device collects the index data measured by the smart instrument. This requires additional networking, increases networking costs, reduces data collection efficiency, and affects user experience.

[0068] In view of the above technical problems, the present application proposes the following technical ideas: In order to reduce the networking cost, improve the data collection efficiency, and improve the user experience, instead of networking separately when the smart meter is used as a host or a slave, under the same HART communication network, the smart meter is used as an internal device, and at least one transmission medium and a collection device are used as external devices, so as to flexibly determine the identity of the internal device according to the inserted external device, so that when the internal device is determined to be the host, the internal device is used to query the data of the external device, and when the internal device is determined to be the slave, the external device is used to query the data of the internal device. Then, when it is determined that the internal device and at least one external device are connected, first determine the identity of the internal device as a host or a slave according to each external device in a specified order, and then, based on this identity, build a communication link between the internal device and the external device, and determine the specific information of the data currently required to be queried, so that when the identity is determined to be the host, based on the corresponding link and specific information, the data in the external device is sent to the internal device, and when the identity is determined to be the slave, based on the corresponding link and specific information, the data in the internal device is sent to the external device. In the same HART communication network, the internal device can act as a host to query data from external devices, or as a slave to be queried by external devices. There is no need for additional networking according to the HART communication protocol, which reduces networking costs, improves data collection efficiency, and improves user experience.

[0069] Figure 1 A schematic diagram of the master-slave polling method provided in this application, such as Figure 1 As shown, the specific application scenarios of the present application include: HART communication device 1, internal device 2, and external device cluster 3. Among them, HART communication device 1 is a device set based on the HART communication protocol, which is used to execute the above-mentioned master-slave polling method. Internal device 2 is any kind of intelligent instrument, which is used to query the data of the transmission medium or be queried by the acquisition device. The external device cluster 3 includes at least one external device, which is a transmission medium or an acquisition device. Among them, the HART communication device 1 is respectively communicated with the internal device 2 and the external device cluster 3. First, the internal device and at least one external device are deployed in the same HART communication network, and the internal device and at least one external device are connected to the HART communication device 1. Then, in response to the access to the internal device and at least one external device, the HART communication device 1 determines the first identity of the internal device, that is, the host identity or the slave identity, according to each external device in turn, and builds a communication link between the internal device and the external device according to the first identity, and further determines the target query information, so that when the first identity is the host identity, the target data in the external device is sent to the internal device according to the communication link and the target query information, and when the first identity is the slave identity, the target data in the internal device is sent to the external device according to the communication link and the target query information.

[0070] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0071] Figure 2 Schematic diagram of the master-slave polling process provided for this application Figure 1 ,like Figure 2 As shown, the execution subject of the present application is a master-slave polling device, and the master-slave polling device is located in a HART communication device. The master-slave polling method provided in this embodiment includes the following steps:

[0072] S201. In response to accessing an internal device and at least one external device, determining a first identity of the internal device according to each external device in turn; the internal device and at least one external device are located in the same HART communication network, and the first identity is a host identity or a slave identity.

[0073] The internal device is any intelligent meter used to record certain indicator data, such as a flow meter, an intelligent water meter, an intelligent gas meter, etc. This embodiment does not limit the specific use of the internal device.

[0074] The external device is any transmission medium used to monitor the fluctuation of certain indicator data, or any collection device used to collect certain indicator data.

[0075] The first identity is used to characterize the identity of the internal device in the HART communication network, and can be a host identity or a slave identity. The host identity is the identity of the device to be queried, and the slave identity is the identity of the device to be queried.

[0076] It is understandable that when executing data query in the same HART communication network, generally one device is the host and the other device is the slave, and the host queries and the slave feeds back the corresponding data. Therefore, after connecting the internal device and at least one external device, by identifying the specific use of each external device in turn according to the specified order, the role of the internal device when communicating with each external device can be determined according to the corresponding specific use. The specified order is a pre-configured order by the user, which can be specifically the address order of each external device, or a user-defined order. This embodiment does not limit the specific order.

[0077] Based on this, the HART communication device responds to the current connection to the internal device and at least one external device, and identifies the specific use of each external device in turn according to the specified order. If the external device is determined to be a transmission medium for monitoring certain indicator data, it is determined that when the external device communicates with the internal device, the role played by the external device is a slave, and the role played by the internal device is a host. If the external device is determined to be a collection device for collecting certain indicator data, it is determined that when the external device communicates with the internal device, the role played by the external device is a host, and the role played by the internal device is a slave, thereby determining the first identity of the internal device.

[0078] S202: Establish a communication link between the internal device and the external device according to the first identity, and determine target query information.

[0079] In this embodiment, based on the result of determining the first identity of the internal device, a communication link is established between the internal device and the external device with which the internal device currently needs to communicate. The communication link is a link through which the relevant signals and data flow when executing a specific data query process.

[0080] It is understandable that when the internal device is a host, it needs to receive a carrier signal and an analog signal, or an analog signal, carrying specific data sent by an external device. When the internal device is a slave, it needs to send a carrier signal and an analog signal, or an analog signal, carrying specific data to the external device. This involves whether an analog signal needs to be generated. Therefore, the data query process performed in these two cases involves different links through which the relevant signals and data flow.

[0081] Specifically, when the first identity is a host identity, the internal device is determined to be a host, the external device is determined to be a slave, and a communication link between the internal device and the external device is directly established. When the first identity is a slave identity, the external device is determined to be a host, the internal device is determined to be a slave, and a communication link between the internal device and the external device is established through a component that generates an analog signal.

[0082] It is understandable that after the communication link is established, the specific data that the host needs to query needs to be determined, based on which the target query information is determined. The target query information is used to characterize the relevant features of the specific data that the host needs to query.

[0083] For example, if the specific data that the host needs to query is temperature data, the target query information may be the field where "temperature" is located. This example is only for example and should not constitute any limitation to the present application.

[0084] Specifically, according to the first identity, when the first identity is a host identity, the target query information required to be queried by the internal device is determined by communicating with the internal device; when the first identity is a slave identity, the target query information required to be queried by the external device is determined by communicating with the external device.

[0085] S203: When the first identity is a host identity, the target data in the external device is sent to the internal device according to the communication link and the target query information.

[0086] The target data is the specific data that the host needs to query, such as the specific temperature data that the host needs to query. This embodiment does not limit the content of the target data.

[0087] In this embodiment, when the first identity is determined to be the host identity, the internal device is determined to be the host, and the external device communicating with it is determined to be the slave. According to the target query information, the target data fed back by the external device is received through the communication link, and the target data is sent to the internal device through the communication link to complete the data query process.

[0088] S204: When the first identity is a slave identity, the target data in the internal device is sent to the external device according to the communication link and the target query information.

[0089] In this embodiment, when the first identity is determined to be a slave identity, the external device is determined to be a host and the internal device is determined to be a slave, and based on the target query information, the target data fed back by the internal device is obtained, and the target data is sent to the internal device through a communication link including an analog signal generation component to complete the data query process.

[0090] The master-slave polling method provided in the embodiment of the present application, since the internal device and at least one external device are deployed in the same HART communication network, by accessing the internal device and at least one external device, the first identity of the internal device, that is, the host identity or the slave identity, can be determined in turn according to each external device according to the polling rule. And by building a communication link between the internal device and the external device according to the first identity, and determining the target query information, when the first identity is the host identity, the target data in the external device can be sent to the internal device according to the communication link and the target query information, and when the first identity is the slave identity, the target data in the internal device can be sent to the external device according to the communication link and the target query information. As a result, in the same HART communication network, the internal device can act as a host to query data from the external device, and can also act as a slave to be queried by the external device, without the need for additional networking according to the HART communication protocol, reducing the networking cost, improving data acquisition efficiency, and improving user experience.

[0091] As an optional embodiment, this embodiment further refines the construction of a communication link between an internal device and an external device according to the first identity based on the above embodiment. When the communication link between the internal device and the external device is constructed according to the first identity, this embodiment specifically includes the following steps:

[0092] Step a1: Determine the second identity of the external device; the second identity is a HART-supporting identity or a HART-non-supporting identity.

[0093] The second identity is used to characterize whether the external device supports HART communication, and can be a HART-supporting identity or a HART-non-supporting identity. The HART-supporting identity is a device identity that supports communication under the HART communication protocol, and the HART-non-supporting identity is a device identity that does not support communication under the HART communication protocol.

[0094] It is understandable that some external devices are configured with the HART support function, while some external devices are not configured with the HART support function.

[0095] When the HART function is supported, if the internal device is the host and the external device is the slave, it is necessary to receive the carrier signal and analog signal carrying the target data sent by the external device; if the internal device is the slave and the external device is the host, it is necessary to send the carrier signal and analog signal carrying the target data to the external device. When the HART function is not supported, if the internal device is the host and the external device is the slave, it is necessary to receive the analog signal carrying the target data sent by the external device; if the internal device is the slave and the external device is the host, it is necessary to send the analog signal carrying the target data to the external device. This not only involves whether the analog signal needs to be generated, but also involves the related processing of the carrier signal.

[0096] Therefore, when building a communication link between the internal device and the external device based on the first identity, it is also necessary to further consider the second identity corresponding to the external device currently communicating with the internal device.

[0097] Specifically, the HART communication protocol is used to authenticate the above-mentioned external device. For example, an authentication command can be sent to the above-mentioned external device, and a response of the external device to the command can be received. If the expected result is returned, it is determined that the authentication is successful, and the second identity of the above-mentioned external device is that it supports HART. If the external device does not return the expected result, it is determined that the authentication has failed, and the second identity of the above-mentioned external device is that it does not support HART.

[0098] It is understandable that the above examples are only specific, and this application does not limit the method of authenticating external devices.

[0099] Step a2: Building a communication link between the internal device and the external device according to the first identity of the internal device and the second identity of the external device.

[0100] In this embodiment, after determining the second identity of the external device, it is determined whether an analog signal needs to be generated and the specific processing content that needs to be performed on the carrier signal based on the first identity of the internal device and the second identity of the external device. Based on the determination result, a communication link is established between the internal device and the external device in different situations.

[0101] The master-slave polling method provided in the embodiment of the present application, since the external device may support HART or may not support HART, by determining the second identity of the external device, that is, supporting HART identity or not supporting HART identity, the first identity of the internal device and the second identity of the external device can be comprehensively considered, so as to construct a communication link between the internal device and the external device in different situations, thereby accurately constructing the communication link and improving the success rate of subsequent data query based on the communication link.

[0102] As an optional embodiment, this embodiment further refines the construction of a communication link between the internal device and the external device according to the first identity of the internal device and the second identity of the external device on the basis of the above embodiment. When the communication link between the internal device and the external device is constructed according to the first identity of the internal device and the second identity of the external device, this embodiment specifically includes the following steps:

[0103] Step b1: When the first identity is a host identity and the second identity is a HART-supporting identity, determine the load state required by the external device and match the corresponding resistance value for the load state.

[0104] The load state refers to the characteristics of the external device when it is working, such as the power, current and voltage required to be consumed, which involves the setting of the resistance value. It can be understood that for different load states, the resistance value required to be matched in the circuit is also different.

[0105] In this embodiment, in response to building a communication link between the internal device and the external device based on the first identity of the internal device and the second identity of the external device, if the first identity is the host identity and the second identity is the HART-supporting identity, it means that it is necessary to receive the carrier signal and the analog signal carrying the target data sent by the external device, and it is necessary to parse the received carrier signal. Then, through communication with the external device, the resistance value required for the external device to reach the load state is determined, and based on the above resistance value, the resistance value within the allowable range of the HART communication protocol is increased to match it, thereby forming a communication link between the internal device and the external device based on the matched load state.

[0106] Step b2: When the first identity is a host identity and the second identity is a non-HART-supporting identity, controlling the selected interface of the external device to communicate with the built-in interface of the internal device.

[0107] The selected interface of the external device is an interface used to connect to a certain external device when the external device is selected to communicate with the internal device in a specified order.

[0108] The built-in interface of the internal device is a connection point set inside the internal device for communication for data exchange.

[0109] In this embodiment, if the first identity is a host identity and the second identity is an identity that does not support HART, it means that it is necessary to receive an analog signal carrying target data sent by an external device, and no processing of the carrier signal is involved. The selected interface of the external device directly communicates with the built-in interface of the internal device, thereby forming a communication link between the internal device and the external device based on the connection between the two.

[0110] Step b3: When the first identity is a slave identity, controlling the selected interface of the external device to communicate with the built-in current interface.

[0111] Among them, the built-in current interface is an interface set inside the HART communication device and is used to transmit analog current signals.

[0112] In this embodiment, if the first identity is a slave identity, it means that regardless of whether the second identity supports HART, an analog signal carrying target data must be sent to the external device, and the selected interface of the external device communicates with the built-in current interface, thereby forming a communication link between the internal device and the external device based on the connection between the two.

[0113] The master-slave polling method provided in the embodiment of the present application establishes different communication links in different situations. Therefore, when the first identity is the host identity and the second identity is the HART-supporting identity, the load state required by the external device is determined, and the corresponding resistance value is matched to the load state. When the first identity is the host identity and the second identity is the HART-unsupporting identity, the selected interface of the external device is controlled to communicate with the built-in interface of the internal device, and when the first identity is the slave identity, the selected interface of the external device is controlled to communicate with the built-in current interface. In this way, different communication links can be successfully established, thereby improving the success rate of data query based on different communication links.

[0114] As an optional embodiment, based on the above embodiment or the previous embodiment, this embodiment includes the following steps before determining the second identity of the external device:

[0115] According to the channel identifier of the external device, the channel where the external device is located is controlled to communicate with the selected interface of the external device.

[0116] The channel identifier is used to characterize the identity of the channel where the external device is located, and the channel where the external device is located is the channel used when connecting at least one external device.

[0117] It can be understood that a prerequisite for the execution of this embodiment is that the external device that currently needs to communicate with the internal device has been selected in a specified order.

[0118] Based on this, before determining the second identity of the external device, each channel used to connect the external device can be marked in advance to obtain at least one channel mark. Then, in response to the needs of selecting the external device, the level combination corresponding to the channel mark of the external device is determined and configured, so that the channel where the external device is located is selected according to the configuration result, and the channel communicates with the selected interface of the set external device.

[0119] When determining and configuring the level combination corresponding to the channel mark where the external device is located, it can be specifically: pre-store the mapping relationship between each channel mark and the corresponding level combination, and then set each control pin responsible for channel selection to a corresponding level according to the mapping relationship. The number of channels = 2 is the number of control pins responsible for channel selection.

[0120] The master-slave polling method provided in the embodiment of the present application requires first selecting an external device that communicates with an internal device. Therefore, the external device can be selected by controlling the communication between the channel where the external device is located and the selected interface of the external device according to the channel identifier where the external device is located, thereby building a communication link based on the selected external device, thereby improving the success rate of subsequently establishing a communication link.

[0121] As an optional embodiment, this embodiment further refines the determination of the target query information based on the above-mentioned previous embodiment. When determining the target query information, this embodiment specifically includes the following steps:

[0122] Step c1: When the second identity is a HART-supporting identity, a query instruction is received, and target query information is obtained in the query instruction; the target query information includes a plurality of parameters to be queried and a physical quantity to be queried.

[0123] The query instruction is a query instruction sent by the host, and may specifically include target query information.

[0124] In this embodiment, the target query information includes multiple parameters to be queried and physical quantities to be queried. The multiple parameters to be queried are multiple parameters that the host needs to query, and specifically may include various parameters related to the slave attributes that the host needs to query, and physical quantities that the host needs to query. The physical quantity to be queried is the physical quantity that the host needs to query.

[0125] Based on this, if the external device supports HART, it means that no matter whether the host is an internal device or an external device, it will actively initiate a query based on the HART communication protocol, receive the query command sent by the host, and obtain the target query information in the query command, that is, multiple parameters to be queried and physical quantities to be queried.

[0126] Step c2: When the second identity is an identity that does not support HART, determine the target query information according to the physical properties of the external device; the target query information includes the physical quantity to be queried.

[0127] The physical property is used to characterize the physical characteristics of the external device. For example, if the external device is a temperature sensor, its physical property can be determined to be temperature.

[0128] In this embodiment, the target query information only includes the physical quantity to be queried.

[0129] Based on this, if the second identity is a HART-unsupported identity, it means that no matter whether the host is an internal device or an external device, it will not actively initiate a query. Then, according to the specific use of the external device, its physical properties are determined, and the physical properties are determined as the physical quantity to be queried, thereby determining the target query information.

[0130] In the master-slave polling method provided in the embodiment of the present application, since the host will actively initiate a query when the external device supports HART, when the second identity is a HART-supporting identity, by receiving a query instruction, the target query information containing multiple parameters to be queried and the physical quantity to be queried can be obtained in the query instruction. And when the second identity is a HART-unsupporting identity, the target query information containing the physical quantity to be queried is determined according to the physical properties of the external device, thereby smoothly and quickly determining the target query information, and improving the success rate of subsequent data queries based on the target query information.

[0131] As an optional embodiment, this embodiment further refines the process of receiving the query instruction based on the above embodiment. When receiving the query instruction, this embodiment specifically includes the following steps:

[0132] Step d1: When the first identity is a host identity, receiving a query instruction sent by an internal device according to a plurality of parameters to be queried and a physical quantity to be queried.

[0133] As in the previous embodiment, regardless of whether the host is an internal device or an external device, it will actively initiate a query based on the HART communication protocol. Therefore, when the second identity is an identity that supports HART, if the first identity is a host identity, it means that the internal device is the host. The internal device then generates a query instruction based on the multiple parameters to be queried and the physical quantities to be queried, and sends the above query instruction to the HART communication device based on the serial communication protocol with the HART communication device, such as the 485 protocol.

[0134] Based on this, the HART communication device receives the query command sent by the internal device.

[0135] Step d2: When the first identity is a slave identity, receiving a query instruction sent by an external device based on a carrier query signal carrying a plurality of parameters to be queried and a physical quantity to be queried.

[0136] In this embodiment, if the first identity is a slave identity, it means that the internal device is a slave and the external device is a master. The external device encodes the multiple parameters to be queried and the physical quantities to be queried into a carrier query signal, and uses the carrier query signal as a query instruction, and sends it to the HART communication device through the selected interface of the external device. Among them, the carrier query signal is a signal used to inform the slave of the specific query requirements.

[0137] Correspondingly, the HART communication device receives the query command sent by the external device.

[0138] It is understandable that when the first identity is a slave identity, the target query information is obtained in the query instruction, which may specifically be: parsing the carrier query signal to obtain the target query information including a plurality of parameters to be queried and physical quantities to be queried.

[0139] The master-slave polling method provided in the embodiment of the present application, since the query instructions received by the host are different due to the different devices to which the host belongs, when the first identity is the host identity, by receiving the query instructions sent by the internal device according to multiple parameters to be queried and the physical quantities to be queried, and when the first identity is the slave identity, by receiving the query instructions sent by the external device based on the carrier query signal carrying multiple parameters to be queried and the physical quantities to be queried, the relevant content that the host needs to query can be smoothly determined based on the reception results, thereby improving the success rate of executing data queries under different subsequent first identities.

[0140] As an optional embodiment, based on the fifth or sixth embodiment, when the second identity is a HART-supporting identity, this embodiment further refines the sending of target data in the external device to the internal device according to the communication link and the target query information. When the target data in the external device is sent to the internal device according to the communication link and the target query information, this embodiment specifically includes the following steps:

[0141] Step e1: Based on the load state, a carrier query signal carrying multiple parameters to be queried and physical quantities to be queried is generated and sent to an external device.

[0142] In this embodiment, the first identity is the host identity, and the second identity is the HART-supporting identity, that is, the internal device is the host, and the external device is a slave that supports HART. According to the communication link in this case and the target query information determined in this case, the target data in the external device is sent to the internal device.

[0143] Specifically, under the currently matched load state, multiple parameters and physical quantities to be queried that the internal device needs to query are encoded to obtain a carrier query signal carrying multiple parameters and physical quantities to be queried, and the carrier query signal is sent to the external device through the selected interface of the external device.

[0144] Step e2: receiving and analyzing the carrier response signal carrying multiple parameter data to be queried and the analog response signal carrying the physical quantity data to be queried returned by the external device.

[0145] The analog response signal is a signal generated by the slave based on the need to send the physical quantity to be queried.

[0146] The plurality of parameter data to be queried are data used to characterize the specific conditions of the plurality of parameters to be queried. The physical quantity data to be queried are data used to characterize the specific conditions of the physical quantity to be queried.

[0147] For example, if the physical quantity to be queried is temperature, the physical quantity data to be queried may be specifically 30° C. If the multiple parameters to be queried are temperature, device name, and device address, the multiple parameter data to be queried may be 30° C., device A, and physical address MAC.

[0148] It should be understood that the above examples are only for illustrative purposes and should not constitute any limitation to the present application.

[0149] The carrier response signal is a signal sent by the slave in response to the carrier query signal.

[0150] In this embodiment, after the carrier query signal is sent to the external device, the external device parses the carrier query signal and obtains the data that needs to be fed back based on the analyzed content, that is, multiple parameter data to be queried and physical quantity data to be queried, thereby encoding the multiple parameter data to be queried into a carrier response signal, encoding the physical quantity data to be queried into an analog response signal, and sending the carrier response signal and the analog response signal to the HART communication device through the selected interface of the external device.

[0151] Correspondingly, the HART communication device receives a carrier response signal carrying multiple parameter data to be queried and an analog response signal carrying physical quantity data to be queried returned by the external device, and parses the carrier response signal and the analog response signal respectively to obtain multiple parameter data to be queried and physical quantity data to be queried.

[0152] Step e3: Sending a plurality of parameter data to be queried and physical quantity data to be queried to an internal device.

[0153] In this embodiment, after obtaining a plurality of parameter data to be queried and a plurality of physical quantity data to be queried, the plurality of parameter data to be queried and the plurality of physical quantity data to be queried are sent to the internal device based on a serial communication protocol with the internal device.

[0154] The master-slave polling method provided in the embodiment of the present application has different target data and target data flow directions in different situations. Therefore, when the internal device is the host and the external device is the slave supporting HART, a carrier query signal carrying multiple parameters to be queried and physical quantities to be queried is generated and sent to the external device based on the load state. Then, a carrier response signal carrying multiple parameter data to be queried and an analog response signal carrying physical quantity data to be queried returned by the external device can be received and analyzed respectively. Therefore, by sending multiple parameter data to be queried and physical quantity data to be queried to the internal device, the intelligent instrument can query the data of each transmission medium supporting HART in the HART communication network, thereby improving the success rate of polling.

[0155] As an optional embodiment, based on the fifth or sixth embodiment, this embodiment further refines the sending of target data in the external device to the internal device according to the communication link and the target query information when the second identity is a HART-unsupported identity. When the target data in the external device is sent to the internal device according to the communication link and the target query information, this embodiment specifically includes the following steps:

[0156] Step f1: receiving and parsing an analog response signal carrying data of the physical quantity to be queried and sent by the external device according to the physical quantity to be queried, through communication between the selected interface of the external device and the built-in interface of the internal device.

[0157] In this embodiment, the first identity is the host identity, and the second identity is the non-HART-supporting identity, that is, the internal device is the host, and the external device is the non-HART-supporting slave. According to the communication link in this case and the target query information determined in this case, the target data in the external device is sent to the internal device.

[0158] Specifically, based on the physical quantity to be queried that the internal device needs to query, wait for the external device to encode according to the physical quantity to be queried, obtain an analog response signal carrying the physical quantity data to be queried, and send the analog response signal. Based on this, through the selected interface of the external device, receive the analog response signal sent by the external device and parse it to obtain the physical quantity data to be queried.

[0159] Step f2: Send the physical quantity data to be queried to the internal device.

[0160] In this embodiment, after the physical quantity data to be queried is obtained, the physical quantity data to be queried is sent to the internal device based on the communication between the selected interface of the external device and the built-in interface of the internal device.

[0161] The master-slave polling method provided in the embodiment of the present application has different target data and target data flow directions in different situations. Therefore, when the internal device is the host and the external device is the slave that does not support HART, the selected interface of the external device communicates with the built-in interface of the internal device, and the analog response signal carrying the physical quantity data to be queried sent by the external device according to the physical quantity to be queried is received and analyzed. The obtained physical quantity data to be queried can be sent to the internal device, thereby realizing data query of the intelligent instrument on each transmission medium that does not support HART in the HART communication network, improving the flexibility of polling, and further improving the success rate of polling.

[0162] As an optional embodiment, based on the fifth or sixth embodiment, when the second identity is a HART-supporting identity, this embodiment further refines the sending of target data in the internal device to the external device according to the communication link and the target query information. When the target data in the internal device is sent to the external device according to the communication link and the target query information, this embodiment specifically includes the following steps:

[0163] Step g1: receiving a plurality of parameter data to be queried and a plurality of physical quantity data to be queried sent by an internal device according to a plurality of parameters to be queried and a plurality of physical quantities to be queried through communication between a selected interface of an external device and a built-in current interface.

[0164] In this embodiment, the first identity is a slave identity, and the second identity is a HART-supporting identity, that is, the internal device is a slave, and the external device is a HART-supporting host. According to the communication link in this case and the target query information determined in this case, the target data in the internal device is sent to the external device.

[0165] Specifically, through the serial communication protocol, multiple parameters to be queried and physical quantities to be queried required by the external device are sent to the internal device, so that the internal device sends multiple parameter data to be queried and physical quantity data to be queried to the HART communication device through the serial communication protocol according to the multiple parameters to be queried and physical quantities to be queried. Based on this, the HART communication device receives the multiple parameter data to be queried and physical quantity data to be queried sent by the internal device.

[0166] Step g2: Generate and send a carrier response signal carrying multiple parameter data to be queried and an analog response signal carrying physical quantity data to be queried to the external device, so as to send the multiple parameter data to be queried and the physical quantity data to be queried to the external device.

[0167] In this embodiment, after obtaining a plurality of parameter data to be queried and a physical quantity data to be queried, the plurality of parameter data to be queried are encoded to obtain a carrier response signal carrying the plurality of parameter data to be queried, and the physical quantity data to be queried are converted into an analog current to obtain an analog response signal carrying the physical quantity data to be queried. Based on this, the carrier query signal is sent to the external device through the selected interface of the external device, and the analog response signal is sent to the external device through the communication between the selected interface of the external device and the built-in current interface.

[0168] The master-slave polling method provided in the embodiment of the present application has different target data and target data flow directions in different situations. Therefore, when the internal device is a slave and the external device is a host supporting HART, the communication between the selected interface of the external device and the built-in current interface can receive multiple parameter data to be queried and physical quantity data to be queried sent by the internal device according to the multiple parameters to be queried and the physical quantities to be queried, and can simultaneously generate a carrier response signal carrying the multiple parameter data to be queried and an analog response signal carrying the physical quantity data to be queried, so as to send the above signals to the external device, and then send the multiple parameter data to be queried and the physical quantity data to be queried to the external device, thereby realizing data query of the intelligent instrument by the acquisition device supporting HART in the HART communication network, further improving the flexibility of polling, and further improving the success rate of polling.

[0169] As an optional embodiment, based on the fifth or sixth embodiment, this embodiment further refines the sending of target data in the internal device to the external device according to the communication link and the target query information when the second identity is a HART-unsupported identity. When the target data in the internal device is sent to the external device according to the communication link and the target query information, this embodiment specifically includes the following steps:

[0170] Step h1: receiving the physical quantity data to be queried sent by the internal device according to the physical quantity to be queried through the communication between the selected interface of the external device and the built-in current interface.

[0171] In this embodiment, the first identity is a slave identity, and the second identity is a non-HART-supporting identity, that is, the internal device is a slave, and the external device is a host that does not support HART. According to the communication link in this case and the target query information determined in this case, the target data in the internal device is sent to the external device.

[0172] Specifically, the physical quantity to be queried required by the external device is sent to the internal device through the serial communication protocol, so that the internal device sends the physical quantity data to be queried to the HART communication device through the serial communication protocol according to the physical quantity to be queried. Based on this, the HART communication device receives the physical quantity data to be queried sent by the internal device.

[0173] Step h2: Generate and send to the external device an analog response signal carrying the physical quantity data to be queried, so as to send the physical quantity data to be queried to the external device.

[0174] In this embodiment, after obtaining the physical quantity data to be queried, the physical quantity data to be queried is converted into analog current to obtain an analog response signal carrying the physical quantity data to be queried, and the analog response signal is sent to the external device through communication between the selected interface of the external device and the built-in current interface.

[0175] The master-slave polling method provided in the embodiment of the present application has different target data and target data flow directions in different situations. Therefore, when the internal device is a slave and the external device is a host that does not support HART, the physical quantity data to be queried sent by the internal device according to the physical quantity to be queried can be received through communication between the selected interface of the external device and the built-in current interface, and an analog response signal carrying the physical quantity data to be queried can be generated, and the analog response signal is sent to the external device, and then the physical quantity data to be queried is sent to the external device, thereby realizing data query of the smart instrument by the acquisition device that does not support HART in the HART communication network, further improving the flexibility of polling, and further improving the success rate of polling.

[0176] Figure 3 Schematic diagram of the process of the master-slave polling method provided in this application Figure 2 ,like Figure 3 As shown, this embodiment fully and in detail describes the master-slave polling method. The master-slave polling method provided by the present application is applied to a HART communication device. The method specifically includes:

[0177] S301: In response to accessing an internal device and at least one external device, determine a first identity of the internal device according to each external device in turn.

[0178] Among them, the internal device and at least one external device are located in the same HART communication network, and the first identity is a host identity or a slave identity.

[0179] S302: Control the channel where the external device is located to communicate with the selected interface of the external device according to the channel identifier where the external device is located.

[0180] S303, determining a second identity of the external device, and executing S304-S308, or S309-S312, or S313-S316, or S317-S320 according to the determination results of the first identity and the second identity.

[0181] The second identity is a HART-supporting identity or a HART-non-supporting identity.

[0182] S304: When the first identity is a host identity and the second identity is a HART-supporting identity, determine a load state required by the external device and match a corresponding resistance value for the load state.

[0183] S305, receiving a query instruction sent by an internal device according to multiple parameters to be queried and physical quantities to be queried, and obtaining target query information in the query instruction; the target query information includes multiple parameters to be queried and physical quantities to be queried.

[0184] S306 : Based on the load state, generate and send to an external device a carrier query signal carrying a plurality of parameters to be queried and a physical quantity to be queried.

[0185] S307: Receive and analyze the carrier response signal carrying multiple parameter data to be queried and the analog response signal carrying the physical quantity data to be queried returned by the external device.

[0186] S308, sending the plurality of parameter data to be queried and the physical quantity data to be queried to an internal device.

[0187] S309: When the first identity is a host identity and the second identity is an identity that does not support HART, control the selected interface of the external device to communicate with the built-in interface of the internal device.

[0188] S310. Determine target query information according to physical properties of the external device; the target query information includes a physical quantity to be queried.

[0189] S311. Receive and parse an analog response signal sent by the external device according to the physical quantity to be queried and carrying the data of the physical quantity to be queried, through communication between the selected interface of the external device and the built-in interface of the internal device.

[0190] S312, sending the physical quantity data to be queried to the internal device.

[0191] S313: When the first identity is a slave identity and the second identity is a HART-supporting identity, control the selected interface of the external device to communicate with the built-in current interface.

[0192] S314, receiving a query instruction sent by an external device based on a carrier query signal carrying multiple parameters to be queried and physical quantities to be queried, and obtaining target query information in the query instruction; the target query information includes multiple parameters to be queried and physical quantities to be queried.

[0193] S315 , receiving a plurality of parameter data to be queried and a plurality of physical quantity data to be queried sent by the internal device according to the plurality of parameters to be queried and the physical quantity to be queried through communication between the selected interface of the external device and the built-in current interface.

[0194] S316, generating and sending a carrier response signal carrying a plurality of parameter data to be queried and an analog response signal carrying a physical quantity data to be queried to an external device, so as to send the plurality of parameter data to be queried and the physical quantity data to be queried to the external device.

[0195] S317: When the first identity is a slave identity and the second identity is an identity that does not support HART, control the selected interface of the external device to communicate with the built-in current interface.

[0196] S318. Determine target query information according to the physical properties of the external device; the target query information includes the physical quantity to be queried.

[0197] S319 , receiving the physical quantity data to be queried sent by the internal device according to the physical quantity to be queried through the communication between the selected interface of the external device and the built-in current interface.

[0198] S320: Generate and send an analog response signal carrying the physical quantity data to be queried to the external device, so as to send the physical quantity data to be queried to the external device.

[0199] Figure 4 The schematic diagram of the master-slave polling device provided in this application is as follows: Figure 4As shown, the master-slave polling device 40 provided in this embodiment is located in a HART communication device. The master-slave polling device 40 includes: a determination module 41 , a construction module 42 , and a sending module 43 .

[0200] Among them, the determination module 41 is used to determine the first identity of the internal device according to each external device in turn in response to the access to the internal device and at least one external device; the internal device and at least one external device are located in the same HART communication network, and the first identity is the host identity or the slave identity; the construction module 42 is used to build a communication link between the internal device and the external device according to the first identity; the determination module 41 is also used to determine the target query information; the sending module 43 is used to send the target data in the external device to the internal device according to the communication link and the target query information when the first identity is the host identity; the sending module 43 is also used to send the target data in the internal device to the external device according to the communication link and the target query information when the first identity is the slave identity.

[0201] In a possible implementation manner, the construction module 42, when building a communication link between the internal device and the external device according to the first identity, is specifically configured to:

[0202] Determine the second identity of the external device; the second identity is a HART-supported identity or a HART-unsupported identity; and establish a communication link between the internal device and the external device based on the first identity of the internal device and the second identity of the external device.

[0203] In a possible implementation manner, the construction module 42, when building a communication link between the internal device and the external device according to the first identity of the internal device and the second identity of the external device, is specifically configured to:

[0204] When the first identity is a host identity and the second identity is an identity that supports HART, determine the load state required by the external device and match the corresponding resistance value for the load state; when the first identity is a host identity and the second identity is an identity that does not support HART, control the selected interface of the external device to communicate with the built-in interface of the internal device; when the first identity is a slave identity, control the selected interface of the external device to communicate with the built-in current interface.

[0205] In a possible implementation, the device further includes: a control module;

[0206] The control module is used to control the channel where the external device is located to communicate with the selected interface of the external device according to the channel identifier where the external device is located before the building module 42 determines the second identity of the external device.

[0207] In a possible implementation manner, the determination module 41, when determining the target query information, is specifically configured to:

[0208] When the second identity is a HART-supporting identity, a query instruction is received, and target query information is obtained in the query instruction; the target query information includes multiple parameters to be queried and physical quantities to be queried; when the second identity is a HART-unsupporting identity, the target query information is determined according to the physical properties of the external device; the target query information includes the physical quantity to be queried.

[0209] In a possible implementation manner, the determination module 41, when receiving the query instruction, is specifically configured to:

[0210] When the first identity is a host identity, a query instruction sent by an internal device according to multiple parameters to be queried and physical quantities to be queried is received; when the first identity is a slave identity, a query instruction sent by an external device based on a carrier query signal carrying multiple parameters to be queried and physical quantities to be queried is received.

[0211] In a possible implementation, when the second identity is a HART-supporting identity, the sending module 43, when sending the target data in the external device to the internal device according to the communication link and the target query information, is specifically used to:

[0212] Based on the load status, a carrier query signal carrying multiple parameters to be queried and physical quantities to be queried is generated and sent to an external device; a carrier response signal carrying multiple parameter data to be queried and an analog response signal carrying physical quantity data to be queried returned by the external device are received and parsed; and the multiple parameter data to be queried and physical quantity data to be queried are sent to an internal device.

[0213] In a possible implementation, when the second identity is an identity that does not support HART, the sending module 43, when sending the target data in the external device to the internal device according to the communication link and the target query information, is specifically used to:

[0214] Through the communication between the selected interface of the external device and the built-in interface of the internal device, the analog response signal carrying the physical quantity data to be queried and sent by the external device according to the physical quantity to be queried is received and analyzed; the physical quantity data to be queried is sent to the internal device.

[0215] In a possible implementation, when the second identity is a HART-supporting identity, the sending module 43, when sending the target data in the internal device to the external device according to the communication link and the target query information, is specifically used to:

[0216] Through the communication between the selected interface of the external device and the built-in current interface, multiple parameter data to be queried and physical quantity data to be queried sent by the internal device are received according to the multiple parameters to be queried and the physical quantities to be queried; a carrier response signal carrying the multiple parameter data to be queried and an analog response signal carrying the physical quantity data to be queried are generated and sent to the external device, so as to send the multiple parameter data to be queried and the physical quantity data to be queried to the external device.

[0217] In a possible implementation, when the second identity is an identity that does not support HART, the sending module 43, when sending the target data in the internal device to the external device according to the communication link and the target query information, is specifically used to:

[0218] Through the communication between the selected interface of the external device and the built-in current interface, the physical quantity data to be queried sent by the internal device according to the physical quantity to be queried is received; an analog response signal carrying the physical quantity data to be queried is generated and sent to the external device to send the physical quantity data to be queried to the external device.

[0219] The master-slave polling device provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be described in detail here.

[0220] Figure 5 This is a schematic diagram of the structure of the HART communication device provided in this application. Figure 5 As shown, the HART communication device 50 provided in this embodiment includes: a channel selection component 51, a load matching and current direction component 52, a coding and decoding component 53, a current generating component 54 and a logic control component 55.

[0221] The logic control component 55 includes a serial communication interface 56, and the serial communication interface 56 is used to access internal devices.

[0222] The channel selection component 51 includes at least one HART protocol interface 57, and the HART protocol interface is used to access an external device.

[0223] Among them, the channel selection component 51 is used to establish a path between the channel where the external device is located and the selected interface of the external device; the load matching and current direction component 52 is used to establish a path between the selected interface of the external device and the internal device; the encoding and decoding component 53 is used to generate and send carrier query signals and carrier response signals, and receive and analyze carrier query signals, carrier response signals and analog response signals; the current generating component 54 is used to generate and send analog response signals; the logic control component 55 is used to control the channel selection component 51, the load matching and current direction component 52, the encoding and decoding component 53 and the current generating component 54 to realize corresponding functions.

[0224] It can be understood that the premise for the logic control component 55 to control each component to realize the corresponding function is that the logic control component 55 is connected with each component in advance. Specifically, the logic control component 55 is connected to the channel selection component 51 through the channel selection pins Hart-CH-Addr0, Hart-CH-Addr1, and Hart-CH-Addr2 wires, connected to the load matching and current direction component 52 through the load control pin HART-LOAD-CTL and the current direction control pin HART-CURRENT-DIR wires, connected to the encoding and decoding component 53 through the control pins MCU-HART-TX, MCU-HART-RX, MCU-HART-RTS, and MCU-HART-CD wires, and connected to the current generating component 54 through the communication pins MCU-SPI-CLOCK, MCU-SPI-DATA, and MCU-SPI-LATCH wires.

[0225] Furthermore, the channel selection component 51 is connected to the load matching and current direction component 52 via the Hart-PORT wire of the selected interface of the external device, the load matching and current direction component 52 is connected to the encoding and decoding component 53 via the Hart-PORT wire of the selected interface of the external device, the load matching and current direction component 52 is connected to the internal device wire via the built-in interface AI-PORT of the internal device, and the load matching and current direction component 52 is connected to the current generating component 54 via the built-in current interface CURRENT-OUT wire.

[0226] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0227] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0228] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0229] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0230] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0231] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0232] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0233] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0234] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0235] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A master-slave polling method, characterized in that: The method is applied to an addressable remote sensor high-speed channel HART communication device, and the method comprises: In response to access to an internal device and at least one external device, the purpose of each of the external devices is identified in turn, and the first identity of the internal device is determined according to the purpose of each of the external devices; the internal device and the at least one external device are located in the same HART communication network, the first identity is a host identity or a slave identity, the internal device is any intelligent instrument used to record any kind of indicator data, and the external device is any transmission medium used to monitor the fluctuation of any kind of indicator data, or any collection device used to collect any kind of indicator data; wherein, if it is determined that the external device is the transmission medium, then it is determined that when the external device communicates with the internal device, the first identity of the internal device is the host identity; if it is determined that the external device is the collection device, then it is determined that when the external device communicates with the internal device, the first identity of the internal device is the slave identity; According to the first identity, a communication link is established between the internal device and the external device, and target query information is determined; When the first identity is a host identity, sending the target data in the external device to the internal device according to the communication link and the target query information; When the first identity is a slave identity, the target data in the internal device is sent to the external device according to the communication link and the target query information.

2. The method according to claim 1, characterized in that The establishing a communication link between the internal device and the external device according to the first identity includes: Determine a second identity of the external device; the second identity is a HART-supported identity or a HART-unsupported identity; A communication link between the internal device and the external device is established according to the first identity of the internal device and the second identity of the external device.

3. The method according to claim 2, characterized in that The step of establishing a communication link between the internal device and the external device according to the first identity of the internal device and the second identity of the external device includes: When the first identity is a host identity and the second identity is a HART-supporting identity, determining a load state required by the external device and matching a corresponding resistance value for the load state; When the first identity is a host identity and the second identity is a HART-unsupported identity, controlling the selected interface of the external device to communicate with the built-in interface of the internal device; When the first identity is a slave identity, the selected interface of the external device is controlled to communicate with the built-in current interface.

4. The method according to claim 2 or 3, characterized in that: Before determining the second identity of the external device, the method includes: According to the channel identifier where the external device is located, the channel where the external device is located is controlled to communicate with the selected interface of the external device.

5. The method according to claim 3, characterized in that: The determining of target query information includes: When the second identity is a HART-supporting identity, receiving a query instruction, and obtaining the target query information in the query instruction; the target query information includes a plurality of parameters to be queried and a physical quantity to be queried; When the second identity is an identity that does not support HART, the target query information is determined according to the physical properties of the external device; the target query information includes a physical quantity to be queried.

6. The method according to claim 5, characterized in that The receiving of the query instruction comprises: When the first identity is a host identity, receiving a query instruction sent by the internal device according to a plurality of parameters to be queried and a physical quantity to be queried; When the first identity is a slave identity, a query instruction sent by the external device based on a carrier query signal carrying a plurality of parameters to be queried and a physical quantity to be queried is received.

7. The method according to claim 5 or 6, characterized in that: When the second identity is a HART-supporting identity, sending the target data in the external device to the internal device according to the communication link and the target query information includes: Based on the load state, generating and sending to the external device a carrier query signal carrying a plurality of parameters to be queried and a physical quantity to be queried; Receiving and parsing a carrier response signal carrying a plurality of parameter data to be queried and an analog response signal carrying physical quantity data to be queried, returned by the external device; A plurality of parameter data to be queried and a plurality of physical quantity data to be queried are sent to the internal device.

8. The method according to claim 5 or 6, characterized in that: When the second identity is a HART-unsupported identity, sending the target data in the external device to the internal device according to the communication link and the target query information includes: Receiving and parsing the analog response signal carrying the data of the physical quantity to be queried and sent by the external device according to the physical quantity to be queried, through the communication between the selected interface of the external device and the built-in interface of the internal device; The physical quantity data to be queried is sent to the internal device.

9. The method according to claim 5 or 6, characterized in that: When the second identity is a HART-supporting identity, sending the target data in the internal device to the external device according to the communication link and the target query information includes: Receiving a plurality of parameter data to be queried and a plurality of physical quantity data to be queried sent by the internal device according to the plurality of parameters to be queried and the physical quantity to be queried through communication between the selected interface of the external device and the built-in current interface; Generate and send a carrier response signal carrying multiple parameter data to be queried and an analog response signal carrying physical quantity data to be queried to the external device, so as to send the multiple parameter data to be queried and the physical quantity data to be queried to the external device.

10. The method according to claim 5 or 6, characterized in that: When the second identity is a HART-unsupported identity, sending the target data in the internal device to the external device according to the communication link and the target query information includes: Receiving the physical quantity data to be queried sent by the internal device according to the physical quantity to be queried through communication between the selected interface of the external device and the built-in current interface; Generate and send an analog response signal carrying the physical quantity data to be queried to the external device, so as to send the physical quantity data to be queried to the external device.

11. A master-slave polling device, characterized in that: The device comprises: A determination module, for identifying the purpose of each of the external devices in turn in response to access to an internal device and at least one external device, and determining the first identity of the internal device according to the purpose of each of the external devices; the internal device and the at least one external device are located in the same HART communication network, the first identity is a host identity or a slave identity, the internal device is any intelligent instrument for recording any kind of index data, the external device is any transmission medium for monitoring the fluctuation of any kind of index data, or any collection device for collecting any kind of index data; wherein, if it is determined that the external device is the transmission medium, then it is determined that when the external device communicates with the internal device, the first identity of the internal device is the host identity; if it is determined that the external device is the collection device, then it is determined that when the external device communicates with the internal device, the first identity of the internal device is the slave identity; A construction module, configured to construct a communication link between the internal device and the external device according to the first identity; The determination module is further used to determine target query information; a sending module, configured to send the target data in the external device to the internal device according to the communication link and the target query information when the first identity is a host identity; The sending module is further configured to send the target data in the internal device to the external device according to the communication link and the target query information when the first identity is a slave identity.

12. A HART communication device, the HART communication device being used to implement the method according to any one of claims 1 to 10, characterized in that: include: Channel selection components, load matching and current direction components, encoding and decoding components, current generation components and logic control components; The logic control component includes a serial communication interface, which is used to access internal devices; the channel selection component includes at least one HART protocol interface, which is used to access external devices; The channel selection component is used to establish a path between the channel where the external device is located and the selected interface of the external device; The load matching and current direction component is used to establish a path between the selected interface of the external device and the internal device; The encoding and decoding component is used to generate and send a carrier query signal and a carrier response signal, and receive and parse the carrier query signal, the carrier response signal and the analog response signal; The current generating component is used to generate and send an analog response signal; The logic control component is used to control the channel selection component, the load matching and current direction component, the encoding and decoding component and the current generating component to realize corresponding functions.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 10 when executed by a processor.

14. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 10 when being executed by a processor.

Citation Information

Patent Citations

  • Control method of energy storage device, energy storage system and networking communication method of energy storage system

    CN107069889A