Inverse design has attracted significant attention as a method to improve device performance and compactness. In this research, we employed a combination of forward design and the inverse algorithm using particle swarm optimization (PSO) to design a bent ultra-compact 1310/1550nm broadband wavelength demultiplexer assisted by a subwavelength grating (SWG). Through the phase matching at 1550nm and the phase mismatch at 1310nm, we rapidly designed the width parameters of SWG in the forward direction. Then the PSO algorithm was used to optimize the SWG parameters in a certain range to achieve the best performance. Additionally, we introduced a new bent dimension significantly reducing the device length while maintaining low insertion loss (IL) and high extinction ratios (ERs). It has been verified that the length of the device is only 7.8µm, and it provides a high ER of 24dB at 1310nm and 27dB at 1550nm. The transmitted spectrum shows that the IL values at both wavelengths are below 0.1dB. Meanwhile, the 1dB bandwidth exceeds 150nm, effectively covering the entire O-band and C-band. This approach has been proven successful in enhancing performance and significantly reducing the device footprint.