Bluetooth equipment state query method and device, electronic equipment and storage medium

By detecting the user's Bluetooth device status query operation in the home host, obtaining control instructions and determining the target operating status, the problem of excessive signals and slow query speed during multi-Bluetooth device status query is solved, and fast, non-impact state query and high success rate Bluetooth device control are achieved.

CN119922519APending Publication Date: 2025-05-02GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411902133.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

When there are many Bluetooth devices, when querying the status of Bluetooth devices, excessive Bluetooth signals lead to poorer environments and slower query speed, affecting the execution and success rate of Bluetooth control signals.

Method used

By detecting the user's status query operation, obtaining the user's control instructions, determining the target operation status of the target Bluetooth device, and determining the query result based on the status, and outputting the query result. This method avoids the impact of large-scale device status query on the Bluetooth network environment.

Benefits of technology

It realizes that the status of Bluetooth devices is quickly queried without affecting the Bluetooth network environment to ensure the success rate of Bluetooth devices performing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922519A_ABST
    Figure CN119922519A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a Bluetooth equipment state query method and device, electronic equipment and a storage medium, and is applied to a home host.The method comprises the steps that after state query operation of a user for Bluetooth equipment is detected, a control instruction input by the user is obtained; determining a target operation state of a target Bluetooth device indicated by the control instruction; determining a query result of the state query operation according to the target running state of the target Bluetooth device; and outputting the query result. According to the embodiment of the invention, when the number of the Bluetooth devices is large, the state when the Bluetooth devices execute the task is taken as the state of the Bluetooth devices, and the devices do not need to be inquired, so that the whole Bluetooth network environment can be prevented from being influenced by inquiry of a large batch of device states, and the success rate of task execution of the Bluetooth devices is not influenced. And querying the state of the Bluetooth device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Bluetooth control, and in particular to a method, device, electronic device and storage medium for querying the status of a Bluetooth device. Background Art

[0002] As the control center of the smart home, the home host will be configured with a variety of Bluetooth sub-devices. When there are a large number of Bluetooth sub-devices, if you want to display the status of Bluetooth devices in the scenario of controlling multiple Bluetooth sub-devices, you need to query the status of each Bluetooth device. In the same Bluetooth environment, too many Bluetooth signals querying the status of Bluetooth devices will cause the Bluetooth environment to deteriorate. Moreover, when querying each Bluetooth device in turn, the speed of obtaining the status result is slow, which will affect the execution of other Bluetooth control signals and the success rate of Bluetooth device control. Summary of the invention

[0003] In order to solve the above problems, the embodiments of the present invention disclose a method, an apparatus, an electronic device and a storage medium for querying the status of a Bluetooth device.

[0004] In a first aspect, an embodiment of the present invention provides a method for querying the status of a Bluetooth device, which is applied to a home host. The method includes:

[0005] When a user's status query operation on a Bluetooth device is detected, a control instruction input by the user is obtained;

[0006] Determine a target operating state of a target Bluetooth device indicated by the control instruction;

[0007] Determining a query result of the status query operation according to a target operating state of the target Bluetooth device;

[0008] The query result is output.

[0009] Optionally, determining the query result of the status query operation according to the target operating state of the target Bluetooth device includes:

[0010] Obtain historical query results of the target Bluetooth device;

[0011] Comparing the target running state of the target Bluetooth device with the historical query result of the target Bluetooth device to obtain difference information of the target Bluetooth device;

[0012] The difference information of the target Bluetooth device is used as the query result of the status query operation.

[0013] Optionally, the control instruction of the Bluetooth device includes a scene control instruction, and determining the target operating state of the target Bluetooth device indicated by the control instruction includes:

[0014] According to the scene control instruction of the target Bluetooth device, the preset state of the target Bluetooth device is obtained from the database of the home host, and the preset state of the target Bluetooth device is used as the target operating state of the target Bluetooth device.

[0015] Optionally, the control instruction of the Bluetooth device includes a zone control instruction, and determining the target operating state of the target Bluetooth device indicated by the control instruction includes:

[0016] According to the area control instruction of the target Bluetooth device, the target Bluetooth device in the target area and the instruction control state of the target Bluetooth device are determined, and the instruction control state of the target Bluetooth device is used as the target operating state of the target Bluetooth device.

[0017] Optionally, the method further comprises:

[0018] When the number of the target Bluetooth device is 1, obtaining the reporting status of the target Bluetooth device;

[0019] The reported state of the target Bluetooth device is used as the target operating state of the target Bluetooth device.

[0020] Optionally, obtaining the reporting status of the target Bluetooth device includes:

[0021] Acquire the reporting status of the target Bluetooth device according to a preset period;

[0022] When the waiting time is greater than the preset period, the current state of the target Bluetooth device is queried, and the current state of the target Bluetooth device is used as the target operating state of the target Bluetooth device.

