HART diagnostic method for portable inspection tooling

By adopting deep learning-based data analysis and enhancement mechanisms in portable point inspection tooling, intelligently judge the HART function status of the IO card, solving the problems of complex and inefficient traditional detection methods, and improving the accuracy and efficiency of detection.

CN119292818BActive Publication Date: 2025-03-21HANGZHOU KANGJISEN AUTOMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411835804.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-21
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

Traditional portable point inspection tooling has difficulties in HART function detection, including multiple wiring methods, complex operation, inefficient and error-prone problems, which affects detection efficiency and accuracy.

Method used

Using a deep learning-based data analysis and enhancement mechanism, the HART response data is extracted from the source card's response, field segmentation and embedding encoding are performed, field effect global semantic enhancement, and command type tags are parsed to form multi-dimensional information to intelligently judge the HART function status of the channel.

Benefits of technology

It improves the accuracy and efficiency of HART functional status judgment, reduces manual intervention, and improves the overall reliability and safety of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292818B_ABST
    Figure CN119292818B_ABST
Patent Text Reader

Abstract

The present application relates to the field of intelligent detection, and specifically discloses a HART diagnostic method adapted to a portable inspection tool, which extracts source card HART response data from the response of the source card, and adopts a data analysis and enhancement mechanism based on deep learning to perform field segmentation and embedding coding on the source card HART response data, and then performs field effect global semantic enhancement on each HART response data field embedding feature, and then parses the command type label corresponding to each enhanced global HART response data field embedding feature, and forms multidimensional information based on the data length and type label of each HART response data field, so as to intelligently judge whether the HART functional state of the channel is normal according to the complex hierarchical structure dependency characteristics between the multidimensional information of each HART response data field. In this way, it is possible to intelligently judge whether the HART functional state of the channel is normal, reduce the need for manual intervention, and effectively improve the accuracy and efficiency of HART functional state judgment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent detection, and more specifically, to a HART diagnostic method adapted for portable inspection tooling. Background Art

[0002] In the field of industrial automation control, the accuracy of IO cards may deviate over time, especially after long-term operation in harsh environments such as high temperature, high humidity and vibration. Therefore, regular inspection becomes particularly important. However, traditional inspection methods usually require the cards to be sent back to the production center for inspection, which is not only time-consuming and labor-intensive, but may also cause production line downtime, increasing time and labor costs. In order to solve this problem, portable inspection tools came into being. Workers can carry this portable equipment to the production site to conduct card inspection, thereby minimizing interference with production.

[0003] However, traditional portable inspection tools face a major difficulty in HART function testing. Usually, IO cards have many HART channel points and support multiple wiring methods, such as two-wire and four-wire. When using traditional instruments for testing, it is necessary to carry a variety of different instruments, which increases the burden on operators and loses portability. In addition, frequent wiring and wire replacement are not only time-consuming, but also prone to errors, which seriously affects the efficiency and accuracy of detection. Each change of wiring requires reconnection and calibration, which increases the complexity and uncertainty of operation.

[0004] Therefore, an optimized HART diagnostic solution for portable inspection equipment is desired. Summary of the invention

[0005] In order to solve the above technical problems, the present application is proposed. The embodiment of the present application provides a HART diagnostic method adapted to a portable inspection tool, which extracts the source card HART response data from the response of the source card, and adopts a data analysis and enhancement mechanism based on deep learning to perform field segmentation and embedding coding on the source card HART response data, and then performs field effect global semantic enhancement on each HART response data field embedding feature, and then parses the command type label corresponding to each enhanced global HART response data field embedding feature, and forms multidimensional information based on the data length and type label of each HART response data field, so as to intelligently judge whether the HART functional state of the channel is normal according to the complex hierarchical structure dependency characteristics between the multidimensional information of each HART response data field. In this way, it is possible to intelligently judge whether the HART functional state of the channel is normal, and deal with problems in a timely manner, reducing the need for manual intervention, thereby effectively improving the accuracy and efficiency of HART functional state judgment, and thus improving the overall reliability and security of the system.

[0006] According to one aspect of the present application, a HART diagnostic method adapted for a portable inspection tool is provided, which comprises: a host computer sends a HART detection command to a source card via an industrial bus; after receiving the HART detection command, the source card is set to HART slave mode and the corresponding physical channel of the source card is configured to receive mode, and sends a response to the host computer; after receiving the response from the source card, the host computer sends a test instruction including a test channel number and a HART query command to the card to be tested; the card to be tested acts as a HART host and sends the test instruction to the source card, and waits for the response from the source card. In response to the source card receiving the test instruction of the card to be tested, verifying the test instruction according to the HART protocol, wherein, in response to the test instruction meeting the protocol requirements, the source card responds; in response to the card to be tested receiving the response of the source card within a specified time, parsing the response to ensure that it complies with the HART protocol, wherein, in response to the response meeting the HART protocol, reporting the response of the source card to the host computer; in response to the host computer receiving the response of the source card, parsing the response of the source card to determine whether the HART function of the channel is normal.

[0007] Compared with the prior art, the present application provides a HART diagnostic method adapted for portable inspection tooling, which extracts the source card HART response data from the response of the source card, and adopts a data analysis and enhancement mechanism based on deep learning to perform field segmentation and embedding encoding on the source card HART response data, and then performs field effect global semantic enhancement on the embedded features of each HART response data field, and then parses the command type label corresponding to each enhanced global HART response data field embedded feature, and forms multidimensional information based on the data length and type label of each HART response data field, so as to intelligently judge whether the HART functional state of the channel is normal according to the complex hierarchical structure dependency characteristics between the multidimensional information of each HART response data field. In this way, it is possible to intelligently judge whether the HART functional state of the channel is normal, and deal with problems in a timely manner, reducing the need for manual intervention, thereby effectively improving the accuracy and efficiency of HART functional state judgment, and thus improving the overall reliability and safety of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0009] Figure 1The present invention is a flowchart of a HART diagnostic method adapted for a portable inspection tool according to an embodiment of the present application.

[0010] Figure 2 Schematic diagram of data flow of the HART diagnostic method adapted for portable inspection tooling according to an embodiment of the present application.

[0011] Figure 3 It is a flowchart of sub-step S7 of the HART diagnostic method adapted for the portable inspection tool according to an embodiment of the present application.

[0012] Figure 4 Schematic diagram of the HART detection principle according to an embodiment of the present application. DETAILED DESCRIPTION

[0013] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.

[0014] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.

[0015] Although the present application makes various references to certain modules in the system according to the embodiments of the present application, any number of different modules can be used and run on the user terminal and / or server. The modules are only illustrative, and different aspects of the system and method can use different modules.

[0016] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps may be processed in reverse order or simultaneously as required. Meanwhile, other operations may also be added to these processes, or a certain step or several steps of operations may be removed from these processes.

[0017] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.

