Data transmission method, device, computer readable medium and electronic device

By using Bluetooth communication connections in the blockchain network to acquire target nodes and forward network data, the problems of high cost and poor quality of network connections in the prior art are solved, and flexible, low-cost and high-quality data transmission is achieved.

CN115580404BActive Publication Date: 2025-03-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110765355.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-06
Publication Date
2025-03-21
Estimated Expiration
2041-07-06

AI Technical Summary

Technical Problem

In the prior art, there are problems such as high network connection cost and poor network connection quality.

Method used

In a blockchain network established based on a Bluetooth communication connection, the target node associated with the current node is obtained, and the network data to be transmitted is forwarded to the target node through the Bluetooth communication connection, so that it can be transmitted to the external network.

Benefits of technology

Improves the flexibility of data transmission, reduces network connection costs, and improves network connection quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115580404B_ABST
    Figure CN115580404B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of blockchain technology, and specifically relates to a data transmission method, a data transmission device, a computer-readable medium, and an electronic device. The data transmission method includes: in a blockchain network established based on a Bluetooth communication connection, obtaining a target node associated with a current node, and the current node and the target node are connected to the external network of the blockchain network in different connection modes; when network data to be transmitted is generated on the current node, the network data is forwarded to the target node via a Bluetooth communication connection, so that the target node transmits the network data to the external network. The embodiment of the present application can improve the flexibility of data transmission, reduce network connection costs, and improve network connection quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of blockchain technology, and specifically relates to a data transmission method, a data transmission device, a computer-readable medium, and an electronic device. Background Art

[0002] With the development of computer and network technology, network connection through 4G network or WiFi can basically meet people's daily network needs. However, affected by factors such as network charges or network signal strength, various network connection methods have problems such as high cost or poor network quality. Summary of the invention

[0003] The purpose of this application is to provide a data transmission method, a data transmission device, a computer-readable medium and an electronic device, which can at least to some extent overcome the technical problems existing in the related art such as high network connection cost and poor network connection quality.

[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0005] According to one aspect of an embodiment of the present application, a data transmission method is provided, including: in a blockchain network established based on a Bluetooth communication connection, obtaining a target node associated with a current node, the current node and the target node accessing an external network of the blockchain network in different connection modes; when network data to be transmitted is generated on the current node, forwarding the network data to the target node via a Bluetooth communication connection, so that the target node transmits the network data to the external network.

[0006] According to one aspect of an embodiment of the present application, a data transmission device is provided, including: an acquisition module, configured to acquire a target node associated with a current node in a blockchain network established based on a Bluetooth communication connection, the current node and the target node being connected to an external network of the blockchain network in different connection modes; a forwarding module, configured to forward the network data to the target node via a Bluetooth communication connection when network data to be transmitted is generated on the current node, so that the target node transmits the network data to the external network.

[0007] In some embodiments of the present application, based on the above technical solution, the current node accesses the external network of the blockchain network in a first connection mode; the acquisition module includes: a search module, configured to search for candidate nodes on the blockchain network that access the external network in a second connection mode, the second connection mode is a network connection mode different from the first connection mode; a selection module, configured to select the candidate node closest to the current node as the target node associated with the current node.

[0008] In some embodiments of the present application, based on the above technical solution, the search module includes: a network status collection module, configured to collect the network status of each blockchain node in the blockchain network through a miner node, the miner node is a node used to package blocks, and the network status is used to indicate the connection mode in which the blockchain node accesses the external network; a candidate node selection module, configured to search for candidate nodes that access the external network in a second connection mode according to the network status of each blockchain node.

[0009] In some embodiments of the present application, based on the above technical solution, the network status acquisition module includes: a data collection module, configured to collect the transaction data generated on each blockchain node in the blockchain network to the miner node; a data detection module, configured to perform data detection on the transaction data flowing through the miner node to obtain the network status of the blockchain node carried in the transaction data.

[0010] In some embodiments of the present application, based on the above technical solution, the search module also includes: a transaction quantity acquisition module, configured to obtain the transaction quantity corresponding to each blockchain node in the blockchain network; a miner node selection module, configured to select the blockchain node with the highest idleness as the miner node according to the transaction quantity, and the idleness is negatively correlated with the transaction quantity.

[0011] In some embodiments of the present application, based on the above technical solution, the transaction quantity acquisition module includes: a bill maintenance module, configured to maintain a bill for recording the transaction status of each blockchain node on each blockchain node in the blockchain network; a transaction statistics module, configured to count the transaction status of each blockchain node according to a preset time period, and write the statistical results into the bill; a bill synchronization module, configured to broadcast the bill in the blockchain network so that each blockchain node synchronizes bill data; a quantity acquisition module, configured to obtain the transaction quantity corresponding to each blockchain node from the bill after data synchronization.

