A method for on-line modification of a dimethyl ether/methanol to olefins (DMTO) catalyst using a coke control reactor; wherein the coke control reactor is a reactor for controlling coke content, coke content distribution, and coke species in the DMTO catalyst; wherein the coke control reactor comprises a coke control reactor shell, a reaction zone I, and a coke controlled catalyst settling zone; the coke control reactor shell comprises an upper coke control reactor shell and a lower coke control reactor shell; the upper coke control reactor shell encloses the coke controlled catalyst settling zone; the lower coke control reactor shell encloses the reaction zone I; the reaction zone I communicates with the coke controlled catalyst settling zone; a cross-sectional area at any position of the reaction zone I is less than a cross-sectional area at any position of the coke controlled catalyst settling zone; n baffles are arranged in a vertical direction in the reaction zone I, bottoms of the n baffles are connected to a bottom of the coke control reactor, tops of the n baffles are located in the coke controlled catalyst settling zone, and the n baffles divide the reaction zone I into m reaction zone I subzones, wherein m and n are both integers; and a catalyst circulation hole is formed in each of the baffles, such that a catalyst flows in the reaction zone I in a preset manner; wherein the method at least comprises feeding a catalyst and a coke control raw material into the reaction zone I to allow a reaction to generate a product with a coke controlled catalyst, wherein the catalyst flows in a preset manner through the catalyst circulation holes on the baffles; characterized in that the coke control raw material comprises 0 wt% to 20 wt% of hydrogen, 0 wt% to 50 wt% of methane, 0 wt% to 50 wt% of ethane, 0 wt% to 20 wt% of ethylene, 0 wt% to 50 wt% of propane, 0 wt% to 20 wt% of propylene, 0 wt% to 90 wt% of butane, 0 wt% to 90 wt% of butene, 0 wt% to 90 wt% of pentane, 0 wt% to 90 wt% of pentene, 0 wt% to 90 wt% of hexane, 0 wt% to 90 wt% of hexene, 0 wt% to 50 wt% of methanol, 0 wt% to 50 wt% of ethanol, and 0 wt% to 50 wt% of water; and a content of the hydrocarbon compounds is greater than 0%. wherein the coke control reactor is a reactor for controlling coke content, coke content distribution, and coke species in the DMTO catalyst; wherein the coke control reactor comprises a coke control reactor shell, a reaction zone I, and a coke controlled catalyst settling zone; the coke control reactor shell comprises an upper coke control reactor shell and a lower coke control reactor shell; the upper coke control reactor shell encloses the coke controlled catalyst settling zone; the lower coke control reactor shell encloses the reaction zone I; the reaction zone I communicates with the coke controlled catalyst settling zone; a cross-sectional area at any position of the reaction zone I is less than a cross-sectional area at any position of the coke controlled catalyst settling zone; n baffles are arranged in a vertical direction in the reaction zone I, bottoms of the n baffles are connected to a bottom of the coke control reactor, tops of the n baffles are located in the coke controlled catalyst settling zone, and the n baffles divide the reaction zone I into m reaction zone I subzones, wherein m and n are both integers; and a catalyst circulation hole is formed in each of the baffles, such that a catalyst flows in the reaction zone I in a preset manner; wherein the method at least comprises feeding a catalyst and a coke control raw material into the reaction zone I to allow a reaction to generate a product with a coke controlled catalyst, wherein the catalyst flows in a preset manner through the catalyst circulation holes on the baffles; characterized in that the coke control raw material comprises 0 wt% to 20 wt% of hydrogen, 0 wt% to 50 wt% of methane, 0 wt% to 50 wt% of ethane, 0 wt% to 20 wt% of ethylene, 0 wt% to 50 wt% of propane, 0 wt% to 20 wt% of propylene, 0 wt% to 90 wt% of butane, 0 wt% to 90 wt% of butene, 0 wt% to 90 wt% of pentane, 0 wt% to 90 wt% of pentene, 0 wt% to 90 wt% of hexane, 0 wt% to 90 wt% of hexene, 0 wt% to 50 wt% of methanol, 0 wt% to 50 wt% of ethanol, and 0 wt% to 50 wt% of water; and a content of the hydrocarbon compounds is greater than 0%.