Star flash and Bluetooth integrated communication method, system and terminal
By opening the StarLight and Bluetooth service scanning interface on the Android device, the device is periodically scanned and information is displayed. The user can directly establish or disconnect the connection, which solves the problem of adding settings for Android devices to adapt to StarLight communication, and realizes StarLight Compatibility with Bluetooth communication reduces costs.
Patent Information
- Application Number
- CN202411098224.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-10-18
AI Technical Summary
Existing Android devices need to add additional settings to adapt to StarLight communications when using StarLight communications, resulting in increased equipment costs and labor costs. There is also a lack of methods to be compatible with the new generation of StarLight communications and traditional Bluetooth communications.
By opening the Star Flash service scanning interface and the Bluetooth service scanning interface, the devices within the preset range are periodically scanned to obtain device information and display it on the UI interface. The user can select the target device and establish or disconnect the connection to realize Star Flash Or connect via Bluetooth to re-perform periodic scanning.
Users can use the Star Flash function without increasing learning costs and additional settings, achieving compatibility of Star Flash and Bluetooth communications, and reducing equipment and labor costs.
Smart Images

Figure CN118803675A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication technology, and in particular to a communication method, system, terminal and computer-readable storage medium integrating StarFlash and Bluetooth. Background Art
[0002] Near Link is a new generation of short-range wireless connection technology. Terminal products support Near Link on some mobile phone models. Through the technical characteristics of Near Link such as low power consumption, low latency, high speed and high reliability, the experience of using Near Link devices is improved. Near Link aims to promote the innovation and industrial ecology of the new generation of wireless short-range communication technology. This technology can meet the technical requirements of low latency, high reliability, precise synchronization and multi-concurrency in multiple scenarios such as smart cars, industrial intelligent manufacturing, smart homes and personal wearables.
[0003] Bluetooth technology is an open global specification for wireless data and voice communications. It is a special short-range wireless technology connection based on low-cost short-range wireless connection to establish a communication environment for fixed and mobile devices. Bluetooth enables some current portable mobile devices and computer devices to connect to the Internet without cables and can access the Internet wirelessly.
[0004] At present, traditional Android devices use Bluetooth technology for wireless communication. For Android devices that need to use Star Flash communication, additional settings are usually required to adapt to Star Flash communication, which also increases the learning cost. It can be seen that there is currently a lack of a method that is compatible with the new generation of Star Flash communication and traditional Bluetooth communication.
[0005] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0006] The main purpose of the present invention is to provide a communication method, system, terminal and computer-readable storage medium that integrates StarFlash and Bluetooth, aiming to solve the problem in the prior art that when Android devices using Bluetooth technology use StarFlash communication, additional settings need to be added to adapt to StarFlash communication, which increases equipment costs and labor costs.
[0007] To achieve the above object, the present invention provides a communication method integrating star flash and Bluetooth, and the communication method integrating star flash and Bluetooth comprises the following steps:
[0008] Open the Starflash service scanning interface and the Bluetooth service scanning interface, and perform periodic scanning on multiple devices within a preset range through the Starflash service scanning interface and the Bluetooth service scanning interface. When a period of scanning is completed, the Starflash scanning result and the Bluetooth scanning result within a period are obtained;
[0009] Obtaining device information of the plurality of devices according to the starflash scanning result and the Bluetooth scanning result, adding the device information of the plurality of devices into a comprehensive storage list, and re-performing periodic scanning according to a period of periodic scanning;
[0010] Read all the devices in the comprehensive storage list, and display the device information of all the devices on the UI interface according to a preset sorting rule;
[0011] Obtain the target device and action instruction selected by the user on the UI interface. If the action instruction is to establish a connection, establish a StarFlash connection or a Bluetooth connection according to the device information of the target device, and perform periodic scanning again;
[0012] If the action instruction is to disconnect, the StarFlash connection or the Bluetooth connection is disconnected according to the device information of the target device, and periodic scanning is performed again.
[0013] Optionally, the communication method integrating Starflash and Bluetooth, wherein the re-performing periodic scanning according to the period of periodic scanning, further comprises:
[0014] Obtaining a first time T1 at which the Bluetooth scanning result is obtained and a second time T2 at which the star flash scanning result is obtained;
[0015] A maximum time is selected from the first time T1 and the second time T2, and the period T of the periodic scan is obtained according to the maximum time:
[0016] T = Max (T1, T2) × 2;
[0017] Among them, Max(·) is a function that returns the maximum value in a set of values.
[0018] Optionally, in the communication method integrating Starflash and Bluetooth, the device comprises a Starflash device and a Bluetooth device;
[0019] The device information includes device source, device MAC address, device signal strength, device connection status, device name, device type and device protocol;
[0020] When the device is a Star Flash device, the device protocol is the Star Flash protocol, and the Star Flash protocol includes supported Star Flash protocol types, supported Star Flash protocol versions, and supported Star Flash device types;
[0021] When the device is a Bluetooth device, the device protocol is a Bluetooth protocol, and the Bluetooth protocol includes supported Bluetooth protocol types, supported Bluetooth protocol versions, and supported Bluetooth device types.
[0022] Optionally, the communication method integrating Starflash and Bluetooth, wherein the reading of all the devices in the comprehensive storage list and displaying the device information of all the devices on the UI interface according to a preset sorting rule, specifically includes:
[0023] Read all the devices in the comprehensive storage list to obtain the device source, device signal strength, device connection status and device type of each device;
[0024] Obtain a first ranking score for each device according to the device connection state, obtain a second ranking score for each device according to the device signal strength, obtain a third ranking score for each device according to the device source, and obtain a fourth ranking score for each device according to the device type;
[0025] The first ranking score, the second ranking score, the third ranking score and the fourth ranking score of each device are added to obtain a final ranking score of each device, the final ranking score of each device is sorted from large to small to obtain ranking information of all the devices, and the device information of all the devices is displayed in sequence on the UI interface according to the ranking information.
[0026] Optionally, the communication method integrating Starflash and Bluetooth, wherein the step of obtaining the target device and action instruction selected by the user on the UI interface, further comprises:
[0027] Forces the ongoing periodic scan to terminate and prohibits all other devices from connecting or disconnecting.
[0028] Optionally, the communication method integrating Starflash and Bluetooth, wherein the step of establishing a Starflash connection or a Bluetooth connection according to the device information of the target device and re-performing periodic scanning specifically includes:
[0029] Obtain the device source of the target device, the device source including Bluetooth service and Starflash service;
[0030] If the device source is a Bluetooth service, the Bluetooth service interface is called through the MAC address and Bluetooth protocol type of the target device to communicate downward, and various types of connections are completed according to the Bluetooth protocol of the target device;
[0031] If the device source is the Star Flash service, the Star Flash service interface is called through the MAC address of the target device and the Star Flash protocol type for downward communication, and various types of connections are completed according to the Star Flash protocol of the target device;
[0032] When the connection is completed, the connection status of the target device in the comprehensive storage list is updated, the UI interface is updated, and the periodic scan is re-entered.
[0033] Optionally, the communication method integrating Starflash and Bluetooth, wherein disconnecting the Starflash connection or disconnecting the Bluetooth connection according to the device information of the target device and re-performing periodic scanning specifically includes:
[0034] Obtain the device source of the target device. If the device source is a Bluetooth service, call the Bluetooth service interface through the MAC address and Bluetooth protocol type of the target device to perform downward communication, and complete various types of disconnection according to the Bluetooth protocol of the target device;
[0035] If the device source is the Star Flash service, the Star Flash service interface is called through the MAC address of the target device and the Star Flash protocol type to communicate downward, and various types of disconnection are completed according to the Star Flash protocol of the target device;
[0036] When the disconnection is completed, the connection status of the target device in the comprehensive storage list is updated, the UI interface is updated, and the periodic scan is re-entered.
[0037] In addition, to achieve the above-mentioned purpose, the present invention also provides a communication system integrating Star Flash and Bluetooth, wherein the communication system integrating Star Flash and Bluetooth comprises:
[0038] The device scanning module is used to open the Starflash service scanning interface and the Bluetooth service scanning interface, and periodically scan multiple devices within a preset range through the Starflash service scanning interface and the Bluetooth service scanning interface. When a cycle scan is completed, the Starflash scanning result and the Bluetooth scanning result within a cycle are obtained;
[0039] An information storage module, used for obtaining device information of the plurality of devices according to the star flash scanning result and the Bluetooth scanning result, adding the device information of the plurality of devices to a comprehensive storage list, and re-performing periodic scanning according to a period of periodic scanning;
[0040] An information display module, used to read all the devices in the comprehensive storage list and display the device information of all the devices on the UI interface according to a preset sorting rule;
[0041] The communication connection module is used to obtain the target device and action instruction selected by the user on the UI interface. If the action instruction is to establish a connection, a StarFlash connection or a Bluetooth connection is established according to the device information of the target device, and a periodic scan is performed again;
[0042] The communication disconnection module is used to disconnect the StarFlash connection or the Bluetooth connection according to the device information of the target device if the action instruction is to disconnect, and re-perform periodic scanning.
[0043] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a communication program for integrating Star Flash and Bluetooth stored in the memory and runnable on the processor, wherein the communication program for integrating Star Flash and Bluetooth, when executed by the processor, implements the steps of the communication method for integrating Star Flash and Bluetooth as described above.
[0044] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a communication program for integrating Star Flash and Bluetooth, and when the communication program for integrating Star Flash and Bluetooth is executed by a processor, the steps of the communication method for integrating Star Flash and Bluetooth as described above are implemented.
[0045] In the present invention, the Starflash service scanning interface and the Bluetooth service scanning interface are turned on, and multiple devices within a preset range are periodically scanned through the Starflash service scanning interface and the Bluetooth service scanning interface. After a periodic scan is completed, the Starflash scanning result and the Bluetooth scanning result within a period are obtained; the device information of multiple devices is obtained according to the Starflash scanning result and the Bluetooth scanning result, and the device information of multiple devices is added to the comprehensive storage list, and the periodic scan is re-performed according to the period of the periodic scan; all devices in the comprehensive storage list are read, and the device information of all devices is displayed on the UI interface according to the preset sorting rules; the target device and the action instruction selected by the user on the UI interface are obtained, and if the action instruction is to establish a connection, the Starflash connection or the Bluetooth connection is established according to the device information of the target device, and the periodic scan is re-performed; if the action instruction is to disconnect, the Starflash connection or the Bluetooth connection is disconnected according to the device information of the target device, and the periodic scan is re-performed. The present invention is compatible with Starflash communication and Bluetooth communication, and the user can directly use the Starflash function without increasing the learning cost and additional settings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a system architecture diagram of a preferred embodiment of the communication method integrating Star Flash and Bluetooth of the present invention;
[0047] Figure 2 It is a flow chart of the communication method integrating Star Flash and Bluetooth of the present invention;
[0048] Figure 3 It is a flow chart of periodic scanning in the communication method integrating Star Flash and Bluetooth of the present invention;
[0049] Figure 4 It is a flow chart of sorting devices in the communication method integrating Star Flash and Bluetooth of the present invention;
[0050] Figure 5 It is a flow chart of a preferred embodiment of the communication method integrating Star Flash and Bluetooth of the present invention;
[0051] Figure 6 It is a schematic diagram of a preferred embodiment of the communication system integrating Star Flash and Bluetooth of the present invention;
[0052] Figure 7 FIG. 4 is a diagram of an operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0053] The present application provides a communication method and related equipment integrating Star Flash and Bluetooth. In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
[0054] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0055] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0056] like Figure 1As shown, it can be understood that the existing Android architecture is hardware layer, Kernel layer, Native layer, Framework layer and App (Application) layer from bottom to top, and the present invention adds a Star Flash service to the Framework layer of the existing Android architecture, which mainly implements the functional interface of Star Flash's scanning, connection, and information reception and transmission. The upper-level integrated application is compatible with both Bluetooth service and Star Flash service interfaces, and communicates with the underlying Star Flash protocol stack through the intermediate interface of the Native layer; the Star Flash protocol stack performs protocol layer analysis and sends data to the Star Flash hardware through the Star Flash driver. The communication method of integrating Star Flash and Bluetooth in this application can be realized by adding the Star Flash service to the Android architecture mentioned above.
[0057] The communication method integrating star flash and Bluetooth of the present invention is as follows: Figure 2 As shown, the communication method integrating Star Flash and Bluetooth includes the following steps:
[0058] Step S10: Open the Starflash service scanning interface and the Bluetooth service scanning interface, and scan the devices within the preset range through the Starflash service scanning interface and the Bluetooth service scanning interface to obtain the Starflash scanning result and the Bluetooth scanning result.
[0059] Specifically, when scanning is required, the comprehensive scanning process is executed, and the Starflash service scanning interface and the Bluetooth service scanning interface are opened in turn. Multiple devices within the preset range (wireless devices identified by the scanning interface) are periodically scanned through the Starflash service scanning interface and the Bluetooth service scanning interface, and the scanning result broadcast is monitored. When a cycle scan is completed, the Starflash scanning result and the Bluetooth scanning result within a cycle are obtained. At the same time, it is determined whether the user has performed a connection or disconnection operation. If a connection or disconnection operation is performed, it is determined whether the scan is completed. If the scan is not completed, the scanning process is terminated. If the scan is completed, it enters the connection or disconnection action stage, and waits for the connection or disconnection action to be completed before updating the comprehensive storage list.
[0060] Step S20, obtaining device information of the device according to the star flash scanning result and the Bluetooth scanning result, adding the device information to a comprehensive storage list, re-scanning at a preset time, and updating the device information in the comprehensive storage list.
[0061] Specifically, according to the Starflash scanning results and the Bluetooth scanning results, multiple devices to be communicated and the device information of the devices can be discovered, among which the devices include Starflash devices and Bluetooth devices; the device information includes device source, device MAC address, device signal strength, device connection status, device name, device type and device protocol; when the device is a Starflash device, the device protocol is the Starflash protocol, and the Starflash protocol includes supported Starflash protocol types, supported Starflash protocol versions and supported Starflash device types; when the device is a Bluetooth device, the device protocol is the Bluetooth protocol, and the Bluetooth protocol includes supported Bluetooth protocol types, supported Bluetooth protocol versions and supported Bluetooth device types.
[0062] Furthermore, the scanning is performed again at a preset time interval, and the process also includes:
[0063] Obtaining a first time T1 at which the Bluetooth scanning result is obtained and a second time T2 at which the star flash scanning result is obtained;
[0064] A maximum time is selected from the first time T1 and the second time T2, and the preset time T is obtained according to the maximum time:
[0065] T = Max (T1, T2) × 2;
[0066] Among them, Max(·) is a function that returns the maximum value in a set of values.
[0067] In this embodiment, after adding the device information of multiple devices to the comprehensive storage list, the first time T1 of obtaining the Bluetooth scan result and the second time T2 of obtaining the star flash scan result are obtained, and the period of the periodic scan is calculated according to the time of obtaining the scan result, such as Figure 3 As shown, after triggering Bluetooth scanning and star flash scanning, when any scan is completed, the scanning result is stored in the comprehensive storage list, and the execution time of the scan is calculated. If the scan is a Bluetooth scan, the first time T1 is obtained, and if the scan is a star flash scan, the second time T2 is obtained. If only one scan is completed, it is necessary to wait for the other scan to be completed. Only when all scans are completed, the first time T1 and the second time T2 are obtained. The maximum time is selected from the first time T1 and the second time T2, and then the maximum time is multiplied by 2 to obtain the period of the periodic scan, and the period of the periodic scan is used as the preset time T for intermittent scanning, which helps to improve user experience.
[0068] Step S30: Display the device information in the comprehensive storage list on the UI interface according to a preset sorting rule.
[0069] Specifically, all devices in the comprehensive storage list are read to obtain the device source, device signal strength, device connection status and device type of each device.
[0070] like Figure 4 As shown, the preset sorting rules for Bluetooth and Star Flash devices are: a first sorting score for each device is obtained according to the device connection status, a second sorting score for each device is obtained according to the device signal strength, a third sorting score for each device is obtained according to the device source, and a fourth sorting score for each device is obtained according to the device type;
[0071] Among them, the first ranking score R1 of each device is obtained according to the device connection status. The device connection status includes connecting, established connection, saved (connection has been established) and other (not connected). When the device connection status is connecting, the value of R1 is 3000; when the device connection status is established connection, the value of R1 is 2000; when the device connection status is saved, the value of R1 is 1000; when the device connection status is other, the value of R1 is 0.
[0072] The second ranking score R2 of each device is obtained according to the device signal strength. The calculation formula of the second ranking score R2 is: R2=1000-X*100;
[0073] in, S represents the signal strength of the device. Indicates rounding down.
[0074] The third ranking score R3 of each device is obtained according to the device source, where the device source includes 0 and 1, where 0 indicates that the device is from the Bluetooth service and 1 indicates that the device is from the Star Flash service. R3 is set, when the device source is 0, R3=0, when the device source is 1, R3=10.
[0075] The fourth ranking score R4 of each device is obtained according to the device type, and the device type includes: speaker device, HID control device and other devices; when the device type is a speaker device, R4=2; when the device type is a HID control device, R4=1; when the device type is other devices, R4=0.
[0076] Furthermore, the first ranking score, the second ranking score, the third ranking score and the fourth ranking score of each device are added together to obtain the final ranking score R of each device, R=R1+R2+R3+R4, and the final ranking score of each device is sorted from large to small to obtain the ranking information of all devices.
[0077] Finally, the device information of all devices is displayed in sequence on a UI (User Interface) according to the sorting information obtained according to the sorting rule for selection, so that the sorting rule helps the user to efficiently search and select connections.
[0078] For example, enter the Bluetooth Star Flash integrated application interface, start the scanning process, trigger the scanning actions of the Bluetooth service and the Star Flash service in turn, wait for the scanning results, and store the results in the comprehensive storage list. Assume that the devices in the final comprehensive storage list are: A (Star Flash, signal strength -45db, not connected), B (Bluetooth, signal strength -42db, not connected), C (Star Flash, signal strength -50db, connected), then according to the sorting requirements 4, 1), C is at the front, 4, 2) BC is consistent, 4, 3) A device is in front, so the final sorting result is CAB. Display each device in the UI in order.
[0079] Step S40: Obtain the target device and action instruction selected by the user on the UI interface. If the action instruction is to establish a connection, establish a StarFlash connection or a Bluetooth connection according to the device information of the target device.
[0080] The step of obtaining the target device and the action instruction selected by the user on the UI interface further includes:
[0081] Forces the ongoing periodic scan to terminate and prohibits all other devices from connecting or disconnecting.
[0082] It is understandable that when entering the connection phase or the disconnection phase, the ongoing scanning phase action is forcibly terminated, the connection or disconnection actions of all other devices are prohibited, and the connection action is executed.
[0083] Further, establishing a StarFlash connection or a Bluetooth connection according to the device information of the target device, and re-performing periodic scanning, specifically includes:
[0084] Obtain the device source of the target device, the device source including Bluetooth service and Starflash service;
[0085] If the device source is a Bluetooth service, the Bluetooth service interface is called through the MAC address and Bluetooth protocol type of the target device to communicate downward, and various types of connections are completed according to the Bluetooth protocol of the target device;
[0086] If the device source is the Star Flash service, the Star Flash service interface is called through the MAC address of the target device and the Star Flash protocol type for downward communication, and various types of connections are completed according to the Star Flash protocol of the target device;
[0087] When the connection is completed, update the connection status of the target device in the comprehensive storage list, update the UI interface, and re-enter the periodic scan
[0088] It is understandable that when executing the connection action, the source item in the device information is first determined. If the source is a Star Flash device, the Star Flash service interface is called to connect through the MAC address, Star Flash protocol type and other information; if the source is Bluetooth, the service interface is called to connect through the MAC address, Bluetooth protocol type and other information. After calling the service interface, the service will communicate downward and connect through their respective protocol stacks (such as Figure 1 ) Complete various types of connection negotiation interaction actions.
[0089] When the connection is completed, the bottom layer will call back the broadcast to inform the upper layer. At this time, the status information of the device information of the corresponding device in the comprehensive storage list will be updated. At the same time, the UI interface will be updated and the connection phase will be left, and the periodic scan will be re-entered.
[0090] Step S50: If the action instruction is to disconnect, disconnect the StarFlash connection or the Bluetooth connection according to the device information of the target device.
[0091] Specifically, if the action instruction is to disconnect, the device source of the target device is obtained; if the device source is a Bluetooth service, a Bluetooth service interface is called through the MAC address and Bluetooth protocol type of the target device to perform downward communication, and various types of disconnection are completed according to the Bluetooth protocol of the target device;
[0092] If the device source is the Star Flash service, the Star Flash service interface is called through the MAC address of the target device and the Star Flash protocol type to communicate downward, and various types of disconnection are completed according to the Star Flash protocol of the target device;
[0093] When the disconnection is completed, the connection status of the target device in the comprehensive storage list is updated, the UI interface is updated, and the periodic scan is re-entered.
[0094] In this embodiment, when executing the disconnection action, the source item in the device information is first determined. If the source is a Starflash device, the Starflash service interface is called to disconnect through the MAC address, Starflash protocol type and other information; if the source is Bluetooth, the service interface is called to disconnect through the MAC address, Bluetooth protocol type and other information. After calling the service interface, the service will communicate downward and connect through their respective protocol stacks (such as Figure 1 ) Complete various types of disconnect negotiation interactions.
[0095] When the disconnection is completed, the bottom layer will call back the broadcast to inform the upper layer. At this time, the status information of the device information of the corresponding device in the comprehensive storage list is updated, and the UI interface is updated at the same time, and the disconnection phase is left, and the periodic scan is re-entered.
[0096] Furthermore, the present invention is compatible with both StarFlash and Bluetooth data transmission, and there are two main forms of data transmission: standard data transmission and protocol data transmission.
[0097] Standard data transmission is based on the Linux standard protocol framework, such as control devices based on the HID protocol, and sound devices based on the ALSA audio architecture. Such protocol data is natively controlled by Linux and does not require other user operations. For example, when a StarFlash or Bluetooth mouse is connected, the corresponding protocol stack will generate a virtual HID control device, which will then be automatically recognized and taken over by the Linux Input subsystem, thereby achieving the function of simultaneous control of Bluetooth and StarFlash.
[0098] Protocol data transmission is based on the sub-protocols of Bluetooth and StarFlash protocols for data exchange and transmission. At this time, the user or application must first select a device to transmit data from the comprehensive storage list, and determine whether it supports the required sub-protocol based on the device information. If it supports calling the sub-protocol connection interface corresponding to the StarFlash and Bluetooth services to establish a sub-protocol connection, a data channel will be created and returned after the connection is completed, and the user or application can directly use this channel for data transmission and communication.
[0099] Furthermore, the communication method integrating Starflash and Bluetooth described in the preferred embodiment of the present invention is as follows: Figure 6 As shown, the communication method integrating Star Flash and Bluetooth includes the following steps:
[0100] S101. Start: A user turns on a smart phone.
[0101] S102, entering the Bluetooth Star Flash integrated application interface of the smart phone: the user opens the Bluetooth Star Flash integrated application APP in the smart phone and enters the Bluetooth Star Flash integrated application interface.
[0102] S103. The smartphone turns on the Starflash service scanning interface and the Bluetooth service scanning interface to scan the devices within the preset range. The smartphone scans the Starflash devices and Bluetooth devices within the preset range, triggers the scanning interfaces of the Starflash and Bluetooth services in turn, and listens to the broadcast of the scanning results.
[0103] S104. Whether the scanning results of the Bluetooth service and the Starflash service are obtained within the preset time: If the scanning results of the two services are obtained, it is regarded as a scanning cycle is completed, and the process goes to S105; if the scanning results of the two services are not obtained within the preset time, the step S103 is executed again.
[0104] S105. Scanning for an audio device and a television device: For example, two devices are scanned through the Bluetooth service and the Star Flash service of the smartphone, namely, an audio device and a television device.
[0105] S106. Add the scanning results of the audio device and the television device to the comprehensive storage list: the scanning results include the device information of the audio device and the television device, and the device information includes the device source, device MAC address, device signal strength, device connection status, device name, device type and device protocol.
[0106] S107. Display the audio equipment and TV equipment information in the comprehensive storage list on the UI interface of the smartphone according to the sorting rules: For example, the acquired device information is: audio equipment (Bluetooth, signal strength -42db, not connected), TV equipment (Star Flash, signal strength -50db, connected). According to the sorting rules, the sorting result is that the TV equipment is ranked before the audio equipment. According to the sorting result, the audio equipment and TV equipment information are displayed on the UI interface of the smartphone.
[0107] S108. Whether the UI interface receives an action instruction within a preset time: The content displayed on the UI interface will not change within a preset time. If an action instruction is received within this time, execute step S110; if no action instruction is received, execute step S109.
[0108] S109, re-scanning and updating the device information in the comprehensive storage list: when an action instruction is received for a long time, re-scanning the device and updating the comprehensive storage list according to the scanned device information.
[0109] S110, connecting and disconnecting the audio device and the television device according to the action instruction: selecting the connection and disconnection operation of the audio device and the television device to perform the Bluetooth service or the Star Flash service according to the action instruction issued by the user.
[0110] S111, end.
[0111] It can be seen that the communication method integrating Starflash and Bluetooth provided by the present invention is compatible with the new generation of Starflash communication and traditional Bluetooth communication, so that users can directly use the new generation of Starflash functions without increasing learning costs and additional settings.
[0112] Furthermore, if Figure 6 As shown, based on the above-mentioned communication method integrating star flash and Bluetooth, the present invention also provides a communication system integrating star flash and Bluetooth, wherein the communication system integrating star flash and Bluetooth includes:
[0113] The device scanning module 51 is used to open the Starflash service scanning interface and the Bluetooth service scanning interface, and scan the devices within the preset range through the Starflash service scanning interface and the Bluetooth service scanning interface to obtain the Starflash scanning result and the Bluetooth scanning result;
[0114] The information storage module 52 is used to open the Starflash service scanning interface and the Bluetooth service scanning interface, and scan the devices within the preset range through the Starflash service scanning interface and the Bluetooth service scanning interface to obtain the Starflash scanning result and the Bluetooth scanning result;
[0115] An information display module 53, used to display the device information in the comprehensive storage list on a UI interface according to a preset sorting rule;
[0116] The communication connection module 54 is used to obtain the target device and action instruction selected by the user on the UI interface, and if the action instruction is to establish a connection, establish a StarFlash connection or a Bluetooth connection according to the device information of the target device;
[0117] The communication disconnection module 55 is used to disconnect the StarFlash connection or the Bluetooth connection according to the device information of the target device if the action instruction is to disconnect.
[0118] Furthermore, if Figure 7 As shown, based on the above-mentioned communication method and system integrating StarFlash and Bluetooth, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Figure 7 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0119] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Furthermore, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a communication program 40 integrating Star Flash and Bluetooth is stored on the memory 20, and the communication program 40 integrating Star Flash and Bluetooth can be executed by the processor 10, thereby realizing the communication method integrating Star Flash and Bluetooth in the present application.
[0120] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the communication method of integrating Star Flash and Bluetooth.
[0121] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0122] In one embodiment, when the processor 10 executes the communication program 40 integrating Starflash and Bluetooth in the memory 20, the following steps are implemented:
[0123] Open the Starflash service scanning interface and the Bluetooth service scanning interface, and scan the devices within the preset range through the Starflash service scanning interface and the Bluetooth service scanning interface to obtain the Starflash scanning result and the Bluetooth scanning result;
[0124] Obtain device information of the device according to the star flash scanning result and the Bluetooth scanning result, add the device information to a comprehensive storage list, re-scan at a preset time interval, and update the device information in the comprehensive storage list;
[0125] Displaying the device information in the comprehensive storage list on the UI interface according to a preset sorting rule;
[0126] Obtain the target device and action instruction selected by the user on the UI interface. If the action instruction is to establish a connection, establish a StarFlash connection or a Bluetooth connection according to the device information of the target device. If the action instruction is to disconnect, disconnect the StarFlash connection or the Bluetooth connection according to the device information of the target device.
[0127] The scanning is performed again at a preset time interval, and the method also includes:
[0128] Obtaining a first time T1 at which the Bluetooth scanning result is obtained and a second time T2 at which the star flash scanning result is obtained;
[0129] A maximum time is selected from the first time T1 and the second time T2, and the preset time T is obtained according to the maximum time:
[0130] T = Max (T1, T2) × 2;
[0131] Among them, Max(·) is a function that returns the maximum value in a set of values.
[0132] Wherein, the devices include Star Flash devices and Bluetooth devices;
[0133] The device information includes device source, device MAC address, device signal strength, device connection status, device name, device type and device protocol;
[0134] When the device is a Star Flash device, the device protocol is the Star Flash protocol, and the Star Flash protocol includes supported Star Flash protocol types, supported Star Flash protocol versions, and supported Star Flash device types;
[0135] When the device is a Bluetooth device, the device protocol is a Bluetooth protocol, and the Bluetooth protocol includes supported Bluetooth protocol types, supported Bluetooth protocol versions, and supported Bluetooth device types.
[0136] The step of displaying the device information in the comprehensive storage list on the UI interface according to a preset sorting rule specifically includes:
[0137] Read all the devices in the comprehensive storage list to obtain the device source, device signal strength, device connection status and device type of each device;
[0138] Obtain a first ranking score for each device according to the device connection state, obtain a second ranking score for each device according to the device signal strength, obtain a third ranking score for each device according to the device source, and obtain a fourth ranking score for each device according to the device type;
[0139] The first ranking score, the second ranking score, the third ranking score and the fourth ranking score of each device are added to obtain a final ranking score of each device, the final ranking score of each device is sorted from large to small to obtain ranking information of all the devices, and the device information of all the devices is displayed in sequence on the UI interface according to the ranking information.
[0140] The step of obtaining the target device and the action instruction selected by the user on the UI interface further includes:
[0141] Forces the ongoing periodic scan to terminate and prohibits all other devices from connecting or disconnecting.
[0142] The step of establishing a StarFlash connection or a Bluetooth connection according to the device information of the target device specifically includes:
[0143] Obtain the device source of the target device, the device source including Bluetooth service and Starflash service;
[0144] If the device source is a Bluetooth service, the Bluetooth service interface is called through the MAC address and Bluetooth protocol type of the target device to communicate downward, and various types of connections are completed according to the Bluetooth protocol of the target device;
[0145] If the device source is the Star Flash service, the Star Flash service interface is called through the MAC address of the target device and the Star Flash protocol type for downward communication, and various types of connections are completed according to the Star Flash protocol of the target device;
[0146] When the connection is completed, the connection status of the target device in the comprehensive storage list is updated, the UI interface is updated, and the periodic scan is re-entered.
[0147] Wherein, disconnecting the StarFlash connection or disconnecting the Bluetooth connection according to the device information of the target device specifically includes:
[0148] Obtain the device source of the target device. If the device source is a Bluetooth service, call the Bluetooth service interface through the MAC address and Bluetooth protocol type of the target device to perform downward communication, and complete various types of disconnection according to the Bluetooth protocol of the target device;
[0149] If the device source is the Star Flash service, the Star Flash service interface is called through the MAC address of the target device and the Star Flash protocol type to communicate downward, and various types of disconnection are completed according to the Star Flash protocol of the target device;
[0150] When the disconnection is completed, the connection status of the target device in the comprehensive storage list is updated, the UI interface is updated, and the periodic scan is re-entered.
[0151] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a communication program for integrating Star Flash and Bluetooth, and when the communication program for integrating Star Flash and Bluetooth is executed by a processor, the steps of the communication method for integrating Star Flash and Bluetooth as described above are implemented.
[0152] In summary, the present invention discloses a communication method, system and terminal integrating Starflash and Bluetooth, the method comprising: opening the Starflash service scanning interface and the Bluetooth service scanning interface, performing periodic scanning on multiple devices within a preset range through the Starflash service scanning interface and the Bluetooth service scanning interface, and obtaining the Starflash scanning result and the Bluetooth scanning result within a period after a period of scanning; obtaining the device information of multiple devices according to the Starflash scanning result and the Bluetooth scanning result, adding the device information of multiple devices to a comprehensive storage list, and re-performing periodic scanning according to the period of periodic scanning; reading all devices in the comprehensive storage list, and displaying the device information of all devices on the UI interface according to a preset sorting rule; obtaining the target device and action instruction selected by the user on the UI interface, if the action instruction is to establish a connection, then establishing a Starflash connection or a Bluetooth connection according to the device information of the target device, and re-performing periodic scanning; if the action instruction is to disconnect, then disconnecting the Starflash connection or disconnecting the Bluetooth connection according to the device information of the target device, and re-performing periodic scanning. The present invention is compatible with Starflash communication and Bluetooth communication, and users can directly use the Starflash function without increasing learning costs and additional settings.
[0153] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.
[0154] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0155] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A communication method integrating Starflash and Bluetooth, characterized in that: The communication method integrating Star Flash and Bluetooth includes: Open the Starflash service scanning interface and the Bluetooth service scanning interface, and scan the devices within the preset range through the Starflash service scanning interface and the Bluetooth service scanning interface to obtain the Starflash scanning result and the Bluetooth scanning result; Obtain device information of the device according to the star flash scanning result and the Bluetooth scanning result, add the device information to a comprehensive storage list, re-scan at a preset time interval, and update the device information in the comprehensive storage list; Displaying the device information in the comprehensive storage list on the UI interface according to a preset sorting rule; Obtain the target device and action instruction selected by the user on the UI interface. If the action instruction is to establish a connection, establish a StarFlash connection or a Bluetooth connection according to the device information of the target device. If the action instruction is to disconnect, disconnect the StarFlash connection or the Bluetooth connection according to the device information of the target device.
2. The communication method integrating Star Flash and Bluetooth according to claim 1, characterized in that: The re-scanning is performed at a preset time interval, and the process also includes: Obtaining a first time T1 at which the Bluetooth scanning result is obtained and a second time T2 at which the star flash scanning result is obtained; A maximum time is selected from the first time T1 and the second time T2, and the preset time T is obtained according to the maximum time: T = Max (T1, T2) × 2; Among them, Max(·) is a function that returns the maximum value in a set of values.
3. The communication method integrating Starflash and Bluetooth according to claim 1, characterized in that: The devices include Star Flash devices and Bluetooth devices; The device information includes device source, device MAC address, device signal strength, device connection status, device name, device type and device protocol; When the device is a Star Flash device, the device protocol is the Star Flash protocol, and the Star Flash protocol includes supported Star Flash protocol types, supported Star Flash protocol versions, and supported Star Flash device types; When the device is a Bluetooth device, the device protocol is a Bluetooth protocol, and the Bluetooth protocol includes supported Bluetooth protocol types, supported Bluetooth protocol versions, and supported Bluetooth device types.
4. The communication method integrating Starflash and Bluetooth according to claim 3, characterized in that: The displaying the device information in the comprehensive storage list on the UI interface according to the preset sorting rule specifically includes: Read all the devices in the comprehensive storage list to obtain the device source, device signal strength, device connection status and device type of each device; Obtain a first ranking score for each device according to the device connection state, obtain a second ranking score for each device according to the device signal strength, obtain a third ranking score for each device according to the device source, and obtain a fourth ranking score for each device according to the device type; The first ranking score, the second ranking score, the third ranking score and the fourth ranking score of each device are added to obtain a final ranking score of each device, the final ranking score of each device is sorted from large to small to obtain ranking information of all the devices, and the device information of all the devices is displayed in sequence on the UI interface according to the ranking information.
5. The communication method integrating Star Flash and Bluetooth according to claim 1, characterized in that: The step of obtaining the target device and the action instruction selected by the user on the UI interface further includes: Forces the ongoing periodic scan to terminate and prohibits all other devices from connecting or disconnecting.
6. The communication method integrating Star Flash and Bluetooth according to claim 3, characterized in that: The establishing of a StarFlash connection or a Bluetooth connection according to the device information of the target device specifically includes: Obtain the device source of the target device, the device source including Bluetooth service and Starflash service; If the device source is a Bluetooth service, the Bluetooth service interface is called through the MAC address and Bluetooth protocol type of the target device to communicate downward, and various types of connections are completed according to the Bluetooth protocol of the target device; If the device source is the Star Flash service, the Star Flash service interface is called through the MAC address of the target device and the Star Flash protocol type for downward communication, and various types of connections are completed according to the Star Flash protocol of the target device; When the connection is completed, the connection status of the target device in the comprehensive storage list is updated, the UI interface is updated, and the periodic scan is re-entered.
7. The communication method integrating Starflash and Bluetooth according to claim 3, characterized in that: Disconnecting the StarFlash connection or the Bluetooth connection according to the device information of the target device specifically includes: Obtain the device source of the target device. If the device source is a Bluetooth service, call the Bluetooth service interface through the MAC address and Bluetooth protocol type of the target device to perform downward communication, and complete various types of disconnection according to the Bluetooth protocol of the target device; If the device source is the Star Flash service, the Star Flash service interface is called through the MAC address of the target device and the Star Flash protocol type to communicate downward, and various types of disconnection are completed according to the Star Flash protocol of the target device; When the disconnection is completed, the connection status of the target device in the comprehensive storage list is updated, the UI interface is updated, and the periodic scan is re-entered.
8. A communication system integrating Starflash and Bluetooth, characterized in that: The communication system integrating Star Flash and Bluetooth includes: The device scanning module is used to open the Starflash service scanning interface and the Bluetooth service scanning interface, and scan the devices within the preset range through the Starflash service scanning interface and the Bluetooth service scanning interface to obtain the Starflash scanning result and the Bluetooth scanning result; An information storage module, used for obtaining device information of the device according to the star flash scanning result and the Bluetooth scanning result, adding the device information to a comprehensive storage list, re-scanning at a preset time, and updating the device information in the comprehensive storage list; An information display module, used to display the device information in the comprehensive storage list on the UI interface according to a preset sorting rule; The communication connection module is used to obtain the target device and action instruction selected by the user on the UI interface. If the action instruction is to establish a connection, a StarFlash connection or a Bluetooth connection is established according to the device information of the target device. The communication disconnection module is used to disconnect the StarFlash connection or the Bluetooth connection according to the device information of the target device if the action instruction is to disconnect.
9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a communication program for integrating Star Flash and Bluetooth stored in the memory and executable on the processor. When the communication program for integrating Star Flash and Bluetooth is executed by the processor, the steps of the communication method for integrating Star Flash and Bluetooth as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a communication program for integrating Star Flash and Bluetooth. When the communication program for integrating Star Flash and Bluetooth is executed by a processor, the steps of the communication method for integrating Star Flash and Bluetooth as described in any one of claims 1-7 are implemented.
Citation Information
Cited By
Star flash and Bluetooth automatic identification switching connection method, device, equipment and medium
CN120076075A
Star flash-based image refreshing method, electronic equipment and star flash-based image refreshing system
CN120568514A
Intelligent terminal non-inductive connection method and system supporting multi-device priority decision
CN121262672A
Intelligent terminal non-inductive connection method and system supporting multi-device priority decision-making
CN121262672B