[0012] In some embodiments of the present application, based on the above technical solution, the transaction statistics module is also configured as follows: if the blockchain node triggers at least one transaction within the preset time period, the transaction quantity is written as 1 into the bill; if the blockchain node does not trigger any transaction within the preset time period, the transaction quantity is written as 0 into the bill.

[0013] In some embodiments of the present application, based on the above technical solution, the miner node selection module includes: a node sorting module, which is configured to sort the various blockchain nodes in the blockchain network according to the number of transactions after a preset number of blocks are generated in the blockchain network; and a node selection module, which is configured to select the blockchain node with the highest idleness as the miner node according to the sorting result.

[0014] In some embodiments of the present application, based on the above technical solution, the first connection mode is a mobile communication connection, and the second connection mode is at least one of a wireless LAN connection or a wired LAN connection.

[0015] In some embodiments of the present application, based on the above technical solution, the forwarding module includes: a graph acquisition module, configured to obtain a connection structure diagram for Bluetooth communication connections between various blockchain nodes in the blockchain network; a path search module, configured to search for the shortest path from the current node to the target node according to the connection structure diagram; and a path forwarding module, configured to forward the network data from the current node to the target node according to the shortest path.

[0016] In some embodiments of the present application, based on the above technical solution, the graph acquisition module includes: a Bluetooth configuration module, configured to configure the Bluetooth of the current node to be turned on; a node search module, configured to search for other blockchain nodes located around the current node through the Bluetooth of the current node; a Bluetooth connection module, configured to establish a Bluetooth communication connection between the current node and the other blockchain nodes based on the search results, and record the node identifiers of the other blockchain nodes in the node list stored in the current node; a node synchronization module, configured to synchronize the node lists of the current node and the other blockchain nodes to generate a connection structure diagram of each blockchain node in the blockchain network.

[0017] In some embodiments of the present application, based on the above technical solution, the blockchain node in the blockchain network is a terminal device with a face recognition function.

[0018] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data transmission method in the above technical solution is implemented.

[0019] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the data transmission method in the above technical solution by executing the executable instructions.

[0020] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data transmission method in the above technical solution.

[0021] In the technical solution provided in the embodiment of the present application, data communication between various blockchain nodes can be achieved by establishing a blockchain network based on Bluetooth communication connection, and network data forwarding can be performed between various blockchain nodes that access the external network in different connection methods, which can improve the flexibility of data transmission, reduce network connection costs, and improve network connection quality.

[0022] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 A schematic diagram of the composition of a blockchain system is shown schematically.

[0025] Figure 2 The structure of a blockchain maintained on a blockchain network is shown.

[0026] Figure 3 A schematic diagram of the process of generating a new block is shown.

[0027] Figure 4 The following is a flowchart schematically showing the steps of a data transmission method in one embodiment of the present application.

[0028] Figure 5 The following schematically shows a business process diagram based on a blockchain network in one embodiment of the present application.

[0029] Figure 6 The flowchart schematically shows the steps of obtaining the target node in one embodiment of the present application.

[0030] Figure 7 The flowchart schematically shows the steps of searching for candidate nodes in one embodiment of the present application.

[0031] Figure 8 The flowchart schematically shows the steps of Bluetooth forwarding of network data in one embodiment of the present application.

[0032] Fig. 9 The figure schematically shows a connection structure diagram of a node cluster based on Bluetooth association in one embodiment of the present application.

[0033] Fig.10 The service flow chart for network data forwarding in one embodiment of the present application is schematically shown.

[0034] Fig.11 The structural block diagram of the data transmission device provided in an embodiment of the present application is schematically shown.

[0035] Fig.12 The structure block diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0037] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0038] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0039] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0040] The technical solution provided in the embodiments of the present application mainly involves transaction business scenarios such as online payment and transfer based on blockchain technology. Blockchain technology can be used to regulate the business processing status and capabilities of offline devices, thereby ensuring that the business system has strong business continuity and stable reliability.

[0041] Blockchain is a shared digital ledger with a chained-block data structure that is anti-counterfeiting, anti-tampering and traceable, built through transparent and trusted rules in a peer-to-peer network environment. The block-chain data structure is a data structure that stores transactions that occur over a period of time in blocks and connects the blocks into a chain in chronological order using a cryptographic algorithm. The ledger is distributed to all member nodes in the network, and the history of asset transactions that occur between peer nodes in the network is permanently recorded in a sequential chain of blocks linked by a hash cryptographic algorithm. All confirmed and proven transactions are linked from the beginning of the chain to the latest block, hence the name blockchain. The blockchain can act as a single source of truth, and members in the blockchain network can only view transactions that are relevant to them.

