CN116033400A - Bluetooth one-to-many data transmission method and device, electronic equipment and storage medium - Google Patents

Bluetooth one-to-many data transmission method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116033400A
CN116033400A CN202211581837.0A CN202211581837A CN116033400A CN 116033400 A CN116033400 A CN 116033400A CN 202211581837 A CN202211581837 A CN 202211581837A CN 116033400 A CN116033400 A CN 116033400A
Authority
CN
China
Prior art keywords
bluetooth
slave
target
equipment
devices
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211581837.0A
Other languages
Chinese (zh)
Inventor
常纪刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Feasycom Technology Co ltd
Original Assignee
Shenzhen Feasycom Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Feasycom Technology Co ltd filed Critical Shenzhen Feasycom Technology Co ltd
Priority to CN202211581837.0A priority Critical patent/CN116033400A/en
Publication of CN116033400A publication Critical patent/CN116033400A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention relates to a Bluetooth one-to-many data transmission method, a device, an electronic device and a storage medium, wherein the method comprises the following steps: s1, acquiring available Bluetooth devices corresponding to a main Bluetooth device, and taking a plurality of available Bluetooth devices as target Bluetooth devices; s2, generating a connection list containing all target Bluetooth devices, and triggering the master Bluetooth device to sequentially establish connection with the target Bluetooth devices based on the connection list so as to acquire slave Bluetooth devices corresponding to the master Bluetooth device; s3, respectively acquiring the equipment attributes of the slave Bluetooth equipment to acquire executable jobs of all the slave Bluetooth equipment according to the equipment attributes of the slave Bluetooth equipment; s4, acquiring a job instruction generated by the master Bluetooth device, identifying a target job of the job instruction, and acquiring a corresponding slave Bluetooth device as a target job device based on the target job and executable jobs of all the slave Bluetooth devices so as to enable the target job device to respond to the job instruction. By implementing the invention, one master Bluetooth device can be quickly realized to simultaneously control a plurality of slave Bluetooth devices.

Description

