Disclosure of Invention
In view of the above, an object of the present invention is to provide a gateway control method, a gateway control apparatus, a gateway operating method, a gateway operating apparatus, and an electronic device, so that scanning and connecting functions can be implemented in a gateway having a single bluetooth module.
The embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a gateway control method, which is applied to a background, where the background communicates with a communication system including multiple gateways and multiple wearable devices, each gateway has a single bluetooth module, and the method includes: acquiring communication data to be issued to the wearable device; when the communication data are determined to contain the ID of the target wearable device and the target wearable device is required to provide feedback information, determining the target gateway and the target wearable device according to the scanning data sent by each acquired gateway based on the broadcast data scanned to the wearable device and the ID of the target wearable device; generating a connection instruction for indicating the target gateway to be connected with the target wearable device; and sending the communication data and the connection instruction to the target gateway so as to establish connection between the target gateway and the target wearable device and perform data interaction. After receiving the connection instruction, the target gateway can switch the original scanning mode to the connection mode, and initiate a connection request to the target wearable device so as to establish connection with the target wearable device. After receiving the connection instruction, the target gateway may switch the original scanning mode to the connection mode, so as to initiate a connection request to the target wearable device, so as to establish a connection with the target wearable device. For the target gateway, the scanning function is realized firstly to scan the broadcast data broadcasted by the wearable device, and then the connection function is realized to establish connection with the target wearable device. That is, the gateway including a single bluetooth module realizes the scanning function and the connection function successively.
With reference to the embodiment of the first aspect, in a possible implementation manner, the scan data includes a gateway ID, a wearable device ID, and a signal strength between a gateway corresponding to the gateway ID and a wearable device corresponding to the wearable device ID; the determining a target gateway and a target wearable device according to the scanning data sent by each acquired gateway based on the broadcast data scanned to the wearable device and the target wearable device ID includes: determining the wearable device with the ID consistent with the ID of the target wearable device as the target wearable device; and determining the gateway which includes the ID of the target wearable device and has the strongest signal strength in the sent scanning data as the target gateway. When the signal strength in the scanning data sent by a certain gateway is strongest, the gateway is characterized to be worn closest to the target. And the background determines the gateway with the strongest signal strength as the target gateway so as to save the time for the target gateway to transmit the communication data and save the energy consumption.
With reference to the embodiment of the first aspect, in a possible implementation manner, after the sending the communication data and the connection instruction to the target gateway, so that the target gateway establishes a connection with the target wearable device and performs data interaction, the method further includes: receiving feedback information of the target wearable device sent by the target gateway or receiving result information fed back by the target gateway based on the fact that the target wearable device is located outside the connection range of the target wearable device.
With reference to the embodiment of the first aspect, in a possible implementation manner, after the receiving feedback information of the target wearable device sent by the target gateway or receiving result information fed back by the target gateway based on that the target wearable device is located outside of a connection range of the target wearable device, the method further includes: and sending a disconnection instruction to the target gateway to reduce the power consumption of the target gateway.
With reference to the embodiment of the first aspect, in one possible implementation manner, the method further includes: when the communication data do not contain the ID of the target wearable device, the communication data are sent to the gateway, so that the gateway broadcasts the communication data to the wearable device. Namely, when the target wearing equipment is not specified, the communication data is broadcasted to all the wearing equipment.
In a second aspect, an embodiment of the present application provides a gateway operating method, which is applied to a gateway having a single bluetooth module in a communication system, where the communication system further includes a plurality of wearable devices, and the gateway is capable of communicating with a background, and the method includes: acquiring communication data issued by the background; and when a connection instruction which is issued by the background and is connected with the target wearable device is acquired, and the broadcast data broadcasted by the target wearable device is scanned, the connection with the target wearable device is established and data interaction is carried out.
With reference to the second aspect, in a possible implementation manner, after the obtaining the communication data delivered by the background, the method further includes: and if the instruction for establishing the connection with the target wearable device issued by the background is not acquired within the preset time, broadcasting the communication data to the wearable device.
With reference to the second aspect, in a possible implementation manner, after the connection is established with the target wearable device and data interaction is performed, the method further includes: and feeding back feedback information of the target wearable device or feedback result information of the target wearable device outside the connection range to the background.
With reference to the second aspect, in a possible implementation manner, after feeding back the feedback information of the target wearable device or the result information fed back by the target wearable device being outside the connection range to the background, the method further includes: and disconnecting the connection with the target wearable device.
With reference to the second aspect, in a possible implementation manner, the method further includes: scanning broadcast data of the wearable device; generating scanning data and navigation data according to the scanned broadcast data; and sending the scanning data to the background, and sending the navigation data to a mobile terminal sharing the same wearing equipment ID with the wearing equipment.
In a third aspect, an embodiment of the present application provides a gateway control apparatus, where the gateway control apparatus communicates with a communication system including a plurality of gateways and a plurality of wearable devices, each of the gateways includes a single bluetooth module, and the apparatus includes: the acquisition module is used for acquiring communication data to be issued to the wearable device; the determining module is used for determining a target gateway and target wearable equipment according to the acquired scanning data sent by each gateway based on the broadcast data scanned to the wearable equipment and the target wearable equipment ID when the communication data are determined to contain the target wearable equipment ID and the target wearable equipment is required to provide feedback information; the generation module is used for generating a connection instruction for indicating the target gateway to be connected with the target wearable device; and the sending module is used for sending the communication data and the connection instruction to the target gateway so as to enable the target gateway to establish connection with the target wearable device and perform data interaction.
With reference to the embodiment of the third aspect, in a possible implementation manner, the determining module is configured to determine, as the target wearable device, the wearable device whose wearable device ID is consistent with the target wearable device ID; and determining the gateway which includes the ID of the target wearable device and has the strongest signal strength in the sent scanning data as the target gateway.
With reference to the third aspect, in a possible implementation manner, the apparatus further includes a receiving module, configured to receive feedback information of the target wearable device sent by the target gateway or receive result information fed back by the target gateway based on that the target wearable device is located outside a connection range of the target wearable device.
With reference to the embodiment of the third aspect, in a possible implementation manner, the sending module is further configured to send a disconnection instruction to the target gateway.
With reference to the embodiment of the third aspect, in a possible implementation manner, the determining module is further configured to send the communication data to the gateway when it is determined that the communication data does not include the target wearable device ID, so that the gateway broadcasts the communication data to the wearable device.
In a fourth aspect, an embodiment provides a gateway operating apparatus, which is applied to a gateway that has a single bluetooth module and is capable of communicating with a background, and the apparatus includes: the acquisition module is used for acquiring the communication data issued by the background; and the connection module is used for establishing connection with the target wearable device and performing data interaction when the connection instruction which is issued by the background and used for establishing connection with the target wearable device is acquired and the broadcast data broadcasted by the target wearable device is scanned.
With reference to the fourth aspect of the embodiment, in a possible implementation manner, the apparatus further includes a broadcasting module, configured to broadcast the communication data to the wearable device when the instruction for establishing a connection with the target wearable device, which is issued by the background, is not obtained within a predetermined time.
With reference to the embodiment of the fourth aspect, in a possible implementation manner, the apparatus further includes a feedback module, configured to feed back feedback information of the target wearable device or result information fed back by the target wearable device being located outside the connection range to the background.
With reference to the embodiment of the fourth aspect, in a possible implementation manner, the apparatus further includes a disconnection module configured to disconnect the target wearable device.
With reference to the embodiment of the fourth aspect, in a possible implementation manner, the apparatus further includes a scanning module and a generating module. The scanning module is used for scanning the broadcast data of the wearable device; the generating module is used for generating scanning data and navigation data according to the scanned broadcast data; and the sending module is further used for sending the scanning data to the background and sending the navigation data to a mobile terminal sharing the same wearing equipment ID with the wearing equipment.
In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a computer to perform the foregoing first aspect and/or the method provided in connection with any one of the possible implementations of the first aspect, or to perform the foregoing second aspect and/or the method provided in connection with any one of the possible implementations of the second aspect.
In a sixth aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor, the memory and the processor being connected; the memory is used for storing programs; the processor calls a program stored in the memory to perform the method of the second aspect embodiment described above and/or provided in connection with any of the possible implementations of the second aspect embodiment.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that the term "and/or" in this application is only one type of association relationship describing the associated object, and means that there may be three types of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The following will describe a control method for a single bluetooth module provided in the present application.
Referring to fig. 1, an embodiment of the present application provides a gateway control method applied to a background, where the background communicates with a communication system including multiple gateways and multiple wearable devices, each gateway has a single bluetooth module, and a communication model between the background and the communication system may refer to fig. 2. The backstage can communicate with the gateway, and the gateway can communicate through the bluetooth with wearing equipment in the connectable range of bluetooth signal.
Each gateway and each wearable device has a unique Identification (ID).
One gateway can simultaneously scan the broadcast data broadcasted by a plurality of wearable devices. After the gateway scans the broadcast data of a certain wearable device, the bluetooth link management protocol in the bluetooth protocol stack can analyze the broadcast data, and the connection signal strength of communication with the wearable device is generated. Then, the gateway can generate scanning data containing broadcast data, connection signal strength between the gateway and the corresponding wearable device and gateway ID, and send the scanning data to the background for use by the background.
The gateway control method comprises the following steps.
Step S110: and communication data to be issued to the wearable device are obtained.
When a user with management authority wishes to issue communication data to a user wearing the wearable device, the background can acquire the communication data issued to the wearable device.
As an optional implementation manner, the user with the management authority may be a doctor, and correspondingly, the user wearing the wearable device is a patient. As another alternative, the user with administrative authority may be a prison manager, and accordingly, the user wearing the wearable device is a prisoner.
Of course, the above application scenarios are only examples, and it should be understood that the above examples do not limit the application scenarios in the embodiments of the present application.
Step S120: when the communication data are determined to contain the ID of the target wearable device and the target wearable device is required to provide feedback information, the target gateway and the target wearable device are determined according to the scanning data sent by each acquired gateway based on the broadcast data scanned to the wearable device and the ID of the target wearable device.
The user with the management authority may only need to transmit the communication data to a specific user, and at the same time, the specific user may want to send feedback information after receiving the communication data. At this moment, the background can monitor that the communication data contains the ID of the target wearable device and the target wearable device needs to provide feedback information, and correspondingly, the background needs to determine the target wearable device and the target gateway. The target gateway is used for acquiring communication data and transmitting the communication data to the target wearable device.
The determination process of the target wearable device and the target gateway is as follows.
As an alternative implementation, for each gateway, whenever it scans broadcast data broadcast by one wearable device, the scan data sent by it may include its own gateway ID, the wearable device ID corresponding to the broadcast data, and the signal strength between the wearable device ID corresponding to the wearable device ID and its own wearable device. At this time, the background may determine the wearable device whose wearable device ID is consistent with the target wearable device ID as the target wearable device. After the target wearable device is determined, the background determines the gateway with the strongest signal strength, which includes the ID of the target wearable device in the sent scanning data, as the target gateway. When the signal strength in the scanning data sent by a certain gateway is strongest, the gateway is characterized to be worn closest to the target. And the background determines the gateway with the strongest signal strength as the target gateway so as to save the time for the target gateway to transmit the communication data and save the energy consumption.
As another optional embodiment, for each gateway, each time it scans broadcast data broadcast by one wearable device, the scan data sent by it may include its own gateway ID and a wearable device ID corresponding to the broadcast data. At this time, the background may determine the wearable device whose wearable device ID is consistent with the target wearable device ID as the target wearable device. After the target wearable device is determined, the background determines the gateways including the ID of the target wearable device in the sent scanning data to be selected, and then randomly determines one target gateway from the gateways to be selected.
Step S130: and generating a connection instruction for indicating the target gateway to be connected with the target wearable device.
Step S140: and sending the communication data and the connection instruction to the target gateway so as to enable the target gateway to establish connection with the target wearable device and perform data interaction.
After receiving the connection instruction, the target gateway may switch the original scanning mode to the connection mode, so as to initiate a connection request to the target wearable device, so as to establish a connection with the target wearable device. To this end, for the target gateway, it has realized the scanning function earlier, scans the broadcast data that wearing equipment broadcasts, has realized the connection function again afterwards, establishes connection with target wearing equipment.
After the connection is established, the target gateway sends the obtained communication data to the target wearable device, and data interaction is carried out between the target gateway and the target wearable device.
After the target gateway sends the communication data to the target wearable device, the communication data needs the target wearable device to perform feedback, so that for the target wearable device, after the communication data is acquired, the feedback data input by the user can be sent to the target gateway, and then the target gateway sends the feedback information to the background. And after the background receives the feedback information fed back by the target gateway, displaying the feedback information to the user with the management right item, and representing that the communication process is ended.
In addition, since the user wearing the target wearable device may be in a moving state, accordingly, the geographical location of the target wearable device is also in a moving state. At this time, a case may occur in which the distance between the target wearable device and the target gateway is too far, so that the target wearable device is located outside the connection range of the target gateway. Optionally, if the target gateway does not successfully establish a connection with the target wearable device within the preset time range, the target gateway may generate result information indicating that the target wearable device is located outside the connection range, and send the result information to the background.
Optionally, when the background receives feedback information representing that the communication is ended or result information representing that the target wearable device is located outside the connection range of the target wearable device, as an optional implementation manner, the background may further send a disconnection instruction to the target gateway, so that the target gateway is no longer connected to the target tag device, and power consumption of the target gateway is reduced.
As an optional implementation manner, when the background acquires the communication data, the communication data may not include the target wearable device ID. At this time, the background can send the communication data to all gateways and control each gateway to broadcast the communication data outwards. Accordingly, the wearable device within the reach of the broadcast signal of the gateway can receive the communication data broadcast by the gateway. In this case, the gateway realizes a broadcast function in addition to the scanning function.
In the gateway control method provided in the first embodiment of the present application, a background first obtains communication data to be issued to the wearable device, and when it is determined that the communication data includes a target wearable device ID and the target wearable device is required to provide feedback information, determines a target gateway and a target wearable device according to obtained scanning data sent by each gateway based on broadcast data scanned to the wearable device and the target wearable device ID, and then generates a connection instruction indicating that the target gateway is connected to the target wearable device; and sending the communication data and the connection instruction to the target gateway so as to enable the target gateway to establish connection with the target wearable device and perform data interaction. After receiving the connection instruction, the target gateway can switch the original scanning mode to a connection mode so as to initiate a connection request to the target wearable device and establish connection with the target wearable device. For the target gateway, firstly, the scanning function is realized to scan the broadcast data broadcasted by the wearable device, and then, the connection function is realized to establish connection with the target wearable device.
In addition, referring to fig. 3 in correspondence to fig. 1, an embodiment of the present application provides a gateway control apparatus 400, which communicates with a communication system including a plurality of gateways having a single bluetooth module and a plurality of wearable devices. The apparatus may include an obtaining module 410, a determining module 420, a generating module 430, and a sending module 440.
An obtaining module 410, configured to obtain communication data to be sent to the wearable device;
a determining module 420, configured to determine, when it is determined that the communication data includes a target wearable device ID and the target wearable device is required to provide feedback information, a target gateway and a target wearable device according to the acquired scanning data sent by each gateway based on the broadcast data scanned to the wearable device and the target wearable device ID;
a generating module 430, configured to generate a connection instruction for instructing the target gateway to connect to the target wearable device;
the sending module 440 is configured to send the communication data and the connection instruction to the target gateway, so that the target gateway establishes connection with the target wearable device and performs data interaction.
Optionally, the determining module 420 is configured to determine the wearable device with the ID consistent with the target wearable device ID as the target wearable device; and determining the gateway which includes the ID of the target wearable device and has the strongest signal strength in the sent scanning data as the target gateway.
Optionally, the apparatus further includes a receiving module, configured to receive feedback information of the target wearable device sent by the target gateway or receive result information fed back by the target gateway based on the target wearable device being outside of a connection range of the target wearable device.
Optionally, the sending module 440 is further configured to send a disconnection instruction to the target gateway.
The determining module 420 is further configured to send the communication data to the gateway when it is determined that the communication data does not include the target wearable device ID, so that the gateway broadcasts the communication data to the wearable device.
The gateway control apparatus 400 provided in the embodiment of the present application has the same implementation principle and technical effect as the corresponding method embodiments described above, and for brief description, reference may be made to the corresponding contents in the method embodiments described above where no part of the apparatus embodiments is mentioned.
In addition, please refer to fig. 4, an embodiment of the present application further provides a gateway operating method, which is applied to a gateway having a single bluetooth module in a communication system, where the communication system further includes a plurality of wearable devices, and the gateway is capable of communicating with a background. The method comprises the following steps.
Step S210: and acquiring communication data issued by the background.
Step S220: and when a connection instruction which is issued by the background and is connected with the target wearable device is acquired and the broadcast data broadcasted by the target wearable device is scanned, the connection with the target wearable device is established and data interaction is carried out.
Optionally, after the obtaining of the communication data delivered by the background, the method further includes:
and if the instruction for establishing the connection with the target wearable device issued by the background is not acquired within the preset time, broadcasting the communication data to the wearable device.
Optionally, after the connection is established with the target wearable device and data interaction is performed, the method further includes:
and feeding back feedback information of the target wearable device or feedback result information of the target wearable device outside the connection range to the background.
Optionally, after the feedback information of the target wearable device or the result information fed back by the target wearable device being outside the connection range is fed back to the background, the method further includes:
and disconnecting the connection with the target wearable device.
Optionally, when the user wearing the wearable device arrives at a certain scene for the first time and the user needs to use the navigation function (for example, the user goes to an unfamiliar hospital for the first time), the user may further turn on the bluetooth function of the mobile terminal (for example, a mobile phone) after wearing the wearable device, so that the mobile terminal and the wearable device share the same wearable device ID. At this time, the broadcast data broadcast by the wearable device includes the location information. After the gateway scans the broadcast data of the wearable device, the gateway can generate scanning data and navigation data according to the scanned broadcast data. And subsequently, the gateway sends the scanning data to a background for the background to use, and sends the navigation data to a mobile terminal sharing the same wearing equipment ID with the wearing equipment, so that the mobile terminal can navigate for the user.
The implementation principle and the generated technical effect of the gateway operating method provided in the embodiment of the present application have similar or identical parts to those of the gateway control method embodiment, and for brief description, corresponding contents in the gateway control method embodiment may be referred to where the gateway operating method embodiment is not mentioned.
In addition, referring to fig. 5 corresponding to fig. 4, an embodiment of the present application further provides a gateway operating device 500, which is applied to a gateway having a single bluetooth module and capable of communicating with a background. The gateway work apparatus 500 includes an obtaining module 510 and a connecting module 520.
An obtaining module 510, configured to obtain communication data issued by a background;
the connection module 520 is configured to establish connection with the target wearable device and perform data interaction when the connection instruction issued by the background and used for establishing connection with the target wearable device is acquired and the broadcast data broadcasted by the target wearable device is scanned.
Optionally, the apparatus further includes a broadcasting module, configured to broadcast the communication data to the wearable device when the instruction for establishing a connection with the target wearable device issued by the background is not obtained within a predetermined time.
Optionally, the apparatus further includes a feedback module, configured to feed back feedback information of the target wearable device or result information fed back by the target wearable device being located outside the connection range to the background.
Optionally, the apparatus further includes a disconnection module configured to disconnect the target wearable device.
Optionally, the apparatus further includes a scanning module and a generating module.
The scanning module is used for scanning the broadcast data of the wearable device;
the generating module is used for generating scanning data and navigation data according to the scanned broadcast data;
and the sending module is further used for sending the scanning data to the background and sending the navigation data to a mobile terminal sharing the same wearing equipment ID with the wearing equipment.
The gateway operating device 500 provided in the embodiment of the present application has the same implementation principle and the same technical effects as those of the corresponding method embodiments described above, and for brevity, reference may be made to corresponding contents in the method embodiments described above where no part of the embodiment of the device is mentioned.
In addition, an embodiment of the present invention further provides a non-volatile computer-readable storage medium (hereinafter, referred to as a computer-readable storage medium), where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computer, the steps included in the gateway operating method or the control method for a single bluetooth module are executed.
In addition, referring to fig. 6, an electronic device 100 may be the background in the foregoing, and may also be the gateway in the foregoing.
When the electronic device 100 is a background (a data processing center, a server), the method for controlling a single bluetooth module according to the embodiment of the present application is implemented, and when the electronic device 100 is a gateway, the method for operating the gateway according to the embodiment of the present application is implemented.
Among them, the electronic device 100 may include: a processor 110, a memory 120.
It should be noted that the components and configuration of electronic device 100 shown in FIG. 6 are exemplary only, and not limiting, and that electronic device 100 may have other components and configurations as desired.
The processor 110, memory 120, and other components that may be present in the electronic device 100 are electrically connected to each other, directly or indirectly, to enable the transfer or interaction of data. For example, the processor 110, the memory 120, the display 130, and other components that may be present may be electrically connected to each other via one or more communication buses or signal lines.
The memory 120 is used for storing programs, such as programs corresponding to the methods (control method of single bluetooth module or gateway operation method) presented above or devices (control device of single bluetooth module or gateway operation device) presented above. Optionally, when the device is stored in the memory 120, the device includes at least one software functional module that can be stored in the memory 120 in the form of software or firmware (firmware).
Alternatively, the software function module included in the apparatus may also be solidified in an Operating System (OS) of the electronic device 100.
The processor 110 is used to execute executable modules stored in the memory 120, such as software functional modules or computer programs included in the apparatus. The computer program may be executed by the processor 110 upon receiving execution instructions.
Of course, the control method of a single bluetooth module or the gateway operation method disclosed in the embodiment of the present application may be applied to the processor 110, or may be implemented by the processor 110.
In summary, the gateway control method and apparatus, the gateway operating method and apparatus, and the electronic device provided in the embodiments of the present invention include: the method comprises the steps that a background acquires communication data to be issued to wearable equipment, when the communication data contain a target wearable equipment ID and the target wearable equipment is required to provide feedback information, a target gateway and the target wearable equipment are determined according to scanning data sent by each acquired gateway based on broadcasting data scanned to the wearable equipment and the target wearable equipment ID, and then a connection instruction for indicating the target gateway to be connected with the target wearable equipment is generated; and sending the communication data and the connection instruction to the target gateway so as to enable the target gateway to establish connection with the target wearable device and perform data interaction. After receiving the connection instruction, the target gateway may switch the original scanning mode to the connection mode, so as to initiate a connection request to the target wearable device, so as to establish a connection with the target wearable device. For the target gateway, the scanning function is realized firstly to scan the broadcast data broadcasted by the wearable device, and then the connection function is realized to establish connection with the target wearable device.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.