A gate opening apparatus based on the absolute value photoelectric encoder of AVM58 type is designed. The internal structure and software design are introduced. It overcomes the disadvantages of low accuracy and poor reliability during gate opening detecting with the contact type encoder and solves the hidden security problem that when the system is powered down the gate travel can not be accurately recorded with the increment type photoelectric encoder. The practical applications in some water conservancy facilities show that it has good effect. For the lifting height of 40 meters, the opening detection precision is up to 1mm, and when the system is powered down, the decline or other moving distance of the gate can be accurately recorded, so the accuracy and safety of the gate control are improved.