[0018] In the technical solution of the present application, a HART diagnostic method adapted for a portable inspection tool is proposed. Figure 1The present invention is a flowchart of a HART diagnostic method adapted for a portable inspection tool according to an embodiment of the present application. Figure 2 Schematic diagram of data flow of the HART diagnostic method adapted for portable inspection tooling according to an embodiment of the present application. Figure 1 and Figure 2 As shown, according to the HART diagnostic method adapted for portable inspection tooling of an embodiment of the present application, the method comprises the following steps: S1, the host computer sends a HART detection command to the source card through the industrial bus; S2, after receiving the HART detection command, the source card is set to the HART slave mode and the corresponding physical channel of the source card is configured to the receiving mode, and sends a response to the host computer; S3, after receiving the response from the source card, the host computer sends a test instruction including a test channel number and a HART query command to the card to be tested; S4, the card to be tested acts as a HART host and sends the test instruction to the source card, and waits for the source card to respond. response; S5, in response to the source card receiving the test instruction of the card to be tested, verifying the test instruction according to the HART protocol, wherein, in response to the test instruction complying with the protocol requirements, the source card responds; S6, in response to the card to be tested receiving the response of the source card within a specified time, parsing the response to ensure that it complies with the HART protocol, wherein, in response to the response complying with the HART protocol, reporting the response of the source card to the host computer; S7, in response to the host computer receiving the response of the source card, parsing the response of the source card to determine whether the HART function of the channel is normal.

[0019] In particular, in S1, the host computer sends a HART detection command to the source card via the industrial bus.

[0020] In industrial automation control systems, the host computer (such as PLC, SCADA system or dedicated computer) communicates with the slave computer (such as IO card, sensor, actuator, etc.) through industrial bus (such as Modbus, Profibus, CAN, etc.). In this architecture, the host computer is responsible for sending control commands and receiving feedback data, while the slave computer performs specific control tasks and data acquisition. This article will introduce in detail the specific implementation steps of the host computer sending HART detection commands to the source card through the industrial bus.

[0021] In the field of industrial automation control, the accuracy of IO cards may deviate over time, especially after long-term operation in harsh environments such as high temperature, high humidity and vibration. Therefore, regular inspection becomes particularly important. However, traditional inspection methods usually require the cards to be sent back to the production center for inspection, which is not only time-consuming and labor-intensive, but may also cause production line downtime, increasing time and labor costs. In order to solve this problem, portable inspection tools came into being. Workers can carry this portable equipment to the production site to conduct card inspection, thereby minimizing interference with production.

[0022] However, traditional portable inspection tools face a major difficulty in HART function testing. Usually, IO cards have many HART channel points and support multiple wiring methods, such as two-wire and four-wire. When using traditional instruments for testing, it is necessary to carry a variety of different instruments, which increases the burden on operators and loses portability. In addition, frequent wiring and wire replacement are not only time-consuming, but also prone to errors, which seriously affects the efficiency and accuracy of detection. Each change of wiring requires reconnection and calibration, which increases the complexity and uncertainty of operation.

[0023] In order to solve the above problems, this technical solution proposes a HART diagnostic method for portable inspection tooling based on communication between the host computer and the card to be tested and the source card. The specific implementation steps are as follows: First, the host computer establishes a communication connection with the source card through the industrial bus. This usually involves configuring communication parameters such as baud rate, data bit, stop bit and check bit. For example, the commonly used configuration parameters of the Modbus RTU protocol are: baud rate 9600 bps, data bit 8 bits, stop bit 1 bit, no check. The host computer sends a handshake signal to confirm whether the communication link with the source card is normal. After receiving the handshake signal, the source card will return a confirmation response, indicating that the communication link has been successfully established. This process can be achieved by sending a simple request command (such as reading the device status).

[0024] In particular, in S2, after receiving the HART detection command, the source card is set to HART slave mode and the corresponding physical channel of the source card is configured to receive mode, and a response is sent to the host computer.

[0025] In industrial automation control systems, when the host computer sends a HART detection command to the source card through the industrial bus, the source card needs to perform a series of operations to ensure the correct reception and processing of the command. This process includes receiving the command, decoding and verifying the command, setting it to HART slave mode, configuring the corresponding physical channel to receive mode, and sending a response to the host computer.

[0026] Specifically, when the host computer sends a HART detection command through the industrial bus, the communication interface of the source card will receive the command. The command is usually transmitted in the form of a data frame, which includes the address, function code, data, and check code. The communication interface of the source card is responsible for decoding the data frame and extracting the specific content of the command.

[0027] After receiving the data frame, the source card first decodes it and extracts information such as the command code, target address, data length, and data field. Then, the source card verifies whether the format and parameters of the command meet the requirements of the HART protocol. The verification process includes the following steps: Check whether the address in the data frame matches the address of the source card. If the address does not match, the source card ignores the command. For example, if the address of the source card is 0x01 and the address of the received data frame is 0x02, the source card ignores the command. Calculate the checksum of the data frame and compare it with the received checksum. If the checksum does not match, the source card reports a communication error. The checksum is usually calculated using a CRC (cyclic redundancy check) algorithm. Check whether the command code is a valid HART command code. If the command code is invalid, the source card returns an error response. Valid HART command codes include reading device status, writing configuration parameters, performing diagnostic tests, etc.

[0028] Once the command is verified, the source card needs to set itself to HART slave mode. In HART slave mode, the source card is ready to receive and process commands from the HART host (usually the host computer or the card under test). The specific steps include: setting communication parameters such as baud rate, data bits, stop bits and parity bits to ensure compatibility with the HART protocol. The standard baud rate of the HART protocol is 1200 bps, the data bit is 8 bits, the stop bit is 1 bit, and the parity bit is even parity. Configure the communication interface of the source card to receive mode and prepare to receive subsequent commands and data. This usually involves setting the registers of the communication interface to put it in the receiving state.

[0029] The source card also needs to configure the corresponding physical channel to receive mode so that it can receive and process data from the HART host. The specific steps include: Identify the physical channel that needs to be configured based on the channel number in the command. The channel number is usually included in the data field of the command. Set the parameters of the physical channel, such as input type (analog input, digital input, etc.), sampling frequency, range, etc., to ensure that the channel can receive data correctly. For example, if the command requires reading data from an analog input channel, the source card needs to configure the channel to analog input mode and set the appropriate sampling frequency and range. Set the physical channel to receive mode and prepare to receive data from the HART host. This usually involves setting the channel's registers to put it in a receiving state.

[0030] After completing the above steps, the source card needs to send a response to the host computer to confirm that the command has been successfully received and processed.

[0031] The source card packages the response back into a data frame that complies with the industrial bus communication protocol and sends it to the host computer through the industrial bus. The format of the data frame is similar to that of the data frame when receiving the command, including the address, function code, data and check code.

[0032] In particular, in S3, after receiving the response from the source card, the host computer sends a test instruction including the test channel number and the HART query command to the card to be tested. In an industrial automation control system, when the host computer sends a HART detection command to the source card through the industrial bus and receives the response from the source card, the next step is that the host computer sends a test instruction including the test channel number and the HART query command to the card to be tested. This process ensures the smooth progress of the detection task.