[0042] Figure 1 The schematic diagram of the composition of a blockchain system is schematically shown. The blockchain system 100 may include at least one client 110 and a blockchain network 120. The blockchain network 120 includes at least one blockchain node 121. The client 110 may be a smart phone, tablet computer, laptop computer, desktop computer, smart wearable device, smart vehicle device, smart payment terminal, facial recognition terminal and other electronic devices. By installing the corresponding client application, blockchain data services can be provided to users. The blockchain node 121 may be a terminal device or a server. For example, the blockchain node 121 may be an independent physical server, a server cluster composed of multiple physical servers, or a cloud server providing cloud computing services.

[0043] In the blockchain network 120, each blockchain node 121 can receive input information when performing normal work, and maintain shared data in the blockchain network based on the received input information. In order to ensure information intercommunication, there can be information connections between the blockchain nodes 121, and the blockchain nodes 121 can transmit information to each other through the information connection. For example, when any blockchain node 121 in the blockchain network 120 receives input information and broadcasts the input information in the blockchain network 120, other node devices in the blockchain network 120 can obtain the input information according to the consensus algorithm and store the input information as shared data.

[0044] Each blockchain node 121 in the blockchain network 120 has a node identifier corresponding thereto, and each blockchain node 121 in the blockchain network 120 can store the node identifiers of other blockchain nodes in the same blockchain network, so that the generated blocks can be broadcast to other nodes in the blockchain network 120 according to the node identifiers of other blockchain nodes. A node identifier list as shown in Table 1 can be maintained in the blockchain node 121, and the node name and the node identifier are stored in the node identifier list accordingly. Among them, the node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address and any other information that can be used to identify the node. Table 1 is a node identifier list taking an IP address as an example.

[0045] Table 1

[0046] Node Name Node ID Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258

[0047] Figure 2 The structure of the blockchain maintained on the blockchain network is shown. Figure 2 As shown, the blockchain consists of a plurality of sequentially connected blocks. Whenever new data needs to be written into the blockchain, these data will be aggregated into a newly generated block, and the newly generated block will be linked to the end of the blockchain. The consensus algorithm can ensure that the newly added blocks on each node device 121 are exactly the same. The data of the current block is recorded in the block body of each block, and the hash value (Hash) of the previous block connected to it is saved in its block header. If the transaction data in the previous block changes, the hash value of the current block will also change accordingly. Therefore, the data uploaded to the blockchain network is difficult to be tampered with, which can improve the reliability of shared data.

[0048] Figure 3 A schematic diagram of the generation process of a new block is shown. Figure 3As shown in the figure, when generating each block in the blockchain, the blockchain node first verifies the received input information. After the verification is completed, the input information is stored in the memory pool, and the hash tree used to record the input information is updated; then, the update timestamp is updated to the time when the input information is received, and different random numbers are tried, and the eigenvalue calculation is performed multiple times, so that the calculated eigenvalue can satisfy the following formula:

[0049] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET

[0050] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.

[0051] In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and block body can be generated, and the current block can be obtained. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes in the data sharing system according to the node identification of other nodes in the data sharing system. Other nodes verify the newly generated block and add the newly generated block to the blockchain stored in them after the verification is completed.

[0052] The data transmission method provided in the embodiment of the present application is described in detail below in conjunction with specific implementation methods.

[0053] Figure 4 The flowchart schematically shows the steps of a data transmission method in an embodiment of the present application. The method can be performed by Figure 1 The terminal device shown as the client can also be executed by a blockchain node in the blockchain network. The embodiment of the present application takes the data transmission method executed by the blockchain node as an example to illustrate, Figure 4 As shown, the data transmission method may include the following steps S410 to S420.

[0054] Step S410: In a blockchain network established based on a Bluetooth communication connection, a target node associated with a current node is obtained, and the current node and the target node are connected to an external network of the blockchain network in different connection modes.

[0055] Bluetooth is a wireless communication technology standard that can be used to exchange data between fixed or mobile devices over short distances to form a personal area network (PAN).

[0056] In one embodiment of the present application, an offline Internet of Things (IOT) device can establish a blockchain network based on Bluetooth communication connection, that is, each blockchain node in the blockchain network transmits data to each other through Bluetooth communication connection. On the blockchain maintained by the blockchain network, each block can be regarded as an encrypted file containing device transaction details + timestamp + block hash. In the embodiment of the present application, the size of the block is specified to be 20M, and the complete record of a single transaction is about 1k.

[0057] Figure 5 The following schematically shows a business process diagram based on a blockchain network in one embodiment of the present application. Figure 5 As shown, a node cluster based on Bluetooth communication connection forms a blockchain network. For example, node 1 in the figure is connected to node 2 via Bluetooth, and node 2 is connected to node 3 via Bluetooth.