[0023] Optionally, the method further comprises:

[0024] Query the actual operating status of the Bluetooth device during a preset time period;

[0025] If the actual running state is a fault state, after detecting a status query operation of the user on the Bluetooth device, the actual running state is used as a status query result.

[0026] In a second aspect, an embodiment of the present invention provides a Bluetooth device status query device, which is applied to a home host, and the device includes:

[0027] A control instruction acquisition module, used for acquiring the control instruction input by the user after detecting a status query operation of the user on the Bluetooth device;

[0028] A control instruction recognition module, used to determine the target operating state of the target Bluetooth device indicated by the control instruction;

[0029] A query result determination module, used to determine the query result of the status query operation according to the target operating state of the target Bluetooth device;

[0030] The query result output module is used to output the query result.

[0031] Optionally, the query result determination module includes:

[0032] A historical query result acquisition submodule is used to acquire the historical query results of the target Bluetooth device;

[0033] A difference information determination submodule, used for comparing the target operating state of the target Bluetooth device with the historical query result of the target Bluetooth device to obtain the difference information of the target Bluetooth device;

[0034] The query result determination submodule is used to use the difference information of the target Bluetooth device as the query result of the status query operation.

[0035] Optionally, the control instruction of the Bluetooth device includes a scene control instruction, and the control instruction recognition module includes:

[0036] The first control instruction recognition submodule is used to obtain the preset state of the target Bluetooth device from the database of the home host according to the scene control instruction of the target Bluetooth device, and use the preset state of the target Bluetooth device as the target operating state of the target Bluetooth device.

[0037] Optionally, the control instruction of the Bluetooth device includes a zone control instruction, and the control instruction identification module includes:

[0038] The second control instruction identification submodule is used to determine the target Bluetooth device in the target area and the instruction control state of the target Bluetooth device according to the area control instruction of the target Bluetooth device, and use the instruction control state of the target Bluetooth device as the target operating state of the target Bluetooth device.

[0039] Optionally, the device further comprises:

[0040] A reporting status acquisition module, used for acquiring the reporting status of the target Bluetooth device when the number of the target Bluetooth device is 1;

[0041] The target running state determining module is used to use the reporting state of the target Bluetooth device as the target running state of the target Bluetooth device.

[0042] Optionally, the reporting status acquisition module includes:

[0043] A reporting status acquisition submodule, used to acquire the reporting status of the target Bluetooth device according to a preset period;

[0044] The reporting status query submodule is used to query the current status of the target Bluetooth device when the waiting time is greater than the preset period, and use the current status of the target Bluetooth device as the target operating status of the target Bluetooth device.

[0045] Optionally, the device further comprises:

[0046] A real operation status determination module, used to query the real operation status of the Bluetooth device in a preset time period;

[0047] The status query result determination module is used to use the real operating state as the status query result after detecting a status query operation of the user on the Bluetooth device if the real operating state is a fault state.

[0048] In a third aspect, the present invention shows an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for querying the status of a Bluetooth device when executing the computer program.

[0049] In a fourth aspect, the present invention shows a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned method for querying the status of a Bluetooth device are implemented.

[0050] The embodiments of the present invention include the following advantages:

[0051] The home host of the embodiment of the present invention can obtain the control instruction input by the user after detecting the user's status query operation for the Bluetooth device; determine the target operating state of the target Bluetooth device indicated by the control instruction, so as to obtain the status of the Bluetooth device when performing the task; determine the query result of the status query operation according to the target operating state of the target Bluetooth device; and output the query result. The embodiment of the present invention uses the status of the Bluetooth device when performing the task as the status of the Bluetooth device when there are many Bluetooth devices, and does not need to query the device, thereby avoiding the query of the status of a large number of devices affecting the entire Bluetooth network environment, and realizing the query of the status of the Bluetooth device without affecting the success rate of the Bluetooth device in performing the task. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0053] Figure 1 is a flowchart of a method for querying the status of a Bluetooth device according to an embodiment of the present invention;

[0054] Figure 2 is a flowchart of another method for querying the status of a Bluetooth device according to an embodiment of the present invention;

[0055] Figure 3 It is a logic diagram of a Bluetooth device status query method according to an embodiment of the present invention;

[0056] Figure 4 The present invention is a structural block diagram of a Bluetooth device status query device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The present invention proposes a method for querying the status of a Bluetooth device, which is applied to a home host, and aims to query the status of a Bluetooth device without affecting the execution of other Bluetooth control signals. To achieve this goal, when there are many Bluetooth devices, the embodiment of the present invention uses the status of the Bluetooth device when executing a task as the status of the Bluetooth device, thereby avoiding the query of the status of a large number of devices affecting the entire Bluetooth network environment, and ensuring that the success rate of the Bluetooth device executing the task is not affected.

