The invention discloses a C #-based SECS / GEM communication protocol implementation method and
system and a computer readable storage medium, and is implemented based on a C #
programming language and a. NET 8 technical framework, and the method comprises the following steps: S1, initialization: loading an equipment configuration file in an
XML /
JSON format, reading an equipment ID, a protocol version and a communication mode parameter, and storing the equipment ID, the protocol version and the communication mode parameter; the method comprises the following steps: initializing a protocol parser based on a. NET 8 framework, loading a SECS / GEM
parsing rule of a corresponding version, meanwhile, initializing a
communication interface, completing pre-configuration of a bottom layer
communication channel, and establishing a binding relationship between equipment parameters and the parser and between the equipment parameters and the
communication interface; s2, establishing connection; s3, core layer
processing: on the basis of the
communication link established in S2, executing three-layer cooperative
processing of a protocol analysis layer, an equipment management layer and a
communication interface layer; s4, performing
session management; and S5, performing
exception handling. The method has the advantages of being good in cross-platform compatibility, high in development efficiency, high in communication
concurrency performance reliability, excellent in flexibility and expansibility, low in deployment cost, convenient to operate, maintain and diagnose faults and the like.