An IP camera control method, comprising: Receiving, 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, by the IP camera, a heartbeat packet to be transmitted between the IP camera and the server; wherein the constructing, by the IP camera, a heartbeat packet to be transmitted between the IP camera and the server comprises: Receiving, 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, 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, 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 by the IP camera, from a working state to a standby state; Sending, 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, 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, by the IP camera, a heartbeat packet to be transmitted between the IP camera and the server; wherein the constructing, by the IP camera, a heartbeat packet to be transmitted between the IP camera and the server comprises: Receiving, 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, 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, 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, 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, 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, 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 by the IP camera, from a working state to a standby state; Sending, 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.