Bluetooth one-to-many communication method, device and storage medium
By using the sub-host determination algorithm and ID information allocation in the Bluetooth one-to-many communication method, the problems of signal instability and slow connection in the prior art are solved, and efficient communication between the host and multiple slaves are achieved.
Patent Information
- Application Number
- CN202111086867.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-09-16
AI Technical Summary
The existing Bluetooth one-to-many communication methods have problems such as unstable signal, slow connection process, and inability to realize communication interaction between the host and multiple slaves.
Through the Bluetooth one-to-many communication method executed by the host, a preset secondary host determination algorithm is obtained, the slave is filtered, ID information is generated, and identity information and token information are output according to the control instructions to control the secondary host and the first slave The machine and the second slave output broadcast data.
It realizes Bluetooth communication between the host and multiple slaves, improves communication efficiency and quality, simplifies the matching authentication process between the host and slave, and reduces the occupation of host resources.
Smart Images

Figure CN113905361B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a Bluetooth one-to-many communication method, device and storage medium. Background Art
[0002] The current Bluetooth one-to-many communication method is often limited by the connection method between each device, and often cannot realize the communication interaction between the host and multiple slaves. At the same time, there are often problems such as unstable signals and slow connection process during the communication process. Therefore, how to provide a Bluetooth one-to-many communication method to improve communication efficiency and communication quality, and realize the communication interaction between the host and multiple slaves has become an urgent problem to be solved. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a Bluetooth one-to-many communication method, which can realize Bluetooth communication between a host and multiple slaves while ensuring communication efficiency and communication quality.
[0004] The present invention also provides a Bluetooth one-to-many communication device having the above Bluetooth one-to-many communication method.
[0005] The present invention also provides a computer-readable storage medium having the above-mentioned Bluetooth one-to-many communication method.
[0006] The Bluetooth one-to-many communication method according to the first aspect of the present invention is executed by a host and includes:
[0007] Obtaining a preset secondary host determination algorithm;
[0008] Screening the slaves of the master according to the secondary master determination algorithm to obtain at least one secondary master;
[0009] Acquire registration information of all slaves of the host, wherein the slaves include a secondary host, a first slave, and a second slave;
[0010] Generate ID information according to the time sequence of the acquired registration information;
[0011] Allocating the ID information to the secondary host, the first slave and the second slave according to a preset allocation order;
[0012] According to the acquired control instruction, output the identity information and the token information to the sub-host, the first slave and the second slave, so as to control at least one of the sub-host, the first slave and the second slave to output the broadcast data;
[0013] The broadcast data outputted by at least one of the sub-master and the first slave is acquired.
[0014] According to the Bluetooth one-to-many communication method of the embodiment of the present invention, there are at least the following beneficial effects: the method uses the host to screen all slaves that have communication interactions with the host according to the obtained sub-host judgment algorithm, and obtains at least one sub-host according to the screening result. The host can also receive the registration information of all slaves, generate ID information in chronological order, and distribute the ID information to all slaves. The host also outputs identity information and token information by receiving control instructions, and can control at least one of the sub-host, the first slave and the second slave that matches the identity information to obtain token information, so that at least one of the corresponding sub-host, the first slave and the second slave outputs broadcast data, and obtains the broadcast data output by at least one of the sub-host and the first slave. This method divides all slaves into sub-hosts, the first slave and the second slave, and can add ID information to all slaves when the host communicates with all slaves, and controls the corresponding sub-host, the first slave and the second slave to obtain token information to output broadcast data according to the identity information matching result, simplifies the one-to-one matching authentication process between the host and all slaves, realizes Bluetooth communication between the host and multiple slaves, and effectively improves the communication efficiency of the host. In addition, during the entire process, the host only needs to receive the broadcast data output by the first slave and the secondary host, which simplifies the process of obtaining broadcast data, can reduce the occupancy of host resources, and effectively improves the communication quality.
[0015] According to some embodiments of the present invention, generating ID information according to the time sequence of acquiring the registration information includes:
[0016] Sorting the first slave and the second slave according to the time sequence to obtain a slave sequence;
[0017] The first slave and the second slave are marked according to the slave sequence to obtain ID information of the first slave and the second slave.
[0018] According to some embodiments of the present invention, the outputting of identity information and token information to the sub-host, the first slave, and the second slave according to the acquired control instruction to control at least one of the sub-host, the first slave, and the second slave to output broadcast data includes:
[0019] Get the preset broadcast interval time;
[0020] The identity information and the token information are output in sequence according to the broadcast interval time.
[0021] According to some embodiments of the present invention, the Bluetooth one-to-many communication method further includes:
[0022] Setting the transmission channel corresponding to the secondary host;
[0023] The host obtains the broadcast data sent by the sub-host according to the transmission channel corresponding to the sub-host.
[0024] The Bluetooth one-to-many communication method according to the second aspect of the present invention is executed by the secondary host and includes:
[0025] Acquire the broadcast data output by the second slave according to the identity information and token information output by the host;
[0026] The broadcast data is fed back to the host.
[0027] The Bluetooth one-to-many communication method according to the embodiment of the present invention has at least the following beneficial effects: the method can obtain the broadcast data output by the second slave according to the identity information and token information output by the host through the sub-host, and send the broadcast data to the host, and can obtain the broadcast data of the second slave with which the sub-host has a communication connection, and output the broadcast data of the second slave to the host, thereby solving the problems of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slaves, and effectively improving the communication quality and communication efficiency.
[0028] According to the third aspect of the present invention, the Bluetooth one-to-many communication method is executed by the second slave, including:
[0029] Output registration information to the host according to preset instructions;
[0030] Obtaining ID information generated by the host according to the registration information, and adjusting the second slave to a dormant state;
[0031] Obtaining identity information and token information output by the host;
[0032] According to the ID information, the identity information and the token information, the dormant state is maintained or the broadcast data is output to the sub-host.
[0033] According to the Bluetooth one-to-many communication method of the embodiment of the present invention, at least the following beneficial effects are achieved: the second slave of the method can output registration information in an undirected broadcast mode according to the preset instructions built into the local host, and obtain the ID information output by the host to adjust to the dormant state; the method can also judge according to the identity information and token information output by the host obtained, and control the second slave to continue to be in a dormant state or output broadcast data to the secondary host. Through this method, the second slave can obtain the ID information output by the host according to the preset order, and store the ID information. At the same time, the current state can be adjusted to a dormant state to reduce power consumption; the second slave can also obtain the identity information and token information, and maintain the dormant state or output broadcast data to the secondary host according to the ID information, identity information and token information. Through this method, the second slave can output broadcast data to the secondary host with which it realizes communication interaction according to the wake-up sequence preset by the system, effectively reducing the problem of unstable communication and high communication delay caused by the resource load generated by the direct communication interaction between the second slave and the host. In addition, the second host can automatically adjust the working state of the second slave according to the ID information, identity information and token information to reduce power consumption, and can also realize the communication interaction between the second slave and the host.
[0034] According to some embodiments of the present invention, maintaining a dormant state or outputting broadcast data to a secondary host according to the ID information, the identity information and the token information includes:
[0035] If the identity information is consistent with the ID information of the second slave, adjusting the current state from the sleep state to the working state;
[0036] The broadcast data is output to the secondary host according to the token information, and the current state is adjusted to a dormant state.
[0037] According to some embodiments of the present invention, maintaining a dormant state or outputting broadcast data to a secondary host according to the ID information, the identity information and the token information includes:
[0038] If the identity information is inconsistent with the ID information of the second slave, the dormant state is maintained.
[0039] A Bluetooth one-to-many communication device according to a fourth aspect of the present invention includes:
[0040] at least one processor, and
[0041] a memory communicatively connected to the at least one processor; wherein,
[0042] The memory stores instructions, which are executed by the at least one processor so that when the processor executes the instructions, it implements the Bluetooth one-to-many communication method as described in the embodiment of the first aspect of the present invention; or the Bluetooth one-to-many communication method as described in the embodiment of the second aspect of the present invention; or the Bluetooth one-to-many communication method as described in the embodiment of the third aspect of the present invention.
[0043] According to the Bluetooth one-to-many communication device of the embodiment of the present invention, at least the following beneficial effects are achieved: through the Bluetooth one-to-many communication device provided by the present invention, the Bluetooth one-to-many communication method of the embodiment of the first aspect of the present invention can be realized; or the Bluetooth one-to-many communication method of the embodiment of the second aspect of the present invention; or the Bluetooth one-to-many communication method of the embodiment of the third aspect of the present invention. Through this method, the host can divide all slaves into a sub-host, a first slave, and a second slave, and add ID information to all slaves when the host communicates with all slaves, and control the corresponding sub-host, the first slave, and the second slave to obtain token information to output broadcast data according to the identity information matching result, simplifying the process of one-to-one matching authentication between the host and all slaves, realizing Bluetooth communication between the host and multiple slaves, and effectively improving the communication efficiency of the host. In addition, in the whole process, the host only needs to receive the broadcast data output by the first slave and the sub-host, which simplifies the process of obtaining broadcast data, can reduce the occupation of host resources, and effectively improves the communication quality. Through this device, the sub-host can obtain the broadcast data of the second slave machine with which it has a communication connection, and output the broadcast data of the second slave machine to the host, thereby reducing the defects of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slave machines, and effectively improving the quality of communication interaction.
[0044] In addition, through this method, the sub-host can obtain the broadcast data output by the second slave based on the identity information and token information output by the host, and send the broadcast data to the host. The sub-host can obtain the broadcast data of the second slave with which it has a communication connection through the sub-host, and output the broadcast data of the second slave to the host, thereby solving the problems of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slaves, and effectively improving the communication quality and efficiency.
[0045] In addition, through this method, the second slave can output broadcast data to the secondary host with which it communicates according to the wake-up sequence preset by the system, effectively reducing the problems of unstable communication and high communication delay caused by the resource load generated by the direct communication interaction between the second slave and the host. In addition, the second host can automatically adjust the working state of the second slave according to the ID information, identity information and token information to reduce power consumption, while also realizing communication interaction between the second slave and the host.
[0046] According to the computer-readable storage medium of the fifth aspect embodiment of the present invention, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the Bluetooth one-to-many communication method as described in the first aspect embodiment of the present invention; or the Bluetooth one-to-many communication method as described in the second aspect embodiment of the present invention; or the Bluetooth one-to-many communication method as described in the third aspect embodiment of the present invention.
[0047] According to the computer-readable storage medium of the embodiment of the present invention, at least the following beneficial effects are achieved: by executing the Bluetooth one-to-many communication method in the computer-readable storage medium of the embodiment of the present invention, the Bluetooth one-to-many communication method of the embodiment of the first aspect of the present invention can be realized; or the Bluetooth one-to-many communication method of the embodiment of the second aspect of the present invention; or the Bluetooth one-to-many communication method of the embodiment of the third aspect of the present invention. Through this method, the host can divide all slaves into a sub-host, a first slave, and a second slave, and add ID information to all slaves when the host communicates with all slaves, and control the corresponding sub-host, the first slave, and the second slave to obtain token information to output broadcast data according to the identity information matching result, simplifying the process of one-to-one matching authentication between the host and all slaves, realizing Bluetooth communication between the host and multiple slaves, and effectively improving the communication efficiency of the host. In addition, in the whole process, the host only needs to receive the broadcast data output by the first slave and the sub-host, which simplifies the process of obtaining broadcast data, can reduce the occupation of host resources, and effectively improves the communication quality. Through this device, the sub-host can realize that the sub-host obtains the broadcast data of the second slave with which it has a communication connection, and outputs the broadcast data of the second slave to the host, thereby reducing the defects of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slaves, and effectively improving the quality of communication interaction. In addition, through this method, the sub-host can obtain the broadcast data output by the second slave according to the identity information and token information output by the host, and send the broadcast data to the host, and can obtain the broadcast data of the second slave with which it has a communication connection through the sub-host, and output the broadcast data of the second slave to the host, thereby solving the problem of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slaves, and effectively improving the communication quality and communication efficiency. In addition, through this method, the second slave can output the broadcast data to the sub-host with which it realizes communication interaction according to the wake-up sequence preset by the system, effectively reducing the problem of unstable communication and high communication delay caused by the resource load generated by the direct communication interaction between the second slave and the host. In addition, the second host can automatically adjust the working state of the second slave according to the ID information, identity information and token information to reduce power consumption, and can also realize the communication interaction between the second slave and the host.
[0048] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The present invention will be further described below with reference to the accompanying drawings and embodiments, wherein:
[0050] Figure 1 A flowchart of a Bluetooth one-to-many communication method provided by an embodiment of the present invention.
[0051] Figure 2 for Figure 1 Specific flow chart of step S140 in FIG.
[0052] Figure 3 for Figure 1 Specific flow chart of step S160 in FIG.
[0053] Figure 4 Another flow chart of the Bluetooth one-to-many communication method provided by an embodiment of the present invention.
[0054] Figure 5 Another flow chart of the Bluetooth one-to-many communication method provided by an embodiment of the present invention.
[0055] Figure 6 Another flow chart of the Bluetooth one-to-many communication method provided by an embodiment of the present invention.
[0056] Figure 7 for Figure 6 Specific flow chart of step S340 in FIG. DETAILED DESCRIPTION
[0057] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0058] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0059] In the description of the present invention, "several" means more than one, "many" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0060] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0061] In the description of the present invention, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0062] First, refer to Figure 1 The present invention provides a Bluetooth one-to-many communication method, which is executed by a host and includes:
[0063] S110, obtaining a preset secondary host determination algorithm;
[0064] S120, screening the slaves of the master according to the secondary master determination algorithm to obtain at least one secondary master;
[0065] S130, obtaining registration information of all slaves of the host, wherein the slaves include the secondary host, the first slave and the second slave;
[0066] S140, generating ID information according to the time sequence of the acquired registration information;
[0067] S150, allocating ID information to the secondary host, the first slave, and the second slave according to a preset allocation order;
[0068] S160, outputting the identity information and the token information to the sub-host, the first slave, and the second slave according to the acquired control instruction, so as to control at least one of the sub-host, the first slave, and the second slave to output broadcast data;
[0069] S170, acquiring broadcast data outputted by at least one of the secondary host and the first slave.
[0070] By executing the Bluetooth one-to-many communication method provided by the present invention, the host can screen all slaves that have communication interaction with the host according to the obtained sub-host judgment algorithm, and obtain at least one sub-host according to the screening result. The host can also generate ID information and distribute the ID information to all slaves in chronological order by receiving the registration information of all slaves. The host outputs identity information and token information by receiving a control instruction to control at least one of the sub-host, the first slave and the second slave that matches the identity information to obtain token information, so that at least one of the corresponding sub-host, the first slave and the second slave outputs broadcast data, and obtains the broadcast data output by at least one of the sub-host and the first slave. This method divides all slaves into a sub-host, a first slave and a second slave, so that when the host communicates with all slaves, by adding ID information to all slaves, and controlling the corresponding sub-host, the first slave and the second slave to obtain token information to output broadcast data according to the identity information matching result, avoids the process of matching authentication with all slaves one by one, and effectively improves the communication efficiency of the host when facing a large number of slaves. During the whole process, the host only receives the broadcast data output by the first slave and the secondary host, which reduces the process of obtaining broadcast data, reduces the occupation of host resources, and effectively improves the communication quality.
[0071] In some specific embodiments, the preset allocation order may be the time sequence of receiving the registration information output by all slaves, or may be the order specified by the system for outputting broadcast data to different slaves according to user requirements, but is not limited thereto.
[0072] In some other embodiments, the host only receives the broadcast data output by the sub-host and the first slave, and the broadcast data output by the second slave is collected by the sub-host directly communicating with it and then uniformly output to the host. Through this method, the host can receive the broadcast information of all slaves only by communicating with the sub-host and the first slave, thereby improving the communication efficiency of the host, reducing the resource occupation of the host, and improving the communication quality.
[0073] In some other embodiments, the identity information may be a data packet including one or a group of ID information, which is output to all slaves through directional broadcasting to control the slaves to match the identity information with the corresponding slave ID information to enable that specific slave to output broadcast data.
[0074] Reference Figure 2 In some embodiments, step S140 includes:
[0075] S141, sorting the first slave and the second slave according to the time sequence to obtain a slave sequence;
[0076] S142, marking the first slave and the second slave according to the slave sequence to obtain ID information of the first slave and the second slave.
[0077] In the present Bluetooth communication process, the host sorts the first slave and the second slave connected to the host according to the time sequence of the registration information obtained, and can obtain the slave sequence. The host can also mark the first slave and the second slave according to the slave sequence. In this way, the host can sort the slaves corresponding to the obtained registration information to achieve the management of each slave. Specifically, the host can perform a directional wake-up of the slave corresponding to the ID information according to different slave ID information, avoiding the occupation of a large amount of system resources in a short period of time due to simultaneous communication and interaction with multiple slaves, and reducing the risk of decreased communication quality and unstable communication connection. It can be understood that the preset allocation order can be the time sequence of the registration information output by the slave obtained by the host, or it can be the allocation order preset by the user according to the needs. The host allocates the ID information to each slave in turn according to the preset allocation order. The ID information can be a number arranged in ascending order of natural numbers, or it can be other symbols that can include sequential logic, but is not limited to this.
[0078] Reference Figure 3 In some embodiments, step S160 includes:
[0079] S161, obtaining a preset broadcast interval time;
[0080] S162, output the identity information and token information in sequence according to the broadcast interval time.
[0081] In the Bluetooth communication process, the host obtains a preset broadcast interval time, and according to the broadcast time interval, sends identity information and token information to at least one of the sub-host, the first slave and the second slave in sequence. By setting the broadcast time interval, the host outputs the corresponding identity information according to the ID information awakened as needed, so that within the preset broadcast time interval, the slave corresponding to the ID information can receive the identity information, thereby achieving the matching of the ID information and the identity information, and then, the slave can receive the token information and output the broadcast data directly or indirectly to the host. Through this method, the host only needs to communicate with the sub-host, the first slave or the second slave whose identity information and ID information can match at the same time to obtain the broadcast data, effectively avoiding the host communicating with other sub-hosts, the first slave and the second slave while communicating with the sub-host, the first slave or the second slave whose identity information and ID information can match, so that a large amount of system resources are occupied in a short time, resulting in problems such as reduced communication quality or unstable communication connection. This method can improve the stability of the Bluetooth one-to-many communication method.
[0082] In some specific embodiments, the broadcast time interval depends on the broadcast interval and the broadcast delay. The broadcast time interval varies for different system settings, but it is understandable that the system preset broadcast time interval should meet the minimum time required for the host to communicate with the corresponding sub-host, the first slave and the second slave.
[0083] Reference Figure 4 In some embodiments, the Bluetooth one-to-many communication method further includes:
[0084] S170, setting a transmission channel corresponding to the secondary host;
[0085] S180, the host obtains the broadcast data sent by the sub-host according to the transmission channel corresponding to the sub-host.
[0086] During the Bluetooth communication process, the host can set and allocate the transmission channels of multiple slaves obtained through the screening and processing of the sub-host determination algorithm, and obtain the broadcast data output by different sub-hosts according to the corresponding transmission channels, which effectively improves the efficiency of the host in obtaining broadcast data. It is understandable that the communication connections made by the host through different transmission channels should be independent, and can realize the communication interaction between the host and multiple sub-hosts at the same time without occupying too many communication resources, and will not cause interference due to different broadcast data obtained by each host, thereby improving communication efficiency.
[0087] Second, refer to Figure 5 The present invention provides a Bluetooth one-to-many communication method, which is executed by a secondary host and includes:
[0088] S210, obtaining broadcast data output by the second slave according to the identity information and token information output by the master;
[0089] S220, feeding back the broadcast data to the host.
[0090] The method can obtain the broadcast data output by the second slave according to the identity information and token information output by the host through the sub-host, and send the broadcast data to the host. The method can obtain the broadcast data of the second slave with which the sub-host has a communication connection, and output the broadcast data of the second slave to the host, thereby solving the problems of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slaves, and effectively improving the communication quality and communication efficiency.
[0091] In some specific embodiments, each sub-host can simultaneously output the broadcast data output by the second slave with which it has information interaction according to the transmission channel set by the host. It can be understood that for multiple sub-hosts, each sub-host only accepts the broadcast data output by the second slave with which it has direct communication interaction. For the second slave with which it does not have direct communication interaction, the sub-host will not obtain its broadcast data. This method can avoid repeated acquisition and repeated submission of data and reduce the waste of system resources.
[0092] In some other embodiments, the sub-host may execute the one-to-many Bluetooth communication method as in the embodiment of the first aspect of the present invention to divide the second slave machine that has communication interaction with the sub-host into a subordinate sub-host and a subordinate second host. The sub-host may further improve the efficiency of acquiring the broadcast data output by the second slave machine corresponding to the sub-host by executing the one-to-many Bluetooth communication method as in the embodiment of the first aspect of the present invention.
[0093] Thirdly, refer to Figure 6 The present invention provides a Bluetooth one-to-many communication method, which is executed by a second slave, comprising:
[0094] S310, outputting registration information to the host according to the preset instruction;
[0095] S320, obtaining ID information generated by the host according to the registration information, and adjusting the second slave to a dormant state;
[0096] S330, obtaining identity information and token information output by the host;
[0097] S340, maintaining a dormant state or outputting broadcast data to the secondary host according to the ID information, identity information and token information.
[0098] The second slave of the method can output registration information in an undirected broadcast mode according to the preset instructions built locally, and obtain the ID information output by the host to adjust to a dormant state; the method can also judge according to the identity information and token information output by the host obtained, and control the second slave to continue to be in a dormant state or output broadcast data to the secondary host. Through this method, the second slave can obtain the ID information output by the host according to the preset order, and store the ID information. At the same time, the current state can be adjusted to a dormant state to reduce power consumption; the second slave can also obtain the identity information and token information, and maintain the dormant state or output broadcast data to the secondary host according to the ID information, identity information and token information. Through this method, the second slave can output broadcast data to the secondary host with which it realizes communication interaction according to the wake-up sequence preset by the system, effectively reducing the problem of unstable communication and high communication delay caused by the resource load generated by the direct communication interaction between the second slave and the host. In addition, the second host can automatically adjust the working state of the second slave according to the ID information, identity information and token information to reduce power consumption, and can also realize the communication interaction between the second slave and the host.
[0099] In some other embodiments, the first slave can directly communicate with the host. The first slave can also output registration information to the host through non-directional broadcast according to preset instructions, and adjust the first slave to a dormant state according to the ID information generated by the host through directional broadcast and output according to the registration information; the first slave can obtain the identity information and token information output by the host through directional broadcast, and match the identity information and ID information to control the first slave to be in a dormant state or output broadcast data to the host. Among them, the first slave matches according to the identity information and ID information. When the identity information and ID information are consistent, the current state is adjusted to the working state, and the broadcast data is output to the host. At the same time, the current state is adjusted to the dormant state; when the identity information and ID information are inconsistent, the first slave is kept in a dormant state. Through this method, the first slave can complete communication interaction with the host while reducing power consumption.
[0100] Reference Figure 7 In some embodiments, S340 includes:
[0101] S341, if the identity information is consistent with the ID information of the second slave, the current state is adjusted from the sleep state to the working state
[0102] S342, output broadcast data to the secondary host according to the token information, and adjust the current state to the sleep state
[0103] During the Bluetooth communication process, the second slave will match the ID information output by the host and stored by the second slave according to the acquired identity information. When the identity information is consistent with the ID information of the second slave, the current state will be adjusted from the sleep state to the working state, and the token information will be obtained to obtain the authority to output the broadcast data. After obtaining the authority, the broadcast data will be output to the sub-host through directional broadcasting. After the broadcast data output is completed, the second slave will adjust the working state to the sleep state again to reduce the standby power consumption. Through this method, the second host can adjust the current state to the working state by matching the identity information in the low-power sleep state, receive the token information output by the host in the working state, authorize the output of the broadcast data through the token information, and adjust the working state back to the sleep state after the output of the broadcast data. This method enables multiple second slaves to output broadcast data to the host through the sub-host in turn according to the rotation of the token, reducing the resource load of the host and improving the stability of the communication process.
[0104] In some embodiments, step S340 includes:
[0105] If the identity information is inconsistent with the ID information of the second slave, the dormant state is maintained.
[0106] During the Bluetooth communication process, the second slave can match the acquired identity information with the ID information output by the host to the second slave, and remain in a dormant state when the matching result shows that the identity information is inconsistent with the ID information of the second slave. Through this method, the second slave can control its own working state according to the identity information, and when the identity information is inconsistent with the ID information, it controls itself to be in a dormant state, which reduces the power consumption of the second slave, realizes the communication interaction between the second slave and the host in different time periods and batches, can effectively reduce the load of the host, and improve the stability of communication.
[0107] In a fourth aspect, the present invention provides a Bluetooth one-to-many communication device, comprising:
[0108] at least one processor, and
[0109] a memory communicatively connected to at least one processor; wherein,
[0110] The memory stores instructions, which are executed by at least one processor, so that when the processor executes the instructions, a Bluetooth one-to-many communication method as in the first embodiment of the present invention is implemented; or a Bluetooth one-to-many communication method as in the second embodiment of the present invention is implemented; or a Bluetooth one-to-many communication method as in the third embodiment of the present invention is implemented.
[0111] The Bluetooth one-to-many communication device provided by the present invention includes at least one processor and a memory that realizes communication connection with the processor. The processor can realize the Bluetooth one-to-many communication method of the first embodiment of the present invention by executing the instructions in the memory; or the Bluetooth one-to-many communication method of the second embodiment of the present invention; or the Bluetooth one-to-many communication method of the third embodiment of the present invention. Through the Bluetooth one-to-many communication device provided by the present invention, the host can divide all slaves into a sub-host, a first slave, and a second slave, and add ID information to all slaves when the host communicates with all slaves, and control the corresponding sub-host, the first slave, and the second slave to obtain token information to output broadcast data according to the identity information matching result, simplifying the process of one-to-one matching authentication between the host and all slaves, realizing Bluetooth communication between the host and multiple slaves, and effectively improving the communication efficiency of the host. In addition, in the whole process, the host only needs to receive the broadcast data output by the first slave and the sub-host, which simplifies the process of obtaining broadcast data, can reduce the occupation of host resources, and effectively improves the communication quality. Through this device, the sub-host can obtain the broadcast data of the second slave machine with which it has a communication connection, and output the broadcast data of the second slave machine to the host, thereby reducing the defects of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slave machines, and effectively improving the quality of communication interaction.
[0112] In addition, the sub-host can obtain the broadcast data output by the second slave based on the identity information and token information output by the host, and send the broadcast data to the host. It can obtain the broadcast data of the second slave with which it has a communication connection through the sub-host, and output the broadcast data of the second slave to the host, thereby solving the problems of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slaves, and effectively improving the communication quality and efficiency.
[0113] In addition, the second slave can output broadcast data to the secondary host with which it communicates according to the wake-up sequence preset by the system, effectively reducing the resource load caused by the direct communication between the second slave and the host, resulting in unstable communication and high communication delay. In addition, the second host can automatically adjust the working state of the second slave according to the ID information, identity information and token information to reduce power consumption, while also realizing communication interaction between the second slave and the host.
[0114] In a fifth aspect, the present invention provides a computer-readable storage medium, which stores computer-executable instructions. By executing the instructions, a Bluetooth one-to-many communication method as in the first embodiment of the present invention can be implemented; or a Bluetooth one-to-many communication method as in the second embodiment of the present invention; or a Bluetooth one-to-many communication method as in the third embodiment of the present invention. By executing the Bluetooth one-to-many communication method in the computer-readable storage medium of the embodiment of the present invention, the host can divide all slaves into a sub-host, a first slave, and a second slave, and add ID information to all slaves when the host communicates with all slaves, and control the corresponding sub-host, the first slave, and the second slave to obtain token information to output broadcast data according to the identity information matching result, simplifying the process of one-to-one matching authentication between the host and all slaves, realizing Bluetooth communication between the host and multiple slaves, and effectively improving the communication efficiency of the host. In addition, in the whole process, the host only needs to receive the broadcast data output by the first slave and the sub-host, which simplifies the process of obtaining broadcast data, can reduce the occupation of host resources, and effectively improves the communication quality. Through this device, the sub-host can realize that the sub-host obtains the broadcast data of the second slave with which it has a communication connection, and outputs the broadcast data of the second slave to the host, thereby reducing the defects of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slaves, and effectively improving the quality of communication interaction. In addition, through this method, the sub-host can obtain the broadcast data output by the second slave according to the identity information and token information output by the host, and send the broadcast data to the host, and can obtain the broadcast data of the second slave with which it has a communication connection through the sub-host, and output the broadcast data of the second slave to the host, thereby solving the problem of low transmission efficiency and poor transmission quality caused by the communication interaction between the host and multiple second slaves, and effectively improving the communication quality and communication efficiency. In addition, through this method, the second slave can output the broadcast data to the sub-host with which it realizes communication interaction according to the wake-up sequence preset by the system, effectively reducing the problem of unstable communication and high communication delay caused by the resource load generated by the direct communication interaction between the second slave and the host. In addition, the second host can automatically adjust the working state of the second slave according to the ID information, identity information and token information to reduce power consumption, and can also realize the communication interaction between the second slave and the host.
[0115] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the purpose of the present invention. In addition, the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
Claims
1. A Bluetooth one-to-many communication method, executed by a host, characterized in that: include: Obtaining a preset secondary host determination algorithm; Screening the slaves of the master according to the secondary master determination algorithm to obtain at least one secondary master; Acquire registration information of all slaves of the host, wherein the slaves include a secondary host, a first slave, and a second slave; Generate ID information according to the time sequence of the acquired registration information; Allocating the ID information to the secondary host, the first slave and the second slave according to a preset allocation order; According to the acquired control instruction, a preset broadcast interval is acquired, and according to the preset broadcast interval, identity information and token information are sequentially output to the sub-host, the first slave and the second slave to control at least one of the sub-host, the first slave and the second slave to output broadcast data; wherein the identity information matches the ID information; Setting the transmission channel corresponding to the secondary host; Acquire the broadcast data sent by the sub-host according to the transmission channel corresponding to the sub-host; Acquire broadcast data output by at least one of the sub-host and the first slave; wherein the host only receives the broadcast data output by the sub-host and the first slave, and the sub-host is used to collect the broadcast data output by the second slave connected to it for communication, and output the broadcast data output by the second slave to the host.
2. The Bluetooth one-to-many communication method according to claim 1, characterized in that: Generating the ID information according to the time sequence of obtaining the registration information includes: Sorting the first slave and the second slave according to the time sequence to obtain a slave sequence; The first slave and the second slave are marked according to the slave sequence to obtain ID information of the first slave and the second slave.
3. A Bluetooth one-to-many communication method, executed by a secondary host, characterized in that: The secondary host is used to execute the Bluetooth one-to-many communication method according to any one of claims 1 to 2, the method comprising: Acquire broadcast data output by the second slave according to the identity information and token information output by the master; The broadcast data is fed back to the host according to a transmission channel set by the host.
4. A Bluetooth one-to-many communication method, executed by a second slave, characterized in that: include: According to the preset instructions, the registration information is output to the host, and the host is used to execute the Bluetooth one-to-many communication method according to any one of claims 1 to 2; Obtaining ID information generated by the host according to the registration information, and adjusting the second slave to a dormant state; Obtaining identity information and token information output by the host; According to the ID information, the identity information and the token information, a sleep state is maintained or broadcast data is output to the sub-host.
5. The Bluetooth one-to-many communication method according to claim 4, characterized in that: The method of maintaining a dormant state or outputting broadcast data to a secondary host according to the ID information, the identity information and the token information comprises: If the identity information is consistent with the ID information of the second slave, adjusting the current state from the sleep state to the working state; The broadcast data is output to the secondary host according to the token information, and the current state is adjusted to a dormant state.
6. The Bluetooth one-to-many communication method according to claim 4, characterized in that: The method of maintaining a dormant state or outputting broadcast data to a secondary host according to the ID information, the identity information and the token information comprises: If the identity information is inconsistent with the ID information of the second slave, the dormant state is maintained.
7. A Bluetooth one-to-many communication device, characterized in that: include: at least one processor, and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions, and the instructions are executed by the at least one processor so that when the processor executes the instructions, the Bluetooth one-to-many communication method as described in any one of claims 1 to 2 is implemented; or the Bluetooth one-to-many communication method as described in claim 3; or the Bluetooth one-to-many communication method as described in any one of claims 4 to 6.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the Bluetooth one-to-many communication method as described in any one of claims 1 to 2; or the Bluetooth one-to-many communication method as described in claim 3; or the Bluetooth one-to-many communication method as described in any one of claims 4 to 6.
Citation Information
Patent Citations
An intelligent sound system for transferring audio based on Bluetooth transmission
CN109743657A
Multi-stage cascade system control method and multi-stage cascade system
CN112084134A
Host-slave pairing method and system
CN112312361A