[0033] Specifically, when the source card receives the HART detection command sent by the host computer and successfully processes it, it will send a response to the host computer. The response usually includes status code, data, and check code. After receiving the response, the host computer will parse the response data and verify the check code to ensure the integrity and correctness of the response. If the response is successful, the host computer will continue to perform the next step; if the response fails, the host computer will record the error information and take corresponding measures.

[0034] Specifically, after receiving the response from the source card, the host computer will first parse the various parts of the response data frame, including the address, function code, data length, data field, and check code. Then, the host computer will calculate the check code of the response data frame and compare it with the received check code. If the check code does not match, the host computer will report a communication error. Next, the host computer will check the status code in the response data to determine whether the command was successfully executed. Common status codes include 0x00 (success), 0x01 (address error), 0x02 (check code error), etc.

[0035] After receiving the response from the source card and verifying its correctness, the host computer needs to construct a test instruction containing the test channel number and the HART query command.

[0036] The specific steps to build a test instruction are as follows: First, the host computer needs to determine the address of the card to be tested. According to the system configuration, the host computer obtains the address information of the card to be tested. Next, select the appropriate function code to indicate the type of test instruction. For example, 0x03 means reading data. Then, set the test channel number according to the channel to be tested. Next, build a HART query command according to the specific detection requirements. For example, the command code for reading the device status is 0x01. Calculate the data length, including the test channel number and the length of the HART query command. Finally, generate a checksum and calculate the checksum of the data frame to ensure the integrity of the data.

[0037] After constructing the test instructions, the host computer needs to package them into data frames that comply with the industrial bus communication protocol.

[0038] Specifically, the host computer creates an empty data frame, then adds the address, function code, data length, data field and check code in sequence, and verifies the format and check code of the data frame again to ensure the correctness of the data frame.

[0039] After packaging the test instructions, the host computer sends the data frame to the card under test through the industrial bus. During the sending process, the host computer monitors the communication status to ensure that the data frame reaches the card under test intactly. The reliability of data transmission can be ensured by setting the timeout time.

[0040] After receiving the test command, the card to be tested will parse the command code, test channel number, HART query command and other information in the data frame. The card to be tested will verify whether the format and parameters of the command meet the requirements of the HART protocol. The verification process includes checking whether the address in the data frame matches the address of the card to be tested, calculating the checksum of the data frame and comparing it with the received checksum, and checking whether the command code is valid.

[0041] The card to be tested executes the corresponding HART query command according to the parsing result. For example, if the command requires reading the status information of a channel, the card to be tested will read the status data of the channel. During the execution of the command, the processor inside the card to be tested will call the corresponding functional module to complete the detection task. After the command execution is completed, the card to be tested generates response data. The response data usually includes the command execution result, detection data, and checksum. For example, if the detection task is successfully completed, the response data will contain the status code 0x00 and the detection result data.

[0042] The card to be tested packages the response data into a data frame that complies with the industrial bus communication protocol and sends it to the host computer through the industrial bus. The format of the data frame is similar to that of the data frame when receiving a command, including the address, function code, data, and check code. Create an empty data frame, and then add the address, function code, data length, data field, and check code in sequence. Verify the format and check code of the data frame again to ensure the correctness of the data frame.

[0043] After receiving the response data frame sent by the card to be tested, the host computer parses the response data in the data frame and extracts the command execution result and test data. The host computer verifies the checksum in the response data frame to ensure the integrity and correctness of the data. If the checksum does not match, the host computer resends the command or reports a communication error. After parsing the response data frame, the host computer extracts the address, function code, data length, data field, checksum and other information in the data frame, calculates the checksum of the data frame and compares it with the received checksum.

[0044] The host computer determines whether the HART detection task is successfully completed based on the analysis results, and further processes the detection data as needed, such as displaying the detection results, recording logs, etc. If the detection task fails, the host computer will record the error information and take corresponding measures. Specifically, the host computer determines whether the command is successfully executed based on the status code, processes the detection data, and performs corresponding processing tasks, such as displaying the detection results, recording logs, etc. If the command execution fails, the host computer will record the error information and take corresponding measures.

[0045] In particular, in S4, the card to be tested acts as a HART host to send the test instruction to the source card and wait for the response of the source card. In an industrial automation control system, when the host computer sends a test instruction including a test channel number and a HART query command to the card to be tested via an industrial bus, the card to be tested needs to act as a HART host to send these test instructions to the source card and wait for the response of the source card.

[0046] Specifically, first, the card to be tested receives the test instruction sent by the host computer through the industrial bus. The test instruction usually includes the address, function code, data length, data field and check code. After receiving the test instruction, the card to be tested will parse the various parts in the data frame, including the address, function code, data length, data field and check code. Specifically, the card to be tested will extract the address in the data frame to ensure that it matches its own address, and then parse the function code to verify its validity. Next, the card to be tested will calculate the check code of the data frame and compare it with the received check code to ensure the integrity of the data. If the check code does not match, the card to be tested will report a communication error and take corresponding measures.

[0047] After the card to be tested receives and verifies the test instructions from the host computer, it needs to construct the test instructions as a HART host and prepare to send them to the source card. The specific steps to construct the test instructions are as follows: The card to be tested first determines the address of the source card and obtains the address information of the source card according to the system configuration. Then, select the appropriate function code to indicate the type of test instruction, for example, 0x03 means reading data. Next, the card to be tested sets the test channel number according to the test channel number in the received test instruction. Subsequently, a HART query command is constructed, and a specific HART query command is constructed according to the HART query command in the received test instruction. Then, the total length of the data field is calculated, including the test channel number and the length of the HART query command. Finally, a checksum is generated, and the checksum of the data frame is calculated to ensure the integrity of the data.

[0048] After constructing the test instructions, the card to be tested needs to package them into a data frame that complies with the HART protocol. The format of the data frame includes the address, function code, data length, data field, and check code. Specifically, the card to be tested creates an empty data frame, and then adds the address, function code, data length, data field, and check code in sequence. Verify the format and check code of the data frame again to ensure the correctness of the data frame.

[0049] After packaging the test instructions, the card under test sends the data frame to the source card through the HART protocol. During the transmission process, the card under test monitors the communication status to ensure that the data frame reaches the source card intact and without error. Specifically, the card under test ensures that the HART communication interface between the card under test and the source card is open and configures the correct communication parameters, such as baud rate, data bit, stop bit, and check bit. Then, the data frame is sent to the source card through the HART protocol, and the timeout is set to monitor the communication status to ensure that the data frame is successfully sent.

[0050] After the card under test sends the test command, it will enter the waiting state and wait for the response of the source card. The card under test needs to set a reasonable timeout to prevent a long wait without a response. If no response is received from the source card within the timeout, the card under test will report a communication error and take appropriate measures, such as resending the command or recording the error information. Specifically, the card under test sets a reasonable timeout, such as 1 second, and then continues to monitor the HART communication interface, waiting for the response of the source card. If no response is received within the timeout, the card under test will report a communication error and take appropriate measures.

