CN111741453A - Bluetooth data encapsulation communication method and device - Google Patents

Bluetooth data encapsulation communication method and device Download PDF

Info

Publication number
CN111741453A
CN111741453A CN202010481846.7A CN202010481846A CN111741453A CN 111741453 A CN111741453 A CN 111741453A CN 202010481846 A CN202010481846 A CN 202010481846A CN 111741453 A CN111741453 A CN 111741453A
Authority
CN
China
Prior art keywords
bluetooth
data
tcp
information
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010481846.7A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lakala Payment Co ltd
Original Assignee
Lakala Payment 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 Lakala Payment Co ltd filed Critical Lakala Payment Co ltd
Priority to CN202010481846.7A priority Critical patent/CN111741453A/en
Priority to PCT/CN2020/113493 priority patent/WO2021237975A1/en
Publication of CN111741453A publication Critical patent/CN111741453A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals

Abstract

The embodiment of the disclosure discloses a Bluetooth data encapsulation communication method and device. Wherein, the method comprises the following steps: setting the transaction information, receiving the card swiping information of the user, and performing TCP (transmission control protocol) packaging and BNEP (bayonet nut seal) packaging to generate a Bluetooth data packet; initiating a BNEP connection request according to the Bluetooth data packet, and establishing BNEP connection with the first terminal as a main device; calling a mobile communication module of a first terminal through BNEP connection, and sending the transaction information and the user card swiping information packaged by TCP in the Bluetooth data package to a background server through the Internet; receiving result information returned by the background server through the first terminal; and confirming that the transaction is completed according to the received and analyzed result information.

Description