[0058] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0059] Reference Figure 1 , shows a flowchart of a method for querying the status of a Bluetooth device according to an embodiment of the present invention, which is applied to a home host. The method may specifically include the following steps:

[0060] Step 101, when a user's status query operation for a Bluetooth device is detected, a control instruction input by the user is obtained;

[0061] In an embodiment of the present invention, the home host can obtain the control instruction input by the user after detecting the user's status query operation for the Bluetooth device. The control instruction may include a separate control instruction, a scene control instruction, a zone control instruction, etc.; the Bluetooth device may include an audio device, a lighting device, a smart fan, a smart air conditioner, an air purifier, a humidifier, a smart refrigerator, a sweeping robot, etc. The home host can perform different status processing on the Bluetooth device according to different control instructions, so as to achieve the optimal status display solution and ensure the cleanliness of the Bluetooth network environment.

[0062] Step 102, determining the target operating state of the target Bluetooth device indicated by the control instruction;

[0063] In an embodiment of the present invention, the home host can determine the target operating state of the target Bluetooth device indicated by the control instruction. Exemplarily, when the control instruction of the Bluetooth device is a scene control instruction, the home host can first determine the target Bluetooth device targeted by the scene control instruction, and then obtain the preset state of the target Bluetooth device corresponding to the scene control instruction from the database of the home host according to the scene control instruction of the target Bluetooth device, and use the preset state of the target Bluetooth device as the target operating state of the target Bluetooth device. When the control instruction of the Bluetooth device is a zone control instruction, the home host can first determine the target Bluetooth device in the target area and the instruction control state of the target Bluetooth device according to the zone control instruction of the target Bluetooth device, and use the instruction control state of the target Bluetooth device as the target operating state of the target Bluetooth device.

[0064] Step 103, determining a query result of the status query operation according to the target operating state of the target Bluetooth device;

[0065] Step 104: output the query result.

[0066] In an embodiment of the present invention, the home host can determine the query result of the status query operation according to the target operating state of the target Bluetooth device, and output the query result. Exemplarily, the home host can output the query result using the MQTT (Message Queuing Telemetry Transport) protocol. Due to the lightweight characteristics of the protocol, MQTT can effectively reduce power consumption when running on a resource-constrained device.

[0067] The home host of the embodiment of the present invention can obtain the control instruction input by the user after detecting the user's status query operation for the Bluetooth device; determine the target operating state of the target Bluetooth device indicated by the control instruction, so as to obtain the status of the Bluetooth device when performing the task; determine the query result of the status query operation according to the target operating state of the target Bluetooth device; and output the query result. The embodiment of the present invention uses the status of the Bluetooth device when performing the task as the status of the Bluetooth device when there are many Bluetooth devices, and does not need to query the device, thereby avoiding the query of the status of a large number of devices affecting the entire Bluetooth network environment, and realizing the query of the status of the Bluetooth device without affecting the success rate of the Bluetooth device in performing the task.

[0068] Reference Figure 2 , shows a flowchart of another method for querying the status of a Bluetooth device according to an embodiment of the present invention, which is applied to a home host. The method may specifically include the following steps:

[0069] Step 201, when a user's status query operation for a Bluetooth device is detected, a control instruction input by the user is obtained;

[0070] In an embodiment of the present invention, the home host can obtain the control instruction input by the user after detecting the user's status query operation for the Bluetooth device. The control instruction may include a separate control instruction, a scene control instruction, a zone control instruction, etc.; the Bluetooth device may include an audio device, a lighting device, a smart fan, a smart air conditioner, an air purifier, a humidifier, a smart refrigerator, a sweeping robot, etc. The home host can perform different status processing on the Bluetooth device according to different control instructions, so as to achieve the optimal status display solution and ensure the cleanliness of the Bluetooth network environment.

[0071] Step 202, determining the target operating state of the target Bluetooth device indicated by the control instruction;

[0072] In one embodiment, the control instruction of the Bluetooth device includes a scene control instruction, and the step of determining the target operating state of the target Bluetooth device indicated by the control instruction may further include the following sub-steps:

[0073] Sub-step S11, according to the scene control instruction of the target Bluetooth device, obtaining the preset state of the target Bluetooth device from the database of the home host, and using the preset state of the target Bluetooth device as the target operating state of the target Bluetooth device.

[0074] In an embodiment of the present invention, the home host can determine the target operating state of the target Bluetooth device indicated by the control instruction. When the control instruction of the Bluetooth device is a scene control instruction, the home host can first determine the target Bluetooth device targeted by the scene control instruction, and then obtain the preset state of the target Bluetooth device corresponding to the scene control instruction from the database of the home host according to the scene control instruction of the target Bluetooth device, and use the preset state of the target Bluetooth device as the target operating state of the target Bluetooth device. Specifically, when the target Bluetooth device is scene-controlled, it is first necessary to set a scene for the target Bluetooth device. At this time, the home host stores the control scene of the set target Bluetooth device in a local database. When the scene control instruction corresponding to the target Bluetooth device is obtained, it is no longer necessary to query the status of the target Bluetooth device. The preset state of the target Bluetooth device can be directly retrieved from the database for reporting, so that the preset state of the target Bluetooth device is output and displayed as the real state of the target Bluetooth device.

