Method and system for controlling engine gears of excavator

The invention discloses a method and system for controlling engine gears of an excavator. The method comprises the following steps of: detecting the position of a gear knob of the excavator to determine the current gear of an engine; determining a rotation speed corresponding to the current gear; detecting the current rotation speed of the engine; comparing the determined rotation speed corresponding to the current gear with the current rotation speed of the engine; and if the difference between the determined rotation speed corresponding to the current gear and the current rotation speed of the engine is larger than a preset value, regulating the position of an accelerator of the engine so that the difference between the current rotation speed of the engine and the determined rotation speed corresponding to the current gear is smaller than the preset value. The method can automatically regulate the gear rotation speed when the rotation speed of the engine generates rotation speed deviation at a certain gear, thereby realizing the self-adaptive control on the gear of the engine.