The invention discloses a real-time stream data processing method and system of a smart city. The method comprises the steps of data collection, data type classification, data cleaning, data calculation and analysis, data display, data persistence storage and the like. The invention sets up a data collection module in the mode of mainly using Flume and supplemented by API collection, and utilizeschannel to carry out data persistence, so as to ensure reliability in the process of data transmission. Using Kafka as a stream processing platform and introducing the fault-tolerant mechanism of Flink to consume Kafka data in high level, the real real-time stream data processing can be realized, which can support millisecond-level computation. In addition, perfect window support of Flink providesmore perfect window aggregation computation API than Storm. Finally, WebSocket is used to establish the connection channel between a server and a Web end to provide real-time data service, reduce thepressure of data transmission, and improve the high concurrent access and availability of the system.