[0051] If a response is received from the source card within the timeout period, the card under test will parse the various parts of the response data frame, including the address, function code, data length, data field, and check code. The card under test will then verify the check code of the data frame to ensure the integrity of the data. Specifically, the card under test extracts the address in the data frame to ensure that it matches its own address, and then parses the function code to verify its validity. The card under test then calculates the check code of the data frame and compares it with the received check code to ensure the integrity of the data. If the check codes do not match, the card under test will report a communication error and take appropriate measures.

[0052] The card to be tested determines whether the HART detection task is successfully completed based on the analysis results, and further processes the detection data as needed, such as displaying the detection results, recording logs, etc. If the detection task fails, the card to be tested will record the error information and take corresponding measures. Specifically, the card to be tested determines whether the command is successfully executed based on the status code. Common status codes include 0x00 (success), 0x01 (address error), 0x02 (check code error), etc. Then, the card to be tested performs the corresponding processing tasks based on the detection data, such as displaying the detection results, recording logs, etc. If the command execution fails, the card to be tested will record the error information and take corresponding measures, such as resending the command or reporting the error.

[0053] In particular, S5, in response to the source card receiving the test instruction of the card to be tested, verifies the test instruction according to the HART protocol, wherein, in response to the test instruction meeting the protocol requirements, the source card responds. In an industrial automation control system, when the card to be tested sends a test instruction to the source card as a HART host, the source card needs to verify the received test instruction and respond if the test instruction meets the HART protocol requirements.

[0054] Specifically, first, the source card receives the test instruction sent by the card to be tested through the HART communication interface. The test instruction usually includes parts such as address, function code, data length, data field and check code. After the source card receives the test instruction, it first needs to parse the various parts in the data frame, including address, function code, data length, data field and check code. Specifically, the source card extracts the received data frame from the buffer, parses the address part, and ensures that it matches the address of the source card. If it does not match, the source card will ignore the instruction. Then, the source card parses the function code part to verify whether it is a valid HART function code. If the function code is invalid, the source card will return an error response. Then, the source card parses the data length part to verify whether it is reasonable. If the data length is unreasonable, the source card will return an error response. Finally, the source card parses the data field part to extract the test channel number and HART query command therein.

[0055] After parsing the test command, the source card needs to verify it to ensure that it meets the requirements of the HART protocol. First, the source card calculates the checksum of the data frame and compares it with the received checksum. If the checksum does not match, the source card returns an error response. Secondly, the source card verifies whether the overall format of the data frame meets the requirements of the HART protocol. If the format is incorrect, the source card returns an error response. Finally, the source card verifies whether the command parameters in the data field are reasonable. If the parameters are unreasonable, the source card returns an error response.

[0056] If the test command passes all the verification steps, the source card will execute the HART query command. Specifically, the source card identifies the command type based on the function code, such as reading device status, configuring parameters, performing diagnostic tests, etc. Then, the source card calls the corresponding function module according to the command type and executes the specific HART query command. After executing the command, the source card generates response data based on the command execution result. The response data usually includes command execution results, detection data, and verification code.

[0057] After generating the response data, the source card needs to package it into a data frame that complies with the HART protocol. The format of the data frame includes the address, function code, data length, data field, and check code. Specifically, the source card creates an empty data frame, and then adds the address, function code, data length, data field, and check code in sequence. Verify the format and check code of the data frame again to ensure the correctness of the data frame.

[0058] After packaging the response data, the source card sends the data frame to the card under test through the HART communication interface. During the transmission process, the source card monitors the communication status to ensure that the data frame reaches the card under test intact and without error. Specifically, the source card ensures that the HART communication interface between the source card and the card under test is open and configures the correct communication parameters, such as baud rate, data bit, stop bit, and check bit. Then, the source card sends the data frame to the card under test through the HART communication interface, sets the timeout, monitors the communication status, and ensures that the data frame is successfully sent.

[0059] In particular, in S6, in response to the test card receiving the response of the source card within the specified time, the response is parsed to ensure that it complies with the HART protocol, wherein, in response to the response complying with the HART protocol, the response of the source card is reported to the host computer. In an industrial automation control system, when the test card sends a test instruction to the source card as a HART host, it is necessary to receive the response of the source card within the specified time, and parse the response to ensure that it complies with the HART protocol. If the response complies with the HART protocol, the test card reports the response of the source card to the host computer.

[0060] Specifically, after the card to be tested sends the test command, it will enter a waiting state and wait for the response from the source card. The card to be tested needs to set a reasonable timeout period to prevent a long wait without a response. Specifically, after the card to be tested sends the test command, a reasonable timeout period will be set, such as 1 second. During this period, the card to be tested will continue to monitor the HART communication interface and wait for the response from the source card. If no response from the source card is received within the timeout period, the card to be tested will report a communication error and take appropriate measures, such as resending the command or recording error information.

[0061] If a response is received from the source card within the timeout period, the card under test receives and stores the response data. Specifically, when a data frame is received, the card under test stores it in a buffer for subsequent processing. Next, the card under test needs to parse the various parts of the data frame, including the address, function code, data length, data field, and checksum. First, the card under test extracts the address part of the data frame to ensure that it matches the address of the card under test. If it does not match, the card under test will ignore the response. Then, the card under test extracts the function code part of the data frame to verify whether it is a valid HART function code. If the function code is invalid, the card under test will return an error response. Next, the card under test extracts the data length part of the data frame to verify whether it is reasonable. If the data length is unreasonable, the card under test will return an error response. Finally, the card under test extracts the data field part of the data frame and parses the command execution results and detection data therein.

[0062] After parsing the response data, the card under test needs to verify the parsed response to ensure that it meets the requirements of the HART protocol. First, the card under test calculates the checksum of the data frame and compares it with the received checksum. If the checksum does not match, the card under test will return an error response. Secondly, the card under test verifies whether the overall format of the data frame meets the requirements of the HART protocol. If the format is incorrect, the card under test will return an error response. Finally, the card under test verifies whether the command parameters in the data field are reasonable. If the parameters are unreasonable, the card under test will return an error response.

[0063] If the response of the source card passes all the verification steps, the card under test reports the response of the source card to the host computer. Specifically, the card under test packages the parsed response data into a data frame that complies with the communication protocol of the host computer. The data frame usually includes the address, function code, data length, data field and check code. Then, the card under test verifies the format and check code of the data frame again to ensure the correctness of the data frame. Then, the card under test sends the data frame to the host computer through the industrial bus, sets the timeout time, monitors the communication status, and ensures that the data frame is successfully sent.