[0075] For example, suppose that the home host is equipped with 100 switches for lighting devices, and the scene control instruction is to turn on all the switches of the lighting devices. At this time, the home host stores the status instruction of turning on all the switches of the lighting devices in the database. When it is detected that the user queries the status of the scene, the status of all the switches of the 100 lighting devices stored in the database being turned on can be directly reported without querying the status of each lighting device switch. In this way, the status of multiple lighting device switches can be directly displayed. The output end does not need to wait for the status query result of each lighting device switch and then display them in turn, and the entire Bluetooth environment will not be affected by too many Bluetooth packets.

[0076] In one embodiment, the control instruction of the Bluetooth device includes a zone control instruction, and the step of determining the target operating state of the target Bluetooth device indicated by the control instruction may further include the following sub-steps:

[0077] Sub-step S21, determining the target Bluetooth device in the target area and the instruction control state of the target Bluetooth device according to the area control instruction of the target Bluetooth device, and using the instruction control state of the target Bluetooth device as the target operating state of the target Bluetooth device.

[0078] In an embodiment of the present invention, the home host can determine the target operating state of the target Bluetooth device indicated by the control instruction. When the control instruction of the Bluetooth device is a regional control instruction, the home host can first determine the target Bluetooth device in the target area and the instruction control state of the target Bluetooth device according to the regional control instruction of the target Bluetooth device, and use the instruction control state of the target Bluetooth device as the target operating state of the target Bluetooth device. Specifically, when the target area targeted by the regional control instruction is a room, the home host can determine which target Bluetooth devices need to be controlled in the room. After finding the target Bluetooth device to be controlled, a status packet of the instruction control state of the target Bluetooth device after executing the room control can be generated, and then output for display, without querying the status of the target Bluetooth device in the room.

[0079] For example, assuming that the zone control instruction is to control all the switches of the lighting devices in the living room to turn on, the home host can find all the lighting devices in the living room from the database, and then report an on switch status to each lighting device for output, instead of querying the switch of each lighting device, thereby reducing the number of Bluetooth status query packets and optimizing the Bluetooth network environment.

[0080] Among them, the scene control instruction is to first set the scene of the target Bluetooth device. When setting the scene, the scene status of the target Bluetooth device to be executed is stored in the database of the home host. When the target Bluetooth device is about to execute the scene, the home host can report the status to be executed as the final status of the target Bluetooth device. The area control instruction does not require scene setting. The user can directly control the target Bluetooth device in a specific area through voice. For example, all the switches of the lighting devices in a room are turned on. Then the home host can find all the lighting devices in the room and report the status of all the switches of the lighting devices in the room being turned on.

[0081] Step 203, obtaining the historical query results of the target Bluetooth device;

[0082] Step 204, comparing the target running state of the target Bluetooth device with the historical query result of the target Bluetooth device to obtain difference information of the target Bluetooth device;

[0083] Step 205, using the difference information of the target Bluetooth device as the query result of the status query operation;

[0084] In an embodiment of the present invention, the home host can also obtain the historical query results of the target Bluetooth device, and compare the target operating status of the target Bluetooth device with the historical query results of the target Bluetooth device to obtain the difference information of the target Bluetooth device, and then use the difference information of the target Bluetooth device as the query result of the status query operation.

[0085] Exemplarily, when the state of the target Bluetooth device may include multiple items, for example, the state of a smart air conditioner may include a switch state, an outlet air temperature, an outlet air mode, etc., assuming that the historical query result of the smart air conditioner is: switch on, outlet air temperature 26 degrees Celsius, outlet air mode cooling, and the target operating state of the smart air conditioner is: switch on, outlet air temperature 22 degrees Celsius, outlet air mode cooling, then the target operating state of the smart air conditioner is compared with the historical query result of the smart air conditioner, and the difference information of the smart air conditioner can be obtained: the outlet air temperature is 22 degrees Celsius. At this time, the home host can output the difference information of the smart air conditioner as the query result of the state query operation.

[0086] Step 206: output the query result.

[0087] In an embodiment of the present invention, the home host can output the query result of the target Bluetooth device. Specifically, the home host can use the MQTT (Message Queuing Telemetry Transport) protocol to output the query result. Among them, MQTT is a lightweight, publish / subscribe-based communication protocol designed for low-bandwidth, high-latency or unreliable network environments. It is widely used in communications between Internet of Things (IoT) devices, especially on resource-constrained devices. MQTT adopts a publish / subscribe model, and devices do not need to be directly connected, but instead use an intermediate broker (Broker) for message delivery. MQTT supports persistent sessions. Even if the client is disconnected, the Broker will save the subscription information and undelivered messages until the client reconnects.

