It can be paid in one lump sum, 20 years for invention patent, 10 for utility model patent and 15 for design patent. It can also be paid year by year, and the annual fee for the next year can be paid in advance within one month before the patent application date. For example, you need to keep the patent valid in 2023 and pay the annual fee before March 18, 2023.
If the annual fee cannot be paid in advance for many years, the fee for the next year can only be paid within the above-mentioned specified time.