[0064] In particular, the S7, in response to the host computer receiving the response of the source card, parses the response of the source card to determine whether the HART function of the channel is normal. It should be understood that communication is a key component of the industrial automation system, and any communication failure may cause data transmission interruption and affect the normal operation of the equipment. As an important way for communication between devices, it is crucial to ensure the normal function of the HART channel to maintain the stability and reliability of communication. Specifically, the HART channel is responsible for transmitting the status information, measurement data and control commands of the device. If the channel function is abnormal, the accuracy of the data cannot be guaranteed, which may lead to control failure or misoperation, thereby affecting the safety and efficiency of the production process. However, traditional HART function judgment usually relies on manual detection and experience judgment. Operators need to carry a variety of instruments to test the HART channels one by one, which is time-consuming and labor-intensive. This method is not only inefficient and prone to errors, but also difficult to detect and locate problems in a timely manner, resulting in delayed fault response, affecting production efficiency and system reliability. In a specific example of the present application, Figure 3 As shown, the S7 includes: S71, extracting the source card HART response data from the response of the source card; S72, performing field segmentation and embedding coding on the source card HART response data to obtain a sequence of HART response data field embedding coding vectors; S73, performing field-driven global semantic enhancement on the sequence of HART response data field embedding coding vectors to obtain a sequence of enhanced global HART response data field embedding coding vectors; S74, obtaining a parsing result based on the sequence of enhanced global HART response data field embedding coding vectors, and the parsing result is used to represent each of the HART response data S75, adding the data length and command type tag corresponding to each HART response data field in the sequence of the HART response data fields to the end of each HART response data field to obtain a sequence of multi-dimensional information of the HART response data fields; S76, semantically encoding the sequence of multi-dimensional information of the HART response data fields to obtain a global semantic encoding feature vector of the HART response data; S77, based on the global semantic encoding feature vector of the HART response data, obtaining a test result, wherein the test result is used to indicate whether the HART functional status of the channel is normal.

[0065] Specifically, the S71 extracts the source card HART response data from the response of the source card. In an industrial automation control system, when the card to be tested receives the response of the source card, it is necessary to extract the HART response data from the response data. This process ensures that the card to be tested can correctly parse and process the response of the source card, thereby completing subsequent tasks.

[0066] Specifically, first, the card to be tested needs to receive the response data from the source card. This step includes reading data from the communication interface and storing it in a buffer. The card to be tested continuously monitors the HART communication interface and waits for the response from the source card. When a data frame is received, the card to be tested stores it in a buffer for subsequent processing.

[0067] Next, the card under test extracts the received data frame from the buffer and prepares for parsing. After reading the received data frame from the buffer, the variables used to store the extracted data, such as address, function code, data length, data field and checksum, are initialized.

[0068] The card to be tested needs to parse each part of the data frame, including the address, function code, data length, data field and checksum. First, extract the address part from the first byte of the data frame and verify whether the extracted address matches the address of the card to be tested. If it does not match, ignore the response. Then, extract the function code part from the second byte of the data frame and verify whether the extracted function code is a valid HART function code. If the function code is invalid, return an error response. Next, extract the data length part from the third byte of the data frame and verify whether the extracted data length is reasonable. If the data length is unreasonable, return an error response. Finally, based on the extracted data length, extract the data field part from the fourth byte of the data frame. The data field usually contains command execution results and detection data. Extract the checksum part from the last byte of the data frame. The checksum is used to verify the integrity of the data frame.

[0069] After parsing the response data, the card under test needs to verify the extracted data frame to ensure that it meets the requirements of the HART protocol. First, use the address, function code, data length and data field part in the extracted data frame to calculate the check code, and compare the calculated check code with the extracted check code. If the check code does not match, an error response is returned. Secondly, verify whether the overall format of the data frame meets the requirements of the HART protocol. If the format is incorrect, an error response is returned. Finally, verify whether the command parameters in the data field are reasonable. If the parameters are unreasonable, an error response is returned.

[0070] After the above analysis and verification steps, the card under test can extract the HART response data from the data field and initialize a list or array to store the extracted HART response data.

[0071] Specifically, the S72, the source card HART response data is segmented and embedded to obtain a sequence of HART response data field embedded coding vectors. That is, in the technical solution of the present application, first, the source card HART response data is segmented according to the fields defined by the protocol to obtain a sequence of HART response data fields. Considering that different fields in the HART response data contain specific data information, such as response code, address, command, check code, etc., and error or abnormal information is usually concentrated in a specific field, therefore, in order to more carefully and effectively identify and locate problems, ensure the reliability and accuracy of HART communication, in the technical solution of the present application, the source card HART response data is segmented according to the fields defined by the protocol to obtain a sequence of HART response data fields, so that a whole complete response field data can be segmented into multiple fields containing specific response information, so as to analyze and process each field more finely. Then, the HART response data embedding matrix is ​​used to embed the HART response data fields in the sequence of the HART response data fields to obtain a sequence of the HART response data field embedded coding vectors. Here, in order to more richly capture the semantic information and expression meaning in each field, such as address, command, data, etc., in the technical solution of the present application, the HART response data embedding matrix is ​​used to embed and encode each HART response data field in the sequence of the HART response data field to capture and extract the rich and more meaningful feature information contained in each field, and obtain a sequence of HART response data field embedded coding vectors. It should be understood that the HART response data embedding matrix is ​​a tool for mapping HART response data fields to high-dimensional vector space. Specifically, the HART response data embedding matrix is ​​a two-dimensional array, in which each row corresponds to a possible field value and each column represents an embedding dimension, which is generally used to convert discrete data fields into continuous vector representations for the convenience of machine learning and deep learning model processing. In particular, the HART response data embedding matrix is ​​obtained by training using a machine learning or deep learning model.

[0072] Specifically, the S73 performs field-driven global semantic enhancement on the sequence of the HART response data field embedded coding vector to obtain a sequence of enhanced global HART response data field embedded coding vectors. Considering that the sequence of the HART response data field embedded coding vector may have insufficient semantic information and uneven feature distribution, this will lead to deviations in semantic understanding when performing contextual semantic analysis. Specifically, the embedded coding vectors of each HART response data field fail to fully capture the complex relationship and global context between fields, thereby affecting the model's ability to accurately parse and detect anomalies in HART communication data. Based on this, in the technical solution of the present application, the sequence of the HART response data field embedded coding vector is subjected to field-driven global semantic enhancement to obtain a sequence of enhanced global HART response data field embedded coding vectors. That is, by introducing more key semantic information into high-level features to embed more spatial information to make up for the semantic and resolution gaps between features at different levels, the efficiency of feature fusion is improved.

[0073] Specifically, the specific process of field-driven global semantic enhancement of the sequence of HART response data field embedded coding vectors includes: first, using a semantic reconstructor to perform feature reconstruction on each HART response data field embedded coding vector in the sequence of HART response data field embedded coding vectors to obtain a sequence of reconstructed HART response data field embedded coding vectors; that is, using a semantic reconstructor to perform domain transformation on each element in the sequence of HART response data field embedded coding vectors to generate a new sequence of reconstructed HART response data field embedded coding vectors. The semantic reconstructor enables each HART response data field embedded coding vector in the sequence of HART response data field embedded coding vectors to achieve dimensional unification, and enhances the representation ability of vocabulary in a specific context, so that the feature vector is more in line with the meaning in the actual language environment.

[0074] Next, the semantic depth implicit representation value of each reconstructed HART response data field embedded coding vector in the sequence of the reconstructed HART response data field embedded coding vector is calculated to obtain a sequence of HART response data depth implicit representation values; the semantic depth implicit representation value of the sequence of the reconstructed HART response data field embedded coding vector is calculated, and the semantic depth implicit representation value reflects the information density or complexity carried by the vocabulary in the text, so as to obtain a sequence of HART response data depth implicit representation values. That is, the importance and influence of each vocabulary in the text paragraph in which it is located can be quantified through the semantic depth implicit representation value, and based on these values, the order of the word feature vectors is further adjusted to ensure that key information is given priority.