Bluetooth data encapsulation communication method and device
Technical Field
The present disclosure relates to the field of wireless communication technologies, and in particular, to a bluetooth data encapsulation communication method and apparatus, an electronic device, and a storage medium.
Background
In order to meet the application requirements of different degrees in different scenes, the mobile communication technology has evolved into a plurality of technical branches, such as 3G, 4G, and 5G cellular networks for adapting to long-distance and large-range wireless communication, WIFI technology for adapting to medium-distance access, and bluetooth technology for adapting to short-distance communication. Because the specific implementation modes of each communication technology have essential differences, networking communication can be realized only under the support of specific software and hardware, so that corresponding hardware units and software modules need to be additionally arranged when user equipment supports more than one communication mode, and the cost of the equipment is obviously influenced.
In order to control the cost, the prior art often designs the user equipment according to the user dependence degree, only integrates various universal communication modules in the more core user terminal equipment, and only adopts one communication module in the peripheral equipment according to a typical application scene. For example, a user's mobile phone typically integrates multiple communication modes, such as cellular communication, WIFI, and bluetooth; mobile terminals such as PAD or notebook usually integrate WIFI and bluetooth modules; and smart hardware such as bracelet, wrist-watch, earphone, audio amplifier then often only can remain bluetooth module, establish the bluetooth and be connected as peripheral equipment and core equipment during the use. By the method, the hardware cost of the equipment can be effectively controlled, and the burden of a user is reduced.
However, in the process of implementing the related technical solution of the embodiment of the present disclosure, the inventor finds that a general bluetooth connection manner in the prior art has a too low location for the peripheral device, does not have any control authority when accessing as the slave device, and can only passively receive input control of the user through a specific application program (App) in the master device, which brings about a great trouble to both the user and the system design. For example, in order to reduce the hardware cost of the mobile POS machine, there is a mpos (mobile Point of sale) machine without a SIM card and without a cellular communication module in the prior art, and the mpos machine is generally connected to the user's mobile phone by using a bluetooth module as a slave device. In the using process, a first user (usually a payee) can only use a specific App in the mobile phone to issue specific setting information to the mPOS machine; after a second user (usually a payer) swipes a card in the mPOS machine, because the mPOS machine does not have the capability of accessing the Internet, the second user can only send data to the mobile phone, and the mobile phone and the server background complete message exchange; likewise, the signature of the second user can only be done in the specific App of the handset. The whole process mPOS machine is more like a card reader, more convenience is not brought to users, and on the contrary, the operation process is complicated, and meanwhile, the workload of development, operation and maintenance of a specific App is large, and on the contrary, more pressure is brought to the users and suppliers.
Disclosure of Invention
In view of the above technical problems in the prior art, the embodiments of the present disclosure provide a bluetooth data encapsulation communication method and apparatus, an electronic device, and a computer-readable storage medium, so as to solve the problem that a bluetooth slave device in the prior art cannot access the internet quickly.
A first aspect of the embodiments of the present disclosure provides a bluetooth data encapsulation communication method, including:
setting the transaction information, receiving the card swiping information of the user, and performing TCP (transmission control protocol) packaging and BNEP (bayonet nut seal) packaging to generate a Bluetooth data packet;
initiating a BNEP connection request according to the Bluetooth data packet, and establishing BNEP connection with the first terminal as a main device;
calling a mobile communication module of a first terminal through BNEP connection, and sending the transaction information and the user card swiping information packaged by TCP in the Bluetooth data package to a background server through the Internet;
receiving result information returned by the background server through the first terminal;
and confirming that the transaction is completed according to the received and analyzed result information.
In some embodiments, the method further comprises:
starting up, searching Bluetooth pairing equipment as slave equipment to establish universal Bluetooth connection with the first terminal.
In some embodiments, the method further comprises:
two threads are created, wherein the first thread realizes data processing of an application layer in the method, and the second thread realizes Bluetooth communication of a bottom layer in the method.
In some embodiments, the first thread implementing data processing at an application layer in the method comprises:
the first thread determines that BNEP connection needs to be established according to the transaction information, uses a TCP protocol to package the transaction information and the user card swiping information, and initiates TCP connection to send data;
and the first thread also receives the TCP data of the buffer area, analyzes and processes the TCP data to obtain result information, and confirms that the transaction is completed according to the result information.
In some embodiments, the second thread implementing underlying bluetooth communication in the method comprises:
the second thread receives Bluetooth data from the Bluetooth serial port and analyzes the Bluetooth data according to a Bluetooth protocol;
if the specific connection setting information is analyzed, setting a corresponding connection state;
and if the TCP data is received by the analysis, the TCP data is placed into a buffer zone.
A second aspect of the embodiments of the present disclosure provides a bluetooth data encapsulation communication apparatus, including:
the data encapsulation module is used for setting the transaction information, receiving the card swiping information of the user, and performing TCP encapsulation and BNEP encapsulation to generate a Bluetooth data packet;
the BNEP connection module is used for initiating a BNEP connection request according to the Bluetooth data packet and establishing BNEP connection with the first terminal as the main equipment;
the TCP sending module is used for calling the mobile communication module of the first terminal through BNEP connection and sending the transaction information and the user card swiping information packaged by TCP in the Bluetooth data package to the background server through the Internet;
the receiving module is used for receiving result information returned by the background server through the first terminal;
and the data processing module is used for confirming that the transaction is completed according to the received and analyzed result information.
In some embodiments, the apparatus further comprises:
and the Bluetooth connection module is used for searching the Bluetooth pairing equipment and establishing a universal Bluetooth connection with the first terminal as the slave equipment.
In some embodiments, the apparatus further comprises:
and the thread management module is used for creating two threads, wherein the first thread realizes the data processing of an application layer in the method, and the second thread realizes the Bluetooth communication of a bottom layer in the method.
In some embodiments, the thread management module comprises:
the transaction thread sending module is used for determining that BNEP connection needs to be established according to the transaction information, packaging the transaction information and the user card swiping information by using a TCP (transmission control protocol), and initiating TCP connection to send data;
and the transaction thread receiving module is used for receiving the TCP data in the buffer area, analyzing and processing the TCP data to obtain result information, and confirming that the transaction is completed according to the result information.
In some embodiments, the thread management module comprises:
the background thread receiving module is used for receiving the Bluetooth data from the Bluetooth serial port and analyzing the Bluetooth data according to a Bluetooth protocol;
the connection setting module is used for setting a corresponding connection state when specific connection setting information is analyzed;
and the data buffer module is used for putting the TCP data into a buffer area when the TCP data is analyzed and received.
A third aspect of the embodiments of the present disclosure provides an electronic device, including:
a memory and one or more processors;
wherein the memory is communicatively coupled to the one or more processors, and the memory stores instructions executable by the one or more processors, and when the instructions are executed by the one or more processors, the electronic device is configured to implement the method according to the foregoing embodiments.
A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium having stored thereon computer-executable instructions, which, when executed by a computing device, may be used to implement the method according to the foregoing embodiments.
A fifth aspect of embodiments of the present disclosure provides a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are operable to implement a method as in the preceding embodiments.
According to the technical scheme provided by the embodiment of the disclosure, the traditional Bluetooth slave equipment only having Bluetooth communication capability can realize Internet access capability without increasing software and hardware costs, so that the applicability of the equipment is effectively improved, quick and convenient operation is realized, and the user experience is improved.
Drawings
The features and advantages of the present disclosure will be more clearly understood by reference to the accompanying drawings, which are illustrative and not to be construed as limiting the disclosure in any way, and in which:
fig. 1A is a schematic flow diagram of a bluetooth data encapsulation communication method according to some embodiments of the present disclosure;
FIG. 1B is a schematic flow chart of a communication method in an application scenario of mPOS machine card swiping according to some embodiments of the present disclosure;
fig. 2 is a hierarchical architecture diagram of the BNEP protocol shown in accordance with some embodiments of the present disclosure;
FIG. 3 is a user interface usage state change diagram for a mPOS machine, shown in accordance with some embodiments of the present disclosure;
fig. 4 is a block diagram of a bluetooth data encapsulation communication device in accordance with some embodiments of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to some embodiments of the present disclosure.
Detailed Description
In the following detailed description, numerous specific details of the disclosure are set forth by way of examples in order to provide a thorough understanding of the relevant disclosure. However, it will be apparent to one of ordinary skill in the art that the present disclosure may be practiced without these specific details. It should be understood that the use of the terms "system," "apparatus," "unit" and/or "module" in this disclosure is a method for distinguishing between different components, elements, portions or assemblies at different levels of sequence. However, these terms may be replaced by other expressions if they can achieve the same purpose.
It will be understood that when a device, unit or module is referred to as being "on" … … "," connected to "or" coupled to "another device, unit or module, it can be directly on, connected or coupled to or in communication with the other device, unit or module, or intervening devices, units or modules may be present, unless the context clearly dictates otherwise. For example, as used in this disclosure, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to limit the scope of the present disclosure. As used in the specification and claims of this disclosure, the terms "a," "an," "the," and/or "the" are not intended to be inclusive in the singular, but rather are inclusive in the plural, unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" are intended to cover only the explicitly identified features, integers, steps, operations, elements, and/or components, but not to constitute an exclusive list of such features, integers, steps, operations, elements, and/or components.
These and other features and characteristics of the present disclosure, as well as the methods of operation and functions of the related elements of structure and the combination of parts and economies of manufacture, will be better understood by reference to the following description and drawings, which form a part of this specification. It is to be expressly understood, however, that the drawings are for the purpose of illustration and description only and are not intended as a definition of the limits of the disclosure. It will be understood that the figures are not drawn to scale.
Various block diagrams are used in this disclosure to illustrate various variations of embodiments according to the disclosure. It should be understood that the foregoing and following structures are not intended to limit the present disclosure. The protection scope of the present disclosure is subject to the claims.
In a bluetooth communication network, devices at two ends of a bluetooth connection are respectively set as a master device and a slave device, the master device has absolute control right, and the slave device can only passively receive and transmit files, so that the expansion of the capacity of the bluetooth slave device is greatly limited, and more convenience cannot be brought to users.
In view of this, the embodiments of the present disclosure provide a bluetooth data encapsulation communication method, which encapsulates bluetooth data into TCP packets for transmission through dynamic switching between a master device and a slave device, so that a peripheral device with only bluetooth communication capability can effectively invoke a 3G/4G/5G network of a core device, thereby simplifying user operations and reducing complexity of system design. In one embodiment of the present disclosure, as shown in fig. 1A, the bluetooth data encapsulation communication method includes:
s101, setting the transaction information, receiving card swiping information of a user, and performing TCP (transmission control protocol) packaging and BNEP (bayonet nut seal) packaging to generate a Bluetooth data packet;
s102, initiating a BNEP connection request according to the Bluetooth data packet, and establishing BNEP connection with the first terminal as a master device;
s103, calling a mobile communication module of the first terminal through BNEP connection, and sending the transaction information and the user card swiping information packaged by TCP in the Bluetooth data package to a background server through the Internet;
s104, receiving result information returned by the background server through the first terminal;
and S105, confirming that the transaction is completed according to the received and analyzed result information.
The above method starts from a bluetooth peripheral device without other communication capability (usually as a slave device in bluetooth connection), and describes a process for implementing internet access by means of the mobile communication module of the first terminal. Of course, it should be understood by those skilled in the art that the technical solution of the embodiment of the present disclosure is a multi-device interactive communication method, each device has its own corresponding data processing procedure, and the description of the above-mentioned single-side processing procedure of the bluetooth peripheral device should not be regarded as a specific limitation to the implementation of the technical solution of the present disclosure. Further, referring to fig. 1B, in a preferred embodiment of the present disclosure, taking an application scenario of mPOS machine card swiping as an example, a communication method in a complete task processing process is described in more detail:
the mPOS machine is started, the first terminal searches for the Bluetooth pairing equipment, and the mPOS machine serves as the slave equipment and establishes universal Bluetooth connection with the first terminal. The first terminal is preferably a mobile phone, but other devices (such as PAD, laptop, etc.) having both bluetooth and internet communication capabilities can be applied to the embodiments of the present disclosure, so that no more specific limitation is made to the type of the first terminal. The bluetooth connection of two devices may need to be initialized when the devices are initially connected, and a user needs to manually select and confirm the devices; subsequent reconnection can be automatically accomplished by both devices without user intervention after the first connection is successfully established.
The mPOS machine sets the transaction information, receives the card swiping information of the user, and performs TCP packaging and BNEP packaging to generate a Bluetooth data packet;
initiating a BNEP connection request according to the Bluetooth data packet, and switching the mPOS machine into a master device to establish BNEP connection with the first terminal;
and calling the mobile communication module of the first terminal through BNEP connection, and sending the transaction information and the user card swiping information packaged by TCP in the Bluetooth data package to a background server through the Internet.
And the mobile communication module of the first terminal receives TCP encapsulation result information returned by the background server, adds BNEP encapsulation and then sends the result information to the mPOS machine through BNEP connection. Furthermore, the mPOS machine may interact with the first terminal and the background server for multiple times, and after transaction result information is received, a signature is handwritten on the mPOS machine by a payment user; and carrying out TCP (transmission control protocol) packaging and BNEP (bayonet nut cap) packaging on the signature information, repeating the previous data sending and receiving processes, receiving the processing result information of the signature information from the background server, and transmitting the processing result information to the mPOS machine by the first terminal.
The mPOS machine obtains result information after analysis, and confirms that the transaction is completed (success or failure). For successful completion of the transaction, the transaction receipt can be printed as required, and the whole transaction process is ended; and for the failure of the transaction, notifying the user, ending the transaction, and initiating the transaction operation again when needed.
BNEP (Bluetooth Network Encapsulation Protocol) is a standard Bluetooth Protocol component, and a Protocol Network architecture thereof is shown in fig. 2. Specifically, a network application layer on the upper layer of the BNEP protocol mainly encapsulates and processes data through a TCP protocol or a UDP protocol, and transmits the data through an IP protocol; and the middle layer encapsulates the TCP message into a bluetooth-supported format through BNEP encapsulation, and finally transmits the data to another bluetooth device through a bluetooth communication module (including but not limited to a bluetooth baseband, a bluetooth radio frequency, etc.) at the bottom layer.
More specifically, the mPOS machine manages and realizes the process through a transaction thread and a background thread; the transaction thread is responsible for data processing of the application layer, and the background thread is responsible for Bluetooth communication of the bottom layer. In the communication method, a background thread is responsible for receiving Bluetooth data from a Bluetooth serial port, resolving the Bluetooth data according to a Bluetooth protocol, and setting a corresponding connection state if specific connection setting information is resolved; and if the TCP data is received by analysis, the TCP data is placed into a buffer zone, and a transaction thread on the upper layer of the protocol is waited for obtaining use. The transaction thread is responsible for data processing of an upper layer, for example, BNEP to be connected and TCP encapsulation information are determined according to transaction information, and TCP connection is initiated to send data (bluetooth interaction is completed by a background thread subsequently); and receiving TCP data of the buffer area, analyzing and processing the data to obtain result information, confirming the transaction and the like. In the mobile phone terminal, after receiving the bluetooth data of the mPOS machine and analyzing the bluetooth data to obtain the TCP data, the mobile phone terminal does not provide data to an upper network application layer (because the mobile phone terminal in the embodiment of the present disclosure does not have a similar upper App application), but directly forwards the TCP data to a background server at the other end of the internet through a mobile communication module; after receiving TCP data returned by the background server, the TCP data is not processed locally at the mobile phone terminal, but is sent to the mPOS machine through the Bluetooth communication module after being subjected to BNEP encapsulation. In this way, in the embodiment of the disclosure, the mobile phone terminal does not need to design and develop a specific App at all, and the work originally completed by the App is distributed to the mPOS machine and the two terminal backgrounds, so that the complexity of system development is reduced, and the overall cost is further reduced.
In one embodiment of the present disclosure, at the user front end, all operations may be done through the interface of the mPOS machine only. As shown in the user interface variation diagram of fig. 3, a first user (usually a payee) first selects an operation type in the mPOS machine, and then sets the transaction information; the second user (usually the payer) swipes the card in the mPOS machine and enters the transaction password of the card correspondingly; the mPOS machine completes data interaction at the back end, and after transaction result information is received, a signature is handwritten in the mPOS machine by a second user; and the mPOS machine completes data interaction again at the back end, and confirms that the transaction is successful after receiving the signature processing result information.
By adopting the mode, the user can complete all the processes only through the mPOS machine at the front end without switching back and forth between the mPOS machine and the merchant mobile phone terminal; meanwhile, the mPOS machine only provided with the Bluetooth communication module can actively complete internet interaction without developing a specific App specially for a merchant mobile phone terminal, so that the embodiment of the disclosure realizes quick and convenient application of the low-cost mPOS machine, further reduces the system development and maintenance cost, and enhances the user experience.
The above method steps are described in an application scenario of swiping a card through an mPOS machine, and it should be understood by those skilled in the art that the embodiments of the present disclosure may also be applied to other interaction scenarios, such as an internet access scenario of devices such as a smart watch, a bluetooth sound box, smart glasses, and a smart bracelet, and therefore the above method steps should not be considered as limitations on specific execution devices in the embodiments of the present disclosure.
According to the Bluetooth data encapsulation communication method provided by the embodiment of the disclosure, the traditional Bluetooth slave device only having the Bluetooth communication capability can realize the Internet access capability without increasing the software and hardware cost, so that the device applicability is effectively improved, the rapid and convenient operation is realized, and the user experience is improved.
Fig. 4 is a schematic diagram of a bluetooth data encapsulation communication device, according to some embodiments of the present disclosure. As shown in fig. 4, the bluetooth data encapsulation communication device 400 includes a data encapsulation module 401, a BNEP connection module 402, a TCP sending module 403, a receiving module 404, and a data processing module 405; wherein the content of the first and second substances,
the data encapsulation module is used for setting the transaction information, receiving the card swiping information of the user, and performing TCP encapsulation and BNEP encapsulation to generate a Bluetooth data packet;
the BNEP connection module is used for initiating a BNEP connection request according to the Bluetooth data packet and establishing BNEP connection with the first terminal as the main equipment;
the TCP sending module is used for calling the mobile communication module of the first terminal through BNEP connection and sending the transaction information and the user card swiping information packaged by TCP in the Bluetooth data package to the background server through the Internet;
the receiving module is used for receiving result information returned by the background server through the first terminal;
and the data processing module is used for confirming that the transaction is completed according to the received and analyzed result information.
In some embodiments, the apparatus further comprises:
and the Bluetooth connection module is used for searching the Bluetooth pairing equipment and establishing a universal Bluetooth connection with the first terminal as the slave equipment.
In some embodiments, the apparatus further comprises:
and the thread management module is used for creating two threads, wherein the first thread realizes the data processing of an application layer in the method, and the second thread realizes the Bluetooth communication of a bottom layer in the method.
In some embodiments, the thread management module comprises:
the transaction thread sending module is used for determining that BNEP connection needs to be established according to the transaction information, packaging the transaction information and the user card swiping information by using a TCP (transmission control protocol), and initiating TCP connection to send data;
and the transaction thread receiving module is used for receiving the TCP data in the buffer area, analyzing and processing the TCP data to obtain result information, and confirming that the transaction is completed according to the result information.
In some embodiments, the thread management module comprises:
the background thread receiving module is used for receiving the Bluetooth data from the Bluetooth serial port and analyzing the Bluetooth data according to a Bluetooth protocol;
the connection setting module is used for setting a corresponding connection state when specific connection setting information is analyzed;
and the data buffer module is used for putting the TCP data into a buffer area when the TCP data is analyzed and received.
Referring to fig. 5, a schematic diagram of an electronic device is provided for one embodiment of the present disclosure. As shown in fig. 5, the electronic device 500 includes:
memory 530 and one or more processors 510;
wherein the memory 530 is communicatively coupled to the one or more processors 510, and instructions 532 executable by the one or more processors are stored in the memory 530, and the instructions 532 are executed by the one or more processors 510 to cause the one or more processors 510 to perform the methods of the foregoing embodiments of the present disclosure.
In particular, processor 510 and memory 530 may be connected by a bus or other means, such as bus 540 in FIG. 5. Processor 510 may be a Central Processing Unit (CPU). The Processor 510 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 530, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as the cascaded progressive network in the disclosed embodiments. The processor 510 performs various functional applications of the processor and data processing by executing non-transitory software programs, instructions, and functional modules 532 stored in the memory 530.
The memory 530 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 510, and the like. Further, memory 530 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 530 may optionally include memory located remotely from processor 510, which may be connected to processor 510 via a network, such as through communication interface 520. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
An embodiment of the present disclosure also provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are executed to perform the method in the foregoing embodiment of the present disclosure.
The foregoing computer-readable storage media include physical volatile and nonvolatile, removable and non-removable media implemented in any manner or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. The computer-readable storage medium specifically includes, but is not limited to, a USB flash drive, a removable hard drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), an erasable programmable Read-Only Memory (EPROM), an electrically erasable programmable Read-Only Memory (EEPROM), flash Memory or other solid state Memory technology, a CD-ROM, a Digital Versatile Disk (DVD), an HD-DVD, a Blue-Ray or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer.
While the subject matter described herein is provided in the general context of execution in conjunction with the execution of an operating system and application programs on a computer system, those skilled in the art will recognize that other implementations may also be performed in combination with other types of program modules. Generally, program modules include routines, programs, components, data structures, and other types of structures that perform particular tasks or implement particular abstract data types. Those skilled in the art will appreciate that the subject matter described herein may be practiced with other computer system configurations, including hand-held devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframe computers, and the like, as well as distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote memory storage devices.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure.
In summary, the present disclosure provides a bluetooth data encapsulation communication method, apparatus, electronic device and computer-readable storage medium thereof. According to the embodiment of the disclosure, TCP data are packaged and transmitted through the Bluetooth BNEP protocol, so that the traditional Bluetooth slave equipment only having the Bluetooth communication capability can realize the Internet access capability under the condition of not increasing the software and hardware cost, thereby effectively improving the equipment applicability, realizing rapid and convenient operation and improving the user experience.
It is to be understood that the above-described specific embodiments of the present disclosure are merely illustrative of or illustrative of the principles of the present disclosure and are not to be construed as limiting the present disclosure. Accordingly, any modification, equivalent replacement, improvement or the like made without departing from the spirit and scope of the present disclosure should be included in the protection scope of the present disclosure. Further, it is intended that the following claims cover all such variations and modifications that fall within the scope and bounds of the appended claims, or equivalents of such scope and bounds.

