A configuration management method, applied to a control device and comprising: determining that an application message needs to be published to a target logical group; obtaining an identifier of the target logical group, wherein the target logical group comprises at least one target terminal; querying, according to a gateway mapping table and the identifier of the target logical group, a gateway connected to each of the at least one target terminal, to obtain at least one target gateway, wherein the gateway mapping table records identifiers of a plurality of gateways, an identifier of a terminal connected to each of the plurality of gateways, and an identifier of a logical group to which each terminal belongs; generating a Message Queuing Telemetry Transport, MQTT, publish packet based on the application message, wherein the MQTT publish packet comprises the identifier of the target logical group and the application message; and sending the MQTT publish packet to the at least one target gateway, wherein the MQTT publish packet is used to indicate a target gateway that receives the MQTT publish packet to send a corresponding application message to each target terminal that is connected to the target gateway and that belongs to the target logical group; wherein the application message includes a configuration management message; wherein the determining that an application message needs to be published to a target logical group comprises: if at least one application message that matches historical behavior data of the at least one target terminal is detected, determining that the application message needs to be published to the target logical group; wherein the method further comprises: receiving the historical behavior data of the at least one target terminal from the at least one target gateway, wherein the historical behavior data of the at least one target terminal is determined by the gateway based on a collected run log of an application of the at least one target terminal. determining that an application message needs to be published to a target logical group; obtaining an identifier of the target logical group, wherein the target logical group comprises at least one target terminal; querying, according to a gateway mapping table and the identifier of the target logical group, a gateway connected to each of the at least one target terminal, to obtain at least one target gateway, wherein the gateway mapping table records identifiers of a plurality of gateways, an identifier of a terminal connected to each of the plurality of gateways, and an identifier of a logical group to which each terminal belongs; generating a Message Queuing Telemetry Transport, MQTT, publish packet based on the application message, wherein the MQTT publish packet comprises the identifier of the target logical group and the application message; and sending the MQTT publish packet to the at least one target gateway, wherein the MQTT publish packet is used to indicate a target gateway that receives the MQTT publish packet to send a corresponding application message to each target terminal that is connected to the target gateway and that belongs to the target logical group; wherein the application message includes a configuration management message; wherein the determining that an application message needs to be published to a target logical group comprises: if at least one application message that matches historical behavior data of the at least one target terminal is detected, determining that the application message needs to be published to the target logical group; wherein the method further comprises: receiving the historical behavior data of the at least one target terminal from the at least one target gateway, wherein the historical behavior data of the at least one target terminal is determined by the gateway based on a collected run log of an application of the at least one target terminal. if at least one application message that matches historical behavior data of the at least one target terminal is detected, determining that the application message needs to be published to the target logical group; wherein the method further comprises: receiving the historical behavior data of the at least one target terminal from the at least one target gateway, wherein the historical behavior data of the at least one target terminal is determined by the gateway based on a collected run log of an application of the at least one target terminal.