[0088] The main components of the MQTT protocol include: Broker, Publisher, Subscriber and Topic. Broker is responsible for receiving messages from publishers and distributing messages to subscribers who have subscribed to the corresponding topics. Common MQTT Brokers include Mosquitto, EMQ X, HiveMQ, etc. Publisher publishes messages to specific topics, and messages are passed to subscribers through Broker. Subscriber subscribes to topics of interest and receives messages from Broker. Topic is a classification identifier for messages. Publishers and subscribers communicate through topics. Topics use a hierarchical structure, similar to a file path.

[0089] Specifically, the client (publisher or subscriber, i.e., home host and user terminal) establishes a connection with the Broker and sends a message for authentication and session setup. The subscriber sends a SUBSCRIBE message to the Broker to subscribe to the topic of interest. The publisher sends a PUBLISH message to the Broker to publish the message to a specific topic. The Broker delivers the message to all subscribers who have subscribed to the topic. Among them, MQTT supports three levels of quality of service (QoS) to ensure reliable message delivery: QoS 0 means at most once delivery (At most once), and the message may be lost. QoS1 means at least once delivery (At least once), and the message may be repeated. QoS2 means exactly once delivery (Exactly once), and the message is guaranteed to be delivered only once. Due to the lightweight nature of the protocol, MQTT can effectively reduce power consumption when running on resource-constrained devices.

[0090] In one embodiment, the method may further include: when the number of the target Bluetooth device is 1, acquiring the reporting status of the target Bluetooth device; and using the reporting status of the target Bluetooth device as the target operating status of the target Bluetooth device.

[0091] The step of obtaining the reporting status of the target Bluetooth device may further include the following sub-steps:

[0092] Sub-step S31, obtaining the reporting status of the target Bluetooth device according to a preset period;

[0093] Sub-step S32, when the waiting time is greater than the preset period, querying the current state of the target Bluetooth device, and using the current state of the target Bluetooth device as the target operating state of the target Bluetooth device.

[0094] In the embodiment of the present invention, the home host can also obtain the reporting status of the target Bluetooth device when the number of the target Bluetooth device is 1, that is, when the control instruction input by the user is a separate control instruction, and use the reporting status of the target Bluetooth device as the target operating status of the target Bluetooth device. Specifically, the home host can wait for the target Bluetooth device to automatically report the device status according to a preset period, and when the waiting time is greater than the preset period, the home host can actively query the current status of the target Bluetooth device, and use the current status of the target Bluetooth device as the target operating status of the target Bluetooth device.

[0095] For example, when the separate control instruction is to control the switch of a certain lighting device to turn on, the lighting device performs the switch-on operation after receiving the separate control instruction, and automatically reports the status to the home host after a preset period. If the separate control instruction is received within the preset period to turn off the switch of the lighting device, the reporting time is reset to the preset period, and the status is not reported until no new control is received within the preset period, so as to reduce the amount of status reports. At the same time, if the home host does not receive the switch status after the preset period of the control switch, it can actively query the status of the switch of the lighting device to obtain the latest status of the switch. Among them, the preset period can be 2s, and those skilled in the art can set the preset period to other appropriate values ​​according to the concept of the present invention, and the present invention does not limit this.

[0096] In one embodiment, the method may further include: querying the actual operating status of the Bluetooth device during a preset time period; if the actual operating status is a fault state, after detecting a user's status query operation on the Bluetooth device, using the actual operating status as a status query result.

[0097] In an embodiment of the present invention, the home host can also query the real operating status of the Bluetooth device in a preset time period. If the real operating status is a fault state, the real operating status is used as the status query result after detecting the user's status query operation for the Bluetooth device. The preset time period can be 0:00-6:00 every day, that is, the status of the Bluetooth device is queried when the user does not control the Bluetooth device, so as not to affect the normal control of the user during the day. Those skilled in the art can set the preset time period to other appropriate values ​​according to the concept of the present invention, and the present invention is not limited to this.

[0098] The home host of the embodiment of the present invention can obtain the control instruction input by the user after detecting the user's status query operation for the Bluetooth device; determine the target operating state of the target Bluetooth device indicated by the control instruction, so as to obtain the status of the Bluetooth device when performing the task; determine the query result of the status query operation according to the target operating state of the target Bluetooth device; and output the query result. The embodiment of the present invention uses the status of the Bluetooth device when performing the task as the status of the Bluetooth device when there are many Bluetooth devices, and does not need to query the device, thereby avoiding the query of the status of a large number of devices affecting the entire Bluetooth network environment, and realizing the query of the status of the Bluetooth device without affecting the success rate of the Bluetooth device in performing the task.