[0058] A blockchain is maintained on the blockchain network, and each node stores the transaction system and node list of the blockchain network. The transaction system is used to execute transaction services. For example, when the blockchain node is a payment device with a face recognition function, face recognition can be performed through the transaction system, and the face recognition result and the corresponding payment result are stored on the blockchain network as transaction data. The node list is used to store the node identification of each blockchain node in the blockchain network. The node list stored on each blockchain node can be the same or different.

[0059] Multiple locally generated blocks are also stored on the blockchain node. For example, node 1 stores blocks 1 to 3, node 2 stores blocks 4 to 6, and node 3 stores blocks 7 to 9. Each block can be regarded as an encrypted file including multiple transaction records. The encrypted file is encrypted and decrypted using a symmetric key. Each IOT device has a unique decryption key burned into the device system layer Rom, which cannot be forcibly obtained by technical means. Through the private key, each IOT device can obtain the data information in the encrypted block. When a transaction is generated on a blockchain node, a miner node can be selected to write the transaction record into the block, and then the block is linked to the blockchain through the chain operation.

[0060] The blockchain in the embodiment of the present application is a private chain, that is, the data read and write permissions of the blockchain are controlled within the range of the node cluster formed based on the Bluetooth communication connection. In order to realize network payment or other business functions, at least a part of the blockchain nodes in the embodiment of the present application needs to be connected to the external network of the blockchain network through various connection methods to realize data transmission between the blockchain network and the external network. For example, the transaction data generated and stored on the blockchain network can be sent to an external server, so that the external server can complete operations such as network payment or transfer based on the transaction data. After executing the operation, the external server can also transmit the transaction results to the blockchain network to store the transaction results on the chain.

[0061] The blockchain network in the embodiment of the present application is connected to the external network in communication with at least two different connection modes. For example, a part of the blockchain nodes are connected to the external network through a first connection mode, and another part of the blockchain nodes are connected to the external network through a second connection mode different from the first connection mode. Among them, the first connection mode or the second connection mode may include, for example, a mobile communication connection based on a 4G or 5G network and a communication connection based on a wireless local area network or a wired local area network.

[0062] In the embodiment of the present application, an association relationship can be established between two blockchain nodes that are connected to an external network in different connection modes. The association relationship can be a pre-established fixed association relationship or a temporary association relationship established when specific conditions are met. For example, when a network data transmission demand is generated on the current node, a blockchain node can be selected as the target node according to the data recorded in the node list.

[0063] Step S420: When network data to be transmitted is generated on the current node, the network data is forwarded to the target node via the Bluetooth communication connection, so that the target node transmits the network data to the external network.

[0064] The current node uses a first connection mode to access the external network, and the target node uses a second connection mode different from the first connection mode to access the external network. When network data to be transmitted is generated on the current node, the current node does not transmit the network data to the external network through the first connection mode, but chooses to forward the network data to the target node through a Bluetooth communication connection, and then transmits the network data to the external network through the target node.

[0065] In one embodiment of the present application, the first connection mode is a mobile communication connection, and the second connection mode is at least one of a wireless local area network connection or a wired local area network connection.

[0066] Take an application scenario as an example. The current node accesses an external server based on the 4G / 5G network, and the target node accesses the external server by connecting to WiFi. When network data that needs to be sent to the external server is generated on the current node, if it is sent through the 4G / 5G network, a large amount of traffic consumption may be generated. In the case of high traffic charges, this will result in a large data transmission cost. In order to save data transmission costs, the current node can choose to forward the network data to the target node via Bluetooth communication connection, and the target node will send it to the external server via WiFi.

[0067] In one embodiment of the present application, the first connection mode is at least one of a wireless LAN connection or a wired LAN connection, and the second connection mode is a mobile communication connection.

[0068] Take an application scenario as an example. The current node accesses an external server by connecting to WiFi, while the target node accesses the external server based on the 4G / 5G network. When network data that needs to be sent to the external server is generated on the current node, the signal strength of the current WiFi connection can be detected. If the signal strength is relatively low, it means that the connection quality is relatively poor, which will cause the transmission speed of the network data to decrease. In order to improve the efficiency of data transmission, the current node can choose to forward the network data to the target node via Bluetooth communication connection, and the target node will send it to the external server via the 4G / 5G network.

[0069] In one embodiment of the present application, the current node accesses the external network of the blockchain network in a first connection mode. In order to find the target node associated therewith, the nodes in the blockchain network can be first screened according to the connection mode to obtain candidate nodes that access the external network in a second connection mode, and then the distance between each candidate node and the current node is compared, and finally the candidate node with the closest distance is selected as the target node associated with the current node.