Bluetooth one-to-many data transmission method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a bluetooth one-to-many data transmission method, apparatus, electronic device, and storage medium.
Background
With the gradual maturation of bluetooth technology, bluetooth is widely seen in our daily lives, and most common bluetooth is one-to-one communication, and more typical bluetooth is: the mobile phone or computer and other equipment are connected with the Bluetooth printer to realize the printing of express bill, take-out bill or picture data. The Bluetooth access control is connected with the mobile phone for unlocking, the Bluetooth earphone is connected with the mobile phone for listening to songs for making calls, the Bluetooth bracelet is connected with the mobile phone for listening to heart rate and the like. Based on a one-to-one connection mode, when a plurality of Bluetooth application scenes exist at the same time, the former Bluetooth connection must be disconnected, and then the required Bluetooth application scenes are connected. In some one-to-many bluetooth application scenarios, the instruction issuing is also required to be sent one by one to specific devices, and the one-to-many data transmission in the full sense is not realized.
Disclosure of Invention
The invention aims to provide a Bluetooth one-to-many data transmission method, a Bluetooth one-to-many data transmission device, electronic equipment and a storage medium.
The technical scheme adopted for solving the technical problems is as follows: a Bluetooth one-to-many data transmission method is constructed, which comprises the following steps:
s1, acquiring available Bluetooth devices corresponding to a main Bluetooth device, so as to acquire a plurality of available Bluetooth devices as target Bluetooth devices;
s2, generating a connection list containing all the target Bluetooth devices, and triggering the master Bluetooth device to sequentially establish connection with the target Bluetooth devices based on the connection list so as to acquire slave Bluetooth devices corresponding to the master Bluetooth device;
s3, respectively acquiring the equipment attributes of the slave Bluetooth equipment to acquire executable jobs of all the slave Bluetooth equipment according to the equipment attributes of the slave Bluetooth equipment;
s4, acquiring a job instruction generated by the master Bluetooth device, identifying a target job of the job instruction, and acquiring a corresponding slave Bluetooth device as a target job device based on the target job and executable jobs of all the slave Bluetooth devices so as to enable the target job device to respond to the job instruction.
Preferably, in the bluetooth one-to-many data transmission method according to the present invention, in the step S1, the available bluetooth device corresponding to the master bluetooth device is obtained; comprising the following steps:
triggering the main Bluetooth device to start scanning to acquire Bluetooth broadcast data, sending a scanning request to Bluetooth devices corresponding to the Bluetooth broadcast data to acquire corresponding response data, and acquiring the Bluetooth devices generating the response data as the available Bluetooth devices.
Preferably, in the bluetooth one-to-many data transmission method according to the present invention, the method further includes:
and acquiring the slave Bluetooth device based on the historical connection information of the master Bluetooth device.
Preferably, in the bluetooth one-to-many data transmission method according to the present invention, in the step S2, the obtaining the master bluetooth device corresponding to the slave bluetooth device includes:
and acquiring the connection state of the master Bluetooth device and the target Bluetooth device, and taking the target Bluetooth device as a slave Bluetooth device of the master Bluetooth device when the target Bluetooth device and the master Bluetooth device are successfully connected.
Preferably, in the bluetooth one-to-many data transmission method according to the present invention, the method further includes:
acquiring historical connection information of the main Bluetooth device and current available Bluetooth devices; acquiring unavailable Bluetooth equipment corresponding to the historical connection information according to the historical connection information and the current available Bluetooth equipment;
acquiring the relation between the unavailable Bluetooth device and the available Bluetooth device so as to acquire a transit device corresponding to the unavailable Bluetooth device from the available Bluetooth device;
and taking the transit equipment and the unavailable Bluetooth equipment as slave Bluetooth equipment of the master Bluetooth equipment, so that the unavailable Bluetooth equipment receives corresponding operation instructions through the transit equipment.
Preferably, in the bluetooth one-to-many data transmission method according to the present invention, the method further includes:
and S21, monitoring the connection state of the slave Bluetooth device and the master Bluetooth device, eliminating the slave Bluetooth device when the slave Bluetooth device is disconnected from the master Bluetooth device, and executing the step S3.
Preferably, in the bluetooth one-to-many data transmission method according to the present invention, in the step S4, the acquiring, based on the target job and executable jobs of all the slave bluetooth devices, a corresponding slave bluetooth device as a target job device further includes:
and when a plurality of corresponding slave Bluetooth devices are acquired based on the operation instruction, acquiring the optimal slave Bluetooth device as the target operation device according to the device information of the plurality of corresponding slave Bluetooth devices.
Preferably, in the bluetooth one-to-many data transmission method according to the present invention, the method further includes:
s5, receiving feedback information generated by the target working equipment based on the working instruction, and judging the execution state of the target working equipment on the working instruction according to the feedback information.
The invention also constructs a Bluetooth one-to-many data transmission device, comprising:
the target Bluetooth device acquisition unit is used for acquiring available Bluetooth devices corresponding to the main Bluetooth device so as to acquire a plurality of available Bluetooth devices as target Bluetooth devices;
the slave Bluetooth device obtaining unit is used for generating a connection list containing all the target Bluetooth devices and triggering the master Bluetooth device to sequentially establish connection with the target Bluetooth devices based on the connection list so as to obtain slave Bluetooth devices corresponding to the master Bluetooth device;
an executable job obtaining unit, configured to obtain device attributes of the slave bluetooth devices, respectively, so as to obtain executable jobs of all the slave bluetooth devices according to the device attributes of the slave bluetooth devices;
and the target operation equipment acquisition unit acquires an operation instruction generated by the master Bluetooth equipment, identifies a target operation of the operation instruction, and acquires a corresponding slave Bluetooth equipment as a target operation equipment based on the target operation and all executable operations of the slave Bluetooth equipment so as to enable the target operation equipment to respond to the operation instruction.
The present invention also constructs a computer readable storage medium storing a computer program adapted to be loaded by a processor to perform the steps of the bluetooth one-to-many data transmission method as described in any of the above.
The present invention also constructs an electronic device comprising a memory and a processor, the memory storing a computer program, the processor executing the steps of the bluetooth one-to-many data transmission method as defined in any one of the above by calling the computer program stored in the memory.
The Bluetooth one-to-many data transmission method, the Bluetooth one-to-many data transmission device, the electronic equipment and the storage medium have the following beneficial effects: the method can quickly realize that one master Bluetooth device simultaneously controls a plurality of slave Bluetooth devices.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flow chart of a process of an embodiment of a Bluetooth one-to-many data transmission method of the present invention;
FIG. 2 is a program flow diagram of another embodiment of a Bluetooth one-to-many data transmission method of the present invention;
FIG. 3 is a program flow diagram of another embodiment of a Bluetooth one-to-many data transmission method of the present invention;
FIG. 4 is a program flow diagram of another embodiment of a Bluetooth one-to-many data transmission method of the present invention;
fig. 5 is a logic block diagram of an embodiment of the bluetooth one-to-many data transmission device of the present invention.
Detailed Description
For a clearer understanding of technical features, objects and effects of the present invention, a detailed description of embodiments of the present invention will be made with reference to the accompanying drawings.
As shown in fig. 1, in a first embodiment of a bluetooth one-to-many data transmission method of the present invention, the method includes the steps of: s1, acquiring available Bluetooth devices corresponding to a main Bluetooth device, and taking a plurality of available Bluetooth devices as target Bluetooth devices. Specifically, when the bluetooth device is used as a master bluetooth device, searching all bluetooth devices currently meeting the distance requirement, namely within the effective range, according to the trigger instruction. All bluetooth devices may be understood as available bluetooth devices corresponding to the master bluetooth device. That is, the available bluetooth device can meet the connection requirement of the master bluetooth device, for example, the signal strength, the communication protocol, etc. can meet the connection requirement with the master bluetooth device. It will be appreciated that all available bluetooth devices corresponding to the current master bluetooth device are not necessarily devices to which the master bluetooth device needs to connect, and thus, a desired bluetooth device may be selected from among the available bluetooth devices as a target bluetooth device based on requirements.
S2, generating a connection list containing all the target Bluetooth devices, and triggering the master Bluetooth device to sequentially establish connection with the target Bluetooth devices based on the connection list so as to acquire slave Bluetooth devices corresponding to the master Bluetooth device. Specifically, a corresponding connection list is generated based on the obtained target bluetooth devices, and all the target bluetooth devices needing to be connected can be obtained from the connection list. And triggering to realize one-key triggering of the connection between the main Bluetooth device and the target Bluetooth device based on the connection list. When the target Bluetooth device establishes connection with the master Bluetooth device, the target Bluetooth device corresponds to the slave Bluetooth device of the master Bluetooth device. In an embodiment, in a specific bluetooth connection process, the master bluetooth device actively sends a key to the slave bluetooth device, if the slave bluetooth device receives the key and successfully parses and returns the key to the master bluetooth device, the master bluetooth device actively sends a command for opening the high-speed communication channel to the slave bluetooth device, the slave bluetooth device opens the high-speed communication channel according to a preset bluetooth communication protocol after receiving the command for opening the high-speed communication channel sent by the master bluetooth device, and the master bluetooth device formally completes the connection step after receiving a message for opening the high-speed communication channel fed back by the slave bluetooth device. In one embodiment, the connection status of each target bluetooth device may be reflected by the status of the connection list.
S3, respectively acquiring the device attributes of the slave Bluetooth devices so as to acquire executable jobs of all the slave Bluetooth devices according to the device attributes of the slave Bluetooth devices. Specifically, after the slave bluetooth devices that establish a connection with the master bluetooth device are obtained, each slave bluetooth device is confirmed. And acquiring the equipment attribute of each slave Bluetooth equipment, and determining the task which can be executed by the Bluetooth equipment according to the equipment attribute, namely executing the task. I.e. what devices the slave bluetooth device is to be connected to, it can use to perform what tasks. For example, when the obtained slave bluetooth device is a printing device, the executable job corresponding to the slave bluetooth device may be obtained as a copy, print, or the like job. When the obtained slave Bluetooth device is an air conditioner, the executable operation corresponding to the slave Bluetooth device can be obtained as operation tasks such as temperature adjustment, wind speed adjustment and the like.
S4, acquiring a job instruction generated by the master Bluetooth device, identifying a target job of the job instruction, and acquiring a corresponding slave Bluetooth device as a target job device based on the target job and executable jobs of all the slave Bluetooth devices so as to enable the target job device to respond to the job instruction. Specifically, a job instruction is generated by the master bluetooth device. The job instruction is a control instruction for controlling the action of the slave bluetooth device, and can be identified to obtain what operation it is to perform. For example, the master bluetooth device generates a print instruction, and then the target job to which the print instruction corresponds is a print job. The print job can be executed from among all the slave bluetooth devices looking for a bluetooth device that can execute printing. The process can realize automatic identification of the operation instruction of the main Bluetooth equipment and corresponding data transmission, and realizes rapid and accurate data transmission when one-to-many Bluetooth is connected.
Optionally, in step S1, an available bluetooth device corresponding to the master bluetooth device is obtained; comprising the following steps: triggering the main Bluetooth device to start scanning to acquire Bluetooth broadcast data, sending a scanning request to Bluetooth devices corresponding to the Bluetooth broadcast data to acquire corresponding response data, and acquiring the Bluetooth devices generating the response data as the available Bluetooth devices. Specifically, the master device starts scanning first, the slave device continuously transmits broadcasting to the surrounding, after the master device starts the scanning function, the master device can receive the broadcasting transmitted by the slave device, the master device receives the broadcasting transmitted by the slave device and then transmits a scanning request to the slave device, after receiving the scanning request transmitted by the master device, the slave device transmits a scanning response (including uuid, mac, name information of the slave device) to the master device, and after receiving the scanning response transmitted by the slave device, the master device acquires the information of the slave device and displays the information in a list.
Optionally, in the bluetooth one-to-many data transmission method of the present invention, the method further includes: the slave bluetooth device is acquired based on the historical connection information of the master bluetooth device. Specifically, after the master bluetooth device is disconnected from the slave bluetooth devices, all information of the previous connection can be stored in the built-in storage of each slave bluetooth device, and meanwhile, the master bluetooth device also records the information of all the previous connected slave bluetooth devices. When the master Bluetooth device enters the effective range covered by the slave Bluetooth device signal again, the master Bluetooth device actively transmits broadcast data, after receiving the broadcast data transmitted by the master Bluetooth device, the slave Bluetooth device feeds back connection related information stored before the slave Bluetooth device to the master Bluetooth device, and the master Bluetooth device automatically takes the slave Bluetooth device as the current target Bluetooth device according to the previously connected related information fed back by the slave Bluetooth device and analyzes the previously stored connection information of the slave Bluetooth device, and automatically completes connection of the target Bluetooth device to obtain the slave Bluetooth device corresponding to the current master Bluetooth device. For example, the connected slave bluetooth device is automatically connected by a system algorithm, the checkbox is checked by default, and the following state is displayed as connected. The unconnected new device checkboxes are not checked and the status indicates unconnected. I.e., the connection list, it is possible to directly modify the connection list state as a connection state for a historically connected slave bluetooth device.
Optionally, in step S2, the obtaining a master bluetooth device corresponding to a slave bluetooth device includes: and acquiring the connection state of the master Bluetooth device and the target Bluetooth device, and taking the target Bluetooth device as a slave Bluetooth device of the master Bluetooth device when the target Bluetooth device and the master Bluetooth device are successfully connected. Specifically, not every selected target bluetooth device can be connected with the master bluetooth device, namely, the connection state of the target bluetooth device and the master bluetooth device can be judged, namely, the target bluetooth device can be used as a slave bluetooth device of the master bluetooth device only after the selected target bluetooth device is connected with the master bluetooth device.
Optionally, as shown in fig. 2, in the inventive bluetooth one-to-many data transmission method, the method further includes: s21, monitoring the connection state of the slave Bluetooth device and the master Bluetooth device, eliminating the slave Bluetooth device when the slave Bluetooth device is disconnected from the master Bluetooth device, and executing the step S3. Specifically, in the operation of the master bluetooth device, the connection state of the master bluetooth device and each slave bluetooth device is monitored, and when the slave bluetooth device is disconnected from the master bluetooth device, the bluetooth device is removed from the slave bluetooth devices of the master bluetooth device. At the moment, the executable operation corresponding to the master Bluetooth device can also be changed, so that the problem that tasks cannot be completed in practice due to the fact that some operation instructions cannot reach the actual slave Bluetooth device is avoided.
Optionally, in step S4, the method further includes obtaining, based on the target job and the executable jobs of all the slave bluetooth devices, the corresponding slave bluetooth device as the target job device, and further including: when a plurality of corresponding slave Bluetooth devices are acquired based on the operation instruction, the optimal slave Bluetooth device is acquired as a target operation device according to the device information of the plurality of corresponding slave Bluetooth devices. Specifically, when one job command can be corresponding to a plurality of slave bluetooth devices, the device information of the plurality of slave bluetooth devices can be judged, and the optimal slave bluetooth device can be selected for response. For example, when connected to each printer, the user terminal first acquires the transmission characteristics of each slave bluetooth device and saves the information record. Before the user terminal sends the data to be printed to the printer through the APP, the printer meeting the requirements is selected as the optimal printer according to the data information to be printed which is matched with the transmission characteristics of the Bluetooth equipment and stored before. For example, there are three slave printers for printing a photo (a), a document (B), and a ticket (C), respectively. The user terminal sends a command of printing the document to A, B, C, and when A, B, C receives the command of printing, the feedback information A and C feed back information to the user terminal to feed back that the user terminal is not suitable for printing the document, and the next step is not performed. And B, feeding back the instruction feedback information to the user terminal, wherein the instruction feedback information is suitable for printing the document, after the user terminal receives the request of B, the user terminal walks through a high-speed channel to send the document to B in a byte array mode, and after the complete receipt of the document data, the printer prints the document.
In an embodiment, when the slave device includes an air conditioner and a refrigerator, the jobs executed by the corresponding job instructions are all temperature adjustment functions, and the executable jobs are similar at this time, so when the executable jobs are generated, the slave device adds device information to the executable jobs, and the generation of the job instructions also increases the instruction types corresponding to the device information. When the mobile phone sends the temperature adjusting instruction of the equipment to be controlled to the air conditioner and the refrigerator, the Bluetooth slave module in the air conditioner and the refrigerator actively distinguishes which type of the instruction is, if the type of the air conditioner is the type of the air conditioner, the air conditioner responds to the operation instruction, but the refrigerator does not respond to the operation instruction because the instruction type identification is not corresponding. For example, when the mobile phone is being connected to the air conditioner 1 (a), the air conditioner 2 (B), the refrigerator 3 (C), and the refrigerator 4 (D), the types of A, B, C and D are first acquired, such as a returns type=1, B returns type=1, C returns type=2, and D returns type=2 and stored inside the mobile phone. When the user wants to control the temperature of the air conditioner in the market, an instruction with type=1 for controlling the air conditioner is selected from the instruction set, the instruction is sent to A, B, C, D, after the A and the B receive the instruction, the temperature is judged to be adjusted, and after the C and the D receive the instruction, the instruction is judged to be not sent to the user and is not processed.
Optionally, as shown in fig. 3, in the method for transmitting bluetooth one-to-many data according to the invention, the method further includes: a1, acquiring historical connection information of the main Bluetooth device and current available Bluetooth devices; acquiring unavailable Bluetooth equipment corresponding to the historical connection information according to the historical connection information and the current available Bluetooth equipment; a2, acquiring the relation between the unavailable Bluetooth device and the available Bluetooth device so as to acquire a transit device corresponding to the unavailable Bluetooth device from the available Bluetooth device; a3, taking the transfer equipment and the unavailable Bluetooth equipment as slave Bluetooth equipment of the master Bluetooth equipment, so that the unavailable Bluetooth equipment receives a corresponding operation instruction through the transfer equipment. In particular, some historically connected devices, i.e., list work devices, may be defined as unavailable bluetooth devices if they are not currently within control range of the handset.
For example, the equipment A (air conditioner 1), the equipment B (air conditioner 2), the equipment C (air conditioner 3), the equipment D (air conditioner 4), the equipment E (air conditioner 5) and the equipment F (air conditioner 6) are connected with the mobile phone before, and the equipment attributes of the equipment are stored in the mobile phone. When the mobile phone can only scan a (air conditioner 1), B (air conditioner 2) and C (air conditioner 3), then D (air conditioner 4), E (air conditioner 5) and F (air conditioner 6) are defined as unavailable devices corresponding to the main bluetooth device, at this time, a scanning function can be started by using available bluetooth devices such as a (air conditioner 1) as the main device, after broadcasting of surrounding unavailable bluetooth slave devices is received, a scanning request is initiated, the surrounding unavailable bluetooth slave devices give scanning responses (including uuid, mac, name, RSSI values and the like) "acquire the corresponding unavailable devices, and whether the available devices are used as agents of the unavailable devices, namely, the intermediate transfer devices are judged through the signal intensity of RSSI values, and connection is established. For example, if the RSSI value of search a is-45, the RSSI value of search a is-80, and the RSSI value of search a is-100, then a (air conditioner 1) acts as a proxy for D (air conditioner 4), i.e., a transit device. A (air conditioner 1) and D (air conditioner 4) are connected, when the A (air conditioner 1) receives the operation command, the operation command for closing the air conditioner is forwarded to D (air conditioner 4), and the D (air conditioner 4) completes the action of closing the air conditioner after receiving the command. And B (air conditioner 2) is used as a master device to start a scanning function, after receiving the broadcast of surrounding unavailable Bluetooth slave devices, a scanning request is initiated, the surrounding unavailable Bluetooth slave devices give scanning response (comprising uuid, mac, name, RSSI value and the like), the unavailable Bluetooth devices are finally obtained, and the corresponding unavailable devices are obtained through the signal intensity of RSSI values and are used as agents of the unavailable devices, namely, the intermediate transfer devices. For example, the RSSI value of B search E is-45, the RSSI value of B search D is-80, the RSSI value of B search F is-100) B (air conditioner 2) is used as the proxy of E (air conditioner 5), the connection between B (air conditioner 2) and E (air conditioner 5) is established, when the operation command is received by B (air conditioner 2), the operation command sent by the mobile phone to turn off the air conditioner is forwarded to E (air conditioner 5), and the E (air conditioner 5) completes the air conditioner turning off action after receiving the command. C (air conditioner 3) as a main device starts a scanning function, after receiving the broadcast of surrounding unavailable Bluetooth slave devices, initiates a scanning request, and the surrounding unavailable Bluetooth slave devices give a scanning response (comprising uuid, mac, name, RSSI value and the like) to finally obtain the unavailable Bluetooth devices, and the corresponding unavailable devices are obtained through the signal intensity of RSSI values and serve as agents of the unavailable devices, namely, the transfer devices. For example, the RSSI value of C search F is-45, the RSSI value of C search D is-80, and the RSSI value of C search E is-100, then C (air conditioner 3) is used as the proxy of F (air conditioner 6), C (air conditioner 3) establishes a connection with F (air conditioner 6), and forwards the operation instruction of closing the air conditioner sent by the mobile phone to F (air conditioner 6), and F (air conditioner 6) completes the closing operation after receiving the instruction.
It can be understood that when unavailable bluetooth devices exist based on the historical connection information and the current available bluetooth devices, all the current available bluetooth devices can be set to start a scanning function, the RSSI values of the current available bluetooth devices relative to the partial target operation devices are scanned, the RSSI values are all transmitted back to the mobile phone for statistical analysis, and finally, the optimal transfer device corresponding to each unavailable bluetooth device is obtained according to the signal intensity of the RSSI values.
Optionally, if a part of unavailable bluetooth devices cannot find a corresponding transfer device, all the slave bluetooth devices of the current master bluetooth device may be defined as current available bluetooth devices of the master bluetooth device, and the transfer devices of the remaining unavailable bluetooth devices may be continuously acquired based on the new current available bluetooth devices. The process can expand the searching range and enhance the scanning function. That is, after each time a new transfer device is acquired, it is determined whether an unavailable bluetooth device exists, and based on the determination result, it is determined whether the transfer device needs to be acquired again until no unavailable bluetooth device exists. The specific process comprises the following steps: and enabling all the first-order scanning main equipment to start a scanning function, enabling all equipment scanned by the first-order scanning main equipment to be called second-order scanning main equipment, enabling all the second-order scanning main equipment to start the scanning function if part of target operation equipment is still not in a second-order scanning main equipment list, enabling all the equipment scanned by the second-order scanning main equipment to be called third-order scanning main equipment, enabling all the third-order scanning main equipment to start the scanning function if part of target operation equipment is still not in the third-order scanning main equipment list, and enabling all the scannable equipment to be connected with all the target operation equipment as far as possible.
For example, the target working device includes A, D, E, K, M, the available bluetooth device of the mobile phone is A, B, C, and the first-order scanning main device is A, B, C as described above, and the first-order scanning main device is enabled to start the scanning function if D, E, K, M is not in the first-order scanning main device, the RSSI value from a to D is-70, the RSSI value from b to D is-40, the RSSI value from b to E is-80, and the RSSI value from c to E is-30, so that the D, E device is a second-order scanning main device. Since K, M is not in the second order scanning master, the second order scanning master is enabled to start the scanning function, the RSSI value when D scans to F is-60, and the RSSI value when D scans to G is-75, so F, G is the third order scanning master. Since K, M is not in the third-order scanning master, the third-order scanning master is enabled to start the scanning function, the RSSI value of F to H is-70, and the RSSI value of g to H is-80, so H is the fourth-order scanning master. Since K, M is not in the fourth-order scanning master, the fourth-order scanning master starts the scanning function, and the RSSI value of H to K is-45, so that K is the fifth-order scanning master. Since M is not in the fifth-order scanning master, the fifth-order scanning master starts the scanning function, and the RSSI value of K to L is-60, so L is the sixth-order scanning master. Since M is not in the sixth order scanning master device, the sixth order scanning master device is enabled to start the scanning function, and since no connectable bluetooth device is found within the effective scanning range of L, execution of the enhanced scanning function is terminated. And (3) returning all acquired useful data in the execution process of the enhanced scanning function to the mobile phone for processing, wherein the useful data is that (A- > D: 70) means that A scans to D, and the RSSI value returned to A by D is-70, and the following is the same. (B- > D: -40), (B- > E: -80), (C- > E: -30), (D- > F: -60), (D- > G: -75), (F- > H: -70), (H- > K: -45), (K- > L: -60), (L- > M: not scanned). After the data are returned to the mobile phone for processing, the optimal links of the target Bluetooth equipment (D, E, K) which is not in the effective scanning range of the mobile phone are respectively as follows: the links of (1) mobile phone- > B- > D, (2) mobile phone- > C- > E, (3) mobile phone- > B- > D- > F- > H- > K, but since L cannot search for the target operation device M, M is the target operation device and cannot execute the operation instruction issued by the mobile phone to him finally, so that (4) mobile phone- > B- > D- > F- > H- > K- > L- > M are not existed.
In the above (2), C may be obtained as a proxy, i.e., a transfer device, of the E target operation device, and a connection may be established and the operation instruction issued by the mobile phone may be forwarded to E, which may be used as an action related to the execution instruction of the target operation device.
In the above (1), the proxy, i.e., the transfer device, of the target operation device B can be obtained, a connection is established, the operation instruction issued by the mobile phone is forwarded to D, and the D performs the operation related to the instruction as the target operation device, and meanwhile, according to the above (3), B, D, F, H, i.e., the transfer device, which is the proxy of the target operation device K, can be known, the connection is sequentially established, the operation instruction issued by the mobile phone is forwarded to layer by layer, and finally reaches the target operation device K, which is used as the target operation device to perform the operation related to the instruction after receiving the operation instruction. Finally, as far as possible, all the unavailable Bluetooth devices within the effective connection range of the available Bluetooth devices are ensured to find the corresponding available Bluetooth devices to serve as agents, namely transit devices, and the job instructions which should be processed are received through the transit devices.
Optionally, as shown in fig. 4, in the bluetooth one-to-many data transmission method of the present invention, the method further includes: s5, receiving feedback information generated by the target working equipment based on the working instruction, and judging the execution state of the target working equipment on the working instruction according to the feedback information. Specifically, in order to ensure that the instruction set can be safely, quickly and accurately transmitted to the slave bluetooth device, the instruction is a special channel, and the channel comprises a data encryption and decryption and quick channel protocol mechanism. In order to ensure that all executed slave Bluetooth devices can execute the instruction issued by the master Bluetooth device accurately, an error correction mechanism is provided. When the slave Bluetooth device receives an instruction from the master Bluetooth device and does not execute corresponding actions, the execution failure result is fed back to the master Bluetooth device. The master Bluetooth device receives the failure result returned by the slave Bluetooth device, and issues the instruction set to the slave Bluetooth device again, so that the operation is completed if the slave Bluetooth device successfully executes the instruction set and feeds back the message to the master Bluetooth device within the specified frequency range. Otherwise, after the designated times are exceeded, the master Bluetooth device sends a restarting instruction to the slave Bluetooth device and stores the information into the database. And after receiving a restart instruction from the Bluetooth equipment and restarting, disconnecting. And after the slave Bluetooth device is restarted, connecting the slave Bluetooth device with the master Bluetooth device, and sending a previous instruction again by the master Bluetooth device, wherein if the message returned to the master Bluetooth device by the slave Bluetooth device is failed, the master Bluetooth device displays that the device fails and needs maintenance. The loop is repeated until all the slave Bluetooth devices execute the instruction issued by the master Bluetooth device, and the action is not completed.
In a specific embodiment, a bluetooth multi-connection application, abbreviated as a, is opened in the mobile phone, and the bluetooth multi-connection application is replaced by a. Conditions are as follows: the main Bluetooth device is in the effective range covered by the signal of the auxiliary Bluetooth device, the Bluetooth sound box, the Bluetooth printer, the Bluetooth curtain, the Bluetooth access control, the Bluetooth air conditioner and the Bluetooth atmosphere lamp are all in the electrified condition, the application A is opened, the interface A only scans the six auxiliary Bluetooth devices which need to be displayed according to the filtering condition, and selects the auxiliary Bluetooth devices to be selected, and one-click connection is performed. After the checked slave Bluetooth equipment is successfully connected, the connected state information is displayed on an interface A, and at the moment, the Bluetooth sound box can be controlled to start playing, pause playing, last one, next one and the like by simultaneously transmitting an instruction set to the slave Bluetooth equipment through an application A in the master Bluetooth equipment. And simultaneously, the instruction set issued from the Bluetooth device controls the Bluetooth printer to print documents, photos and the like. And simultaneously, a command set is issued to the slave Bluetooth equipment to control the opening and closing of the Bluetooth curtain. And simultaneously, issuing a command set from the Bluetooth equipment to control the Bluetooth access control equipment to be turned on and off. And simultaneously, issuing a command set from the Bluetooth device to control the Bluetooth air conditioner to be turned on, turned off, temperature regulated, wind speed, scanning mode and the like. And simultaneously, the Bluetooth atmosphere lamp is controlled to be turned on, turned off, color temperature adjusted and the like by issuing a command set from the Bluetooth equipment. If the A application of the master Bluetooth device issues a corresponding instruction to the slave Bluetooth device, the slave Bluetooth device returns an error instruction and triggers an error correction mechanism, so that the slave Bluetooth device can correctly execute a control instruction set issued by the master Bluetooth device. And when the master Bluetooth device leaves the effective coverage range of the slave Bluetooth device signal, the connection is automatically disconnected.
When the master bluetooth device reappears in the valid range of the slave bluetooth device information coverage, the slave bluetooth device connected before is automatically connected. Therefore, the realization of one-to-many connection of Bluetooth is realized, the life quality of a user is greatly improved, and the automatic function of simultaneously controlling a plurality of slave Bluetooth devices by one master Bluetooth device is realized in a real sense, so that the Bluetooth device is more convenient.
In addition, as shown in fig. 5, a bluetooth one-to-many data transmission device of the present invention includes:
a target bluetooth device obtaining unit 110, configured to obtain available bluetooth devices corresponding to the master bluetooth device, so as to obtain a plurality of available bluetooth devices as target bluetooth devices;
the slave bluetooth device obtaining unit 120 is configured to generate a connection list including all target bluetooth devices, and trigger the master bluetooth device to sequentially establish connection with the target bluetooth devices based on the connection list to obtain slave bluetooth devices corresponding to the master bluetooth device;
an executable job acquisition unit 130 for acquiring device attributes of the slave bluetooth devices, respectively, to acquire executable jobs of all the slave bluetooth devices according to the device attributes of the slave bluetooth devices;
the target operation device acquiring unit 140 acquires the operation instruction generated by the master bluetooth device, identifies the target operation of the operation instruction, and acquires the corresponding slave bluetooth device as the target operation device based on the target operation and the executable operations of all the slave bluetooth devices, so that the target operation device responds to the operation instruction.
Specifically, the specific coordination operation process between each unit of the bluetooth one-to-many data transmission device may refer to the above bluetooth one-to-many data transmission method, which is not described herein again.
In addition, the electronic equipment comprises a memory and a processor; the memory is used for storing a computer program; the processor is configured to execute a computer program to implement a bluetooth one-to-many data transmission method as any of the above. In particular, according to embodiments of the present invention, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may perform the above-described functions defined in the methods of embodiments of the present invention when downloaded and installed and executed by an electronic device. The electronic equipment in the invention can be a terminal such as a notebook, a desktop, a tablet computer, a smart phone and the like, and also can be a server.
In addition, a computer storage medium of the present invention has stored thereon a computer program which, when executed by a processor, implements the bluetooth one-to-many data transmission method of any one of the above. In particular, it should be noted that the computer readable medium of the present invention may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
It is to be understood that the above examples only represent preferred embodiments of the present invention, which are described in more detail and are not to be construed as limiting the scope of the invention; it should be noted that, for a person skilled in the art, the above technical features can be freely combined, and several variations and modifications can be made without departing from the scope of the invention; therefore, all changes and modifications that come within the meaning and range of equivalency of the claims are to be embraced within their scope.

