An IP camera control method, comprising: Receiving (S202), by an IP camera, a standby instruction sent by a server; wherein the standby instruction is the instruction that a client sends to the server, and the IP camera and the client are connected to the server respectively; Constructing (S2034), by the IP camera, a heartbeat packet to be transmitted between the IP camera and the server; wherein the constructing (S2034), by the IP camera, a heartbeat packet to be transmitted between the IP camera and the server comprises: Receiving (S2032), by the IP camera, first heartbeat information sent by the server, wherein the first heartbeat information comprises a communication address and a port number of the server; Obtaining (S2033), by the IP camera, second heartbeat information, wherein the second heartbeat information comprises a communication address and a port number of the IP camera; and Constructing (S2034), by the IP camera, the heartbeat packet according to the first heartbeat information and the second heartbeat information, wherein the heartbeat packet is a data frame that comprises the port number of the server, the communication address of the server, the port number of the IP camera, and the communication address of the IP camera; Switching (S203) by the IP camera, from a working state to a standby state; Sending (S205), by the IP camera, the heartbeat packet to the server at a first preset frequency to make the IP camera maintain a heartbeat connection to the server. Receiving (S202), by an IP camera, a standby instruction sent by a server; wherein the standby instruction is the instruction that a client sends to the server, and the IP camera and the client are connected to the server respectively; Constructing (S2034), by the IP camera, a heartbeat packet to be transmitted between the IP camera and the server; wherein the constructing (S2034), by the IP camera, a heartbeat packet to be transmitted between the IP camera and the server comprises: Receiving (S2032), by the IP camera, first heartbeat information sent by the server, wherein the first heartbeat information comprises a communication address and a port number of the server; Obtaining (S2033), by the IP camera, second heartbeat information, wherein the second heartbeat information comprises a communication address and a port number of the IP camera; and Constructing (S2034), by the IP camera, the heartbeat packet according to the first heartbeat information and the second heartbeat information, wherein the heartbeat packet is a data frame that comprises the port number of the server, the communication address of the server, the port number of the IP camera, and the communication address of the IP camera; Receiving (S2032), by the IP camera, first heartbeat information sent by the server, wherein the first heartbeat information comprises a communication address and a port number of the server; Obtaining (S2033), by the IP camera, second heartbeat information, wherein the second heartbeat information comprises a communication address and a port number of the IP camera; and Constructing (S2034), by the IP camera, the heartbeat packet according to the first heartbeat information and the second heartbeat information, wherein the heartbeat packet is a data frame that comprises the port number of the server, the communication address of the server, the port number of the IP camera, and the communication address of the IP camera; Switching (S203) by the IP camera, from a working state to a standby state; Sending (S205), by the IP camera, the heartbeat packet to the server at a first preset frequency to make the IP camera maintain a heartbeat connection to the server. <EOS>