[0070] Figure 6 The following schematically shows a flow chart of steps for obtaining a target node in one embodiment of the present application. Figure 6 As shown, based on the above embodiment, the method for obtaining the target node associated with the current node in step S410 may include the following steps S610 to S620.

[0071] Step S610: searching for candidate nodes on the blockchain network that access an external network in a second connection mode, where the second connection mode is a network connection mode different from the first connection mode.

[0072] Step S620: Select the candidate node that is closest to the current node as the target node associated with the current node.

[0073] In one embodiment of the present application, the distance between two blockchain nodes refers to the length of the communication link. For example, the candidate nodes include two nodes A and B; starting from node A, the current node can be reached after passing through 5 path nodes, and starting from node B, the current node can be reached after passing through 3 path nodes. If the distance between node B and the current node is less than the distance between node A and the current node, node B can be selected as the target node associated with the current node.

[0074] In one embodiment of the present application, the distance between two blockchain nodes can be an actual physical distance. For example, the candidate nodes include two nodes A and B; the distance between node A and the current node is 5 meters, and the distance between node B and the current node is 3 meters. Then the distance between node B and the current node is less than the distance between node A and the current node. In this case, node B can be selected as the target node associated with the current node.

[0075] Figure 7 The flowchart of the steps of searching for candidate nodes in one embodiment of the present application is schematically shown. Figure 7 As shown, based on the above embodiments, searching for candidate nodes on the blockchain network that access the external network in the second connection mode in step S610 may include the following steps S710 to S740.

[0076] Step S710: Obtain the transaction quantity corresponding to each blockchain node in the blockchain network.

[0077] In one embodiment of the present application, each blockchain node in the blockchain network can each record its own transaction status and synchronize data in a timely manner to obtain the transaction quantity corresponding to each blockchain node.

[0078] In one embodiment of the present application, a method for obtaining the number of transactions corresponding to each blockchain node in a blockchain network may include: maintaining a bill for recording the transaction status of each blockchain node on each blockchain node in the blockchain network; counting the transaction status of each blockchain node according to a preset time period, and writing the statistical results into the bill; broadcasting the bill in the blockchain network so that each blockchain node synchronizes the bill data; and obtaining the number of transactions corresponding to each blockchain node from the bill after data synchronization.

[0079] In one embodiment of the present application, the method for each blockchain node to write statistical results into the bill may include: if the blockchain node triggers at least one transaction within a preset time period, the transaction number written into the bill is 1; if the blockchain node does not trigger any transaction within the preset time period, the transaction number written into the bill is 0.

[0080] For example, if the preset time period is 12 hours, each blockchain node can count whether it triggers a transaction within 12 hours. If at least one transaction is triggered, the number of transactions recorded is 1; if no transaction is triggered, the number of transactions recorded is 0. For example, if node A triggers 5 transactions within 12 hours, the number of transactions recorded is 1; if node B triggers 3 transactions within 12 hours, the number of transactions recorded is also 1.

[0081] In one embodiment of the present application, the number of transactions written into the bill by each blockchain node may also be the number of transactions triggered by the blockchain node within a preset time period. For example, if node A triggers 5 transactions within 12 hours, the recorded number of transactions is 5; if node B triggers 3 transactions within 12 hours, the recorded number of transactions is 3.

[0082] Step S720: Select the blockchain node with the highest idleness as the miner node according to the number of transactions, and the idleness is negatively correlated with the number of transactions.

[0083] In one embodiment of the present application, after a preset number of blocks are generated in the blockchain network, each blockchain node in the blockchain network is sorted according to the number of transactions; and the blockchain node with the highest idleness is selected as the miner node based on the sorting result.

[0084] In the embodiment of the present application, it is stipulated that each miner node can generate at least a preset number of blocks. For example, if the preset number is 3, the current miner node can continuously generate and save 3 blocks. According to the number of transactions of each blockchain node obtained by statistics in the process of generating these 3 blocks, the nodes are sorted, and then the blockchain node with the highest idleness is selected as the new miner node according to the sorting result.

[0085] Step S730: The network status of each blockchain node in the blockchain network is collected through the miner node. The miner node is a node used to package blocks. The network status is used to indicate the connection method of the blockchain node to access the external network.

[0086] In one embodiment of the present application, the transaction data generated on each blockchain node in the blockchain network is collected to the miner node; the transaction data flowing through the miner node is detected to obtain the network status of the blockchain node carried in the transaction data. The network status represents the connection mode between a blockchain node and the external network. When a blockchain node triggers a transaction and generates corresponding transaction data, the transaction data and its own network status can be sent to the miner node together, so that the miner node can realize the statistics of the network status of each blockchain node while recording the transaction data.

