<p>Disclosed are a deep packet inspection (DPI) method and device, the method comprising: receiving a DPI request; determining to conduct an internal DPI or external DPI according to a packet characteristic and a preset first condition for conducting the internal DPI and external DPI; if it is determined to conduct an internal DPI, then notifying an internal DPI module to inspect the packet to obtain a packet inspection report, and if it is determined to conduct an external DPI, then notifying an external DPI module to inspect the packet to obtain a packet inspection report. The above method improves the maintainability and forwarding performance of the whole network.</p>