[0099] Reference Figure 3 , shows a logic diagram of a Bluetooth device status query method provided by an embodiment of the present invention, in order to enable those skilled in the art to better understand the embodiment of the present invention, the following Figure 3 The embodiments of the present invention are described as follows:

[0100] Step 301, when the control instruction input by the user is a separate control instruction, the reporting state of the target Bluetooth device is obtained, and the reporting state of the target Bluetooth device is used as the target operating state of the target Bluetooth device;

[0101] In an embodiment of the present invention, when the control instruction input by the user is a separate control instruction, the home host can wait for the target Bluetooth device to automatically report the device status according to a preset period. When the waiting time is greater than the preset period, the current status of the target Bluetooth device can be actively queried, and the current status of the target Bluetooth device is used as the target operating state of the target Bluetooth device. For example, when the separate control instruction is to control the switch of a certain lighting device to turn on, the lighting device performs the switch-on operation after receiving the separate control instruction, and automatically reports the status to the home host after a preset period. If the separate control instruction is received within the preset period to turn off the switch of the lighting device, the reporting time is reset to the preset period, and the status is not reported until no new control is received within the preset period, so as to reduce the amount of status reports. At the same time, if the home host does not receive the switch status after the preset period of controlling the switch, it can actively query the status of the switch of the lighting device to obtain the latest status of the switch.

[0102] Step 302, when the control instruction of the Bluetooth device is a scene control instruction, determining the target Bluetooth device targeted by the scene control instruction, obtaining the preset state of the target Bluetooth device corresponding to the scene control instruction from the database of the home host according to the scene control instruction of the target Bluetooth device, and using the preset state of the target Bluetooth device as the target operating state of the target Bluetooth device;

[0103] In an embodiment of the present invention, the home host can set a scene for the target Bluetooth device and store the control scene of the set target Bluetooth device in a local database. When the control instruction input by the user is a scene control instruction, it is no longer necessary to query the status of the target Bluetooth device. The preset status of the target Bluetooth device can be directly taken out from the database for reporting, so that the preset status of the target Bluetooth device is output and displayed as the real status of the target Bluetooth device. For example, assuming that the home host is equipped with 100 switches of lighting devices, and the scene control instruction is to turn on all the switches of the lighting devices, the home host stores the status instruction of turning on all the switches of the lighting devices in the database. When the user queries the status of the scene, the status of turning on all the switches of the 100 lighting devices stored in the database can be directly reported, and the status of the switches of each lighting device can no longer be queried, so that the status of the switches of multiple lighting devices can be directly displayed, and the output end does not need to wait for the status query result of each lighting device switch and then display them in sequence, and the entire Bluetooth environment will not be affected by too many Bluetooth packets.

[0104] Step 303, when the control instruction of the Bluetooth device is a zone control instruction, the target Bluetooth device in the target area and the instruction control state of the target Bluetooth device are determined according to the zone control instruction of the target Bluetooth device, and the instruction control state of the target Bluetooth device is used as the target operating state of the target Bluetooth device.

[0105] In an embodiment of the present invention, when the control instruction input by the user is a zone control instruction, for example, when the target area of ​​the zone control instruction is a room, the home host can determine which target Bluetooth devices need to be controlled in the room, and after finding the target Bluetooth device to be controlled, it can generate a status packet of the control status of the target Bluetooth device after executing the room control instruction, and then output it for display, without querying the status of the target Bluetooth device in the room.

[0106] The home host of the embodiment of the present invention can obtain the control instruction input by the user after detecting the user's status query operation for the Bluetooth device; determine the target operating state of the target Bluetooth device indicated by the control instruction, so as to obtain the status of the Bluetooth device when performing the task; determine the query result of the status query operation according to the target operating state of the target Bluetooth device; and output the query result. The embodiment of the present invention uses the status of the Bluetooth device when performing the task as the status of the Bluetooth device when there are many Bluetooth devices, and does not need to query the device, thereby avoiding the query of the status of a large number of devices affecting the entire Bluetooth network environment, and realizing the query of the status of the Bluetooth device without affecting the success rate of the Bluetooth device in performing the task.

[0107] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0108] Reference Figure 4 , shows a structural block diagram of a Bluetooth device status query device provided by an embodiment of the present invention, which is applied to a home host and may specifically include the following modules:

[0109] The control instruction acquisition module 401 is used to acquire the control instruction input by the user after detecting the user's state query operation on the Bluetooth device;

[0110] Among them, the home host can obtain the control instructions that the user has entered after detecting the user's status query operation on the Bluetooth device. Among them, the control instructions may include individual control instructions, scene control instructions, area control instructions, etc.; Bluetooth devices may include audio equipment, lighting equipment, smart fans, smart air conditioners, air purifiers, humidifiers, smart refrigerators, sweeping robots, etc. The home host can perform different status processing on the Bluetooth device according to different control instructions, so as to achieve the optimal status display solution, while ensuring the cleanliness of the Bluetooth network environment.

