Abstract:To address the needs of visualization and intelligent control in knitting machine operations, this study designs and implements an integrated system for parsing knitting instructions, managing operational states, handling exceptions, and providing 2D visualization. The system adopts a modular architecture, comprising core modules for instruction parsing, operation state management, exception handling, 2D rendering, and a graphical user interface. Using regular expressions and finite-state machine methods, the system automatically parses and executes diverse knitting instructions, supporting operations such as stitch setting, knitting, transferring, stacking, skipping, shifting, yarn feeding, yarn retraction, and reverse knitting. The system employs a hybrid JavaFX and Swing framework to develop a visualization interface with 2D animation, dynamically rendering structures like needle beds, needles, and yarns, while interactively reflecting the impact of operation sequences on needle bed states in real time.Experimental results demonstrate that the system accurately parses and executes complex knitting processes, with 2D visualization response delays below 100 ms. The instruction parsing speed reaches a processing capacity of over 1000 instructions per second. The accuracy of system parsing has reached 99.8%, and the execution efficiency has been improved by about 80% compared to traditional manual operations. The stability test verified the reliability of the system in the scenario of continuous operation for 8 hours and processing over 1000 weaving instructions, without any memory leaks or performance degradation. Greatly enhancing the visual expression and intelligent control capabilities of knitting technology. This method provides effective technical support for the digital and intelligent upgrading of knitting machines.significantly enhancing the expressive visualization and intelligent control of knitting techniques.