  In some quantum gravity (QG) theories, Lorentz symmetry may be broken above
the Planck scale. The Lorentz invariance violation (LIV) may induce observable
effects at low energies and be detected at high energy astrophysical
measurements. The Large High Altitude Air Shower Observatory(LHAASO) has
detected the onset, rise, and decay phases of the afterglow of GRB 221009A,
covering a wide energy range of photons approximately from $0.2$ to $18$ TeV.
This observation provides an excellent opportunity to study the Lorentz
invariance violation effect. In this study, we simultaneously utilize the data
from the KM2A and WCDA detectors of LHAASO, and apply two event by event
methods, namely the pair view method and maximum likelihood method, to
investigate LIV. We obtain stringent constraints on the QG energy scale. For
instance, through the maximum likelihood method, we determine the 95$\%$
confidence level lower limits to be $E_{QG,1} > 14.7 (6.5)\times 10^{19}$GeV
for the subluminal (superluminal) scenario of $n = 1$, and $E_{QG,2} > 12.0
(7.2)\times 10^{11}$GeV for the subluminal (superluminal) scenario of $n = 2$.
We find that the rapid rise and slow decay behaviors of the afterglow can
impose strong constraints on the subluminal scenario, while the constraints are
weaker for the superluminal scenario.