Claims (10)

1. A bluetooth one-to-many data transmission method, comprising the steps of:
s1, acquiring available Bluetooth devices corresponding to a main Bluetooth device, so as to acquire a plurality of available Bluetooth devices as target Bluetooth devices;
s2, generating a connection list containing all the target Bluetooth devices, and triggering the master Bluetooth device to sequentially establish connection with the target Bluetooth devices based on the connection list so as to acquire slave Bluetooth devices corresponding to the master Bluetooth device;
s3, respectively acquiring the equipment attributes of the slave Bluetooth equipment to acquire executable jobs of all the slave Bluetooth equipment according to the equipment attributes of the slave Bluetooth equipment;
s4, acquiring a job instruction generated by the master Bluetooth device, identifying a target job of the job instruction, and acquiring a corresponding slave Bluetooth device as a target job device based on the target job and executable jobs of all the slave Bluetooth devices so as to enable the target job device to respond to the job instruction.
2. The bluetooth one-to-many data transmission method according to claim 1, wherein in the step S1, the available bluetooth device corresponding to the master bluetooth device is obtained; comprising the following steps:
triggering the main Bluetooth device to start scanning to acquire Bluetooth broadcast data, sending a scanning request to Bluetooth devices corresponding to the Bluetooth broadcast data to acquire corresponding response data, and acquiring the Bluetooth devices generating the response data as the available Bluetooth devices.
3. The bluetooth one-to-many data transmission method according to claim 1, wherein the method further comprises:
acquiring the slave Bluetooth equipment based on the historical connection information of the master Bluetooth equipment; and/or
And S21, monitoring the connection state of the slave Bluetooth device and the master Bluetooth device, eliminating the slave Bluetooth device when the slave Bluetooth device is disconnected from the master Bluetooth device, and executing the step S3.
4. The bluetooth one-to-many data transmission method according to claim 1, wherein in the step S2, the acquiring the master bluetooth device corresponding to the slave bluetooth device includes:
and acquiring the connection state of the master Bluetooth device and the target Bluetooth device, and taking the target Bluetooth device as a slave Bluetooth device of the master Bluetooth device when the target Bluetooth device and the master Bluetooth device are successfully connected.
5. The bluetooth one-to-many data transmission method according to claim 1, wherein the method further comprises:
acquiring historical connection information of the main Bluetooth device and current available Bluetooth devices; acquiring unavailable Bluetooth equipment corresponding to the historical connection information according to the historical connection information and the current available Bluetooth equipment;
acquiring the relation between the unavailable Bluetooth device and the available Bluetooth device so as to acquire a transit device corresponding to the unavailable Bluetooth device from the available Bluetooth device;
and taking the transit equipment and the unavailable Bluetooth equipment as slave Bluetooth equipment of the master Bluetooth equipment, so that the unavailable Bluetooth equipment receives corresponding operation instructions through the transit equipment.
6. The bluetooth one-to-many data transmission method according to claim 1, wherein in the step S4, the acquiring the corresponding slave bluetooth device as the target job device based on the target job and the executable jobs of all the slave bluetooth devices, further comprises:
and when a plurality of corresponding slave Bluetooth devices are acquired based on the operation instruction, acquiring the optimal slave Bluetooth device as the target operation device according to the device information of the plurality of corresponding slave Bluetooth devices.
7. The bluetooth one-to-many data transmission method according to claim 1, wherein the method further comprises:
s5, receiving feedback information generated by the target working equipment based on the working instruction, and judging the execution state of the target working equipment on the working instruction according to the feedback information.
8. A bluetooth one-to-many data transmission device, comprising:
the target Bluetooth device acquisition unit is used for acquiring available Bluetooth devices corresponding to the main Bluetooth device so as to acquire a plurality of available Bluetooth devices as target Bluetooth devices;
the slave Bluetooth device obtaining unit is used for generating a connection list containing all the target Bluetooth devices and triggering the master Bluetooth device to sequentially establish connection with the target Bluetooth devices based on the connection list so as to obtain slave Bluetooth devices corresponding to the master Bluetooth device;
an executable job obtaining unit, configured to obtain device attributes of the slave bluetooth devices, respectively, so as to obtain executable jobs of all the slave bluetooth devices according to the device attributes of the slave bluetooth devices;
and the target operation equipment acquisition unit acquires an operation instruction generated by the master Bluetooth equipment, identifies a target operation of the operation instruction, and acquires a corresponding slave Bluetooth equipment as a target operation equipment based on the target operation and all executable operations of the slave Bluetooth equipment so as to enable the target operation equipment to respond to the operation instruction.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor performing the steps of the bluetooth one-to-many data transmission method according to any one of claims 1 to 7 by invoking the computer program stored in the memory.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded by a processor for performing the steps of the bluetooth one-to-many data transmission method according to any of claims 1 to 7.
CN202211581837.0A 2022-12-09 2022-12-09 Bluetooth one-to-many data transmission method and device, electronic equipment and storage medium Pending CN116033400A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211581837.0A CN116033400A (en) 2022-12-09 2022-12-09 Bluetooth one-to-many data transmission method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211581837.0A CN116033400A (en) 2022-12-09 2022-12-09 Bluetooth one-to-many data transmission method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116033400A true CN116033400A (en) 2023-04-28