Claims (10)

1. A bluetooth data encapsulation communication method, comprising:
setting the transaction information, receiving the card swiping information of the user, and performing TCP (transmission control protocol) packaging and BNEP (bayonet nut seal) packaging to generate a Bluetooth data packet;
initiating a BNEP connection request according to the Bluetooth data packet, and establishing BNEP connection with the first terminal as a main device;
calling a mobile communication module of a first terminal through BNEP connection, and sending the transaction information and the user card swiping information packaged by TCP in the Bluetooth data package to a background server through the Internet;
receiving result information returned by the background server through the first terminal;
and confirming that the transaction is completed according to the received and analyzed result information.
2. The method of claim 1, further comprising:
starting up, searching Bluetooth pairing equipment as slave equipment to establish universal Bluetooth connection with the first terminal.
3. The method of claim 1, further comprising:
two threads are created, wherein the first thread realizes data processing of an application layer in the method, and the second thread realizes Bluetooth communication of a bottom layer in the method.
4. The method of claim 3, wherein the first thread implementing data processing at an application layer of the method comprises:
the first thread determines that BNEP connection needs to be established according to the transaction information, uses a TCP protocol to package the transaction information and the user card swiping information, and initiates TCP connection to send data;
and the first thread also receives the TCP data of the buffer area, analyzes and processes the TCP data to obtain result information, and confirms that the transaction is completed according to the result information.
5. The method of claim 3, wherein the second thread implementing underlying Bluetooth communication in the method comprises:
the second thread receives Bluetooth data from the Bluetooth serial port and analyzes the Bluetooth data according to a Bluetooth protocol;
if the specific connection setting information is analyzed, setting a corresponding connection state;
and if the TCP data is received by the analysis, the TCP data is placed into a buffer zone.
6. A bluetooth data encapsulation communication device, comprising:
the data encapsulation module is used for setting the transaction information, receiving the card swiping information of the user, and performing TCP encapsulation and BNEP encapsulation to generate a Bluetooth data packet;
the BNEP connection module is used for initiating a BNEP connection request according to the Bluetooth data packet and establishing BNEP connection with the first terminal as the main equipment;
the TCP sending module is used for calling the mobile communication module of the first terminal through BNEP connection and sending the transaction information and the user card swiping information packaged by TCP in the Bluetooth data package to the background server through the Internet;
the receiving module is used for receiving result information returned by the background server through the first terminal;
and the data processing module is used for confirming that the transaction is completed according to the received and analyzed result information.
7. The apparatus of claim 6, further comprising:
and the Bluetooth connection module is used for searching the Bluetooth pairing equipment and establishing a universal Bluetooth connection with the first terminal as the slave equipment.
8. The apparatus of claim 6, further comprising:
and the thread management module is used for creating two threads, wherein the first thread realizes the data processing of an application layer in the method, and the second thread realizes the Bluetooth communication of a bottom layer in the method.
9. The apparatus of claim 8, wherein the thread management module comprises:
the transaction thread sending module is used for determining that BNEP connection needs to be established according to the transaction information, packaging the transaction information and the user card swiping information by using a TCP (transmission control protocol), and initiating TCP connection to send data;
and the transaction thread receiving module is used for receiving the TCP data in the buffer area, analyzing and processing the TCP data to obtain result information, and confirming that the transaction is completed according to the result information.
10. The apparatus of claim 8, wherein the thread management module comprises:
the background thread receiving module is used for receiving the Bluetooth data from the Bluetooth serial port and analyzing the Bluetooth data according to a Bluetooth protocol;
the connection setting module is used for setting a corresponding connection state when specific connection setting information is analyzed;
and the data buffer module is used for putting the TCP data into a buffer area when the TCP data is analyzed and received.
CN202010481846.7A 2020-05-29 2020-05-29 Bluetooth data encapsulation communication method and device Pending CN111741453A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010481846.7A CN111741453A (en) 2020-05-29 2020-05-29 Bluetooth data encapsulation communication method and device
PCT/CN2020/113493 WO2021237975A1 (en) 2020-05-29 2020-09-04 Bluetooth data encapsulation communication method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010481846.7A CN111741453A (en) 2020-05-29 2020-05-29 Bluetooth data encapsulation communication method and device