[0111] A control instruction recognition module 402, used to determine the target operating state of the target Bluetooth device indicated by the control instruction;

[0112] A query result determination module 403, configured to determine a query result of the status query operation according to a target operating state of the target Bluetooth device;

[0113] The query result output module 404 is used to output the query result.

[0114] In the embodiment of the present invention, the query result determination module 403 includes:

[0115] A historical query result acquisition submodule is used to acquire the historical query results of the target Bluetooth device;

[0116] A difference information determination submodule, used for comparing the target operating state of the target Bluetooth device with the historical query result of the target Bluetooth device to obtain the difference information of the target Bluetooth device;

[0117] The query result determination submodule is used to use the difference information of the target Bluetooth device as the query result of the status query operation.

[0118] Among them, the home host can obtain the historical query results of the target Bluetooth device, and compare the target operating status of the target Bluetooth device with the historical query results of the target Bluetooth device to obtain the difference information of the target Bluetooth device, and then use the difference information of the target Bluetooth device as the query result of the status query operation.

[0119] Exemplarily, when the state of the target Bluetooth device may include multiple items, for example, the state of a smart air conditioner may include a switch state, an outlet air temperature, an outlet air mode, etc., assuming that the historical query result of the smart air conditioner is: switch on, outlet air temperature 26 degrees Celsius, outlet air mode cooling, and the target operating state of the smart air conditioner is: switch on, outlet air temperature 22 degrees Celsius, outlet air mode cooling, then the target operating state of the smart air conditioner is compared with the historical query result of the smart air conditioner, and the difference information of the smart air conditioner can be obtained: the outlet air temperature is 22 degrees Celsius. At this time, the home host can output the difference information of the smart air conditioner as the query result of the state query operation.

[0120] In the embodiment of the present invention, the control instruction of the Bluetooth device includes a scene control instruction, and the control instruction identification module 402 includes:

[0121] The first control instruction recognition submodule is used to obtain the preset state of the target Bluetooth device from the database of the home host according to the scene control instruction of the target Bluetooth device, and use the preset state of the target Bluetooth device as the target operating state of the target Bluetooth device.

[0122] In the embodiment of the present invention, the control instruction of the Bluetooth device includes a zone control instruction, and the control instruction identification module 402 includes:

[0123] The second control instruction identification submodule is used to determine the target Bluetooth device in the target area and the instruction control state of the target Bluetooth device according to the area control instruction of the target Bluetooth device, and use the instruction control state of the target Bluetooth device as the target operating state of the target Bluetooth device.

[0124] Among them, when the control instruction of the Bluetooth device is a scene control instruction, the home host can first determine the target Bluetooth device targeted by the scene control instruction, and then obtain the preset state of the target Bluetooth device corresponding to the scene control instruction from the database of the home host according to the scene control instruction of the target Bluetooth device, and use the preset state of the target Bluetooth device as the target operating state of the target Bluetooth device. When the control instruction of the Bluetooth device is a zone control instruction, the home host can first determine the target Bluetooth device in the target area and the instruction control state of the target Bluetooth device according to the zone control instruction of the target Bluetooth device, and use the instruction control state of the target Bluetooth device as the target operating state of the target Bluetooth device.

[0125] The scene control instruction is to first set the scene of the target Bluetooth device. When setting the scene, the scene status of the target Bluetooth device to be executed is stored in the database of the home host. When the target Bluetooth device is about to execute the scene, the home host can report the status to be executed as the final status of the target Bluetooth device. The area control instruction does not require scene setting. The user can directly control the target Bluetooth device in a specific area through voice. For example, all the switches of the lighting devices in a room are turned on. Then the home host can find all the lighting devices in the room and report the status of all the switches of the lighting devices in the room being turned on.

[0126] In an embodiment of the present invention, the device further includes:

[0127] A reporting status acquisition module, used for acquiring the reporting status of the target Bluetooth device when the number of the target Bluetooth device is 1;

[0128] The target running state determining module is used to use the reporting state of the target Bluetooth device as the target running state of the target Bluetooth device.

[0129] In the embodiment of the present invention, the reporting status acquisition module includes:

[0130] A reporting status acquisition submodule, used to acquire the reporting status of the target Bluetooth device according to a preset period;

[0131] The reporting status query submodule is used to query the current status of the target Bluetooth device when the waiting time is greater than the preset period, and use the current status of the target Bluetooth device as the target operating status of the target Bluetooth device.

[0132] The home host can also obtain the reporting status of the target Bluetooth device when the number of the target Bluetooth device is 1, that is, when the control instruction input by the user is a separate control instruction, and use the reporting status of the target Bluetooth device as the target operating status of the target Bluetooth device. Specifically, the home host can wait for the target Bluetooth device to automatically report the device status according to a preset period, and when the waiting time is greater than the preset period, it can actively query the current status of the target Bluetooth device, and use the current status of the target Bluetooth device as the target operating status of the target Bluetooth device.

