Communication method and device of industrial equipment, electronic equipment and storage medium
By configuring the protocol processor to dynamically adapt to the communication protocol of semiconductor devices, the problem of existing technologies being unable to adapt to multiple protocol types is solved, achieving flexible compatibility and efficient communication of devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING JINGYI AUTOMATION EQUIP CO LTD
- Filing Date
- 2026-01-04
- Publication Date
- 2026-05-15
AI Technical Summary
The communication capabilities of existing semiconductor devices cannot dynamically adapt to the requirements of various communication protocol types, resulting in high difficulty in device integration and increased system complexity and cost.
Configure a protocol processor for at least one type of communication protocol, match the target protocol processor based on the current communication protocol type sent by the industrial equipment, process the internal data of the target through the target protocol processor, and respond to request messages to achieve dynamic adaptation to multiple communication protocol types.
It enables semiconductor devices to dynamically adapt to the requirements of various communication protocol types, reduces hardware resource consumption, improves device compatibility and applicability, and simplifies configuration and maintenance.
Smart Images

Figure CN122053715A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial communication technology, and in particular to a communication method, apparatus, electronic device, and storage medium for industrial equipment. Background Technology
[0002] Semiconductor manufacturing is the core of the modern electronics industry, and its production process involves a series of highly complex processes such as wafer fabrication, photolithography, etching, thin film deposition, and packaging and testing. These processes require a large number of precise, automated production and auxiliary equipment working together. For example, main production equipment such as photolithography machines and etching machines, along with auxiliary equipment such as vacuum pumps, RF power supplies, and cooling systems, together form a tightly coupled production system. These devices typically come from different suppliers, resulting in a wide variety of built-in communication interfaces and software communication protocols. This heterogeneity in communication protocols poses a significant challenge to achieving data integration, centralized monitoring, and intelligent management of all equipment in the plant, creating "data silos" and hindering the construction of an efficient and unified industrial Internet of Things (IIoT) and intelligent manufacturing system.
[0003] To address the communication challenges between heterogeneous devices, existing technologies typically employ a "one device, one solution" approach. Specifically, this involves developing independent hardware communication modules or software drivers for each specific communication protocol. In the initial stages of system deployment, technicians need to select a dedicated programmable logic controller (PLC), embedded controller, or industrial computer with a specific communication interface card based on the protocol type of the field devices. This approach is essentially a single-protocol stack processing mechanism, meaning that a single control unit can only handle one pre-defined communication protocol at a time. When data exchange with devices using different protocols is required, one or more external protocol conversion gateway devices must be added to the system. This approach increases system complexity and cost.
[0004] Existing semiconductor devices can only support one or a few fixed communication protocol types, and cannot dynamically adapt to the needs of multiple communication protocol types, resulting in great difficulty in device integration. Summary of the Invention
[0005] This invention provides a communication method, apparatus, electronic device, and storage medium for industrial equipment, which addresses the shortcomings of existing semiconductor devices in dynamically adapting to the requirements of various communication protocol types, thereby enabling semiconductor devices to dynamically adapt to the requirements of various communication protocol types.
[0006] This invention provides a communication method for industrial equipment, comprising: Configure a protocol processor for at least one type of communication protocol; Based on the current communication protocol type sent by the industrial equipment, match each protocol processor and obtain the target protocol processor; Based on the request message of the target protocol processor and the current communication protocol type, the internal data of the target is processed; the internal data of the target is the internal data of the industrial equipment requested to be processed by the request message of the current communication protocol type. Once the target's internal data processing is complete, a response request message is sent.
[0007] According to the communication method for industrial equipment provided by the present invention, the target protocol processor includes a target verification function, a target read function, a target write function, a verification flag, and a format conversion flag. The format conversion flag is used to convert a request message of a second format type into a request message of a first format type. If the current communication protocol type is the first format type, the format conversion flag indicates that no format conversion is needed. Based on the target protocol processor and the request message of the current communication protocol type, the internal data of the target is processed, including: When the verification flag indicates that verification is required, the request message of the first format type is verified based on the target verification function to obtain the request message that has passed the verification. Parse the validated request message to identify the target's internal data; The target read function reads the target's internal data from the internal storage unit into the protocol data structure; the internal storage unit is used to periodically retrieve the internal data of the industrial equipment; the protocol data structure is used to cache the processing data of request messages. When the function code of the request message that passes the verification is the write function, the write operation is performed on the target internal data in the protocol data structure to obtain the target internal data after writing. The target write function writes the target's internal data from the protocol data structure to the internal storage unit to complete the processing of the target's internal data.
[0008] According to the communication method for industrial equipment provided by the present invention, parsing a verified request message and identifying target internal data includes: Parse the validated request message and obtain the destination register address of the validated request message; Based on the target register address, the mapping table between register addresses and internal data is queried, and the queried internal data is used as the target internal data.
[0009] The communication method for industrial equipment provided by the present invention, after reading the target's internal data from the internal storage unit into the protocol data structure based on the target reading function, further includes: When the function code is read, a read operation is performed on the target internal data in the protocol data structure to obtain the read target internal data in order to complete the processing of the target internal data.
[0010] According to the communication method for industrial equipment provided by the present invention, if the request message of the current communication protocol type is of the second format type, before obtaining the request message of the first format type after verifying the first format type based on the target verification function when the verification flag bit is required, the method further includes: Convert the second format type message request into the first format type request message.
[0011] According to the communication method for industrial equipment provided by the present invention, after the target's internal data processing is completed, a response request message is sent, including: Once the target's internal data processing is complete, a first-format response frame is created; If the request message of the current communication protocol type is of the first format type, then a reply message is sent to the host of the request message based on the first format response frame; If the request message of the current communication protocol type is of the second format type, then the first format response frame is converted into the second format response frame, and a reply message is sent to the host based on the second format response frame.
[0012] According to the communication method for industrial equipment provided by the present invention, the reply message is determined based on the following method: Retrieve the target's internal data after reading or writing from the protocol data structure; The response message is determined based on the target's internal data after it has been read or written.
[0013] According to the communication method for industrial equipment provided by the present invention, the target protocol processor further includes a target initialization function, which is used to determine the receiving method and response method of the request message.
[0014] According to the communication method for industrial equipment provided by the present invention, after responding to the request message, it further includes: When the internal storage unit obtains the target internal data after it has been written, it sends the target internal data to the industrial equipment to update the internal data of the industrial equipment.
[0015] The present invention also provides a communication device for industrial equipment, comprising a communication board and industrial equipment, wherein the communication board and industrial equipment are communicatively connected; A communication board for configuring a protocol processor of at least one type of communication protocol; Industrial equipment is used to select the current communication protocol type and send the current communication protocol type to the communication board; The communication board is used to match various protocol processors based on the current communication protocol type and obtain the target protocol processor; when a request message of the current communication protocol type is received, the internal data of the target is processed based on the target protocol processor; the internal data of the target is the internal data of the industrial equipment requested to be processed by the request message of the current communication protocol type; after the internal data of the target is processed, the board responds to the request message.
[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the communication method of any of the above-described industrial devices.
[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the communication method of any of the industrial devices described above.
[0018] The present invention provides a communication method, apparatus, electronic device, and storage medium for industrial equipment. This involves configuring a protocol processor for at least one communication protocol type; matching various protocol processors based on the current communication protocol type sent by the industrial equipment to obtain a target protocol processor; processing the target's internal data based on a request message of the target protocol processor and the current communication protocol type; the target's internal data being the request message of the current communication protocol type requesting processing of the industrial equipment's internal data; and responding to the request message after the target's internal data processing is complete. By pre-configuring a protocol processor for at least one communication protocol type and then matching various protocol processors to determine the target protocol processor, the present invention enables communication with hosts using different communication protocol types according to changing communication needs, achieving dynamic adaptation of industrial equipment (e.g., semiconductor equipment) to multiple communication protocol type requirements. Furthermore, by integrating various protocol processors, the present invention reduces the hardware resource consumption of each protocol processor. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is one of the flowcharts illustrating the communication method for industrial equipment provided by the present invention.
[0021] Figure 2 This is the second flowchart illustrating the communication method for industrial equipment provided by the present invention.
[0022] Figure 3 This is the third flowchart illustrating the communication method for industrial equipment provided by the present invention.
[0023] Figure 4 This is the fourth flowchart illustrating the communication method for industrial equipment provided by the present invention.
[0024] Figure 5 This is a schematic diagram of the structure of the communication device for industrial equipment provided by the present invention.
[0025] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0027] The following is combined with Figures 1-6 The present invention describes a communication method, apparatus, and electronic device for industrial equipment.
[0028] Figure 1 This is one of the flowcharts illustrating the communication method for industrial equipment provided by the present invention. Figure 2 This is a second schematic flowchart of the communication method for industrial equipment provided by the present invention, as shown below. Figure 1 and Figure 2 As shown, the communication method for industrial equipment includes steps S100-S400, and the specific steps are as follows.
[0029] S100: Configure a protocol processor for at least one type of communication protocol.
[0030] The industrial equipment of this invention includes semiconductor manufacturing equipment. This embodiment of the invention uses semiconductor manufacturing equipment as an example for illustration. The industrial equipment of this invention is equipped with a communication board. The industrial equipment uses the communication board to interface with various types of communication protocols.
[0031] Protocol processors include dedicated units or software for handling communication protocols, responsible for tasks such as parsing, encapsulating, verifying, and managing the status of communication protocols.
[0032] Communication protocol types include industrial communication protocol types, such as industrial Ethernet and industrial wireless.
[0033] Different manufacturers' host devices communicate with the communication board using their respective communication protocol types. Protocol processors are configured for each communication protocol type. One protocol processor is configured for each communication protocol type on the communication board. Multiple protocol processors, or all protocol processors, share a single communication board (physical hardware).
[0034] Each protocol processor stores a protocol descriptor matching the communication protocol type. The protocol descriptor contains all the necessary information about the communication protocol type. Various types of communication protocols are abstracted into protocol descriptors based on a unified protocol description template. The protocol descriptor includes basic configuration parameters of the communication protocol, a pointer to the protocol processing function, the processing function itself, and flag bits.
[0035] Basic configuration parameters include baud rate, timeout, and communication code. Baud rate defines the data transmission speed. Timeout defines the maximum time the host will wait for a response to a request message. Communication code is a unique identifier that identifies the communication protocol type.
[0036] Protocol processing function pointers are used to point to and invoke processing functions. Processing functions include initialization functions, verification functions, read functions, and write functions. Verification functions include Cyclic Redundancy Check (CRC) and Longitudinal Redundancy Check (LRC) functions.
[0037] To address the differences in data representation between different types of communication protocols (such as ASCII vs. RTU formats, endianness, etc.), this invention includes several flag bits in the protocol descriptor. These flag bits indicate whether the protocol requires ASCII conversion, CRC checksum, LRC checksum, or other similar features. The system can automatically adjust its data processing flow based on these flag bits during runtime.
[0038] S200: Based on the current communication protocol type sent by the industrial equipment, match each protocol processor and obtain the target protocol processor.
[0039] The target protocol processor is a protocol processor that matches the current communication protocol type. Other industrial processing equipment (e.g., wafer processing equipment, etching equipment, deposition equipment, etc.) communicate with the semiconductor industrial production equipment through their corresponding host terminals.
[0040] The operator inputs the current communication protocol type of other industrial processing equipment (e.g., semiconductor manufacturing equipment) into the industrial equipment. The industrial equipment then sends the current communication protocol type to the communication board.
[0041] Optionally, the operator inputs an identifier for the current communication protocol type (e.g., the name of the communication protocol, communication code, etc.) into the industrial equipment. The industrial equipment sends this identifier to the communication board. The communication board pre-stores identifiers for various communication protocol types. The communication board matches the received identifier for the current communication protocol type against the pre-stored identifiers for various communication protocol types; if a match is found, the current communication protocol type is identified.
[0042] The communication board matches the pre-configured protocol processors with the received current communication protocol type (or the identified current communication protocol type) to obtain the target protocol processor.
[0043] Furthermore, the communication board continuously monitors the current communication protocol type from the industrial equipment and checks for changes in this type. If the current communication protocol type changes, it re-matches the target protocol processor. If the current communication protocol type does not change, it continues to use the currently determined target protocol processor.
[0044] S300: Processes the internal data of the target based on the request message of the target protocol processor and the current communication protocol type.
[0045] The target internal data is a request message of the current communication protocol type, requesting the processing of internal data of the industrial equipment.
[0046] When the host terminal corresponding to the communication protocol type needs to process the internal data of the industrial equipment, the host terminal sends a request message of the current communication protocol type to the communication board of the industrial equipment.
[0047] The request message includes an address field, a function code, a data segment, and an error check segment. The address field identifies the communication board (communication object). The function code determines the specific operation type (including read, write, etc.). The data segment identifies the internal data of the industrial equipment that the request message requests to be processed. The error check segment checks whether the data segment transmission was correct.
[0048] After receiving a request message of the current communication protocol type, the communication board obtains the target's internal data according to the request message of the current communication protocol type.
[0049] The communication board processes the target's internal data based on the request message from the target protocol processor and the current communication protocol type.
[0050] Furthermore, when the communication board receives a request message of the current communication protocol type, it determines whether the request message of the current communication protocol type requires special processing. If the request message of the current communication protocol type does not require special processing, the general protocol parsing function is called to process the request message of the current communication protocol type. If the request message of the current communication protocol type requires special processing, the special protocol parsing function is called to process the request message of the current communication protocol type.
[0051] S400: After the target's internal data processing is complete, respond with a request message.
[0052] After the communication board finishes processing the target's internal data, it generates a reply message based on the processed data and sends the reply message to the host of the request message in response to the request message.
[0053] The communication method for industrial equipment provided in this invention involves configuring a protocol processor for at least one communication protocol type; matching various protocol processors based on the current communication protocol type sent by the industrial equipment to obtain a target protocol processor; processing the target's internal data based on a request message of the target protocol processor and the current communication protocol type; the target's internal data being the request message of the current communication protocol type requesting processing of the industrial equipment's internal data; and responding to the request message after the target's internal data processing is complete. This invention, by pre-configuring a protocol processor for at least one communication protocol type and then matching various protocol processors to determine the target protocol processor, enables communication with hosts using different communication protocol types according to changing communication needs, achieving dynamic adaptation of industrial equipment (e.g., semiconductor equipment) to multiple communication protocol type requirements. Furthermore, by integrating various protocol processors, this invention reduces the hardware resource consumption of each protocol processor.
[0054] Based on the above embodiments, the target protocol processor includes a target verification function, a target read function, a target write function, a verification flag, and a format conversion flag. The format conversion flag is used to convert a request message of the second format type into a request message of the first format type. If the request message of the current communication protocol type is of the first format type, the internal data of the target is processed based on the target protocol processor and the request message of the current communication protocol type, including the following steps: When the verification flag indicates that verification is required, the request message of the first format type is verified based on the target verification function to obtain the request message that has passed the verification. Parse the validated request message to identify the target's internal data; The target read function reads the target's internal data from the internal storage unit into the protocol data structure; the internal storage unit is used to periodically retrieve the internal data of the industrial equipment; the protocol data structure is used to cache the processing data of request messages. When the function code of the request message that passes the verification is the write function, the write operation is performed on the target internal data in the protocol data structure to obtain the target internal data after writing. The target write function writes the target's internal data from the protocol data structure to the internal storage unit to complete the processing of the target's internal data.
[0055] The target protocol processor stores a target protocol descriptor for the current communication protocol type. The target protocol descriptor includes the target's basic configuration parameters for the current communication protocol type, a pointer to the target protocol processing function, the target processing function, and target flags. The target processing functions include a target verification function, a target read function, and a target write function. The target flags include a verification flag and a format conversion flag.
[0056] The target verification function includes a CRC verification function and an LRC verification function, which are used to verify the request message.
[0057] The target read function is used to read the target's internal data from its internal storage unit into the protocol data structure.
[0058] The target write function is used to write the processed target internal data from the protocol data structure to the internal storage unit.
[0059] The checksum flag indicates whether a request message of the current communication protocol type requires checksum verification. The format conversion flag indicates whether a request message of the current communication protocol type requires format conversion. The checksum flag and format conversion flag are used to automatically adjust the data processing flow of request messages of the current communication protocol type.
[0060] The internal storage unit, located within the communication board, serves as a "central data warehouse" specifically for storing the internal data of industrial equipment. It contains all the equipment's status information, such as temperature, pressure, operating status, and alarm information. All request messages access this internal storage unit through protocol-specific processing functions (including target read and target write functions) to ensure data consistency.
[0061] Each protocol processor has a corresponding protocol data structure for its communication protocol type. The protocol data structure stores the data items defined for that communication protocol type. It serves as a relay station for data exchange between the protocol processor and its internal storage.
[0062] like Figure 2As shown, the communication board and the industrial equipment communicate using a fixed communication protocol (e.g., Modbus TCP). The communication board and the industrial equipment maintain communication periodically. The communication board periodically (or periodically) reads the internal data of the industrial equipment and stores the read data in its internal storage unit.
[0063] The first format type is a common format type for the communication board. A communication protocol type can use at least one format type for request messages. The first format type includes RTU type or ASCII type. When the first format type is RTU type, the second format type is ASCII type. When the first format type is ASCII type, the second format type is RTU type. This embodiment of the invention uses RTU type as the first format type and ASCII type as the second format type for illustration. If the current communication protocol type is the first format type (RTU type), then the request message of the current communication protocol type is an RTU type request message. In this case, the RTU type request message does not require format conversion, and the communication board can directly process the first format type (RTU type) request message.
[0064] Specifically, the communication board writes data to the target's internal data based on the request message from the target protocol processor and the current communication protocol type, including the following steps.
[0065] Step a: Verification and Parsing. The communication board determines whether a request message of the first format type needs verification based on the verification flag. If the verification flag indicates no verification is needed, no verification is required, and the request message of the first format type is directly parsed to identify the target's internal data. If the verification flag indicates verification is needed, the target verification function is first called to verify the request message of the first format type, obtaining a verification-passing request message. The verification-passing request message is then parsed to identify the target's internal data. Verification is to confirm whether there are any transmission errors or data loss issues during the data transmission of the request message. If verification fails, subsequent processing stops. If verification succeeds, proceed to step b.
[0066] Step b: Read the target's internal data. The communication board calls the target read function to read the target's internal data from the internal storage unit into the target protocol processor's protocol data structure.
[0067] Step c: Process the target internal data. The communication board calls the function code of the verified request message to process the target internal data. If the function code of the verified request message is a write function, then the function code is called to perform a write operation on the target internal data in the protocol data structure, obtaining the written target internal data.
[0068] Step d: Update internal data. After the write operation is completed, the target write function is called to write the target internal data from the protocol data structure to the internal storage unit, so as to update the internal data in the internal storage unit according to the written target internal data. This completes the processing of the target internal data.
[0069] The target protocol processor designed in this invention includes a target verification function, a target read function, a target write function, a verification flag, and a format conversion flag. The verification flag automatically adjusts the verification process for request messages of the current communication protocol type. The format conversion flag automatically identifies whether format conversion is needed for request messages of the current communication protocol type. The protocol data structure of this invention serves as an intermediate structure for data interaction with the internal storage unit, ensuring that all protocol processors interact with the internal storage unit through their own protocol data structure, thus standardizing the data interaction process between each protocol processor and the internal storage unit. By designing the target verification function, target read function, and target write function, the process of processing the target internal data according to request messages of different communication protocol types and the target protocol processor is standardized. Based on the write function code, this invention performs a write operation on the target internal data in the protocol data structure, and then writes the written target internal data from the protocol data structure to the internal storage unit, realizing the update of the internal data in the internal storage unit.
[0070] Based on the above embodiments, the target protocol processor further includes a target initialization function, which is used to determine the receiving method and response method of the request message.
[0071] The target initialization function is used to call the basic configuration parameters in the target protocol processor to determine the receiving and response methods of request messages.
[0072] Basic configuration parameters include baud rate, timeout, and communication code. Baud rate defines the data transmission speed. Timeout defines the maximum time the host will wait for a response to a request message. Communication code is a unique identifier that identifies the communication protocol type.
[0073] This invention enables flexible configuration of the target initialization function, allowing for flexible setting of the request message receiving and response methods.
[0074] Based on the above embodiments, parsing the verified request message and identifying the target's internal data includes the following steps: Parse the verified request message to obtain the target register address of the verified request message; Based on the target register address, the mapping table between the register address and the internal data is queried, and the queried internal data is used as the target internal data.
[0075] The mapping table contains a one-to-one mapping between register addresses and internal data. The register address is the address carried in the data segment of the request message. Optionally, there can be one, two, or more mapping tables. Optionally, one mapping table can be designed for each communication protocol type. The mapping table can be stored in each protocol processor or centrally stored on the communication board.
[0076] Parse the verified request message and extract the target register address from the data segment of the verified request message.
[0077] Based on the extracted target register address, the mapping table between register address and internal data is queried, and the queried internal data is used as the target internal data.
[0078] Furthermore, the mapping table between register addresses and internal data also includes access permission identifiers for the register addresses. These access permission identifiers indicate whether the register address is readable or writable. Optionally, the validated request message is parsed to obtain the target register address. Based on the target register address, the mapping table between register addresses and internal data is queried to obtain the access permission for the target register address, and the retrieved internal data is used as the target internal data.
[0079] To enable messages of different communication protocol types to access the internal data of the same industrial device, this invention designs a unified data mapping mechanism, namely a mapping table between register addresses and internal data. Through this mapping table, request messages of different communication protocol types can access the same internal data through their respective defined register addresses. This mechanism allows the system to support multiple communication protocols with different address mapping rules without changing the internal data structure. For example, some communication protocols may use an address space starting with 0, while others may use an address space with a specific offset; these differences can be easily handled through the mapping table.
[0080] Based on the above embodiments, after reading the target's internal data from the internal storage unit into the protocol data structure using the target read function, the following steps are also included: When the function code is read, a read operation is performed on the target internal data in the protocol data structure to obtain the read target internal data in order to complete the processing of the target internal data.
[0081] Specifically, the communication board reads and processes the internal data of the target based on the request message of the target protocol processor and the current communication protocol type, including the following steps.
[0082] Step a: Verification and Parsing. The communication board determines whether a request message of the first format type needs verification based on the verification flag. If the verification flag indicates no verification is needed, no verification is required, and the request message of the first format type is directly parsed to identify the target's internal data. If the verification flag indicates verification is needed, the target verification function is first called to verify the request message of the first format type, obtaining the verification-passing request message. The verification-passing request message is then parsed to identify the target's internal data.
[0083] Step b: Read the target's internal data. The communication board calls the target read function to read the target's internal data from the internal storage unit into the target protocol processor's protocol data structure.
[0084] Step c: Process the target's internal data. The communication board calls the function code of the verified request message to process the target's internal data. If the function code of the verified request message is a read function, then the function code is called to perform a read operation on the target's internal data in the protocol data structure, obtaining the read target's internal data. This completes the processing of the target's internal data.
[0085] This invention enables the reading of target internal data in a protocol data structure based on the function code of the reading function.
[0086] Based on the above embodiments, if the request message of the current communication protocol type is of the second format type, when the verification flag bit indicates that verification is required, before verifying the request message of the first format type based on the target verification function and obtaining the verification-passed request message, the following steps are also included: Convert the second format type message request into the first format type request message.
[0087] The second format type includes the ASCII type. The second format type is not a common communication protocol type for the communication board. If the current communication protocol type is the second format type (ASCII type), then the request message for the current communication protocol type is an ASCII type request message. In this case, the communication board needs to first convert the second format type request message into a first format type request message. Then, it executes the processing flow for the first format type request message.
[0088] This invention, through a format conversion flag, can automatically convert the format of request messages of a second format type before processing. This invention, by setting a format conversion flag, can automatically convert the format of request messages of multiple different format types before processing.
[0089] Based on the above embodiments, after the target's internal data processing is completed, the response request message includes the following steps: Once the target's internal data processing is complete, a first-format response frame is created; If the request message of the current communication protocol type is of the first format type, then a reply message is sent to the host of the request message based on the first format response frame; If the request message of the current communication protocol type is of the second format type, then the first format response frame is converted into the second format response frame, and a reply message is sent to the host based on the second format response frame.
[0090] Once the target's internal data processing is complete, a first-format response frame is created. This first-format response frame is a common response frame for the communication board. It is a response frame to a request message of the first format type. The second-format response frame is a response frame to a request message of the second format type. The first-format response frame can be either an RTU format response frame or an ASCII format response frame. Optionally, when the first-format response frame is an RTU format response frame, the second-format response frame is an ASCII format response frame. Alternatively, when the first-format response frame is an ASCII format response frame, the second-format response frame is an RTU format response frame.
[0091] If the current communication protocol type is the first format type, then a reply message is sent to the host of the request message based on the first format response frame.
[0092] If the current communication protocol type is the second format type, then the first format response frame is converted into the second format response frame, and a reply message is sent to the host based on the second format response frame.
[0093] Optionally, the reply message is used to send the processed target internal data to the request message host. The processed target internal data includes the target internal data after reading or the target internal data after writing.
[0094] Optionally, a reply message is used to inform the request message host of the processing status of the request message.
[0095] This invention converts a first-format response frame into a second-format response frame, enabling flexible processing of request messages with different response methods.
[0096] Furthermore, a unified exception handling and error response mechanism is designed. When an error occurs during the processing of a request message (e.g., an invalid destination register address or invalid data value exists in the request message), the communication board will construct an appropriate exception response message based on the characteristics of the request message for the current protocol type. For example, for RTU type request messages, an exception response message containing a CRC checksum is constructed. For ASCII type request messages, an ASCII-encoded exception response message is constructed.
[0097] For request messages of the current protocol type with special verification requirements, an abnormal response message will be constructed according to its specific rules.
[0098] This invention proposes a unified yet flexible exception handling mechanism for request messages, ensuring that the communication board can provide responses that conform to the corresponding protocol specifications when faced with various abnormal situations.
[0099] Based on the above embodiments, the reply message is determined in the following manner: Retrieve the target's internal data after reading or writing from the protocol data structure; The response message is determined based on the target's internal data after it has been read or written.
[0100] The target internal data is retrieved from the protocol data structure of the target protocol processor after being read or written. When the function code of the request message is "read," the target internal data is retrieved from the protocol data structure of the target protocol processor. When the function code of the request message is "write," the target internal data is retrieved from the protocol data structure of the target protocol processor.
[0101] The read or written target internal data is added to the reply message, and a reply message is sent to the host of the request message to send the read or written target internal data to the host of the request message.
[0102] This invention determines the response message based on the read or written target internal data, and can promptly send the processed target internal data back to the host of the request message.
[0103] Based on the above embodiments, after responding to the request message, the following steps are also included: When the internal storage unit obtains the target internal data after it has been written, it sends the target internal data to the industrial equipment to update the internal data of the industrial equipment.
[0104] When the function code of the request message is the write function, the write operation is performed on the target internal data in the protocol data structure to obtain the written target internal data.
[0105] After the write operation is completed, the target write function is called to write the target internal data from the protocol data structure to the internal storage unit, so as to update the internal data in the internal storage unit according to the target internal data after the write operation.
[0106] When the internal storage unit obtains the target internal data after it has been written, the communication board sends the target internal data to the industrial equipment to update the internal data of the industrial equipment.
[0107] This invention enables real-time updates of the internal data of industrial equipment by promptly sending the written target internal data to the industrial equipment.
[0108] like Figure 4 As shown, this invention provides a communication method for industrial equipment, with a communication board as the executing entity. The first format type is RTU type, the second format type is ASCII type, the first format response frame is an RTU format response frame, and the second format response frame is an ASCII format response frame. The communication method for industrial equipment specifically includes the following steps.
[0109] When the communication device of industrial equipment starts up, it loads the default protocol configuration and initializes the relevant hardware.
[0110] Step 1: Receive and read the current communication protocol type sent by the industrial equipment in real time, and then proceed to Step 2.
[0111] Step 2: Monitor whether the current communication protocol type has changed. For example, check if the current communication code has changed. If the communication protocol code has changed, it means the current communication protocol type has changed. If the communication protocol code has not changed, it means the current communication protocol type has not changed.
[0112] If a change in the current communication protocol type is detected, the target protocol processor is re-matched based on the changed current communication protocol type, and the target initialization function is called to determine the receiving and response methods of the request message of the changed current communication protocol type, and then step 3 is executed.
[0113] If no change is detected in the current communication protocol type, continue using the current target protocol processor and proceed to step 3.
[0114] Step 3: Confirm whether a request message of the current communication protocol type has been received. If a request message of the current communication protocol type has been received, proceed to Step 4. If no request message of the current protocol type has been received, return to Step 1.
[0115] Step 4: Confirm whether the request message of the current communication protocol type requires special handling.
[0116] If the current communication protocol type does not require special handling, the general protocol parsing function in the communication board is used to begin processing the request message of the current communication protocol type and proceed to step 5.
[0117] If the current communication protocol type requires special handling, a special protocol parsing function is called to process the request message for that communication protocol type. After processing, the communication board's serial port is used to send a reply message to the host that sent the request message.
[0118] Step 5: Determine whether the request message of the current communication protocol type is of ASCII type (second format type).
[0119] If the request message of the current communication protocol type is not of type ASCII (second format type), then the request message of the current communication protocol type is assumed to be of type RTU (first format type), and the general protocol parsing process continues, and step 6 is executed.
[0120] If the request message of the current communication protocol type is of ASCII type (second format type), then the ASCII type request message needs to be converted into an RTU type request message, and step 6 should be executed.
[0121] Step 6: Determine whether to execute the target verification function to verify the RTU type request message based on the verification flag of the target protocol processor, and then execute Step 7 (if the request message is of ASCII type, it will be converted into an RTU type request message in Step 5).
[0122] Step 7: Parse the RTU type request message and obtain the target register address. Based on the target register address, look up the mapping table between register addresses and internal data, and use the retrieved internal data as the target's internal data. Call the target read function to read the target's internal data from the internal storage unit into the protocol data structure, and then execute Step 8.
[0123] Step 8: When the function code is write function, perform a write operation on the target internal data in the protocol data structure to obtain the written target internal data, and then execute step 9.
[0124] Step 9: Call the target write function to write the target internal data from the protocol data structure to the internal storage unit, and then execute step 10.
[0125] Step 10: Construct an RTU format response frame and proceed to step 11.
[0126] Step 11: Determine if the current communication protocol type is ASCII? If the current communication protocol type is ASCII, the RTU format response frame will be converted to an ASCII format response frame, and the serial port of the communication board will be called to send a reply message to the host of the request message according to the ASCII format response frame.
[0127] If the current communication protocol type is not ASCII, the serial port of the communication board is directly invoked to send a reply message to the host of the request message according to the RTU format response frame.
[0128] After sending the reply message, return to step 1.
[0129] This invention stores the data items defined for each communication protocol type by setting up a protocol data structure. Each protocol processor executes function code within its respective protocol data structure to write to or read the target internal data requested by the request message, thus avoiding arbitrary modification of the internal data in the internal storage unit.
[0130] This invention periodically retrieves internal data from industrial equipment through an internal storage unit, ensuring the real-time performance and reliability of the internal data.
[0131] The communication device for industrial equipment of this invention supports multiple communication protocol types through a single hardware platform, significantly improving the compatibility and applicability of industrial equipment. This invention can dynamically identify and switch communication protocol types during industrial equipment operation, adapting to different communication environments without downtime or reconfiguration. This invention shares hardware resources, avoiding the need for separate hardware deployment for each type of communication protocol. When adding a new communication protocol type, this invention only requires adding the corresponding protocol processor (including protocol descriptors), without affecting existing functions. The protocol processor of this invention has a built-in format conversion (format conversion flag) to reduce communication latency caused by external gateways. This invention achieves automated protocol identification and switching, greatly simplifying the configuration and maintenance of industrial equipment.
[0132] Furthermore, such as Figure 3 As shown, considering that industrial equipment typically has multiple control channels, this invention designs a multi-channel data synchronization mechanism. The internal storage unit of the communication board stores data by channel, and the internal storage unit periodically updates the internal data by channel. This mechanism can: track the data update status of each channel; perform consistency checks between channels; support incremental data synchronization by channel; and handle data dependencies between channels. Through this multi-channel mechanism, data synchronization of multi-channel devices can be managed efficiently, avoiding unnecessary full data transmission and improving communication efficiency.
[0133] The communication device for industrial equipment provided by the present invention is described below. The communication device for industrial equipment described below and the communication method for industrial equipment described above can be referred to in correspondence.
[0134] like Figure 5 As shown, a communication device for industrial equipment includes a communication board and industrial equipment, and the communication board and industrial equipment are communicatively connected. A communication board for configuring a protocol processor of at least one type of communication protocol; Industrial equipment is used to select the current communication protocol type and send the current communication protocol type to the communication board; The communication board is used to match various protocol processors based on the current communication protocol type and obtain the target protocol processor; when a request message of the current communication protocol type is received, the internal data of the target is processed based on the target protocol processor; the internal data of the target is the internal data of the industrial equipment requested to be processed by the request message of the current communication protocol type; after the internal data of the target is processed, the board responds to the request message.
[0135] Existing industrial equipment typically supports only one or a few fixed communication protocols, failing to dynamically adapt to diverse protocol requirements, thus making integration difficult. This invention addresses this by integrating a protocol processor for at least one communication protocol type into a communication board, enabling industrial equipment to communicate with multiple types of communication protocols.
[0136] When adding or changing communication protocols to existing industrial equipment, it often requires redesigning the entire communication module or even replacing the hardware, resulting in high maintenance costs. This invention, however, only requires adding or changing the protocol processor within the communication board, without replacing the entire communication board of the industrial equipment.
[0137] In existing industrial equipment communication processes, separate hardware resources are deployed for each communication protocol, resulting in redundant investment and resource waste. This invention integrates all types of communication protocols into a single communication board, allowing multiple communication protocols to share a single hardware resource, thus improving the utilization rate of hardware resources.
[0138] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0139] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640, wherein the processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a communication method for the industrial device. This method includes: configuring a protocol processor for at least one communication protocol type; matching various protocol processors based on the current communication protocol type sent by the industrial device to obtain a target protocol processor; processing the target's internal data based on a request message of the target protocol processor and the current communication protocol type; the target's internal data being the request message of the current communication protocol type requesting processing of the industrial device's internal data; and responding to the request message after the target's internal data processing is complete.
[0140] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0141] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the communication method for industrial equipment provided by the above methods. The method includes: configuring a protocol processor of at least one communication protocol type; matching each protocol processor based on the current communication protocol type sent by the industrial equipment to obtain a target protocol processor; processing target internal data based on a request message of the target protocol processor and the current communication protocol type; the target internal data being the internal data of the industrial equipment requested to be processed by the request message of the current communication protocol type; and responding to the request message after the target internal data processing is completed.
[0142] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0143] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0144] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A communication method for industrial equipment, characterized in that, include: Configure a protocol processor for at least one type of communication protocol; Based on the current communication protocol type sent by the industrial equipment, match each of the protocol processors to obtain the target protocol processor; Based on the target protocol processor and the request message of the current communication protocol type, the target internal data is processed; the target internal data is the internal data of the industrial equipment requested to be processed by the request message of the current communication protocol type. Once the target's internal data processing is complete, it responds to the request message.
2. The communication method for industrial equipment according to claim 1, characterized in that, The target protocol processor includes a target verification function, a target read function, a target write function, a verification flag, and a format conversion flag. The format conversion flag is used to convert a request message of the second format type into a request message of the first format type. If the request message of the current communication protocol type is of the first format type, the processing of the target internal data based on the target protocol processor and the request message of the current communication protocol type includes: When the verification flag indicates that verification is required, the request message of the first format type is verified based on the target verification function to obtain a request message that has passed the verification. Parse the verified request message to identify the target's internal data; Based on the target read function, the target's internal data is read from the internal storage unit into the protocol data structure; the internal storage unit is used to periodically acquire the internal data of the industrial equipment; the protocol data structure is used to cache the processing data of the request message; When the function code of the request message that passes the verification is the write function, the write operation is performed on the target internal data in the protocol data structure to obtain the written target internal data. Based on the target write function, the written target internal data is written from the protocol data structure to the internal storage unit to complete the processing of the target internal data.
3. The communication method for industrial equipment according to claim 2, characterized in that, The process of parsing the verified request message and identifying the target's internal data includes: Parse the verified request message to obtain the target register address of the verified request message; Based on the target register address, the mapping table between the register address and the internal data is queried, and the queried internal data is used as the target internal data.
4. The communication method for industrial equipment according to claim 2, characterized in that, After reading the target's internal data from the internal storage unit into the protocol data structure based on the target read function, the process further includes: When the function code is a read function, a read operation is performed on the target internal data in the protocol data structure to obtain the read target internal data, thereby completing the processing of the target internal data.
5. The communication method for industrial equipment according to claim 2, characterized in that, If the request message of the current communication protocol type is of the second format type, before verifying the request message of the first format type based on the target verification function and obtaining the verification-passed request message when the verification flag bit indicates that verification is required, the method further includes: Convert the message request of the second format type into a request message of the first format type.
6. The communication method for industrial equipment according to claim 1, characterized in that, The step of responding to the request message after the target's internal data processing is completed includes: Once the internal data of the target is processed, a first-format response frame is created; If the request message of the current communication protocol type is of the first format type, then a reply message is sent to the host of the request message based on the first format response frame; If the request message of the current communication protocol type is of the second format type, then the first format response frame is converted into the second format response frame, and a reply message is sent to the host based on the second format response frame.
7. The communication method for industrial equipment according to claim 6, characterized in that, The response message is determined based on the following method: Retrieve the target's internal data after reading or writing from the protocol data structure; The response message is determined based on the target internal data read or written.
8. The communication method for industrial equipment according to claim 1, characterized in that, The target protocol processor further includes a target initialization function, which is used to determine the receiving method and response method of the request message.
9. The communication method for industrial equipment according to claim 1, characterized in that, Following the response to the request message, the method further includes: When the internal storage unit obtains the target internal data after it has been written, it sends the target internal data after it has been written to the industrial equipment to update the internal data of the industrial equipment.
10. A communication device for industrial equipment, characterized in that, It includes a communication board and industrial equipment, wherein the communication board and the industrial equipment are communicatively connected; The communication board is used to configure a protocol processor of at least one type of communication protocol. The industrial equipment is used to select the current communication protocol type and send the current communication protocol type to the communication board; The communication board is used to match each of the protocol processors based on the current communication protocol type and obtain a target protocol processor; when a request message of the current communication protocol type is received, the board processes the target internal data based on the target protocol processor; the target internal data is the internal data of the industrial equipment requested to be processed by the request message of the current communication protocol type; after the target internal data is processed, the board responds to the request message.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the communication method of the industrial equipment as described in any one of claims 1 to 9.
12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the communication method of the industrial equipment as described in any one of claims 1 to 9.