[0075] More specifically, the semantic depth implicit representation value of each reconstructed HART response data field embedded coding vector in the sequence of the reconstructed HART response data field embedded coding vector is calculated using the following semantic depth implicit representation formula to obtain a sequence of HART response data depth implicit representation values; wherein the semantic depth implicit representation formula is: ;in, A sequence of embedded encoding vectors for the HART response data field, and The first, second, and third sequences of the HART response data field embedded coding vector are respectively and The HART response data field is embedded in the encoding vector, and are the first weight matrix and the second weight matrix respectively, yes The corresponding reconstructed HART response data field embedding encoding vector, For calculation The square of the one-norm, represents the logarithmic function value with base 2, For calculation The semantic depth implicit representation value of for The corresponding HART response data depth implicitly represents the value.

[0076] Furthermore, based on the sequence of the HART response data deep implicit representation values, the sequence of the HART response data field embedded coding vector is subjected to bidirectional global semantic interaction to obtain a sequence of enhanced global HART response data field embedded coding vectors. In the technical solution of the present application, based on the sorting of the sequence of the HART response data deep implicit representation values, the sequence of the HART response data field embedded coding vector is reordered to obtain an updated sequence of the HART response data field embedded coding vector; in this way, the sentence structure is reorganized according to the importance of the vocabulary, which can improve the quality and consistency of global semantic encoding. On this basis, a bidirectional long short-term memory (LSTM) model is used to encode the updated sequence of the HART response data field embedded coding vector from both the forward and backward directions. The forward LSTM captures the information flow pattern from the beginning to the end of the sentence, while the backward LSTM operates in reverse to identify the dependency from the end of the sentence to the beginning of the sentence. This dual-perspective encoding mechanism effectively captures the complex temporal structure in the text and provides a more comprehensive semantic understanding. Finally, by weighting the global semantic encoding results from the forward and backward directions, the bidirectional semantic information is integrated to form a richer and more comprehensive enhanced global semantic encoding feature vector to support more complex natural language processing tasks.

[0077] Wherein, based on the sequence of the HART response data deep implicit representation values, a bidirectional global semantic interaction is performed on the sequence of the HART response data field embedded coding vectors to obtain a sequence of enhanced global HART response data field embedded coding vectors, including: based on the sorting of the sequence of the HART response data deep implicit representation values, the sequence of the HART response data field embedded coding vectors is reordered to obtain an updated sequence of the HART response data field embedded coding vectors; the updated sequence of the HART response data field embedded coding vectors is input into a first semantic encoder based on a forward LSTM model to obtain a sequence of forward global HART response data field embedded coding vectors; the updated sequence of the HART response data field embedded coding vectors is input into a first semantic encoder based on a backward LSTM model to obtain a sequence of backward global HART response data field embedded coding vectors; and the weighted sum of the corresponding forward global HART response data field embedded coding vectors and the backward global HART response data field embedded coding vectors in the sequence of the forward global HART response data field embedded coding vectors and the sequence of the backward global HART response data field embedded coding vectors is calculated to obtain the sequence of enhanced global HART response data field embedded coding vectors.

[0078] More specifically, based on the sequence of the HART response data deep implicit representation values, the sequence of the HART response data field embedded coding vectors is subjected to a bidirectional global semantic interaction using the following bidirectional global semantic interaction formula to obtain a sequence of enhanced global HART response data field embedded coding vectors; wherein the bidirectional global semantic interaction formula is: ;in, and The first, second and third bits in the update sequence of the HART response data field embedding code vector are respectively Update the HART response data field embedding encoding vector, is the update sequence of the HART response data field embedded code vector, For Perform forward LSTM semantic encoding, is the sequence of forward global HART response data field embedding encoding vectors, For Perform backward LSTM semantic encoding, is the sequence of backward global HART response data field embedding encoding vectors, and are the forward coding weight matrix and the backward coding weight matrix respectively, is the bias vector, is a sequence of the enhanced global HART response data field embedded coding vectors.

[0079] Specifically, the S74 obtains a parsing result based on the sequence of the enhanced global HART response data field embedded coding vectors, and the parsing result is used to represent the command type label corresponding to each of the HART response data fields. Considering that different command types are used to perform specific operations or obtain specific information, such as reading device status, configuring parameters, performing diagnostic tests, etc. Based on this, in order to be able to more accurately identify the current status and operation results of the device, so as to more accurately determine whether the HART function of the channel is normal, in the technical solution of the present application, each enhanced global HART response data field embedded coding vector in the sequence of the enhanced global HART response data field embedded coding vector is respectively passed through a classifier-based command type parser to obtain a parsing result.

[0080] Specifically, in S75, the data length and command type tag corresponding to each HART response data field in the sequence of the HART response data field are added to the end of each HART response data field to obtain a sequence of multidimensional information of the HART response data field. That is, in order to more comprehensively and richly characterize the multidimensional field information and content in each HART response data field, in the technical solution of the present application, the data length and command type tag corresponding to each HART response data field in the sequence of the HART response data field are added to the end of each HART response data field to obtain a sequence of multidimensional information of the HART response data field. That is, the data length and command type tag provide clear structural information and functional information. For example, the data length can help the parser determine the actual content of the data field, and the command type tag clarifies the specific operation corresponding to the field, which can provide richer context and background, and help the model understand the meaning and function of each field more comprehensively.

[0081] Specifically, the S76 semantically encodes the sequence of multidimensional information of the HART response data field to obtain a global semantic encoding feature vector of the HART response data. Considering that there is a hierarchical structure and mutual dependency between the fields in the sequence of multidimensional information of the HART response data field, such as nested fields, multi-level commands, etc. Therefore, in order to better understand and represent the global semantic structure information of the HART response data, in the technical solution of the present application, the sequence of multidimensional information of the HART response data field is passed through a HART response data semantic encoder based on a tree-shaped long short-term memory network to obtain a global semantic encoding feature vector of the HART response data. That is, compared with traditional linear sequence models (such as RNN and LSTM), the tree-shaped long short-term memory network can more effectively process data with complex structures. Through the hierarchical relationship of the tree structure, it can better capture the logical relationship and dependency between fields, characterize the deep association of long-distance dependencies between fields, and thus obtain global semantic information.

[0082] Specifically, the S77 obtains a test result based on the global semantic coding feature vector of the HART response data, and the test result is used to indicate whether the HART functional state of the channel is normal. In a specific example of the present application, the global semantic structure coding feature vector of the HART response data is passed through a HART functional state detector based on a classifier to obtain a test result, and the test result is used to indicate whether the HART functional state of the channel is normal. That is, the global semantic coding feature vector of the HART response data obtained by global structural association using the sequence of multi-dimensional information of the HART response data field is classified and processed to intelligently determine whether the HART functional state of the channel is normal. In this way, it is possible to intelligently determine whether the HART functional state of the channel is normal, and deal with problems in a timely manner, reducing the need for manual intervention, thereby effectively improving the accuracy and efficiency of the HART functional state judgment, and thus improving the overall reliability and safety of the system.

