C#-based implementation method, system and computer readable storage medium of secs / gem communication protocol
By implementing the SECS/GEM communication protocol based on a layered architecture and asynchronous programming model using C# and .NET 8, the problems of high platform dependence, high development complexity, and insufficient flexibility and scalability in existing technologies are solved. This achieves cross-platform compatibility, high development efficiency, high reliability of communication concurrency performance, and low device integration cost.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XUELONG CNC EQUIP (SHENZHEN) CO LTD
- Filing Date
- 2026-03-30
- Publication Date
- 2026-07-03
Smart Images

Figure CN121967546B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of semiconductor device communication technology, specifically relating to a C#-based SECS / GEM communication protocol implementation method, system, and computer-readable storage medium. Background Technology
[0002] SECS / GEM is a standard protocol system for communication in the semiconductor manufacturing equipment industry developed by the SEMI organization. It includes sub-protocols such as SECS-I, SECS-II, HSMS, and GEM. It standardizes data exchange and control between equipment and host systems, significantly reduces the data interaction costs between semiconductor factories and equipment suppliers, breaks down data silos for smart manufacturing, and is widely used in semiconductor equipment-intensive production scenarios.
[0003] Existing implementations of the SECS / GEM protocol mostly rely on dedicated hardware or specific programming languages, and can be mainly divided into two categories: one is dedicated hardware solutions, which use dedicated SECS / GEM communication cards and gateway devices to achieve protocol parsing. These devices are based on fixed hardware platforms, require physical installation and on-site configuration, and have poor versatility; the other is software library implementation solutions, which provide protocol support through commercial or open-source libraries based on C / C++. However, these solutions are highly platform-dependent, only compatible with specific versions of Windows or Linux, and require extensive customization during integration, making them difficult to adapt for small and medium-sized equipment manufacturers.
[0004] While existing technologies can perform protocol parsing, data encapsulation, and basic device management, they suffer from several drawbacks: 1) High platform dependency: Implementations based on dedicated hardware or C / C++ cannot run across platforms, do not support .NET environments and cloud deployments, and limit device integration scenarios; 2) High development complexity: Requires writing a large amount of customized code, resulting in long development cycles and high costs for device adaptation; 3) Insufficient flexibility and scalability: Does not support dynamic addition and removal of devices, and cannot quickly adapt to new SECS / GEM protocol versions or custom protocol variants; 4) Low communication efficiency: Most adopt a single-threaded processing mode, which easily leads to data delays and loss issues in high-concurrency scenarios, resulting in poor real-time performance; 5) Poor compatibility: Some solutions cannot fully cover transmission modes such as SECS-I and HSMS, leading to low interoperability between different devices.
[0005] The SECS-I protocol defines a point-to-point serial communication interface, specifying hardware and underlying logic protocols such as physical connectors and signal levels, but does not define message data content. The SECS-II protocol defines a stream-function message passing method and is the core message specification of the SECS / GEM protocol. The HSMS protocol, as an alternative to SECS-I, achieves efficient data transmission based on TCP / IP and is currently the mainstream transmission mode in the semiconductor industry. Existing solutions cannot simultaneously support multiple transmission modes and meet the needs of cross-platform, high-concurrency communication, becoming a technical bottleneck for the widespread application of the SECS / GEM protocol. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a C#-based SECS / GEM communication protocol implementation method, system, and computer-readable storage medium. This eliminates the need for dedicated hardware, improves cross-platform compatibility, development efficiency, and communication concurrency performance, reduces device integration costs, enables dynamic device management and flexible protocol expansion, and ensures the reliability and real-time performance of communication between semiconductor devices and the host computer.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0008] This document describes a method for implementing the SECS / GEM communication protocol using C#. It utilizes the C# programming language and the .NET 8 technology framework, and includes the following steps:
[0009] S1. Initialization: Load the device configuration file in XML / JSON format, read the device ID, protocol version, and communication mode parameters, initialize the protocol parser based on the .NET 8 framework and load the corresponding version of the SECS / GEM parsing rules, initialize the communication interface and complete the pre-configuration of the underlying communication channel, and establish the binding relationship between device parameters and parser and communication interface;
[0010] S2. Connection Establishment: Based on the communication mode parameters in S1, select the client / server working mode to initiate a connection request, encapsulate the SECS / GEM standard handshake message through the protocol parser, send it to the target host through the initialized communication interface, and complete the handshake authentication between the device and the host after receiving the host's response details to establish a communication link.
[0011] S3, Core Layer Processing: Based on the communication link established in S2, it performs collaborative processing across three layers: the protocol parsing layer, the device management layer, and the communication interface layer. The protocol parsing layer utilizes C# reflection and custom features to encode, decode, and verify SECS / GEM messages based on the parsing rules loaded in S1, supporting HSMS and SECS-I transmission modes. The device management layer, based on the device configuration files loaded in S1, dynamically registers, deregisters, and monitors device status in real-time, using a dictionary structure to store device information. The communication interface layer, based on the communication interface initialized in S1, provides a unified API interface and uses C# async / await asynchronous programming to send and receive TCP / IP and serial port data, implementing timeout retransmission in conjunction with the status monitoring results from the device management layer.
[0012] S4. Session Management: During the core layer processing of S3, the S1F13 / S1F14 standard heartbeat messages are periodically encapsulated by the protocol parser and sent by the communication interface layer to maintain the connectivity of the communication session. Alarm messages and control command messages are prioritized for processing. After processing by the protocol parser layer, they are sent to the device management layer for response operations. If a link interruption is detected, the communication interface layer is triggered to execute a reconnection mechanism based on the parameters configured in S1. At the same time, the device management layer marks the corresponding device status as abnormal.
[0013] S5. Anomaly Handling: Real-time capture of link anomalies at the communication interface layer, message parsing errors at the protocol parsing layer, and device status anomalies at the device management layer, and classification by type. Execute preset processing strategies for different types of anomalies, synchronously record the anomaly type, occurrence time, associated device ID, and corresponding processing results, and generate a complete device status log by combining the device information stored at the device management layer.
[0014] The protocol parsing layer in S3 processes the following:
[0015] When sending data, the application layer data is encapsulated into a SECS-II specification message, Stream and Function code headers are added, and a checksum is generated;
[0016] When receiving data, the original data is parsed, validated, and verified. The original data is then automatically mapped into a readable message object using C# reflection, thus completing the decoding.
[0017] Preferably, in step S3, a message class with custom C# attribute annotations is added to the protocol parsing layer to achieve adaptation to new protocol versions or custom protocol variants.
[0018] This invention also discloses a C#-based SECS / GEM communication protocol implementation system, adapted to the aforementioned C#-based SECS / GEM communication protocol implementation method, deployed on general-purpose computing devices with TCP / IP and serial communication capabilities, developed based on the C# programming language and the .NET 8 technology framework, adopting a layered architecture, and including the following functional modules:
[0019] The protocol parsing module has a built-in SECS / GEM parsing rule base, integrates a C# reflection and feature parsing engine, completes message encoding, decoding, verification and validation, provides protocol extension interfaces, and supports HSMS and SECS-I transmission modes;
[0020] The device management module is used to realize device configuration parameter parsing, dynamic registration and deregistration, status monitoring, and full lifecycle management of communication sessions;
[0021] The communication interface module provides a unified API interface to enable asynchronous data transmission and reception and port listening via TCP / IP and serial ports.
[0022] The exception handling and logging module is used to realize real-time exception capture, classification and processing, and standardized recording of device status, communication data, and exception information;
[0023] The device management module is connected to the communication interface module and the protocol parsing module, respectively. The communication interface module is connected to the protocol parsing module, and the exception handling and logging module is connected to the protocol parsing module, the device management module, and the communication interface module, respectively.
[0024] Preferably, the device management module uses a dictionary data structure to store device ID, online / offline status, communication rate, and session status information, and provides standardized operation interfaces for adding, deleting, and querying devices.
[0025] Preferably, the communication interface module implements data sending and receiving based on the C# async / await asynchronous programming mode.
[0026] Preferably, the exception handling and logging module supports local log storage and remote monitoring terminal push. The exception handling and logging module performs timeout retransmission, data discarding, and status marking processing strategies for link interruption, message parsing error, and device offline anomaly, respectively.
[0027] The present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described C#-based SECS / GEM communication protocol implementation method.
[0028] By adopting the above technical solution, the present invention has the following beneficial effects:
[0029] (1) Strong cross-platform compatibility: This invention is based on C# and .NET 8 and can be deployed on mainstream operating systems such as Windows, Linux, and macOS without modification. It supports a variety of general computing devices such as cloud servers and industrial control machines. It also supports .NET environment and cloud deployment, expanding the application scenarios.
[0030] (2) Significantly improved development and integration efficiency: Through the universal configuration file and API interface, the device integration does not require a large amount of customized coding, the integration time is shortened, and the adaptation cost is reduced;
[0031] (3) High reliability of high-concurrency communication: The present invention adopts an asynchronous communication model to process data interaction between multiple devices, and supports timeout retransmission and link reconnection mechanisms to ensure the real-time performance and integrity of data transmission in high-concurrency scenarios;
[0032] (4) Excellent flexibility and scalability: This invention supports dynamic registration, deregistration and status monitoring of devices, enabling plug-and-play functionality. Based on the reflection-based dynamic protocol parsing mechanism, it can quickly adapt to new SECS / GEM protocol versions or custom protocol variants, resulting in short development time and no impact on the performance of the original system.
[0033] (5) Significantly reduced deployment costs: The overall process of this invention achieves full-process support for the SECS / GEM protocol in a pure software manner, without the need to purchase and install dedicated SECS / GEM communication cards, gateways and other hardware devices. The software deployment cost is significantly reduced compared to existing hardware solutions, while also reducing hardware maintenance and upgrade costs.
[0034] (6) Convenient operation and maintenance and fault diagnosis: The present invention has a built-in complete anomaly handling and logging system, which realizes standardized recording and real-time monitoring of equipment status, communication data and anomaly information, and can quickly locate communication faults and equipment anomalies, thereby improving the efficiency of system operation and maintenance;
[0035] In summary, this invention has the advantages of good cross-platform compatibility, high development efficiency, high reliability of communication concurrency performance, excellent flexibility and scalability, low deployment cost, and convenient operation, maintenance and fault diagnosis. Attached Figure Description
[0036] Figure 1 This is a communication flowchart of one of the communication devices in this invention initiating a network connection to other communication devices;
[0037] Figure 2 This is an example of a system integration architecture diagram when the present invention is applied in the circuit board and semiconductor industries. Detailed Implementation
[0038] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0039] The components of the embodiments of the invention described and shown in the accompanying drawings can typically be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention.
[0040] Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0042] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0043] Example 1
[0044] In this embodiment, the present invention provides a C#-based method for implementing the SECS / GEM communication protocol, and also provides a SECS / GEM communication protocol implementation system adapted to the method and a computer-readable storage medium. The method is implemented based on the C# programming language and the .NET 8 technology framework. The system adopts a layered architecture design. Through the cooperation of the method and the system, the encoding, decoding, device management and high-concurrency data interaction of the SECS / GEM protocol are completed.
[0045] like Figure 1 and Figure 2As shown, in one embodiment of the present invention, the SECS / GEM communication protocol implementation method based on C# is implemented using the C# programming language and the .NET 8 technology framework. This method adopts a core approach of layered processing combined with asynchronous communication and dynamic parsing to realize the full-process processing of the SECS / GEM protocol, including three core stages: protocol parsing layer processing, device management layer processing, and communication interface layer processing. It also includes a standardized communication process of initialization, connection establishment, data exchange, and session management, specifically including the following steps:
[0046] S1. Initialization: Load the device configuration file in XML / JSON format, read the device ID, protocol version, and communication mode parameters (including TCP / IP / serial port / port number, etc.), initialize the protocol parser based on the .NET 8 framework and load the corresponding version of SECS / GEM parsing rules, initialize the communication interface and complete the pre-configuration of the underlying communication channel, and establish the binding relationship between device parameters and parser and communication interface;
[0047] S2. Connection Establishment: Based on the communication mode parameters in S1, select the client / server working mode to initiate a connection request, encapsulate the SECS / GEM standard handshake message through the protocol parser, send it to the target host through the initialized communication interface, and complete the handshake authentication between the device and the host after receiving the host's response details to establish a communication link.
[0048] S3, Core Layer Processing: Based on the communication link established in S2, the protocol parsing layer, device management layer, and communication interface layer perform collaborative processing. The protocol parsing layer utilizes C# reflection and custom feature mechanisms to encode, decode, and verify SECS / GEM messages based on the parsing rules loaded in S1. It supports HSMS and SECS-I transmission modes. That is, when sending data, the application layer data is encapsulated into SECS-II specification messages, Stream and Function code message headers are added, and a checksum is generated. When receiving data, the original data is parsed and verified for format. The original data is automatically mapped into readable message objects through the C# reflection mechanism to complete the decoding. The C#-based SECS / GEM communication protocol implementation method of this invention supports SECS / GEM protocol extension. Specifically, by adding message classes with C# custom feature annotations to the protocol parsing layer, adaptation to new protocol versions or custom protocol variants can be achieved without rewriting the core parsing code.
[0049] The device management layer processes devices based on the device configuration files loaded in S1, dynamically registering, deregistering, and monitoring device status in real time by associating with the communication link status. It uses a dictionary structure to store device information; specifically, device parameters are defined through configuration files, supporting dynamic registration, deregistration, and status monitoring. The dictionary structure stores information such as device online / offline status, communication rate, and session status, providing standardized interfaces for adding, deleting, and querying devices. It also provides unified management of device communication sessions, recording session establishment and disconnection times and interaction logs.
[0050] The communication interface layer handles the communication interface based on the S1 initialization, providing a unified API interface. It uses C#'s async / await asynchronous programming mode to handle TCP / IP and serial port data transmission and reception, and combines the status monitoring results from the device management layer to implement timeout retransmission. Specifically, it provides a unified API communication interface for TCP / IP and serial ports, and uses C#'s async / await asynchronous programming mode to handle data transmission and reception. When sending data, the standard message encapsulated by the protocol parsing layer is sent asynchronously through the corresponding communication channel to avoid thread blocking. When receiving data, it asynchronously listens to the communication channel, obtains the raw data in real time, and forwards it to the protocol parsing layer, while simultaneously implementing a timeout retransmission mechanism.
[0051] S4. Session Management: During the core layer processing of S3, the S1F13 / S1F14 standard heartbeat messages are periodically encapsulated by the protocol parser and sent by the communication interface layer to maintain the connectivity of the communication session. Alarm messages and control command messages are prioritized for processing. After processing by the protocol parser layer, they are sent to the device management layer for response operations. If a link interruption is detected, the communication interface layer is triggered to execute a reconnection mechanism based on the parameters configured in S1. At the same time, the device management layer marks the corresponding device status as abnormal.
[0052] S5. Anomaly Handling: Real-time capture of link anomalies at the communication interface layer, message parsing errors at the protocol parsing layer, and device status anomalies at the device management layer, and classification by type. Execute preset processing strategies for different types of anomalies, synchronously record the anomaly type, occurrence time, associated device ID, and corresponding processing results, and generate a complete device status log by combining the device information stored at the device management layer. Execute corresponding processing strategies for different anomaly types, such as timeout retransmission, link reconnection, and device status marking.
[0053] This invention also discloses a C#-based SECS / GEM communication protocol implementation system, adapted to the aforementioned C#-based SECS / GEM communication protocol implementation method. It is deployed on general-purpose computing devices (computers, cloud servers, industrial control machines) with TCP / IP and serial communication capabilities. Developed using the C# programming language and the .NET 8 technology framework, it adopts a layered architecture to achieve standardized support for the SECS / GEM protocol. The system's hardware carrier is a general-purpose computing device with TCP / IP and serial communication capabilities, with no dedicated hardware dependencies. It includes the following functional modules:
[0054] The protocol parsing module, as the core processing module of the system, corresponds to the protocol parsing layer processing steps of the above-mentioned C#-based SECS / GEM communication protocol implementation method. It has a built-in SECS / GEM parsing rule base, supports two transmission modes: HSMS and SECS-I, integrates a C# reflection and feature parsing engine, completes message encoding, decoding, verification and validation, and provides protocol extension interfaces. By adding message classes with custom feature annotations, it can achieve rapid adaptation to new protocol variants.
[0055] The device management module includes a configuration file parsing unit, a device status management unit, and a session management unit. It is used to implement device configuration parameter parsing, dynamic registration and deregistration, status monitoring, and full lifecycle management of communication sessions. The device management module uses a dictionary data structure to store device ID, online / offline status, communication rate, and session status information. It provides standardized operation interfaces for adding, deleting, and querying devices. Specifically, the device management module corresponds to the device management layer processing steps of the aforementioned C#-based SECS / GEM communication protocol implementation method, including the configuration file parsing unit, device status management unit, and session management unit. The configuration file parsing unit supports parsing device configuration files in XML / JSON format to extract core device parameters. The device status management unit uses a dictionary data structure to store device status information and provides operation interfaces for dynamic device registration, deregistration, and querying. The session management unit is responsible for establishing, maintaining, and disconnecting device communication sessions, and records full lifecycle information of the sessions.
[0056] The communication interface module, comprising an abstract communication interface unit, a TCP communication subunit, and a Serial communication subunit, provides a unified API interface to implement asynchronous data transmission and reception and port listening for TCP / IP and serial ports. The communication interface module implements data transmission and reception based on the C# async / await asynchronous programming mode. Specifically, as the system's underlying communication module, the communication interface module corresponds to the communication interface layer processing steps of the aforementioned C#-based SECS / GEM communication protocol implementation method, including the abstract communication interface unit, the TCP communication subunit, and the Serial communication subunit. The abstract communication interface unit provides a unified API interface, decoupling the upper-layer module from the lower-layer communication channel. The TCP communication subunit implements asynchronous transmission and reception and port listening for TCP / IP communication based on .NET 8 Socket programming. The Serial communication subunit implements parameter configuration and asynchronous transmission and reception for serial communication, supporting standard serial port protocols such as RS232.
[0057] The anomaly handling and logging module includes an anomaly capture unit, an anomaly processing unit, and a log recording unit. It is used to achieve real-time anomaly capture, classification, and standardized recording of device status, communication data, and anomaly information. The module supports local log storage and remote monitoring terminal push. For link interruptions, message parsing errors, and device offline anomalies, the module executes timeout retransmission, data discarding, and status marking strategies, respectively. Specifically, as an auxiliary module of the system, the module includes an anomaly capture unit, an anomaly processing unit, and a log recording unit. The anomaly capture unit captures and classifies operational anomalies of various system modules in real time. The anomaly processing unit executes preset processing strategies (timeout retransmission, link reconnection, etc.) for different anomaly types. The log recording unit records device status, communication data, and anomaly information in a standardized manner, supports real-time log querying and remote push, and enables fault diagnosis and status monitoring.
[0058] The device management module is connected to both the communication interface module and the protocol parsing module. The exception handling and logging module is connected to the protocol parsing module, the device management module, and the communication interface module. Specifically, the device management module and the protocol parsing module establish a bidirectional interactive connection: the device management module sends device-specific protocol parameters (including SECS / GEM version, checksum rules, and Stream / Function support range) and parsing start / stop commands to the protocol parsing module through a standardized interface. The protocol parsing module provides feedback on the parsing status (including message parsing success / failure, protocol version matching result, and custom message loading status) to the device management module through an event-triggered mechanism. The device management module updates the operating status of the corresponding device based on the parsing status. The device management module and the communication interface module also establish a bidirectional interactive connection: the device management module allocates an independent communication interface instance to each device and sends communication parameters (including IP address / port, serial port baud rate / data bits, heartbeat interval, and reconnection strategy) and communication start / stop / reconnection commands to the communication interface module. The communication interface module provides feedback on the communication status (including connection success / failure, link interruption, and data transmission / reception results) to the device management module through an event-triggered mechanism. The management module updates the communication status of the corresponding device based on the communication status. The communication interface module and the protocol parsing module establish a bidirectional data interaction connection: the communication interface module pushes the raw binary data (with device ID and reception time metadata) received from the device / host to the protocol parsing module through a data reception event. After completing the message parsing, the protocol parsing module pushes the encapsulated standard SECS / GEM message to the communication interface module by calling the asynchronous sending method of the communication interface module. The communication interface module then distributes the message to the target device / host. The exception handling and logging module works in conjunction with the protocol parsing module, the device management module, and the communication interface module. Establishing a one-way access connection: The protocol parsing module actively reports parsing anomalies (including message format errors, checksum failures, and reflection parsing anomalies) and parsing operation logs to the anomaly handling and logging module. The device management module actively reports management anomalies (including duplicate device registration and status update failures) and device operation logs to the anomaly handling and logging module. The communication interface module actively reports communication anomalies (including connection failures, port occupancy, and data transmission / reception failures) and communication operation logs to the anomaly handling and logging module. The anomaly handling and logging module only receives the reported information, performs classification processing, and standardizes storage, without issuing any instructions to upper-layer modules.
[0059] The present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described C#-based SECS / GEM communication protocol implementation method.
[0060] The C#-based SECS / GEM communication protocol implementation method of this invention can be applied to communication between semiconductor testing equipment and a host computer. Specifically, the C#-based SECS / GEM communication protocol implementation system of this invention is deployed on a Windows-based semiconductor testing equipment (hardware carrier: industrial control computer). The C#-based SECS / GEM communication protocol implementation method of this invention is used to implement standard SECS / GEM communication between the testing equipment and the host computer. The specific steps are as follows:
[0061] a1. System Deployment and Configuration: Deploy the relevant software packages of the SECS / GEM communication protocol implementation system based on C# of this invention on the industrial control computer of the test equipment, and write a device configuration file in JSON format, such as defining the device ID as 001, the protocol version as SECS / GEME5-0703, the communication mode as TCP / IP, the communication port as 5000, and the host IP as 192.168.1.100;
[0062] a2. Initialization: Start the system, load the configuration file, the system's device management module parses the configuration parameters, the protocol parsing module initializes the SECS / GEME5-0703 parsing rules, and the communication interface module initializes the TCP communication subunit.
[0063] a3. Connection Establishment: The system runs in client mode, initiates a TCP / IP connection request to the host 192.168.1.100, and sends an S1F1 standard message to complete the session establishment;
[0064] a4. Data Interaction: The application layer of the test equipment generates test data and sends it to the system's protocol parsing module. The module encapsulates the data into an S6F11 standard message, adds a checksum, and forwards it to the communication interface module, which then sends it to the host in asynchronous mode. The host sends an S2F41 control command, which is received asynchronously by the communication interface module and forwarded to the protocol parsing module. After decoding, the command is sent to the application layer of the test equipment to drive the device to execute the corresponding test process.
[0065] a5. Session Management: The system periodically sends S1F13 / S1F14 heartbeat messages to maintain the session connection with the host and record the device communication status in real time.
[0066] This approach enables standardized SECS / GEM communication between semiconductor test equipment and the host, resulting in high test data upload rates, low communication error rates, and fully meeting the real-time data interaction requirements of semiconductor test equipment. It also significantly shortens equipment integration time compared to existing solutions.
[0067] The C#-based SECS / GEM communication protocol implementation method of this invention can also be applied to centralized cloud communication management of multiple devices. Specifically, the C#-based SECS / GEM communication protocol implementation system of this invention is deployed on a Linux cloud server (hardware carrier: cloud server host). The C#-based SECS / GEM communication protocol implementation method of this invention is used to simultaneously manage 10 different types of semiconductor devices (etching machine, lithography machine), realizing centralized cloud communication management of multiple devices. The specific steps are as follows:
[0068] b1. System Deployment and Configuration: Deploy the software package of the SECS / GEM communication protocol implementation system based on C# of this invention on a Linux cloud server, modify the system configuration parameters, adjust the communication protocol to HSMS, set the communication port to 6000, and run the system in server mode.
[0069] b2. Dynamic Device Registration: The communication interface module of the system based on the C# SECS / GEM communication protocol of this invention listens to port 6000. Ten semiconductor devices sequentially initiate connection requests to the cloud server. The device management module of the system based on the C# SECS / GEM communication protocol of this invention completes the dynamic registration of all devices, assigns a unique identifier to each device, and uses a dictionary structure to store information such as device ID, status, and communication parameters.
[0070] b3. High-concurrency data interaction: The SECS / GEM communication protocol implementation system based on C# of this invention adopts an asynchronous communication model to handle concurrent data requests from 10 devices simultaneously. The protocol parsing module performs parallel encoding / decoding of messages from each device, and the communication interface module completes asynchronous sending and receiving, realizing fast data interaction among multiple devices.
[0071] b4. Anomaly Handling and Early Warning: When an etching machine malfunctions and sends an S5F1 alarm message, the system's anomaly capture unit captures the message in real time, the log module records the alarm information, and forwards the alarm message to the factory monitoring system in real time to achieve real-time fault early warning.
[0072] b5. Flexible expansion: When adding a new lithography machine, only a configuration file needs to be written and a connection request initiated. The system can then complete the dynamic registration of the device without restarting or modifying the core system code, thus achieving flexible expansion of the device.
[0073] Using this approach, the cloud server of the present invention can stably manage multiple types and quantities of semiconductor devices, with low communication latency, improved resource utilization of the cloud server, support for seamless elastic expansion of devices, and meet the large-scale equipment management needs of semiconductor factories.
[0074] The C#-based SECS / GEM communication protocol implementation method of this invention can also be applied to the extension and adaptation of SECS / GEM protocol variants. Specifically, it verifies the protocol extension capabilities of the C#-based SECS / GEM communication protocol implementation method and system of this invention for user-defined SECS message protocol variants. The specific steps are as follows:
[0075] c1. Protocol extension configuration: In the protocol parsing module of the SECS / GEM communication protocol implementation system based on C#, the newly added message class is marked with a custom C# attribute, and the [SecsMessage(Stream=10,Function=1)] attribute is added to define the stream and function code of the custom protocol without modifying the core code of the protocol parsing module;
[0076] c2. Parsing rule update: The system's dynamic parsing engine, based on the C# SECS / GEM communication protocol, automatically identifies newly added message classes through reflection, updates the protocol parsing rule base, and completes the adaptation of custom protocols.
[0077] c3. Functional testing: The test terminal sends the custom message to the system based on the C# SECS / GEM communication protocol. The protocol parsing module of the system based on the C# SECS / GEM communication protocol completes the encoding / decoding of the message, and the communication interface module implements data sending and receiving, verifying the accuracy of message processing.
[0078] c4. Performance Testing: During the test, the message processing rate, latency, and other performance indicators of the C#-based SECS / GEM communication protocol implementation system are monitored in real time to verify the operational stability of the C#-based SECS / GEM communication protocol implementation system after the protocol extension.
[0079] In this way, the extension and adaptation time for custom protocol variants is short, and the system based on the C# SECS / GEM communication protocol can accurately process custom messages without any significant decrease in performance indicators such as message processing rate and latency. This fully demonstrates that the method and system of this invention have excellent protocol extension capabilities.
[0080] This embodiment does not impose any limitation on the shape, material, structure, etc. of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention shall fall within the protection scope of the technical solution of the present invention.
Claims
1. A method for implementing the SECS / GEM communication protocol based on C#, characterized in that, Implemented using the C# programming language and the .NET 8 technology framework, including the following steps: S1. Initialization: Load the device configuration file in XML / JSON format, read the device ID, protocol version, and communication mode parameters, initialize the protocol parser based on the .NET 8 framework and load the corresponding version of the SECS / GEM parsing rules, initialize the communication interface and complete the pre-configuration of the underlying communication channel, and establish the binding relationship between device parameters and parser and communication interface; S2. Connection Establishment: Based on the communication mode parameters in S1, select the client / server working mode to initiate a connection request, encapsulate the SECS / GEM standard handshake message through the protocol parser, send it to the target host through the initialized communication interface, and complete the handshake authentication between the device and the host after receiving the host's response details to establish a communication link. S3, Core Layer Processing: Based on the communication link established in S2, it performs collaborative processing across three layers: the protocol parsing layer, the device management layer, and the communication interface layer. The protocol parsing layer utilizes C# reflection and custom features to encode, decode, and verify SECS / GEM messages based on the parsing rules loaded in S1, supporting HSMS and SECS-I transmission modes. The device management layer, based on the device configuration files loaded in S1, dynamically registers, deregisters, and monitors device status in real-time, using a dictionary structure to store device information. The communication interface layer, based on the communication interface initialized in S1, provides a unified API interface and uses C# async / await asynchronous programming to send and receive TCP / IP and serial port data, implementing timeout retransmission in conjunction with the status monitoring results from the device management layer. S4. Session Management: During the core layer processing of S3, the S1F13 / S1F14 standard heartbeat messages are periodically encapsulated by the protocol parser and sent by the communication interface layer to maintain the connectivity of the communication session. Alarm messages and control command messages are prioritized for processing. After processing by the protocol parser layer, they are sent to the device management layer for response operations. If a link interruption is detected, the communication interface layer is triggered to execute a reconnection mechanism based on the parameters configured in S1. At the same time, the device management layer marks the corresponding device status as abnormal. S5. Anomaly Handling: Real-time capture of link anomalies at the communication interface layer, message parsing errors at the protocol parsing layer, and device status anomalies at the device management layer are classified by type. Pre-defined processing strategies are executed for different types of anomalies. The anomaly type, occurrence time, associated device ID, and corresponding processing results are recorded synchronously. A complete device status log is generated by combining the device information stored at the device management layer. The protocol parsing layer in S3 processes the following: When sending data, the application layer data is encapsulated into a SECS-II specification message, Stream and Function code headers are added, and a checksum is generated; When receiving data, the original data is parsed, validated, and verified. The original data is automatically mapped into a readable message object through C# reflection mechanism to complete the decoding. In S3, a message class with custom C# attribute annotations is added to the protocol parsing layer to achieve adaptation to new protocol versions or custom protocol variants.
2. A system for implementing the SECS / GEM communication protocol based on C#, characterized in that: The SECS / GEM communication protocol implementation method based on C#, adapted to claim 1, is deployed on general-purpose computing devices with TCP / IP and serial communication capabilities. Developed using the C# programming language and the .NET 8 technology framework, it adopts a layered architecture and includes the following functional modules: The protocol parsing module has a built-in SECS / GEM parsing rule base, integrates a C# reflection and feature parsing engine, completes message encoding, decoding, verification and validation, provides protocol extension interfaces, and supports HSMS and SECS-I transmission modes; The device management module is used to realize device configuration parameter parsing, dynamic registration and deregistration, status monitoring, and full lifecycle management of communication sessions; The communication interface module provides a unified API interface to enable asynchronous data transmission and reception and port listening via TCP / IP and serial ports. The exception handling and logging module is used to realize real-time exception capture, classification and processing, and standardized recording of device status, communication data, and exception information; The device management module is connected to the communication interface module and the protocol parsing module respectively. The communication interface module is connected to the protocol parsing module. The exception handling and logging module is connected to the protocol parsing module, the device management module, and the communication interface module respectively. The device management module uses a dictionary data structure to store device ID, online / offline status, communication rate, and session status information, and provides standardized operation interfaces for adding, deleting, and querying devices. The communication interface module implements data sending and receiving based on the C# async / await asynchronous programming mode; The exception handling and logging module supports local log storage and remote monitoring terminal push. The exception handling and logging module performs timeout retransmission, data discarding, and status marking processing strategies for link interruption, message parsing error, and device offline anomaly, respectively.
3. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the C#-based SECS / GEM communication protocol implementation method as described in claim 1.