[0087] Step S740: According to the network status of each blockchain node, search for candidate nodes that access the external network in the second connection mode.

[0088] In an embodiment of the present application, after the network status of each blockchain node is obtained by statistics of the miner node, candidate nodes of the external network of the node in the second connection mode can be screened and found.

[0089] Figure 8 The following is a schematic diagram showing the steps of forwarding network data via Bluetooth in one embodiment of the present application. Figure 8 As shown, based on the above embodiment, forwarding the network data to the target node via the Bluetooth communication connection in step S420 may include the following steps S810 to S830.

[0090] Step S810: Obtain a connection structure diagram for Bluetooth communication connection between each blockchain node in the blockchain network.

[0091] Step S820: Find the shortest path from the current node to the target node according to the connection structure graph.

[0092] Step S830: forwarding the network data from the current node to the target node according to the shortest path.

[0093] In one embodiment of the present application, a method for obtaining a connection structure diagram of each blockchain node in a blockchain network for Bluetooth communication connection may include: configuring the Bluetooth of the current node to be turned on; searching for other blockchain nodes located around the current node through the Bluetooth of the current node; establishing a Bluetooth communication connection between the current node and the other blockchain nodes based on the search results, and recording the node identifiers of the other blockchain nodes in a node list stored in the current node; and performing node synchronization on the node lists of the current node and other blockchain nodes to generate a connection structure diagram of each blockchain node in the blockchain network.

[0094] Fig. 9 The following schematically shows a connection structure diagram of a node cluster based on Bluetooth association in one embodiment of the present application. Fig. 9 As shown in the figure, with node 1 as the initial node, after the Bluetooth of node 1 is configured to be turned on, nodes 2, 3 and 4 with Bluetooth turned on around it can be searched, and then nodes 2, 3 and 4 search for other nodes around them. Among them, node 3 searches for nodes 5, 7 and 8. By analogy, the connection structure diagram of each blockchain node in the blockchain network can be obtained by continuously expanding outward.

[0095] Fig.10 The following schematically shows a service flow chart for network data forwarding in one embodiment of the present application. Fig.10 As shown, the miner node 1001 is a node on the blockchain network for block packaging and accounting. Since the miner node records the network status of each blockchain node, it can realize the association and pairing of two blockchain nodes connected to the external network in different connection modes. The miner node 1001 can send notification messages to the current node 1002 and the target node 1003 respectively to notify the current node 1002 to establish a Bluetooth connection path with the target node 1003. Among them, the current node 1002 is a 4G node connected to the external network based on the 4G network, and the target node 1003 is a wired / WiFi node connected to the external network based on a wired LAN or WiFi.

[0096] In the embodiment of the present application, through the continuous operation of the miner node 1001, a directional data transmission target node will eventually be established for all 4G nodes in the entire blockchain network. The 4G node will find the shortest path to the target node based on the graph structure of the locally synchronized node cluster, and notify each node on the path, requiring it to perform data forwarding operations on the 4G node. When the 4G node triggers a network operation, the data stream will be packaged and transmitted to the target node through the forwarding of the path node. The means of transmission is through Bluetooth data forwarding, and then forwarded to the background cloud server 1004 through the wired / wifi network proxy of the target node. The final server result is also transmitted from the target node to the 4G node in reverse to complete a data forwarding operation. Through this strategy, the 4G device can save the traffic consumption caused by sending a request once.

[0097] The embodiment of the present application implements a throttling technology solution based on the combination of blockchain and Bluetooth. This solution can effectively solve the traffic consumption that partially relies on mobile cards for network transmission, thereby achieving the purpose of helping offline merchants to save money.

[0098] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0099] The following introduces an apparatus embodiment of the present application, which can be used to execute the data transmission method in the above-mentioned embodiment of the present application. Fig.11 The structure block diagram of the data transmission device provided in the embodiment of the present application is schematically shown. Fig.11As shown, the data transmission device 1100 includes: an acquisition module 1110, configured to acquire a target node associated with a current node in a blockchain network established based on a Bluetooth communication connection, wherein the current node and the target node are connected to an external network of the blockchain network in different connection modes; a forwarding module 1120, configured to forward the network data to the target node via a Bluetooth communication connection when network data to be transmitted is generated on the current node, so that the target node transmits the network data to the external network.

[0100] In some embodiments of the present application, based on the above technical solution, the current node accesses the external network of the blockchain network in a first connection mode; the acquisition module 1110 includes: a search module, configured to search for candidate nodes on the blockchain network that access the external network in a second connection mode, wherein the second connection mode is a network connection mode different from the first connection mode; a selection module, configured to select the candidate node closest to the current node as the target node associated with the current node.