[0083] Preferably, passing the HART response data global semantic structure encoding feature vector through a classifier-based HART functional state detector to obtain a detection result includes: performing feature clustering on the feature set of the HART response data global semantic structure encoding feature vector to obtain a HART response data global semantic structure encoding in-class feature set and a HART response data global semantic structure encoding out-class feature set, that is: ;in, represents the feature set within the global semantic structure encoding class of the HART response data, Represents the out-of-class feature set encoded in the global semantic structure of the HART response data.

[0084] Calculate the ratio of the number of eigenvalues ​​in the feature set of the HART response data global semantic structure encoding class to the number of eigenvalues ​​in the feature set of the HART response data global semantic structure encoding feature vector, that is: ;in, represents the number of feature values ​​in the feature set within the global semantic structure encoding class of the HART response data, The number of eigenvalues ​​of the feature set representing the global semantic structure encoding feature vector of the HART response data.

[0085] Calculate the absolute value sum of all feature values ​​in the feature set of the global semantic structure encoding class of the HART response data The power of the sum of the absolute values ​​of all feature values ​​in the feature set of the feature vector encoding the global semantic structure of the HART response data The ratio of the powers is used to obtain the modulation weights of the global semantic structure coding of the HART response data, namely: ;in, Represents the HART response data global semantic structure coding modulation weight;

[0086] Calculate the sum of squares of all feature values ​​in the feature set of the global semantic structure encoding class of the HART response data The power of the sum of squares of all eigenvalues ​​in the feature set of the feature vector encoded with the global semantic structure of the HART response data The ratio of the powers is used to obtain the global semantic structure encoding and harmonic weight of the HART response data, namely: ;in, Represents the global semantic structure encoding and reconciliation weights of the HART response data.

[0087] For each feature value in the feature set within the HART response data global semantic structure encoding class, calculate its product with the HART response data global semantic structure encoding harmonic weight and add the HART response data global semantic structure encoding modulation weight to obtain the optimized feature value, that is: ;in, represents the optimized eigenvalue.

[0088] For each feature value in the out-of-class feature set of the HART response data global semantic structure encoding, the product of the feature value and the HART response data global semantic structure encoding adjustment weight is calculated to obtain the optimized feature value, that is: ;in, represents the optimized eigenvalue.

[0089] The optimized HART response data global semantic structure encoding feature vector based on the optimized feature values ​​of the HART response data global semantic structure encoding in-class feature set and the HART response data global semantic structure encoding out-class feature set is passed through a classifier-based HART functional status detector to obtain a detection result.

[0090] Here, in the case where the sequence of the multi-dimensional information of the HART response data field represents the source card HART response data field sequence and its collective expression of class labels and lengths based on sequence field effect distribution enhanced embedded semantic features, it is expected to improve the semantically consistent aggregation expression effect of the HART response data global semantic structure encoding feature vector obtained by the HART response data semantic encoding based on the tree-shaped long short-term memory network.

[0091] Therefore, while clustering the feature vectors of the global semantic structure encoding of the HART response data, the interaction description of the key feature information of the global semantic structure encoding feature vectors of the HART response data in the clustering process is carried out, and the geometric equivariant topology of the features is constructed by low-rank harmonic modulation of the features on the equivariant basis of the clustering features of the global semantic structure encoding feature vectors of the HART response data and the features as a whole, so as to obtain the graphical distribution translation and rotation symmetry of the clustering features of the global semantic structure encoding feature vectors of the HART response data relative to the features as a whole, thereby introducing geometric message passing into the feature expression of the global semantic structure encoding feature vectors of the HART response data, and realizing the clustering mapping symmetry of the global semantic structure encoding feature vectors of the HART response data through manipulation of irreducible low-rank coefficients, thereby improving the consistency of the clustering-based feature representation of the global semantic structure encoding feature vectors of the HART response data, thereby improving the accuracy of the detection results obtained by the global semantic structure encoding feature vectors of the HART response data through the classifier-based HART functional state detector.

[0092] In summary, the HART diagnostic method adapted for portable inspection tooling according to the embodiment of the present application is explained, which extracts the source card HART response data from the response of the source card, and adopts a data analysis and enhancement mechanism based on deep learning to perform field segmentation and embedding encoding on the source card HART response data, and then performs field effect global semantic enhancement on the embedded features of each HART response data field, and then parses the command type label corresponding to each enhanced global HART response data field embedded feature, and forms multi-dimensional information based on the data length and type label of each HART response data field, so as to intelligently judge whether the HART functional status of the channel is normal according to the complex hierarchical structure dependency characteristics between the multi-dimensional information of each HART response data field. In this way, it is possible to intelligently judge whether the HART functional status of the channel is normal, and deal with problems in a timely manner, reducing the need for manual intervention, thereby effectively improving the accuracy and efficiency of the HART functional status judgment, and thus improving the overall reliability and security of the system.

[0093] In the field of industrial automation control, the accuracy of IO card parts may deviate over time. After working for a long time in a harsh environment, periodic inspection is required. If it is sent back to the production center for inspection, the time and labor costs are high. Therefore, a portable inspection tooling system is developed, which can be carried by staff to the production site to inspect the card parts, minimizing the impact on production as much as possible.

[0094] One difficulty in portable inspection tools is the detection of HART functions. Generally speaking, IO cards have many HART channel points and support several wiring methods. Using connecting instruments to detect IO cards requires carrying a large number of different instruments, which loses portability; it also requires constant wiring, which loses efficiency.

[0095] In view of the above problems, this paper proposes a diagnostic method that integrates HART on the source card. The HART modulator is used to transmit the HART signal of the channel to the MCU of the source card. The HART slave is simulated in the firmware of the source card to respond to the HART host signal of the card to be tested, thereby realizing HART tooling detection.

[0096] There are two ways to implement it, taking the 16-point AI type source card as an example: 1. A HART modulator is installed on each channel. Each of the 16 channels of the source card is integrated with a HART modulator. During the test, the source card sets all HART modulators to the receiving mode to receive the HART polling command sent by the HART host of the card to be tested on any channel, and responds to the current channel after receiving it.

[0097] 2. Only one HART modulator is equipped. The hardware controls the sending and receiving of HART commands on a certain channel through the MCU. The source card does not have the information sent from that channel by the HART host command of the test card. At this time, supporting host computer software is required to synchronize the information.

[0098] The advantage of solution one is that it does not require synchronization with the host computer, but the problem it brings is the increase in cost and the tight space on the PCB board, so the second solution is chosen.

[0099] Figure 4 Schematic diagram of the HART detection principle according to an embodiment of the present application.

[0100] There are many benefits to HART modulation chip reuse, but the biggest problem is how to synchronize the HART channels of the source card and the IO card to be tested. To solve this problem, a set of processes is designed to synchronize the source card and the card to be tested through the host device equipped with inspection software and the industrial bus.