[0133] In an embodiment of the present invention, the device further includes:

[0134] A real operation status determination module, used to query the real operation status of the Bluetooth device in a preset time period;

[0135] The status query result determination module is used to use the real operating state as the status query result after detecting a status query operation of the user on the Bluetooth device if the real operating state is a fault state.

[0136] The home host of the embodiment of the present invention can obtain the control instruction input by the user after detecting the user's status query operation for the Bluetooth device; determine the target operating state of the target Bluetooth device indicated by the control instruction, so as to obtain the status of the Bluetooth device when performing the task; determine the query result of the status query operation according to the target operating state of the target Bluetooth device; and output the query result. The embodiment of the present invention uses the status of the Bluetooth device when performing the task as the status of the Bluetooth device when there are many Bluetooth devices, and does not need to query the device, thereby avoiding the query of the status of a large number of devices affecting the entire Bluetooth network environment, and realizing the query of the status of the Bluetooth device without affecting the success rate of the Bluetooth device in performing the task.

[0137] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0138] An embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for querying the status of a Bluetooth device when executing the computer program.

[0139] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for querying the status of a Bluetooth device are implemented.

[0140] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0141] Those skilled in the art will appreciate that the embodiments of the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more machine-readable media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0142] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0145] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0146] Finally, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a list of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements that are inherent to such process, method, article, or terminal device.

[0147] The above is a detailed introduction to a Bluetooth device status query method and a Bluetooth device status query device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for querying the status of a Bluetooth device, characterized in that: Applied to a home host, the method comprises: When a user's status query operation on a Bluetooth device is detected, a control instruction input by the user is obtained; Determine a target operating state of a target Bluetooth device indicated by the control instruction; Determining a query result of the status query operation according to the target operating state of the target Bluetooth device; The query result is output.

2. The method according to claim 1, characterized in that: The step of determining a query result of the status query operation according to the target operating state of the target Bluetooth device includes: Obtain historical query results of the target Bluetooth device; Comparing the target running state of the target Bluetooth device with the historical query result of the target Bluetooth device to obtain difference information of the target Bluetooth device; The difference information of the target Bluetooth device is used as the query result of the status query operation.

3. The method according to claim 1, characterized in that The control instruction of the Bluetooth device includes a scene control instruction, and determining the target operating state of the target Bluetooth device indicated by the control instruction includes: According to the scene control instruction of the target Bluetooth device, the preset state of the target Bluetooth device is obtained from the database of the home host, and the preset state of the target Bluetooth device is used as the target operating state of the target Bluetooth device.

4. The method according to claim 1, characterized in that The control instruction of the Bluetooth device includes a zone control instruction, and determining the target operating state of the target Bluetooth device indicated by the control instruction includes: According to the area control instruction of the target Bluetooth device, the target Bluetooth device in the target area and the instruction control state of the target Bluetooth device are determined, and the instruction control state of the target Bluetooth device is used as the target operating state of the target Bluetooth device.

5. The method according to claim 1, characterized in that: The method further comprises: When the number of the target Bluetooth device is 1, obtaining the reporting status of the target Bluetooth device; The reported state of the target Bluetooth device is used as the target operating state of the target Bluetooth device.

6. The method according to claim 5, characterized in that The obtaining the reporting status of the target Bluetooth device includes: Acquire the reporting status of the target Bluetooth device according to a preset period; When the waiting time is greater than the preset period, the current state of the target Bluetooth device is queried, and the current state of the target Bluetooth device is used as the target operating state of the target Bluetooth device.

7. The method according to claim 1, characterized in that The method further comprises: Query the actual operating status of the Bluetooth device during a preset time period; If the actual running state is a fault state, after detecting a status query operation of the user on the Bluetooth device, the actual running state is used as a status query result.

8. A Bluetooth device status query device, characterized in that: Applied to a home host, the device comprises: A control instruction acquisition module, used to acquire the control instruction input by the user after detecting the user's state query operation on the Bluetooth device; A control instruction recognition module, used to determine the target operating state of the target Bluetooth device indicated by the control instruction; A query result determination module, used to determine the query result of the status query operation according to the target operating state of the target Bluetooth device; The query result output module is used to output the query result.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of a Bluetooth device status query method as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a Bluetooth device status query method as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • System and method for controlling household internet of things, device and system comprising system for controlling household internet of things

    CN103001837A

  • Hardware state information display method and device, storage medium and mobile terminal

    CN111258829A

  • Air conditioner and method for detecting indoor unit

    CN112283872A

  • Scene creation method and device, electronic equipment and storage medium

    CN115327932A

  • Equipment state query method and device, electronic equipment and storage medium

    CN117675903A