[0101] In some embodiments of the present application, based on the above technical solution, the search module includes: a network status collection module, configured to collect the network status of each blockchain node in the blockchain network through a miner node, the miner node is a node used to package blocks, and the network status is used to indicate the connection mode in which the blockchain node accesses the external network; a candidate node selection module, configured to search for candidate nodes that access the external network in a second connection mode according to the network status of each blockchain node.

[0102] In some embodiments of the present application, based on the above technical solution, the network status acquisition module includes: a data collection module, configured to collect the transaction data generated on each blockchain node in the blockchain network to the miner node; a data detection module, configured to perform data detection on the transaction data flowing through the miner node to obtain the network status of the blockchain node carried in the transaction data.

[0103] In some embodiments of the present application, based on the above technical solution, the search module also includes: a transaction quantity acquisition module, configured to obtain the transaction quantity corresponding to each blockchain node in the blockchain network; a miner node selection module, configured to select the blockchain node with the highest idleness as the miner node according to the transaction quantity, and the idleness is negatively correlated with the transaction quantity.

[0104] In some embodiments of the present application, based on the above technical solution, the transaction quantity acquisition module includes: a bill maintenance module, configured to maintain a bill for recording the transaction status of each blockchain node on each blockchain node in the blockchain network; a transaction statistics module, configured to count the transaction status of each blockchain node according to a preset time period, and write the statistical results into the bill; a bill synchronization module, configured to broadcast the bill in the blockchain network so that each blockchain node synchronizes bill data; a quantity acquisition module, configured to obtain the transaction quantity corresponding to each blockchain node from the bill after data synchronization.

[0105] In some embodiments of the present application, based on the above technical solution, the transaction statistics module is also configured as follows: if the blockchain node triggers at least one transaction within the preset time period, the transaction quantity is written as 1 into the bill; if the blockchain node does not trigger any transaction within the preset time period, the transaction quantity is written as 0 into the bill.

[0106] In some embodiments of the present application, based on the above technical solution, the miner node selection module includes: a node sorting module, which is configured to sort the various blockchain nodes in the blockchain network according to the number of transactions after a preset number of blocks are generated in the blockchain network; and a node selection module, which is configured to select the blockchain node with the highest idleness as the miner node according to the sorting result.

[0107] In some embodiments of the present application, based on the above technical solution, the first connection mode is a mobile communication connection, and the second connection mode is at least one of a wireless LAN connection or a wired LAN connection.

[0108] In some embodiments of the present application, based on the above technical solution, the forwarding module 1120 includes: a graph acquisition module, configured to obtain a connection structure diagram for Bluetooth communication connection of each blockchain node in the blockchain network; a path search module, configured to search for the shortest path from the current node to the target node according to the connection structure diagram; and a path forwarding module, configured to forward the network data from the current node to the target node according to the shortest path.

[0109] In some embodiments of the present application, based on the above technical solution, the graph acquisition module includes: a Bluetooth configuration module, configured to configure the Bluetooth of the current node to be turned on; a node search module, configured to search for other blockchain nodes located around the current node through the Bluetooth of the current node; a Bluetooth connection module, configured to establish a Bluetooth communication connection between the current node and the other blockchain nodes based on the search results, and record the node identifiers of the other blockchain nodes in the node list stored in the current node; a node synchronization module, configured to synchronize the node lists of the current node and the other blockchain nodes to generate a connection structure diagram of each blockchain node in the blockchain network.

[0110] In some embodiments of the present application, based on the above technical solution, the blockchain node in the blockchain network is a terminal device with a face recognition function.

[0111] The specific details of the data transmission device provided in each embodiment of the present application have been described in detail in the corresponding method embodiments and will not be repeated here.

[0112] Fig.12 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.

[0113] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0114] like Fig.12 As shown, the computer system 1200 includes a central processing unit 1201 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1202 (ROM) or the program loaded from the storage part 1208 to the random access memory 1203 (RAM). Various programs and data required for system operation are also stored in the random access memory 1203. The central processing unit 1201, the read-only memory 1202 and the random access memory 1203 are connected to each other through a bus 1204. An input / output interface 1205 (Input / Output interface, i.e., I / O interface) is also connected to the bus 1204.

[0115] The following components are connected to the input / output interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the input / output interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.

[0116] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1209, and / or installed from the removable medium 1211. When the computer program is executed by the central processor 1201, various functions defined in the system of the present application are executed.

[0117] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0118] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0119] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0120] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0121] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

[0122] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A data transmission method, characterized in that: include: In a blockchain network established based on a Bluetooth communication connection, a target node associated with a current node is obtained, wherein the current node and the target node are connected to an external network of the blockchain network in different connection modes; When network data to be transmitted is generated on the current node, the network data is forwarded to the target node via a Bluetooth communication connection, so that the target node transmits the network data to the external network.