[0101] The following is the test process of a channel: 1. First, the host computer sends a HART detection command to the notification source card through the industrial bus. The command contains the channel number information of the channel to be tested.

[0102] 2. After receiving the HART detection command from the host computer, the source card sets itself to the HART slave, sets itself to the receiving state, and waits for the query command from the HART host. After completing the above actions, it sends a response to the host computer, indicating that it is ready to receive.

[0103] 3. After receiving the response from the source card, the host computer starts to send the HART host query command, which also contains the HART test channel number and the HART query command that should be sent to the slave. The card to be tested acts as a HART host to send the query command to the source card. After sending, it waits for the source card to respond. If there is no response within a certain period of time, it will resend. No more attempts will be made after 3 failures.

[0104] 4. After receiving the command as a slave, the source card will check it according to the protocol. If the query command complies with the protocol, it will respond. If it does not comply, it will not respond.

[0105] 5. After receiving the reply to the query command within the specified time, the card under test will parse it to see if the command complies with the HART protocol. If it does, the command of the source card response will be reported to the host computer.

[0106] 6. After receiving the command, the host computer will analyze it. If it is normal, it is considered that the HART of the channel is normal; if it times out, it is considered that the HART is faulty.

[0107] For an IO card, the HART function test of the entire card can be completed by automatically detecting all channels through software.

[0108] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A HART diagnostic method adapted for portable inspection tooling, characterized in that: include: The host computer sends HART detection commands to the source card through the industrial bus; After receiving the HART detection command, the source card is set to HART slave mode and the corresponding physical channel of the source card is configured to receive mode, and sends a response to the host computer; After receiving the response from the source card, the host computer sends a test instruction including a test channel number and a HART query command to the card to be tested; The card to be tested acts as a HART host to send the test instruction to the source card and wait for a response from the source card; In response to the source card receiving the test instruction of the card to be tested, verifying the test instruction according to the HART protocol, wherein in response to the test instruction meeting the protocol requirements, the source card responds; In response to the card under test receiving a response from the source card within a specified time, parsing the response to ensure that it complies with the HART protocol, wherein, in response to the response complying with the HART protocol, reporting the response from the source card to the host computer; In response to the host computer receiving a response from the source card, parsing the response from the source card to determine whether the HART function of the channel is normal; Wherein, in response to the host computer receiving a response from the source card, parsing the response from the source card to determine whether the HART function of the channel is normal includes: Extracting source card HART response data from the response of the source card; Performing field segmentation and embedding coding on the source card HART response data to obtain a sequence of HART response data field embedding coding vectors; Performing field-driven global semantic enhancement on the sequence of HART response data field embedded coding vectors to obtain a sequence of enhanced global HART response data field embedded coding vectors; Based on the sequence of the enhanced global HART response data field embedded coding vectors, obtaining a parsing result, wherein the parsing result is used to represent a command type label corresponding to each of the HART response data fields; Adding the data length and command type tag corresponding to each HART response data field in the sequence of HART response data fields to the end of each HART response data field to obtain a sequence of multi-dimensional information of the HART response data field; Performing semantic encoding on the sequence of multi-dimensional information of the HART response data field to obtain a global semantic encoding feature vector of the HART response data; Based on the global semantic coding feature vector of the HART response data, a detection result is obtained, and the detection result is used to indicate whether the HART functional status of the channel is normal.

2. According to the HART diagnostic method adapted for portable inspection tooling of claim 1, field segmentation and embedding coding are performed on the source card HART response data to obtain a sequence of HART response data field embedding coding vectors, including: Segmenting the source card HART response data according to the fields defined by the protocol to obtain a sequence of HART response data fields; The HART response data embedding matrix is ​​used to embed code each HART response data field in the sequence of HART response data fields to obtain a sequence of HART response data field embedding code vectors.

3. The HART diagnostic method adapted for portable inspection tooling according to claim 2, characterized in that: Performing field-driven global semantic enhancement on the sequence of HART response data field embedded coding vectors to obtain a sequence of enhanced global HART response data field embedded coding vectors, including: Using a semantic reconstructor, feature reconstruct each HART response data field embedded coding vector in the sequence of HART response data field embedded coding vectors to obtain a sequence of reconstructed HART response data field embedded coding vectors; Calculating the semantic depth implicit representation value of each reconstructed HART response data field embedded coding vector in the sequence of reconstructed HART response data field embedded coding vectors to obtain a sequence of HART response data depth implicit representation values; Based on the sequence of deep implicit representation values ​​of the HART response data, a bidirectional global semantic interaction is performed on the sequence of HART response data field embedding coding vectors to obtain a sequence of enhanced global HART response data field embedding coding vectors.

4. According to the HART diagnostic method adapted for portable inspection tooling of claim 3, based on the sequence of HART response data deep implicit representation values, a bidirectional global semantic interaction is performed on the sequence of HART response data field embedded coding vectors to obtain a sequence of enhanced global HART response data field embedded coding vectors, including: Based on the order of the sequence of the HART response data deep implicit representation values, reorder the sequence of the HART response data field embedded coding vectors to obtain an updated sequence of the HART response data field embedded coding vectors; Inputting the updated sequence of the HART response data field embedding coding vector into the first semantic encoder based on the forward LSTM model to obtain a sequence of forward global HART response data field embedding coding vectors; Inputting the updated sequence of the HART response data field embedding coding vector into the first semantic encoder based on the backward LSTM model to obtain a sequence of backward global HART response data field embedding coding vectors; Calculate the weighted sum of the corresponding forward global HART response data field embedded coding vector and the backward global HART response data field embedded coding vector in the sequence of the forward global HART response data field embedded coding vector and the sequence of the backward global HART response data field embedded coding vector to obtain the sequence of the enhanced global HART response data field embedded coding vector.

5. The HART diagnostic method adapted for portable inspection tooling according to claim 4, characterized in that: Based on the sequence of the enhanced global HART response data field embedded coding vectors, a parsing result is obtained, including: each enhanced global HART response data field embedded coding vector in the sequence of the enhanced global HART response data field embedded coding vector is passed through a classifier-based command type parser to obtain the parsing result.

6. The HART diagnostic method adapted for portable inspection tooling according to claim 5, characterized in that: The sequence of multi-dimensional information of the HART response data field is semantically encoded to obtain a global semantic encoding feature vector of the HART response data, including: passing the sequence of multi-dimensional information of the HART response data field through a HART response data semantic encoder based on a tree-like long short-term memory network to obtain the global semantic encoding feature vector of the HART response data.

7. The HART diagnostic method adapted for portable inspection tooling according to claim 6, characterized in that: Based on the global semantic coding feature vector of the HART response data, a detection result is obtained, including: passing the global semantic structure coding feature vector of the HART response data through a classifier-based HART functional status detector to obtain the detection result.

Citation Information

Patent Citations

  • Communication control system and method suitable for high-speed CAN and low-speed CAN

    CN116136685A

  • Automatic semantic labeling of form fields with limited annotations

    US20230161952A1