Publications (1)

Publication Number Publication Date
CN111741453A true CN111741453A (en) 2020-10-02

Family

ID=72648018

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010481846.7A Pending CN111741453A (en) 2020-05-29 2020-05-29 Bluetooth data encapsulation communication method and device

Country Status (2)

Country Link
CN (1) CN111741453A (en)
WO (1) WO2021237975A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291772A (en) * 2020-12-30 2021-01-29 北京维普无限智能技术有限公司 Bluetooth device and communication method thereof
CN112330325A (en) * 2020-11-23 2021-02-05 拉卡拉支付股份有限公司 Transaction data acquisition method, apparatus, device, storage medium, and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8014339B1 (en) * 2003-02-25 2011-09-06 Hewlett-Packard Company Methods for providing universal network access within a wireless communication system
CN103268546A (en) * 2013-03-27 2013-08-28 上海富友支付服务有限公司 Mobile communication terminal-based bank card acquisition method
CN104123645A (en) * 2014-07-15 2014-10-29 北京金科联信数据科技有限公司 Financial security authentication based mobile Internet intelligent payment terminal and payment system
CN105184556A (en) * 2015-08-12 2015-12-23 珠海保税区星汉智能卡股份有限公司 Bluetooth-based mobile payment system and payment method
CN107274608A (en) * 2017-07-07 2017-10-20 武汉天喻信息产业股份有限公司 Intelligent POS, transaction system and method for commerce with electronic signature functionality
CN108460937A (en) * 2018-04-25 2018-08-28 北京百汇安科技有限公司 A kind of intelligence POS system and method for payment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5958254B2 (en) * 2012-09-28 2016-07-27 ブラザー工業株式会社 Specific server and communication device
CN105528722A (en) * 2014-09-29 2016-04-27 阿里巴巴集团控股有限公司 Method and device for sending/receiving data packet, data packet transmission system and mobile equipment
CN105050026A (en) * 2015-05-29 2015-11-11 深圳市明星网络有限公司 Device capable of carrying out short-distance communication through third party server and information interaction method thereof
CN107221111B (en) * 2017-05-26 2018-07-13 深圳飞人网络信息技术有限公司 Near field wireless POS devices, near field method of mobile payment and system
CN108390783A (en) * 2018-02-13 2018-08-10 广东嘉泰智能技术有限公司 A kind of configuration method and device of bluetooth equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8014339B1 (en) * 2003-02-25 2011-09-06 Hewlett-Packard Company Methods for providing universal network access within a wireless communication system
CN103268546A (en) * 2013-03-27 2013-08-28 上海富友支付服务有限公司 Mobile communication terminal-based bank card acquisition method
CN104123645A (en) * 2014-07-15 2014-10-29 北京金科联信数据科技有限公司 Financial security authentication based mobile Internet intelligent payment terminal and payment system
CN105184556A (en) * 2015-08-12 2015-12-23 珠海保税区星汉智能卡股份有限公司 Bluetooth-based mobile payment system and payment method
CN107274608A (en) * 2017-07-07 2017-10-20 武汉天喻信息产业股份有限公司 Intelligent POS, transaction system and method for commerce with electronic signature functionality
CN108460937A (en) * 2018-04-25 2018-08-28 北京百汇安科技有限公司 A kind of intelligence POS system and method for payment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
彭丽平等: "蓝牙网络封装协议", 《天津通信技术》 *
郑惠生等: "基于BNEP蓝牙移动终端接入网络的研究", 《软件导刊》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112330325A (en) * 2020-11-23 2021-02-05 拉卡拉支付股份有限公司 Transaction data acquisition method, apparatus, device, storage medium, and program product
CN112291772A (en) * 2020-12-30 2021-01-29 北京维普无限智能技术有限公司 Bluetooth device and communication method thereof

