The invention discloses a congestion control method and system based on deep reinforcement learning. The congestion control method includes: firstly, initializing the environment and model parametersof a network; and training a congestion control model by utilizing the collected current window, the throughput, the time delay, the data transmission rate and the like in the network, selecting the congestion control model with the minimum model loss function value and the maximum reward function value according to a training result, and deploying the model into the network to perform congestioncontrol. According to the method, the size of the congestion window is dynamically adjusted according to the current network throughput, round-trip time delay and data packet loss rate, so that the data transmission rate is controlled, the network throughput is improved, the data transmission delay and the data packet loss rate are reduced, the network congestion is reduced, and the aim of optimizing the network performance is fulfilled.