The invention discloses an HTTP and WebSocket collaborative distributed state synchronization method which is characterized by comprising the following steps: step 1, initializing a WebSocket server cluster, step 2, reconstructing a URL of the WebSocket server cluster, step 3, allocating a WebSocket session to each client, step 4, detecting whether long connection is normal, step 5, determining aservice state change request. Step 6, calling a service server to process the request, and feeding back a result to the client, step 7, sending the request to the WebSocket server node, and step 8, closing the long connection. The WebSocket server is used for replacing an original client to send heartbeat detection, messages or external storage is not used, the effects of being simple in deployment and easy to expand are achieved, and meanwhile the using function requirements of different scenes are met.