2. The data transmission method according to claim 1, characterized in that: The current node accesses the external network of the blockchain network in a first connection mode; Get the target node associated with the current node, including: Searching for a candidate node on the blockchain network that accesses the external network in a second connection mode, where the second connection mode is a network connection mode different from the first connection mode; A candidate node that is closest to the current node is selected as a target node associated with the current node.

3. The data transmission method according to claim 2, characterized in that: Searching for a candidate node on the blockchain network that accesses the external network in a second connection manner includes: The network status of each blockchain node in the blockchain network is collected through a miner node, where the miner node is a node used to package blocks, and the network status is used to indicate the connection mode of the blockchain node to access the external network; According to the network status of each blockchain node, search for a candidate node that accesses the external network in a second connection manner.

4. The data transmission method according to claim 3, characterized in that: The network status of each blockchain node in the blockchain network is collected through the miner node, including: Aggregate transaction data generated on each blockchain node in the blockchain network to a miner node; Data detection is performed on the transaction data flowing through the miner node to obtain the network status of the blockchain node carried in the transaction data.

5. The data transmission method according to claim 3, characterized in that: Before collecting the network status of each blockchain node in the blockchain network through the miner node, the method further includes: Obtaining the number of transactions corresponding to each blockchain node in the blockchain network; The blockchain node with the highest idleness is selected as the miner node according to the transaction quantity, and the idleness is negatively correlated with the transaction quantity.

6. The data transmission method according to claim 5, characterized in that: Obtaining the number of transactions corresponding to each blockchain node in the blockchain network, including: On each blockchain node in the blockchain network, a bill for recording the transaction status of each blockchain node is maintained; Counting the transaction status of each blockchain node according to a preset time period, and writing the statistical results into the bill; Broadcasting the bill in the blockchain network so that each blockchain node synchronizes bill data; The transaction quantity corresponding to each blockchain node is obtained from the bill after data synchronization.

7. The data transmission method according to claim 6, characterized in that: The statistical results are written into the bill, including: If the blockchain node triggers at least one transaction within the preset time period, the transaction quantity is written as 1 into the bill; If the blockchain node does not trigger any transaction within the preset time period, the transaction quantity written into the bill is 0.

8. The data transmission method according to claim 5, characterized in that: According to the number of transactions, the blockchain node with the highest idleness is selected as the miner node, including: After a preset number of blocks are generated in the blockchain network, sorting the blockchain nodes in the blockchain network according to the number of transactions; According to the sorting results, the blockchain node with the highest idleness is selected as the miner node.

9. The data transmission method according to claim 2, characterized in that: The first connection mode is a mobile communication connection, and the second connection mode is at least one of a wireless local area network connection and a wired local area network connection.

10. The data transmission method according to claim 1, characterized in that: Forwarding the network data to the target node via a Bluetooth communication connection includes: Obtain a connection structure diagram of each blockchain node in the blockchain network for Bluetooth communication connection; Find the shortest path connecting the current node to the target node according to the connection structure graph; The network data is forwarded from the current node to the target node according to the shortest path.

11. The data transmission method according to claim 10, characterized in that: Obtaining a connection structure diagram of each blockchain node in the blockchain network for Bluetooth communication connection, including: Configure the Bluetooth of the current node to be turned on; Searching for other blockchain nodes around the current node through the Bluetooth of the current node; Establishing a Bluetooth communication connection between the current node and the other blockchain nodes according to the search results, and recording the node identifiers of the other blockchain nodes in the node list stored in the current node; Node synchronization is performed on the node lists of the current node and the other blockchain nodes to generate a connection structure diagram of each blockchain node in the blockchain network.

12. The data transmission method according to claim 1, characterized in that: The blockchain nodes in the blockchain network are terminal devices with face recognition functions.

13. A data transmission device, characterized in that: include: An acquisition module is configured to acquire a target node associated with a current node in a blockchain network established based on a Bluetooth communication connection, wherein the current node and the target node are connected to an external network of the blockchain network in different connection modes; The forwarding module is configured to forward the network data to the target node via a Bluetooth communication connection when network data to be transmitted is generated on the current node, so that the target node transmits the network data to the external network.

14. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data transmission method according to any one of claims 1 to 12.

15. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the data transmission method according to any one of claims 1 to 12 by executing the executable instructions.

Citation Information

Patent Citations

  • Block chain network transmission method and system based on Bluetooth, NFC and AIRDROP

    CN110475232A

  • Gate, ticket checking transaction method and device thereof, and storage medium

    CN112669471A