CN109874136B - Bluetooth memory sharing method and device, storage medium and electronic equipment - Google Patents

Bluetooth memory sharing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN109874136B
CN109874136B CN201910218641.7A CN201910218641A CN109874136B CN 109874136 B CN109874136 B CN 109874136B CN 201910218641 A CN201910218641 A CN 201910218641A CN 109874136 B CN109874136 B CN 109874136B
Authority
CN
China
Prior art keywords
time
bluetooth
module
receiving
time slot
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910218641.7A
Other languages
Chinese (zh)
Other versions
CN109874136A (en
Inventor
俞斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Leplay Technology Co.,Ltd.
Original Assignee
Huizhou TCL Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN201910218641.7A priority Critical patent/CN109874136B/en
Publication of CN109874136A publication Critical patent/CN109874136A/en
Application granted granted Critical
Publication of CN109874136B publication Critical patent/CN109874136B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application provides a method, a device, a storage medium and electronic equipment for sharing a memory by Bluetooth, which are applied to a Bluetooth device, wherein the Bluetooth device comprises a transceiver module, a connecting switch and a Bluetooth data memory, the connecting switch is used for connecting the Bluetooth data memory with the transceiver module, and the method for sharing the memory by Bluetooth determines a corresponding preset time according to the response time of data transceiving by determining a sending time slot or a receiving time slot of Bluetooth when the successful connection of Bluetooth is detected; a connecting switch is controlled to be connected with the transceiver module in advance by presetting time before the sending time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the transceiver module; and data are received and transmitted through the Bluetooth data memory. Therefore, the transceiver module and the Bluetooth data memory are connected through the connecting switch before the sending time slot or the receiving time slot arrives, the waiting time of connecting the Bluetooth data memory when the Bluetooth receives or sends data is saved, and the data transmission efficiency is improved.

Description

Bluetooth memory sharing method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for sharing a memory by bluetooth, a storage medium, and an electronic device.
Background
Along with the development of communication technology, all can be provided with the bluetooth on the mobile terminal at present, generally adopted the bluetooth chip on the mobile terminal at present, made mobile terminal support the bluetooth function to carry out wireless connection with other equipment that have the bluetooth such as car, wrist-watch, earphone.
At present, data transmission such as pictures and files through bluetooth connection is a common data transmission mode between devices, but in the data transmission process, because the bluetooth speed is relatively low, in order to reduce the resource utilization rate, data received and sent by bluetooth is distributed in a bluetooth memory, when the bluetooth receives or sends the data, a bluetooth receiving module or a bluetooth sending module is connected with the memory to transmit the data, but each bluetooth data transmission needs to be connected with the bluetooth memory for multiple times, so that time delay is easily caused, and the transmission efficiency of bluetooth is affected.
Disclosure of Invention
The embodiment of the application provides a method and a device for sharing a memory by Bluetooth, a storage medium and an electronic device, which can connect a Bluetooth transceiver module with a Bluetooth data memory in advance, reduce data transmission time and improve Bluetooth data transmission efficiency.
In a first aspect, an embodiment of the present application provides a method for sharing a memory by bluetooth, where the method is applied to a bluetooth device, the device includes a transceiver module, a connection switch and a bluetooth data memory, the connection switch is used to connect the bluetooth data memory with the transceiver module, and the method for sharing a memory by bluetooth includes:
when detecting that the Bluetooth connection is successful, determining a sending time slot or a receiving time slot of the Bluetooth;
determining corresponding preset time according to the data receiving and sending reaction time;
a connecting switch is controlled to be connected with the transceiver module in advance by presetting time before the sending time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the transceiver module;
and data are received and transmitted through the Bluetooth data memory.
In a second aspect, an embodiment of the present application provides a bluetooth memory sharing apparatus, which is applied to a bluetooth apparatus, where the bluetooth apparatus includes a transceiver module, a connection switch and a bluetooth data memory, the connection switch is used to connect the bluetooth data memory with the transceiver module, and the bluetooth memory sharing apparatus includes:
the detection module is used for determining the sending time slot or the receiving time slot of the Bluetooth when the Bluetooth connection is detected to be successful;
the determining module is used for determining corresponding preset time according to the data receiving and transmitting reaction time;
the connection module is used for controlling the connection switch to be connected with the transceiver module in advance by presetting time before the sending time slot or the receiving time slot arrives so as to connect the Bluetooth data memory with the transceiver module;
and the data module is used for receiving and transmitting data through the Bluetooth data memory.
In a third aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a bluetooth memory sharing method as provided in any of the embodiments of the present application.
In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor and a storage, where the storage has a computer program, and when the processor calls the computer program, the method for bluetooth memory sharing provided in any embodiment of the present application is implemented.
The embodiment of the application provides a method for sharing a memory by Bluetooth, which is applied to a Bluetooth device, wherein the device comprises a transceiver module, a connecting switch and a Bluetooth data memory, the connecting switch is used for connecting the Bluetooth data memory with the transceiver module, and the method for sharing the memory by Bluetooth determines a corresponding preset time according to the response time of data transceiving by determining a sending time slot or a receiving time slot of the Bluetooth when the successful connection of the Bluetooth is detected; a connecting switch is controlled to be connected with the transceiver module in advance by presetting time before the sending time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the transceiver module; and data are received and transmitted through the Bluetooth data memory. Therefore, the transceiver module and the Bluetooth data memory are connected before the sending time slot or the receiving time slot arrives, the waiting time for connecting the Bluetooth data memory when the Bluetooth receives or sends data is saved, and the data transmission efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly introduced below. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a schematic structural diagram of a bluetooth device according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a method for sharing a memory by bluetooth according to an embodiment of the present disclosure.
Fig. 3 is another schematic structural diagram of a bluetooth device according to an embodiment of the present disclosure.
Fig. 4 is another flowchart illustrating a method for bluetooth memory sharing according to an embodiment of the present disclosure.
Fig. 5 is a schematic structural diagram of a bluetooth memory sharing apparatus according to an embodiment of the present disclosure.
Fig. 6 is another schematic structural diagram of a bluetooth memory sharing apparatus according to an embodiment of the present disclosure.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
The term "module" as used herein may be considered a software object executing on the computing system. The various components, modules, engines, and services described herein may be viewed as objects implemented on the computing system. The apparatus and method described herein are preferably implemented in software, but may also be implemented in hardware, and are within the scope of the present application.
An execution main body of the method for sharing the memory by bluetooth may be the device for sharing the memory by bluetooth provided by the embodiment of the present application, or an electronic device integrated with the device for sharing the memory by bluetooth, where the device for sharing the memory by bluetooth may be implemented in a hardware or software manner. The electronic device may be a smart phone, a tablet computer, a Personal Digital Assistant (PDA), or the like.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a bluetooth device provided in this embodiment, wherein a bluetooth device 10 includes: bluetooth data memory 110, connection switch 120 and transceiver module 130.
The bluetooth data memory 110 is connected to the transceiver module 130 through the connection switch 120, specifically, the connection switch 120 includes a switch, an a connection end and a B connection end, the transceiver module 130 is connected to the a connection end of the connection switch, when the switch of the connection switch 120 is connected to the a connection end, the transceiver module 130 is connected to the bluetooth data memory 110 through the connection switch 120, and transmits and receives data through the bluetooth data memory 110; when the switch of the connection switch 120 is connected to the B connection terminal, the connection switch 120 is disconnected from the transceiver module 130, the transceiver module 130 is disconnected from the bluetooth data memory 110, and the transceiver module 130 does not perform data transceiving.
An embodiment of the present application provides a method for sharing a memory by bluetooth, which is applied to the bluetooth device 10, please refer to fig. 2, where fig. 2 is a flowchart illustrating the method for sharing a memory by bluetooth according to the embodiment of the present application, where the method for sharing a memory by bluetooth includes the following steps:
in step S101, when a bluetooth connection success is detected, a transmission slot or a reception slot of bluetooth is determined.
The bluetooth is specifically a bluetooth device composed of bluetooth devices, including an electronic device with a bluetooth function. Specifically, when it is detected that the bluetooth device is successfully connected, the bluetooth device is connected with other bluetooth devices to form a piconet, and since one piconet includes one master device and one or more slave devices and a time slot is determined according to the master device, when it is detected that the bluetooth device is successfully connected, it is determined whether the bluetooth device is the master device, when the bluetooth device is the master device, the time slot is numbered and circulated according to a local clock of the bluetooth device, it is determined that a start time of a transmission time slot of the bluetooth device is a start time of an even time slot, a start time of a reception time slot of the bluetooth device is a start time of an odd time slot, and when data transmission and reception are performed, the start time of the data transmission and reception is synchronized with the start time of the time slot.
When the Bluetooth device is a slave device, in order to ensure the transceiving synchronization and the frequency hopping synchronization with the master device, an offset is added into a local clock of the Bluetooth device to realize the synchronization. Further, the starting time of the sending time slot of the Bluetooth device is determined to be the starting time of the odd time slot according to the time slot determined by the main device, and the starting time of the receiving time slot is determined to be the starting time of the even time slot. When receiving a data transceiving instruction, determining the nearest transmitting time slot and the starting time of the receiving time slot, so as to transceive data when the transmitting time slot or the receiving time slot arrives.
It should be noted that the transmission time slot refers to a time interval during which the transmission module is connected to the bluetooth data memory and transmits data successfully through the bluetooth data memory. The receiving time slot is a period of time interval during which the receiving module is connected with the Bluetooth data memory and successfully receives information through the Bluetooth data memory.
In step S102, a corresponding preset time is determined according to the response time of data transmission and reception.
Recording the historical time difference from the time when the connection switch starts to connect the transceiver module to the time when the transceiver module starts to transmit and receive signals each time, defining the historical time difference as the reaction time of data transmission and reception, and determining the corresponding preset time according to the reaction time.
In some embodiments, the reaction time may be arithmetically averaged to obtain a corresponding preset time.
In step S103, the connection switch is controlled to be connected to the transceiver module by a preset time before the transmission timeslot or the reception timeslot comes, so that the bluetooth data memory is connected to the transceiver module.
When receiving a data transceiving instruction, the method can determine the starting time point of a transmitting time slot or a receiving time slot according to a local clock of the main equipment, determine the starting time point of the nearest transmitting time slot or receiving time slot, and control the connection switch to be connected with the transceiving module by presetting time in advance before the transmitting time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the transceiving module by presetting time in advance.
In step S104, data is transmitted and received through the bluetooth data memory.
After the transceiver module is connected with the Bluetooth data memory through the connecting switch, the transceiver module sends data to the Bluetooth data memory, or receives data through the Bluetooth data memory to complete data transceiving.
The method for sharing the memory by the Bluetooth is applied to a Bluetooth device, the Bluetooth device comprises a transceiver module, a connecting switch and a Bluetooth data memory, the connecting switch is used for connecting the Bluetooth data memory with the transceiver module, and when the Bluetooth connection is detected to be successful, the transmitting time slot or the receiving time slot of the Bluetooth is determined; determining corresponding preset time according to the data receiving and sending reaction time; a connecting switch is controlled to be connected with a receiving and transmitting module in advance by presetting time before the sending time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the receiving and transmitting module; and data are received and transmitted through the Bluetooth data memory. Therefore, the transceiver module and the Bluetooth data memory are connected before the sending time slot or the receiving time slot arrives, the waiting time for connecting the Bluetooth data memory when the Bluetooth receives or sends data is saved, and the data transmission efficiency is improved.
Referring to fig. 3, fig. 3 is another schematic structural diagram of a bluetooth device according to an embodiment of the present disclosure, the bluetooth device 10 includes a bluetooth data memory 110, a connection switch 120 and a transceiver module 130, the connection switch 120 is used for connecting the bluetooth data memory 110 with the transceiver module 130, the transceiver module 130 includes a receiving module 1302 and a sending module 1304, please refer to fig. 4 at the same time, fig. 4 is another schematic flow chart of a bluetooth memory sharing method according to an embodiment of the present disclosure, and the bluetooth memory sharing method includes:
in step S201, when detecting that the bluetooth connection is successful, a transmission slot or a reception slot of bluetooth is determined.
When the Bluetooth device is detected to be successfully connected, determining whether the Bluetooth device belongs to a master device, and when the Bluetooth device is the master device, numbering and circulating time slots according to a local clock of the Bluetooth device, determining that the starting time of a sending time slot of the Bluetooth device is the starting time of an even time slot, determining that the starting time of a receiving time slot of the Bluetooth device is the starting time of an odd time slot, and synchronizing the starting time of data receiving and sending with the starting time of the time slots; when the Bluetooth device is a slave device, in order to ensure the transceiving synchronization and the frequency hopping synchronization with the master device, an offset is added into a local clock of the Bluetooth device to realize the synchronization.
Further, the starting time of the sending time slot of the Bluetooth device is determined to be the starting time of the odd time slot according to the time slot determined by the main device, and the starting time of the receiving time slot is determined to be the starting time of the even time slot. It should be noted that the bluetooth frequency hopping rate is 1600 times/second, and the duration of each frequency is 625 microseconds, which is called a time slot. In the process of sending data through Bluetooth, the receiving and sending starting time of a data packet is synchronous with a time slot, and one data packet is allowed to occupy 1-5 time slots for sending and receiving. For example, when data is transmitted by the bluetooth transmission module, the transmission time slot is 1865 microseconds, at this time, the data packet occupies 3 time slots 1875 microseconds to transmit the data, and after the transmission time slot 1865 microseconds ends, the connection switch is controlled to disconnect from the transceiver module.
In step S202, a connection state of the connection switch and the transceiver module is detected, and when the connection switch and the transceiver module are detected to start connecting, a current time is recorded as a first time, where the transceiver module includes a transmitting module and a receiving module.
Referring to fig. 3, the connection state between the connection switch 120 and the transceiver module 130 is detected, and when the connection switch 120 is connected to the connection end of a1 or the connection end of a2, the connection switch 120 is connected to the receiving module 1302 or the transmitting module 1304, respectively; when the connection switch 120 is connected to the B connection terminal, the connection switch 120 and the transceiver module 130 are in a disconnected state, and when it is detected that the connection switch 120 starts to be connected to the a1 connection terminal or the a2 connection terminal, that is, when the connection switch 120 is turned from the B connection terminal to the a1 connection terminal or the a2 connection terminal, the current time is recorded as the first time.
In step S203, the transmission power of the transmission module and the strength of the signal received by the reception module are detected to determine the transmission/reception state of the signal.
When the sending module sends a signal, the sending power of the sending module changes to a certain extent, and at the moment, the sending power of the sending module is detected, and the sending state of the signal is determined according to the change of the sending power. Meanwhile, when the receiving module receives a signal, the strength of the signal received by the receiving module changes to a certain extent, and the strength of the signal received by the receiving module is detected to determine the receiving state of the signal.
In step S204, when it is detected that the transmission power of the transmission module is greater than the preset value, it is determined that the transmission module starts to transmit signals through the bluetooth data memory.
When the transmitting power of the transmitting module is detected to be larger than the preset value, the transmitting module is connected with the Bluetooth data memory through the connecting switch, at the moment, a path from the Bluetooth transmitting module to the Bluetooth special data memory is ready, and the transmitting module starts to transmit signals through the Bluetooth data memory.
In step S205, when it is detected that the strength of the signal received by the receiving module is greater than the predetermined value, it is determined that the receiving module starts to receive the signal through the bluetooth data memory.
When the intensity of the signal received by the receiving module is detected to be larger than the preset value, the receiving module is connected with the Bluetooth data memory through the connecting switch, at the moment, the access from the Bluetooth receiving module to the Bluetooth special data memory is ready, and the receiving module starts to receive the signal through the Bluetooth data memory.
In step S206, when it is detected that the transceiver module starts to transceive signals, the current time is recorded as the second time.
When the sending module is detected to start sending signals or the receiving module starts receiving signals, for example, when the strength of the signals received by the receiving module is detected to be greater than a preset value, recording the current time as second receiving time; and when the transmitting power of the transmitting module is detected to be larger than the preset value, recording the current time as a second transmitting time.
In step S207, a historical time difference is determined from the first time and the second time, the historical time difference comprising a historical transmission time difference and a historical reception time difference.
The historical time difference may be determined according to a difference between the first time and the second time, for example, the sending time difference may be determined according to a difference between the sending first time and the sending second time, and specifically, the sending first time is subtracted from the sending second time to obtain the sending time difference.
In step S208, the historical time difference is arithmetically averaged to obtain a preset time, wherein the preset time includes a preset sending time and a preset receiving time.
The sending historical time difference is subjected to arithmetic mean to obtain preset sending time, and the receiving historical time difference is subjected to arithmetic mean to obtain preset receiving time. For example, the historical time differences from the time when the connection switch starts to connect the transmission module to the time when the transmission module starts to transmit the signal are recorded as 0.12 second, 0.14 second and 0.13 second respectively, and at this time, the preset transmission time obtained by arithmetically averaging the historical transmission time differences is 0.13 second. Correspondingly, the historical time difference from the time when the connecting switch starts to connect the receiving module to the time when the receiving module starts to receive the signal is recorded to be 0.2 second, 0.24 second and 0.24 second respectively, and at the moment, the arithmetic mean is obtained according to the historical receiving time difference to obtain the preset receiving time of 0.23 second.
In step S209, the connection switch is controlled to connect with the transceiver module by a preset time before the transmission timeslot or the reception timeslot comes, so that the bluetooth data memory is connected with the transceiver module.
When receiving a data transceiving instruction, the method can determine the starting time of a transmitting time slot or a receiving time slot according to a local clock of the main equipment, determine the starting time of the nearest transmitting time slot or receiving time slot, and control the connection switch to be connected with the transceiving module by presetting time in advance before the transmitting time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the transceiving module by presetting time in advance. For example, please continue to refer to fig. 3, when receiving a data transmission instruction, the preset transmission time is obtained as 0.13 second, the starting time point of the latest transmission timeslot is determined, and the connection between the connection switch 120 and the connection end of a2 is controlled 0.13s before the transmission timeslot arrives, so as to ensure the connection between the connection switch 120 and the transmission module 1304, so that the transmission module 1304 is connected to the bluetooth data memory 110, and thus data is transmitted through the bluetooth data memory 110.
In some embodiments, after the step of controlling the connection switch to connect with the transceiver module by a preset time before the transmission timeslot or the reception timeslot comes, and connecting the bluetooth data memory with the transceiver module, the method further includes:
and after the sending time slot or the receiving time slot is finished, the connection switch is controlled to be disconnected with the transceiving module.
Referring to fig. 3, after the transmission time slot or the reception time slot is over, that is, after the transceiver module 130 completes the data transmission and reception through the bluetooth data memory 110, the connection switch 120 is controlled to be connected to the B connection terminal, so as to disconnect the connection switch 120 from the transceiver module 130. For example, when the bluetooth transmission module 1304 transmits data, the transmission time slot is 1865 microseconds, at this time, the data packet occupies 3 time slots 1875 microseconds to transmit data, and after the transmission time slot 1865 microseconds ends, the connection switch 120 is controlled to disconnect from the transmission module 1304.
In step S210, data is transmitted and received through the bluetooth data memory.
After the transceiver module is connected with the Bluetooth data memory through the connecting switch, the transceiver module sends data to the Bluetooth data memory, or receives data through the Bluetooth data memory to complete data transceiving.
The method for sharing the memory by the Bluetooth is applied to a Bluetooth device, the Bluetooth device comprises a transceiver module, a connecting switch and a Bluetooth data memory, the connecting switch is used for connecting the Bluetooth data memory with the transceiver module, and when the Bluetooth connection is detected to be successful, the transmitting time slot or the receiving time slot of the Bluetooth is determined; determining corresponding preset time according to the data receiving and sending reaction time; a connecting switch is controlled to be connected with a receiving and transmitting module in advance by presetting time before the sending time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the receiving and transmitting module; and data are received and transmitted through the Bluetooth data memory. Therefore, the transceiver module and the Bluetooth data memory are connected before the sending time slot or the receiving time slot arrives, the waiting time for connecting the Bluetooth data memory when the Bluetooth receives or sends data is saved, and the data transmission efficiency is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a bluetooth memory sharing device according to an embodiment of the present disclosure. Specifically, the bluetooth memory sharing apparatus 300 includes: a detection module 31, a determination module 32, a connection module 33 and a data module 34.
And a detecting module 31, configured to determine a transmission timeslot or a reception timeslot of bluetooth when detecting that the bluetooth connection is successful.
The detection module 31 is configured to, when detecting that the bluetooth device is successfully connected, perform numbering cycle on slots according to a local clock of a master device, and when the bluetooth device is the master device, perform numbering cycle on the slots according to the local clock of the bluetooth device, determine that the start time of a transmission slot of the bluetooth device is the start time of an even slot, determine that the start time of a reception slot of the bluetooth device is the start time of an odd slot, and synchronize the start time of data transceiving with the start time of the slots; when the Bluetooth device is a slave device, in order to ensure the transceiving synchronization and the frequency hopping synchronization with the master device, an offset is added into a local clock of the Bluetooth device to realize the synchronization. Further, the starting time of the sending time slot of the Bluetooth device is determined to be the starting time of the odd time slot according to the time slot determined by the main device, and the starting time of the receiving time slot is determined to be the starting time of the even time slot. And finally, when receiving a data transceiving instruction, determining the nearest starting time of the sending time slot and the receiving time slot so as to enable the data to be transceived at the sending time slot or the receiving time slot.
The determining module 32 is configured to determine a corresponding preset time according to the data transceiving response time.
The determining module 32 records a historical time difference between when the connection switch starts to connect the transceiver module and when the transceiver module starts to transmit and receive signals each time, defines the historical time difference as a response time for data transmission and reception, and determines a corresponding preset time according to the response time.
In some embodiments, referring to fig. 6, fig. 6 is another schematic structural diagram of a bluetooth memory sharing apparatus according to an embodiment of the present application, where the determining module 32 includes: a recording sub-module 321 and a determination sub-module 322.
The recording sub-module 321 is configured to record a historical time difference between when the connection switch starts to connect the transceiver module and when the transceiver module starts to transmit and receive signals each time.
The recording sub-module 321 detects a connection state between the connection switch and the transceiver module, and records a current time as a first time when detecting that the connection switch and the transceiver module start to be connected. And simultaneously detecting the sending power of the sending module and the strength of the signal received by the receiving module to determine the transceiving state of the signal, and recording the current time as a second time when the signal is detected to be started to be transceived. And obtaining each historical time difference according to the difference value between the second time and the first time.
And a determining submodule 322, configured to determine a preset time according to the historical time difference.
The specific determining sub-module 322 calculates an average according to each time difference of the historical time to obtain a corresponding preset time.
And a connection module 33, configured to control the connection switch to connect with the transceiver module by presetting a time ahead before the sending timeslot or the receiving timeslot arrives, so that the bluetooth data memory is connected with the transceiver module.
When receiving a data transceiving instruction, the connection module 33 may determine a starting time point of a transmitting time slot or a receiving time slot according to a local clock of the master device, determine a starting time point of a nearest transmitting time slot or receiving time slot, and control the connection switch to be connected with the transceiving module by a preset time in advance before the transmitting time slot or the receiving time slot arrives, so that the bluetooth data memory is connected with the transceiving module by the preset time in advance.
And the data module 34 is used for receiving and transmitting data through the Bluetooth data memory.
The data module 34 is configured to send data to the bluetooth data memory or receive data through the bluetooth data memory to complete data transceiving after the transceiving module is connected to the bluetooth data memory through the connection switch.
The device for sharing the memory by the Bluetooth is applied to the Bluetooth device, the Bluetooth device comprises a receiving and sending module, a connecting switch and a Bluetooth data memory, the connecting switch is used for connecting the Bluetooth data memory with the receiving and sending module, and when the detection module 31 detects that the Bluetooth connection is successful, the sending time slot or the receiving time slot of the Bluetooth is determined; the determining module 32 determines a corresponding preset time according to the data receiving and transmitting reaction time; the connection module 33 controls the connection switch to be connected with the transceiver module in advance of a preset time before the sending time slot or the receiving time slot arrives, so that the bluetooth data memory is connected with the transceiver module; the data module 34 receives and transmits data through the bluetooth data memory. Therefore, the transceiver module and the Bluetooth data memory are connected before the sending time slot or the receiving time slot arrives, the waiting time for connecting the Bluetooth data memory when the Bluetooth receives or sends data is saved, and the data transmission efficiency is improved.
The embodiment of the application also provides the electronic equipment. Referring to fig. 7, the electronic device 500 includes a bluetooth device 10 and a main controller 140, the bluetooth device 10 is connected to the main controller 140, and specifically the bluetooth device includes: bluetooth data memory 110, connection switch 120, receiving module 1302, sending module 1304. The main controller 140 includes: a transmission detection module 1401, a switch control module 1402, a reception detection module 1403, and a time calculation module 1404.
The receiving module 1302 is specifically configured to convert data in the bluetooth data memory 110 into signals and transmit the signals through the bluetooth device 10. The sending module 1304 is specifically configured to receive data via the bluetooth device 10 and store the data in the bluetooth data memory 110. The main controller 140 is connected to the connection switch 120, the reception module 1302, and the transmission module 1304 of the bluetooth device 10, respectively. Specifically, the switch control module 1402 in the main controller 140 is connected to the connection switch 120, and is used for controlling connection and disconnection between the connection switch 120 and the transceiver module 130, that is, controlling connection states of the connection switch 120 and the connection terminals a1, a2, and B.
The sending detection module 1401 and the receiving detection module 1403 in the main controller 140 are respectively connected to the sending module 1304 and the receiving module 1302 in the bluetooth apparatus 10, and are specifically configured to detect the sending and receiving states of the data in the sending and receiving module 130 after the connection switch 120 is connected to the sending and receiving module 130. Specifically, the transmission detection module 1401 is configured to detect a state where the transmission module 1304 transmits a signal after the connection switch 120 is connected to the transmission module 1304, and the transmission detection module 1401 reads the transmission power of the transmission module 1304 in real time, and determines that the transmission module 1304 has started to transmit the signal when it is detected that the transmission power is greater than a preset value. Accordingly, the reception detection module 1403 is configured to detect the state of the receiving module 1302 receiving the signal after the connection switch 120 is connected to the receiving module 1302, and the reception detection module 1403 reads the strength of the signal received by the receiving module 1302 in real time and determines that the receiving module 1302 starts receiving the signal when detecting that the strength of the received signal is greater than a preset value.
On the other hand, the time calculation module 1404 in the main controller 140 is respectively connected to the sending detection module 1401, the switch control module 1402, and the receiving detection module 1403, and the time calculation module 1404 includes a timer (not shown in the figure) specifically for recording the reaction time of data sending and receiving, so that the time calculation module 1404 calculates the preset time according to the reaction time, and since the timer can synchronize the current time, the switch control module 1402 in the main controller 140 controls the connection switch 120 to connect with the sending and receiving module 130 by the preset time before the sending time slot or the receiving time slot arrives.
Referring to fig. 8, an electronic device 500 includes a processor 501 and a memory 502. The processor 501 is electrically connected to the memory 502.
The processor 500 is a control center of the electronic device 500, connects various parts of the whole electronic device using various interfaces and lines, performs various functions of the electronic device 500 by running or loading a computer program stored in the memory 502, and calls data stored in the memory 502, and processes the data, thereby performing overall monitoring of the electronic device 500.
The memory 502 may be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
In this embodiment, the processor 501 in the electronic device 500 loads instructions corresponding to one or more processes of the computer program into the memory 502, and the processor 501 runs the computer program stored in the memory 502, so as to implement various functions as follows:
when detecting that the Bluetooth connection is successful, determining a sending time slot or a receiving time slot of the Bluetooth;
determining corresponding preset time according to the data receiving and sending reaction time;
a connecting switch is controlled to be connected with a receiving and transmitting module in advance by presetting time before the sending time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the receiving and transmitting module;
and data are received and transmitted through the Bluetooth data memory.
The method for sharing the memory by the Bluetooth is applied to a Bluetooth device, the Bluetooth device comprises a transceiver module, a connecting switch and a Bluetooth data memory, the connecting switch is used for connecting the Bluetooth data memory with the transceiver module, and when the Bluetooth connection is detected to be successful, the transmitting time slot or the receiving time slot of the Bluetooth is determined; determining corresponding preset time according to the data receiving and sending reaction time; a connecting switch is controlled to be connected with a receiving and transmitting module in advance by presetting time before the sending time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the receiving and transmitting module; and data are received and transmitted through the Bluetooth data memory. Therefore, the transceiver module and the Bluetooth data memory are connected before the sending time slot or the receiving time slot arrives, the waiting time for connecting the Bluetooth data memory when the Bluetooth receives or sends data is saved, and the data transmission efficiency is improved.
Referring to fig. 9, in some embodiments, the electronic device 500 may further include: a display 503, radio frequency circuitry 504, audio circuitry 505, and a power supply 506. The display 503, the rf circuit 504, the audio circuit 505, and the power source 506 are electrically connected to the processor 501.
The display 503 may be used to display information entered by or provided to the user as well as various graphical user interfaces, which may be made up of graphics, text, icons, video, and any combination thereof. The Display 503 may include a Display panel, and in some embodiments, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The rf circuit 504 may be used for transceiving rf signals to establish wireless communication with a network device or other electronic devices via wireless communication, and for transceiving signals with the network device or other electronic devices.
The audio circuit 505 may be used to provide an audio interface between a user and an electronic device through a speaker, microphone.
The power source 506 may be used to power various components of the electronic device 500. In some embodiments, power supply 506 may be logically coupled to processor 501 through a power management system, such that functions of managing charging, discharging, and power consumption are performed through the power management system.
Although not shown in fig. 9, the electronic device 500 may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
An embodiment of the present application further provides a storage medium, where the storage medium stores a computer program, and when the computer program runs on a computer, the computer is caused to execute the method for sharing a memory by bluetooth in any of the above embodiments, such as: when detecting that the Bluetooth connection is successful, determining a sending time slot or a receiving time slot of the Bluetooth; determining corresponding preset time according to the data receiving and sending reaction time; a connecting switch is controlled to be connected with a receiving and transmitting module in advance by presetting time before the sending time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the receiving and transmitting module; and data are received and transmitted through the Bluetooth data memory.
In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It should be noted that, for the method for sharing a memory by bluetooth in the embodiment of the present application, it can be understood by a person skilled in the art that all or part of the process of implementing the method for sharing a memory by bluetooth in the embodiment of the present application can be completed by controlling related hardware through a computer program, where the computer program can be stored in a computer readable storage medium, such as a memory of an electronic device, and executed by at least one processor in the electronic device, and the process of the embodiment of the method for sharing a memory by bluetooth can be included in the execution process. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.
For the bluetooth memory sharing device according to the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented as a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium such as a read-only memory, a magnetic or optical disk, or the like.
The method, the apparatus, the storage medium, and the electronic device for sharing a memory by bluetooth provided in the embodiments of the present application are described in detail above, and a specific example is applied in the description to explain the principle and the implementation of the present application, and the description of the embodiments above is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for sharing memory by Bluetooth is applied to a Bluetooth device, the device comprises a transceiver module, a connecting switch and a Bluetooth data memory, the connecting switch is used for connecting the Bluetooth data memory with the transceiver module, and the method for sharing memory by Bluetooth comprises the following steps:
when detecting that the Bluetooth connection is successful, determining a sending time slot or a receiving time slot of the Bluetooth, wherein the sending time slot refers to a time interval during which a sending module is connected with the Bluetooth data memory and data is successfully sent out through the Bluetooth data memory, the receiving time slot refers to a time interval during which a receiving module is connected with the Bluetooth data memory and information is successfully received through the Bluetooth data memory, a Bluetooth device comprising the Bluetooth device is connected with other Bluetooth devices to form a piconet, when the Bluetooth device comprising the Bluetooth device is a master device in the piconet, the time slots are numbered according to a local clock of the Bluetooth device to cycle, the starting time of the sending time slot of the Bluetooth device is determined to be the starting time of an even number time slot, and the starting time of the receiving time slot of the Bluetooth device is determined to be the starting time of an odd number time slot, when data is transmitted and received, the starting time of the data transmission and reception is synchronous with the starting time of the time slot, when the Bluetooth device is a slave device in the piconet, an offset is added into a local clock of the Bluetooth device, the starting time of the transmission time slot of the Bluetooth device is determined to be the starting time of an odd time slot according to the time slot determined by a master device in the piconet, the starting time of the reception time slot is determined to be the starting time of an even time slot, and when a data transmitting and receiving instruction is received, the latest starting time of the transmission time slot and the latest starting time of the reception time slot are determined;
determining corresponding preset time according to the data receiving and transmitting reaction time, recording the historical time difference from the time when the connecting switch starts to connect the receiving and transmitting module to the time when the receiving and transmitting module starts to receive and transmit signals each time, defining the historical time difference as the data receiving and transmitting reaction time, and determining the corresponding preset time according to the reaction time;
a connecting switch is controlled to be connected with the transceiver module in advance by presetting time before the sending time slot or the receiving time slot arrives, so that the Bluetooth data memory is connected with the transceiver module;
and data are received and transmitted through the Bluetooth data memory.
2. The method according to claim 1, wherein the step of determining the corresponding preset time according to the reaction time of data transceiving comprises:
recording the historical time difference from the time when the connection switch starts to connect the transceiver module to the time when the transceiver module starts to transmit and receive signals each time;
and determining preset time according to the historical time difference.
3. The method of claim 2, wherein the step of recording the historical time difference between each time the connection switch starts to connect the transceiver module and each time the transceiver module starts to transceive signals comprises:
detecting the connection state of the connecting switch and the transceiver module, and recording the current time as first time when detecting that the connecting switch and the transceiver module start to be connected;
detecting the receiving and transmitting state of the signal of the receiving and transmitting module, and recording the current time as second time when the receiving and transmitting module starts to receive and transmit the signal;
and determining a historical time difference according to the first time and the second time, wherein the historical time difference comprises a historical sending time difference and a historical receiving time difference.
4. The method of claim 3, wherein the transceiver module comprises a transmitting module and a receiving module, and wherein the step of detecting the transceiving state of the signal of the transceiver module comprises:
detecting the transmitting power of a transmitting module and the strength of a signal received by a receiving module to determine the transmitting and receiving states of the signal;
when the transmitting power of the transmitting module is detected to be larger than a preset value, the transmitting module is judged to start to transmit signals through the Bluetooth data memory;
and when the strength of the signal received by the receiving module is detected to be larger than a preset value, the receiving module is judged to start receiving the signal through the Bluetooth data memory.
5. The method of claim 2, wherein the step of determining the preset time based on the historical time difference comprises:
and calculating an arithmetic mean of the historical time differences to obtain preset time, wherein the preset time comprises preset sending time and preset receiving time.
6. The method of claim 1, wherein after the step of controlling the connection of the connection switch to the transceiver module by a preset time before the transmission or reception timeslot arrives, the method comprises:
and after the sending time slot or the receiving time slot is finished, the connection switch is controlled to be disconnected with the transceiving module.
7. The utility model provides a device of memory is shared to bluetooth device, is applied to bluetooth device, bluetooth device includes transceiver module, linked switch and bluetooth data memory, linked switch is used for being connected bluetooth data memory and transceiver module, its characterized in that, device of memory is shared to bluetooth includes:
a detection module, configured to determine a transmission timeslot or a reception timeslot of a bluetooth device when a bluetooth connection is detected to be successful, where the transmission timeslot is a time interval during which the transmission module is connected to the bluetooth data memory and transmits data successfully through the bluetooth data memory, the reception timeslot is a time interval during which the reception module is connected to the bluetooth data memory and receives information successfully through the bluetooth data memory, a bluetooth device including the bluetooth device is connected to other bluetooth devices to form a piconet, and when the bluetooth device including the bluetooth device is a master device in the piconet, a slot is numbered according to a local clock of the bluetooth device to determine that a start time of the transmission timeslot of the bluetooth device is a start time of an even timeslot, and a start time of the reception timeslot of the bluetooth device is a start time of an odd timeslot, when data is transmitted and received, the starting time of the data transmission and reception is synchronous with the starting time of the time slot, when the Bluetooth device is a slave device in the piconet, an offset is added into a local clock of the Bluetooth device, the starting time of the transmission time slot of the Bluetooth device is determined to be the starting time of an odd time slot according to the time slot determined by a master device in the piconet, the starting time of the reception time slot is determined to be the starting time of an even time slot, and when a data transmitting and receiving instruction is received, the latest starting time of the transmission time slot and the latest starting time of the reception time slot are determined;
the determining module is used for determining corresponding preset time according to the data receiving and transmitting reaction time, recording the historical time difference between the time when the connecting switch starts to connect the receiving and transmitting module and the time when the receiving and transmitting module starts to receive and transmit signals each time, defining the historical time difference as the data receiving and transmitting reaction time, and determining the corresponding preset time according to the reaction time;
the connection module is used for controlling the connection switch to be connected with the transceiver module in advance by presetting time before the sending time slot or the receiving time slot arrives so as to connect the Bluetooth data memory with the transceiver module;
and the data module is used for receiving and transmitting data through the Bluetooth data memory.
8. The apparatus of claim 7, wherein the determining module comprises:
the recording submodule is used for recording the historical time difference from the time when the connecting switch starts to connect the transceiver module to the time when the transceiver module starts to transmit and receive signals each time;
and the determining submodule is used for determining preset time according to the historical time difference.
9. A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method of bluetooth shared memory of any one of 1 to 6.
10. An electronic device comprising a processor and a memory, the memory having a computer program, wherein the processor is configured to perform the method of bluetooth shared memory according to any one of claims 1 to 6 by invoking the computer program.
CN201910218641.7A 2019-03-21 2019-03-21 Bluetooth memory sharing method and device, storage medium and electronic equipment Active CN109874136B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910218641.7A CN109874136B (en) 2019-03-21 2019-03-21 Bluetooth memory sharing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910218641.7A CN109874136B (en) 2019-03-21 2019-03-21 Bluetooth memory sharing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN109874136A CN109874136A (en) 2019-06-11
CN109874136B true CN109874136B (en) 2022-01-04

Family

ID=66921021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910218641.7A Active CN109874136B (en) 2019-03-21 2019-03-21 Bluetooth memory sharing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN109874136B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110931026B (en) * 2019-11-27 2022-07-12 南京中感微电子有限公司 Audio data communication method, equipment and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030802A (en) * 2007-02-05 2007-09-05 北京邮电大学 Wireless multi-skip trunk network combining method for supporting multimedium broadcasting service
WO2011068554A1 (en) * 2009-12-01 2011-06-09 Qualcomm Incorporated Method and apparatus of utilizing uplink synchronization shift command bits in td-scdma uplink transmission
CN102144359A (en) * 2008-09-03 2011-08-03 诺基亚公司 Software-defined radio configuration
CN103181232A (en) * 2010-07-22 2013-06-26 捷讯研究有限公司 Methods and apparatus to poll in wireless communications
CN106559737A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Bluetooth operating mode switching control method and device
CN106559734A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Bluetooth data transfer method and device
WO2018223408A1 (en) * 2017-06-06 2018-12-13 Hong Kong Applied Science and Technology Research Institute Company Limited Optimized deployment of ble network and power efficient and secure management of data exchange between ble devices
CN109495867A (en) * 2018-11-22 2019-03-19 重庆物奇科技有限公司 The method of bluetooth equipment, system and the transmission of equipment room information

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030802A (en) * 2007-02-05 2007-09-05 北京邮电大学 Wireless multi-skip trunk network combining method for supporting multimedium broadcasting service
CN102144359A (en) * 2008-09-03 2011-08-03 诺基亚公司 Software-defined radio configuration
WO2011068554A1 (en) * 2009-12-01 2011-06-09 Qualcomm Incorporated Method and apparatus of utilizing uplink synchronization shift command bits in td-scdma uplink transmission
CN103181232A (en) * 2010-07-22 2013-06-26 捷讯研究有限公司 Methods and apparatus to poll in wireless communications
CN106559737A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Bluetooth operating mode switching control method and device
CN106559734A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Bluetooth data transfer method and device
WO2018223408A1 (en) * 2017-06-06 2018-12-13 Hong Kong Applied Science and Technology Research Institute Company Limited Optimized deployment of ble network and power efficient and secure management of data exchange between ble devices
CN109495867A (en) * 2018-11-22 2019-03-19 重庆物奇科技有限公司 The method of bluetooth equipment, system and the transmission of equipment room information

Also Published As

Publication number Publication date
CN109874136A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
JP7101862B2 (en) Random access method, terminals and network devices
CN110035556B (en) Method and terminal for processing conflict of communication service process
US11405894B2 (en) System and method of establishing communication for exchanging ranging information
US20220217810A1 (en) Data receiving method, data sending method, terminal, and network side device
CN107786424B (en) Audio and video communication method, terminal and server
CN112469016A (en) Bluetooth-ultra wideband synchronization
CN112449745A (en) TRS/CSI-RS configuration method and device
CN102202132B (en) Method, system and equipment for initializing networking equipment
WO2023169434A1 (en) Communication method and apparatus
CN109874136B (en) Bluetooth memory sharing method and device, storage medium and electronic equipment
WO2022089313A1 (en) Communication processing method and apparatus, storage medium, chip and related device
EP3817396A1 (en) Communicational connection establishment method and related device
CN111149313B (en) Data transmission method and equipment
JP2019185771A (en) Method, device for processing data of bluetooth speaker, and bluetooth speaker
CN111433756A (en) Terminal and Type C interface anti-corrosion method
CN113225727B (en) Processing method and device and electronic equipment
CN112261634B (en) Bluetooth transmission control method and device, terminal equipment and storage medium
CN105635379B (en) Noise suppression method and device
US20240064699A1 (en) Paging early indication method and apparatus
CN113722260A (en) Protection circuit, serial bus system, circuit protection method and mobile terminal
CN108601044B (en) Network type switching method and device, storage medium and mobile terminal
CN110913022A (en) Method, device and system for downloading network file of mobile terminal and storage medium
CN110958641B (en) WIFI data receiving and transmitting control method and device for mobile terminal
JP7151345B2 (en) Wireless communication device, clock and wireless communication program
US11997460B2 (en) Electronic device for audio input and method for operating the same

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20231212

Address after: Building B, 625, Urban Shanhai Center, No. 11 Zhongxing Road, Ma'antang Community, Bantian Street, Longgang District, Shenzhen City, Guangdong Province, 518100

Patentee after: Shenzhen Leplay Technology Co.,Ltd.

Address before: 516006 Zhongkai hi tech Zone, Huizhou, Guangdong, 86 Chang seven Road West

Patentee before: HUIZHOU TCL MOBILE COMMUNICATION Co.,Ltd.

TR01 Transfer of patent right