Family

ID=86076741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211581837.0A Pending CN116033400A (en) 2022-12-09 2022-12-09 Bluetooth one-to-many data transmission method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116033400A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116761110A (en) * 2023-08-18 2023-09-15 江西斐耳科技有限公司 Multi-point bluetooth headset control method, system, storage medium and equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116761110A (en) * 2023-08-18 2023-09-15 江西斐耳科技有限公司 Multi-point bluetooth headset control method, system, storage medium and equipment
CN116761110B (en) * 2023-08-18 2023-11-14 江西斐耳科技有限公司 Multi-point bluetooth headset control method, system, storage medium and equipment

Similar Documents

Publication Publication Date Title
US11671813B2 (en) Function execution device and communication terminal
US10540581B2 (en) Printer
US10631155B2 (en) Communication apparatus
US8107926B2 (en) Communication device
CN110996405B (en) Earphone connection method, terminal, earphone box and computer readable storage medium
JP6056558B2 (en) Wireless communication device, wireless communication terminal, reconnection program, wireless communication method, and wireless communication system
US8810839B2 (en) Information processing apparatus for transferring image data, server apparatus for receiving transferred image data, and control methods and storage media therefor
US20060116166A1 (en) Wireless communication system, device, and method of setting up wireless communication adapter
US10091827B2 (en) Electronic apparatus, method of supporting wireless connection, image forming apparatus, and method of wireless connection
US20180124769A1 (en) Communication apparatus, control method thereof, and program
US10652427B2 (en) Non-transitory computer-readable recording medium storing computer-readable instructions for terminal device, and terminal device
CN116033400A (en) Bluetooth one-to-many data transmission method and device, electronic equipment and storage medium
EP3402252A1 (en) Information processing apparatus, control method, and program
US20170279994A1 (en) Control device for user authentication, image processing apparatus, image processing method, information processing system, and non-transitory computer readable medium storing program
US20180183970A1 (en) Communication system in which server transmits to terminal device restriction information for restricting settings of image process
CN108509163B (en) Printing control method and printing control device
US20190303122A1 (en) Application program setup method and download server
US20170277488A1 (en) Control device, image processing apparatus, non-transitory computer readable medium storing program, information processing control system, and image processing method
JP2021022877A (en) Information processing device, control method, and program
US20180239572A1 (en) Communication Device and Non-Transitory Computer-Readable Medium for Terminal Device
US11429324B2 (en) Data processing apparatus, storage medium, and control method for obtaining information about an apparatus
US20200301625A1 (en) Communication device, method of controlling communication device, and non-transitory computer-readable recording medium therefor
US10708447B2 (en) Image forming apparatus sharing connection information with a terminal device
US20190272127A1 (en) Terminal device and non-transitory computer-readable medium storing computer-readable instructions for terminal device
JP2020141269A (en) Information processing system and information processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination