The Large High Altitude Air Shower Observatory (LHAASO), to be built at 4410 m a.s.l. near the Daocheng in the Sichuan province of China, is a new generation EAS array. It consists of three kinds of detector arrays. KM2A is the main array of LHAASO and is composed of 5195 electromagnetic particle detectors and 1171 muon detectors, which are distributed in an area of 1.3 km2. In this work, we study the trigger logics of KM2A, which will adopt an unprecedented software trigger system. Taking into account the characters of real cosmic ray events, we investigate the trigger logics by adjusting the space window and time window together. In this study, we adopt the CORSIKA to simulate the shower development and a parameterization code to simulate the detector response. We also develop a toy simulation to estimate the noise event rate due to chance coincidence noise hits. With the principle to maximize the real cosmic ray events in the same time to inhibit the noise events, we achieve an optimized trigger criterion for KM2A. The corresponding threshold energy for gamma-ray is about 4 TeV, which is much lower than the previous initial trigger logic. The performances of KM2A with this trigger criterion are also presented.