Also Published As

Publication number Publication date
WO2021237975A1 (en) 2021-12-02

Similar Documents

Publication Publication Date Title
US10848946B2 (en) Network access method, device, and system
CN108121568B (en) APP calling method and device, electronic equipment and readable storage medium
CN105763723B (en) Mobile terminal and method for upgrading system
EP4277237A2 (en) Method, apparatus, and system for supporting multiple imsis
EP2993802B1 (en) Near field communication-based data transmission method and apparatus, and near field communication device
WO2019184658A1 (en) Profile switching method and apparatus, and mobile terminal
KR101751225B1 (en) Apparatus and method for remote control in mobile communication terminal
CN108632901B (en) Data transmission method and terminal
CN104346560A (en) Security authentication method and security authentication device
CN111741453A (en) Bluetooth data encapsulation communication method and device
CN112001720B (en) mPOS machine and data processing method thereof
JP5931224B2 (en) Data access method and apparatus
CN113825123A (en) Communication method, communication device, electronic equipment and computer storage medium
US8451993B2 (en) Dial-up connection method and device of mobile data terminal
US20140038548A1 (en) Information processing apparatus and information processing method
CN113507750B (en) Terminal control method and device, terminal and storage medium
CN114650508B (en) Service update processing method and device
US9332374B2 (en) Communication interface method for SE equipped on mobile terminal and SE using the same
CN111625371A (en) Text transmission method, device, PC (personal computer) terminal, mobile terminal and system
CN111050377A (en) Method for sharing network connection by mobile terminal and mobile terminal
EP2991314A1 (en) Method and first device for loading an application
CN117793850A (en) Network access method, terminal, system, electronic equipment and storage medium
CN114501582A (en) Wi-Fi connection method, device, terminal and wireless access point
KR101105414B1 (en) Method for Transforming Data Coding Scheme of SMS and Smartcard therefor
CN104426589A (en) Data transmission method and electronic device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20201002

RJ01 Rejection of invention patent application after publication