The invention provides an automatic ticket selling and checking method and system. The method comprises the steps that 1, identity registration information sent by a mobile terminal of a passenger isreceived, and a gate entering certificate is generated on the basis of the identity registration information and sent to the mobile terminal; 2, the gate entering certificate is verified, the passenger is allowed to enter a gate on the basis of a verification result, and the mobile terminal is authorized to access a WIFI hotspot; 3, a travel trajectory of the passenger is generated on the basis ofthe WIFI hotspot and a connection record of the mobile terminal; and 4, a payment bill is generated on the basis of the travel trajectory, and the passenger is allowed to be out of a gate on the basis of a payment result of the payment bill. According to the method and system, by means of the operations that the WIFI hotspot connection is acquired when the passenger enters a station and the travel trajectory is generated on the basis of the WIFI hotspot and the connection record of the mobile terminal, the payment bill is generated, the waiting time can be shortened, the passenger can quickly enter the station, the payment time is shortened, and the information security of the passenger is guaranteed.