CN113472825B - NB-IoT terminal transaction processing method and device based on block chain - Google Patents

NB-IoT terminal transaction processing method and device based on block chain Download PDF

Info

Publication number
CN113472825B
CN113472825B CN202010237761.4A CN202010237761A CN113472825B CN 113472825 B CN113472825 B CN 113472825B CN 202010237761 A CN202010237761 A CN 202010237761A CN 113472825 B CN113472825 B CN 113472825B
Authority
CN
China
Prior art keywords
terminal node
terminal
node
state
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010237761.4A
Other languages
Chinese (zh)
Other versions
CN113472825A (en
Inventor
宋国兴
张建强
高宗宝
张家铭
刘丽美
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Group Design Institute Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Design Institute 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 China Mobile Communications Group Co Ltd, China Mobile Group Design Institute Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010237761.4A priority Critical patent/CN113472825B/en
Publication of CN113472825A publication Critical patent/CN113472825A/en
Application granted granted Critical
Publication of CN113472825B publication Critical patent/CN113472825B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computing Systems (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • Marketing (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • Computer Hardware Design (AREA)
  • Development Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method and a device for processing terminal transaction in NB-IoT based on a block chain, wherein the method comprises the following steps: taking a terminal in NB-IoT as a terminal node in a block chain, and determining the state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node for any terminal node; obtaining the voting result of other terminal nodes except the terminal node in the block chain to the terminal node according to the state of the terminal node, and obtaining the voting statistical result of the terminal node; and determining whether the terminal node is an agent node or not according to the voting statistical result of the terminal node, if so, collecting the transactions among all the terminal nodes in the block chain by using the terminal node, generating a block according to the transactions, and transmitting the generated block to other terminal nodes. The invention can reduce the possibility that the abnormal node is selected as the proxy node, and ensures the safety and the stability of the system.

Description

NB-IoT terminal transaction processing method and device based on block chain
Technical Field
The invention belongs to the technical field of block chains, and particularly relates to a method and a device for processing terminal transaction in NB-IoT based on a block chain.
Background
The terminal in NB-IoT (Narrow Band Internet of Things) has the characteristics of strong connection, ultralow power consumption, deep coverage, low cost, safety, stability and reliability. The method is widely applied to scenes with fixed positions of terminal equipment such as intelligent cities, intelligent families, environment monitoring and the like. However, the characteristics of low cost and low power consumption also determine that the terminal chip in the NB-IoT has weak computing power and storage capacity, is not suitable for real-time online, cannot be moved quickly, and also has the problems of privacy protection and incapability of effectively preventing hacker attacks.
The blockchain is used as a decentralized and distributed technical system, and the application in NB-IoT can realize a management and service system without central server management and vendor differentiation. In the system, a manufacturer can perform point-to-point management on equipment of the manufacturer, and the difference between a consumer and a network layer does not need to be concerned, and the equipment is only required to smoothly obtain the access right according to a uniform access protocol. The encryption algorithm and the consensus mechanism of the block chain determine that a hacker cannot illegally control the transaction of the internet of things equipment, and the controller of the equipment cannot be obtained. Among them, the consensus DPOS (released Proof of trust) and its improved algorithms are widely used due to their zero-procedure, point-to-point interaction characteristics.
The application of the block chain technology to NB-IoT avoids the management and service system of different manufacturer devices, and the encryption algorithm and the consensus mechanism reduce the hacking attack. However, different consensus algorithms differ in terms of resource consumption, security, and time to achieve consensus due to differences in specific scenarios. Although the widely used DPOS consensus algorithm can shorten the consensus time to the second level by selecting the agent node to generate the block by voting at the terminal node, if a malicious node occurs in the agent node, the malicious node cannot be found and removed in time, which may result in a reduction in the security of the block chain system.
Disclosure of Invention
In order to overcome the problem that the application of the existing DPOS consensus algorithm to the NB-IoT causes the security of the blockchain system to be reduced or at least partially solve the problem, embodiments of the present invention provide a method and an apparatus for processing a terminal transaction in the NB-IoT based on a blockchain.
According to a first aspect of the embodiments of the present invention, there is provided a method for processing terminal transactions in NB-IoT based on a blockchain, including:
taking a terminal in NB-IoT as a terminal node in a block chain, and determining the state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node for any terminal node;
obtaining the voting result of other terminal nodes except the terminal node in the block chain to the terminal node according to the state of the terminal node, counting the voting result of the other terminal nodes to the terminal node, and obtaining the voting counting result of the terminal node;
and determining whether the terminal node is an agent node or not according to the voting statistical result of the terminal node, if so, collecting the transactions among all the terminal nodes in the block chain by using the terminal node, generating a block according to the transactions, and transmitting the generated block to other terminal nodes.
Specifically, the step of determining the state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node comprises:
if the terminal node continuously generates effective blocks and the number of the effective blocks is greater than a first preset threshold value, determining that the state of the terminal node is a first state;
if the number of the blocks which are invalid and generated by the terminal node is smaller than a second preset threshold value, determining that the state of the terminal node is a second state;
if the number of the blocks which are invalid and generated by the terminal node is larger than a third preset threshold value, determining that the state of the terminal node is a third state;
and if all the blocks generated by the terminal node are valid blocks, determining that the state of the terminal node is a fourth state.
Specifically, the step of determining the state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node further comprises:
and if the state of the terminal node is the third state, the terminal node does not participate in the election of the agent node in a preset time period.
In particular, the voting results comprise an objection vote and a support vote;
and the voting statistical result comprises the total number of votes against the votes and the total number of votes supported in the voting results of all the other terminal nodes to the terminal node.
Specifically, the step of counting the voting results of the other terminal nodes to the terminal node and obtaining the voting counting results of the terminal node includes:
calculating the credit coefficient updated this time by the terminal node according to the time interval of the latest two votes of the terminal node and the credit coefficient updated last time by the terminal node;
and obtaining the voting statistical result of the terminal node according to the credit coefficient updated by the terminal node at this time and the voting result of the other terminal nodes to the terminal node.
Specifically, the credit coefficient updated this time by the terminal node is calculated according to the time interval between the last two votes by the terminal node and the credit coefficient updated last time by the following formula:
Cre n =Cre n-1 -Floor(t/T)*M;
wherein Cre n Cre credit coefficient updated for the nth time of the terminal node n-1 And (3) updating the credit coefficient of the terminal node for the (n-1) th time, wherein n is a positive integer, floor is a downward rounding function, T is the time interval of the last two votes of the terminal node, T is preset time, and M is a preset attenuation coefficient.
Specifically, the step of calculating the credit coefficient updated this time by the terminal node according to the time interval of the last two votes by the terminal node and the credit coefficient updated last time by the terminal node further includes:
if the terminal node submits the objection ticket to the other terminal nodes with the second state and the other terminal nodes submitted the objection ticket are not selected as the proxy nodes, the credit coefficient updated by the terminal node at this time is increased; and the other terminal nodes in the second state are the other terminal nodes of which the number of the generated invalid blocks is less than a second preset threshold value.
Specifically, the voting statistical result of the terminal node is obtained according to the credit coefficient updated by the terminal node this time and the voting result of the other terminal nodes to the terminal node by the following formula:
VoteResult=a*Cre+b*Vote-c*NeVote;
wherein, voteResult represents the voting statistical result, cre represents the credit coefficient updated at this time by the terminal node, vote represents the total number of votes supported by the terminal node in the voting results of all other terminal nodes, neVote represents the total number of votes against the votes in the voting results of the terminal node by all other terminal nodes, a is a coefficient related to the number of all terminal nodes and the number of proxy nodes in the block chain, and b and c are preset constants.
According to a second aspect of the embodiments of the present invention, there is provided a terminal transaction processing apparatus in NB-IoT based on a blockchain, including:
the determining module is used for taking a terminal in the NB-IoT as a terminal node in a block chain, and for any terminal node, determining the state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node;
the acquisition module is used for acquiring the voting result of other terminal nodes except the terminal node in the block chain to the terminal node according to the state of the terminal node, counting the voting result of the other terminal nodes to the terminal node and acquiring the voting counting result of the terminal node;
and the processing module is used for determining whether the terminal node is an agent node or not according to the voting statistical result of the terminal node, if so, collecting the transactions among all the terminal nodes in the block chain by using the terminal node, generating a block according to the transactions, and transmitting the generated block to other terminal nodes.
According to a third aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor calls the program instructions to be able to execute the method for processing a terminal transaction in NB-IoT based on a blockchain provided in any one of the various possible implementations of the first aspect.
The embodiment of the invention provides a method and a device for processing terminal transaction in NB-IoT based on a block chain.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic overall flow chart of a method for processing terminal transactions in NB-IoT based on a block chain according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating state transition of a terminal node in a NB-IoT terminal transaction processing method based on a block chain according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an overall structure of a terminal transaction processing apparatus in NB-IoT based on a block chain according to an embodiment of the present invention;
fig. 4 is a schematic view of an overall structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
In an embodiment of the present invention, a method for processing a terminal transaction in NB-IoT based on a block chain is provided, and fig. 1 is a schematic overall flow chart of the method for processing a terminal transaction in NB-IoT based on a block chain according to the embodiment of the present invention, where the method includes: s101, taking a terminal in NB-IoT as a terminal node in a block chain, and determining the state of the terminal node according to the number of effective blocks and ineffective blocks generated by the terminal node for any terminal node;
the terminal in the NB-IoT refers to the Internet of things equipment in the NB-IoT. And applying the block chain technology to the NB-IoT, and taking the terminal in the NB-IoT as a terminal node of the block chain. If the end node is selected as a proxy node in a previous or last proxy node election, a block is generated, and the generated block is divided into a valid block and an invalid block. Since the state of the terminal node is determined according to the validity of the block generated by the terminal node, the terminal node is likely to be a malicious node and will damage the block chain system when the invalid block is generated too much, and therefore the state of the terminal node reflects the security degree of the terminal node. An attribute field is added to each end node to characterize the state of the end node.
S102, obtaining the voting result of other terminal nodes except the terminal node in the block chain to the terminal node according to the state of the terminal node, counting the voting result of the other terminal nodes to the terminal node, and obtaining the voting counting result of the terminal node.
And transmitting the state of each terminal node to other terminal nodes so that the other terminal nodes can vote for each terminal node according to the state of each terminal node. And voting statistics is carried out on the voting result of each terminal node, and a final voting statistical result is obtained.
S103, determining whether the terminal node is a proxy node according to the voting statistical result of the terminal node, if so, collecting the transactions among all terminal nodes in the block chain by using the terminal node, generating a block according to the transactions, and transmitting the generated block to other terminal nodes.
And sequencing the voting statistical results of the terminal nodes, and taking the preset number of terminal nodes with the highest voting statistical results as proxy nodes. The proxy node collects transactions generated in the NB-IoT system and generates a block of transactions, and packages the transactions into the block. And then the block is transmitted to other terminal nodes for the other terminal nodes to store the block, thereby realizing the sharing of terminal transactions in the block chain system.
According to the embodiment, the state of each terminal node is determined according to the number and effectiveness of the blocks generated by each terminal node, and the state attribute is added to each terminal node, so that the possibility that the terminal node becomes a proxy node is judged according to the state of the terminal node, the generation of malicious blocks or other behaviors damaging the system safety by abnormal terminal nodes is avoided, the abnormal terminal nodes can be removed in time on the basis of ensuring the quick response of the terminal nodes in a large-scale NB-IoT network, and the safety and the stability of the system are ensured.
On the basis of the above embodiment, in this embodiment, the step of determining the state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node includes: if the terminal node continuously generates effective blocks and the number of the effective blocks is greater than a first preset threshold value, determining that the state of the terminal node is a first state; if the number of the blocks which are invalid and generated by the terminal node is smaller than a second preset threshold value, determining that the state of the terminal node is a second state; if the number of the blocks which are invalid and generated by the terminal node is larger than a third preset threshold value, determining that the state of the terminal node is a third state; and if all the blocks generated by the terminal node are valid blocks, determining that the state of the terminal node is a fourth state.
Specifically, in the present embodiment, the first state is denoted by G, the second state is denoted by EX, the third state is denoted by ER, and the fourth state is denoted by N. The state of the terminal node can be dynamically converted, so that the possibility that the terminal node is adjusted to become the proxy node in time is realized. Whether the state transitions is determined by the number and validity of blocks generated by the end node. When the terminal node becomes the agent node, the initial state is set to be N, and the terminal node can normally participate in the subsequent agent node election process; when the number of the effective blocks generated by the agent node is larger than a first preset threshold value, the state of the agent node is converted into G, and the agent node is easier to win in next agent node competition; if the proxy node generates an invalid block, the state is converted to EX, and it is at a disadvantage in the next proxy node election; if the number of the invalid blocks generated by the agent node is larger than a third preset threshold, the state of the agent node is changed into ER, and the agent node cannot participate in the election of the agent node within a preset time period, so that the system is prevented from being damaged by a malicious node. The state transition of the end node is shown in fig. 2. And the time for eliminating the abnormal terminal nodes from the proxy nodes is further shortened through the conversion of the terminal node states.
On the basis of the above embodiment, the voting result in this embodiment includes an objection ticket and a support ticket; and the voting statistical result comprises the total number of votes against the votes and the total number of votes supported in the voting results of all the other terminal nodes to the terminal node.
In the embodiment, the terminal node can reduce the possibility that an abnormal terminal node becomes a proxy node by casting a negative vote, and can reduce the time for removing a malicious node from the system. In the block chain consensus mechanism, the terminal node is uniquely identified by a public key, so that the voting process can be carried out anonymously, and the voting with subjective colors is prevented from interfering with the fairness of the voting process. For the terminal node with the state of EX, the possibility of becoming a proxy node is reduced by casting a negative vote.
On the basis of the foregoing embodiments, in this embodiment, the step of counting voting results of the other terminal nodes to the terminal node and obtaining a voting statistical result of the terminal node includes: calculating the credit coefficient updated this time by the terminal node according to the time interval of the latest two votes of the terminal node and the credit coefficient updated last time by the terminal node; and acquiring the voting statistical result of the terminal node according to the credit coefficient updated by the terminal node at this time and the voting results of the other terminal nodes to the terminal node.
The credit coefficient Cre is used for representing the trust degree of the terminal node in the system. The specific meaning of the credit coefficient in different blockchain systems is different, and needs to be combined with specific service scenes. Normally, the credit coefficient Cre is an integer in the range of [0,100], and the initial credit coefficient of the terminal node is set to 50. In a huge NB-IoT system, due to the existence of a large number of terminal nodes, a situation that the terminal nodes vote untimely is very easy to occur, so the embodiment considers the influence of the untimely terminal voting on the trust degree of the terminal nodes, and updates the credit coefficients of the terminal nodes according to the time interval of the last two terminal node votes. And then determining the final voting statistical result of the terminal node according to the updated credit coefficient and voting result of the terminal node.
In the embodiment, the credit coefficient is added to each terminal node, and the less timely the voting is, the smaller the credit coefficient is. And (4) rewarding and punishing the terminal node according to the credit level, wherein the lower the credit coefficient is, the lower the possibility that the terminal node becomes the proxy node is.
On the basis of the foregoing embodiment, in this embodiment, the credit coefficient updated this time by the terminal node is calculated according to the time interval between the last two votes by the terminal node and the credit coefficient updated last time by the following formula:
Cre n =Cre n-1 -Floor(t/T)*M;
wherein Cre n Cre credit coefficient updated for the nth time of the terminal node n-1 And (3) updating the credit coefficient of the terminal node for the (n-1) th time, wherein n is a positive integer, floor is a downward rounding function, T is the time interval of the last two votes of the terminal node, T is preset time, and M is a preset attenuation coefficient.
Specifically, the credit coefficient of the terminal node is updated by using a reward and punishment algorithm in the embodiment. The reward and punishment algorithm mainly comprises credit attenuation, credit reward, credit constancy and time t updating. Where the decay of the credits, i.e. the credit coefficient, is inversely proportional to time, represents a certain reduction of value in a real system, satisfying the above formula. The preset time T and the preset attenuation coefficient M are determined by the specific system. When T is smaller than T, cre is unchanged, and credit is constant; when T is greater than T, the credit decays. And after the voting is finished, the value t is re-assigned to be 0, and the terminal node is encouraged to continue voting.
On the basis of the foregoing embodiment, in this embodiment, the step of calculating the credit coefficient updated this time by the terminal node according to the time interval between the last two votes by the terminal node and the credit coefficient updated last time by the terminal node further includes: if the terminal node submits the objection ticket to the other terminal nodes in the second state and the other terminal nodes submitted the objection ticket are not selected as proxy nodes, the credit coefficient updated by the terminal node at this time is increased; and the other terminal nodes in the second state are the other terminal nodes of which the number of the generated invalid blocks is less than a second preset threshold value.
Specifically, each end node has only one chance of casting a vote during time T. If a terminal node applies an objection to the vote to the terminal node with the state of EX and the voted terminal node with the state of EX does not become a proxy node finally, the voted terminal node is rewarded, namely a credit coefficient is increased. For example, by increasing the credit coefficient by M, i.e. Cre n =Cre n-1 +M。
On the basis of the foregoing embodiment, in this embodiment, the voting statistical result of the terminal node is obtained according to the credit coefficient updated by the terminal node this time and the voting result of the other terminal nodes to the terminal node by using the following formula:
VoteResult=a*Cre+b*Vote-c*NeVote;
wherein, voteResult represents the voting statistical result, cre represents the credit coefficient updated by the terminal node at this time, vote represents the total votes of the votes supported by all other terminal nodes in the voting result of the terminal node, neVote represents the total votes of the votes rejected by all other terminal nodes in the voting result of the terminal node, and a is determined by the system service requirement and the system security level in a specific system according to the coefficients related to the number of all terminal nodes and the number of proxy nodes in the block chain; b and c are preset constants, c + b =1 is satisfied, and the initial value is usually set to b = c =1/2.
Specifically, reasonable statistics of the voting results can not only improve the security of the blockchain system, but also quickly determine whether the terminal node can become a proxy node. By using the above formula to count the voting results, more votes are required for terminal nodes with low credit coefficients to possibly become proxy nodes, so that the probability that the terminal node with the state of EX becomes a proxy node can be reduced, and the time for eliminating the proxy node by an abnormal terminal node can be shortened.
In the embodiment, the existing block chain consensus algorithm DPOS is optimized and improved, and the improved consensus algorithm solves the problems that a malicious terminal exists in NB-IoT terminal application and the terminal response is not timely in the block chain technology.
In another embodiment of the present invention, an NB-IoT in-terminal transaction processing apparatus based on a blockchain is provided, which is configured to implement the methods in the foregoing embodiments. Therefore, the descriptions and definitions in the embodiments of the terminal transaction processing method in NB-IoT based on the block chain described above can be used for understanding the various execution modules in the embodiments of the present invention. Fig. 3 is a schematic diagram of an overall structure of a terminal transaction processing apparatus in NB-IoT based on a blockchain according to an embodiment of the present invention, where the apparatus includes a determining module 301, an obtaining module 302, and a processing module 303, where:
the determining module 301 is configured to use a terminal in NB-IoT as a terminal node in a block chain, and for any terminal node, determine a state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node;
the obtaining module 302 is configured to obtain the voting result of the terminal node by other terminal nodes in the block chain except the terminal node according to the state of the terminal node, count the voting result of the terminal node by the other terminal nodes, and obtain the voting statistical result of the terminal node;
the processing module 303 is configured to determine whether the terminal node is an agent node according to the voting statistical result of the terminal node, and if so, collect transactions between all terminal nodes in the block chain using the terminal node, generate a block according to the transactions, and transmit the generated block to the other terminal nodes.
According to the embodiment, the state of each terminal node is determined according to the number and effectiveness of the blocks generated by each terminal node, and the state attribute is added to each terminal node, so that the possibility that the terminal node becomes a proxy node is judged according to the state of the terminal node, the generation of malicious blocks or other behaviors damaging the system safety by abnormal terminal nodes is avoided, the abnormal terminal nodes can be removed in time on the basis of ensuring the quick response of the terminal nodes in a large-scale NB-IoT network, and the safety and the stability of the system are ensured.
Fig. 4 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 4: a processor (processor) 401, a communication Interface (communication Interface) 402, a memory (memory) 403 and a communication bus 404, wherein the processor 401, the communication Interface 402 and the memory 403 complete communication with each other through the communication bus 404. Processor 401 may call logic instructions in memory 403 to perform the following method: taking a terminal in NB-IoT as a terminal node in a block chain, and determining the state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node for any terminal node; acquiring the voting result of other terminal nodes except the terminal node in the block chain to the terminal node according to the state of the terminal node, and acquiring the voting statistical result of the terminal node; and determining whether the terminal node is an agent node or not according to the voting statistical result of the terminal node, if so, collecting the transactions among all the terminal nodes in the block chain by using the terminal node, generating a block according to the transactions, and transmitting the generated block to other terminal nodes.
In addition, the logic instructions in the memory 403 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art 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 invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the methods provided by the above method embodiments, for example, including: taking a terminal in NB-IoT as a terminal node in a block chain, and determining the state of the terminal node for any terminal node according to the number of valid blocks and invalid blocks generated by the terminal node; obtaining the voting result of other terminal nodes except the terminal node in the block chain to the terminal node according to the state of the terminal node, and obtaining the voting statistical result of the terminal node; and determining whether the terminal node is an agent node or not according to the voting statistical result of the terminal node, if so, collecting the transactions among all the terminal nodes in the block chain by using the terminal node, generating a block according to the transactions, and transmitting the generated block to other terminal nodes.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A method for processing terminal transaction in NB-IoT based on block chain is characterized by comprising the following steps:
taking a terminal in NB-IoT as a terminal node in a block chain, and determining the state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node for any terminal node;
obtaining the voting result of other terminal nodes except the terminal node in the block chain to the terminal node according to the state of the terminal node, counting the voting result of the other terminal nodes to the terminal node, and obtaining the voting counting result of the terminal node;
determining whether the terminal node is an agent node according to the voting statistical result of the terminal node, if so, collecting the transactions among all terminal nodes in the block chain by using the terminal node, generating a block according to the transactions, and transmitting the generated block to other terminal nodes;
the step of determining the state of the terminal node based on the number of valid and invalid blocks generated by the terminal node comprises:
if the terminal node continuously generates effective blocks and the number of the effective blocks is greater than a first preset threshold value, determining that the state of the terminal node is a first state;
if the number of the blocks which are invalid and generated by the terminal node is smaller than a second preset threshold value, determining that the state of the terminal node is a second state;
if the number of the blocks which are invalid and generated by the terminal node is larger than a third preset threshold value, determining that the state of the terminal node is a third state;
and if all the blocks generated by the terminal node are valid blocks, determining that the state of the terminal node is a fourth state.
2. The method of claim 1, wherein the determining the state of the end node according to the number of valid and invalid blocks generated by the end node further comprises:
and if the state of the terminal node is the third state, the terminal node does not participate in the election of the agent node within a preset time period.
3. The blockchain-based NB-IoT in-terminal transaction method according to claim 1, wherein the voting results include an objection vote and a support vote;
and the voting statistical result comprises the total number of votes against the votes and the total number of votes supported in the voting results of all the other terminal nodes to the terminal node.
4. The NB-IoT in-terminal transaction method based on the blockchain as claimed in any of claims 1 to 3, wherein the step of counting the voting results of the other terminal nodes to the terminal node and obtaining the voting statistical results of the terminal node comprises:
calculating the credit coefficient updated this time by the terminal node according to the time interval of the latest two votes of the terminal node and the credit coefficient updated last time by the terminal node;
and acquiring the voting statistical result of the terminal node according to the credit coefficient updated by the terminal node at this time and the voting results of the other terminal nodes to the terminal node.
5. The NB-IoT in a block chain based on claim 4, wherein the credit coefficient updated this time by the terminal node is calculated according to the time interval between the last two votes by the terminal node and the credit coefficient updated last time by the terminal node according to the following formula:
Cre n =Cre n-1 -Floor(t/T)*M;
wherein, cre n Cre credit coefficient for the nth update of the terminal node n-1 And updating the credit coefficient of the terminal node for the (n-1) th time, wherein n is a positive integer, floor is a down-rounding function, T is the time interval of the last two votes of the terminal node, T is preset time, and M is a preset attenuation coefficient.
6. The method of claim 5, wherein the step of calculating the credit coefficient updated this time by the terminal node according to the time interval between the last two votes of the terminal node and the credit coefficient updated last time by the terminal node further comprises:
if the terminal node submits the objection ticket to the other terminal nodes with the second state and the other terminal nodes submitted the objection ticket are not selected as the proxy nodes, the credit coefficient updated by the terminal node at this time is increased; and the other terminal nodes in the second state are the other terminal nodes of which the number of the generated invalid blocks is less than a second preset threshold value.
7. The NB-IoT in-block-chain-based terminal transaction method according to claim 4, wherein the voting statistics result of the terminal node is obtained according to the credit coefficient updated this time by the terminal node and the voting result of the other terminal nodes to the terminal node by the following formula:
VoteResult=a*Cre+b*Vote-c*NeVote;
wherein, voteResult represents the voting statistical result, cre represents the credit coefficient updated at this time by the terminal node, vote represents the total number of votes supported by the terminal node in the voting results of all other terminal nodes, neVote represents the total number of votes against the votes in the voting results of all other terminal nodes to the terminal node, a is a coefficient related to the number of all terminal nodes and the number of proxy nodes in the block chain, and b and c are preset constants.
8. An NB-IoT in-block chain based terminal transaction device, comprising:
a determining module, configured to use a terminal in an NB-IoT as a terminal node in a block chain, and for any terminal node, determine a state of the terminal node according to the number of valid blocks and invalid blocks generated by the terminal node;
the acquisition module is used for acquiring the voting result of other terminal nodes except the terminal node in the block chain to the terminal node according to the state of the terminal node, counting the voting result of the other terminal nodes to the terminal node and acquiring the voting counting result of the terminal node;
the processing module is used for determining whether the terminal node is an agent node or not according to the voting statistical result of the terminal node, if so, the terminal node is used for collecting the transactions among all the terminal nodes in the block chain, generating a block according to the transactions and transmitting the generated block to other terminal nodes;
the determination module is further to:
if the terminal node continuously generates effective blocks and the number of the effective blocks is greater than a first preset threshold value, determining that the state of the terminal node is a first state;
if the number of the blocks which are invalid and generated by the terminal node is smaller than a second preset threshold value, determining that the state of the terminal node is a second state;
if the number of the blocks which are invalid and generated by the terminal node is larger than a third preset threshold value, determining that the state of the terminal node is a third state;
and if all the blocks generated by the terminal node are valid blocks, determining that the state of the terminal node is a fourth state.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of the blockchain-based NB-IoT in-terminal transaction method according to any of claims 1 to 7.
CN202010237761.4A 2020-03-30 2020-03-30 NB-IoT terminal transaction processing method and device based on block chain Active CN113472825B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010237761.4A CN113472825B (en) 2020-03-30 2020-03-30 NB-IoT terminal transaction processing method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010237761.4A CN113472825B (en) 2020-03-30 2020-03-30 NB-IoT terminal transaction processing method and device based on block chain

Publications (2)

Publication Number Publication Date
CN113472825A CN113472825A (en) 2021-10-01
CN113472825B true CN113472825B (en) 2023-01-13

Family

ID=77864968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010237761.4A Active CN113472825B (en) 2020-03-30 2020-03-30 NB-IoT terminal transaction processing method and device based on block chain

Country Status (1)

Country Link
CN (1) CN113472825B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113938371B (en) * 2021-10-19 2023-05-23 南方电网科学研究院有限责任公司 Node monitoring method, system and equipment based on blockchain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109165945A (en) * 2018-09-07 2019-01-08 腾讯科技(深圳)有限公司 Represent node device electoral machinery, device, computer equipment and storage medium
CN109819022A (en) * 2019-01-11 2019-05-28 华侨大学 A kind of block chain common recognition method based on credit appraisal
CN110138597A (en) * 2019-04-17 2019-08-16 上海大学 Based on the block chain DPOS of credit score and node clustering common recognition mechanism improved method
CN110298657A (en) * 2018-03-21 2019-10-01 中思博安科技(北京)有限公司 A kind of block chain common recognition method, relevant apparatus and system
CN110535836A (en) * 2019-08-12 2019-12-03 安徽师范大学 A kind of trust block chain common recognition method of based role classification

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981281B (en) * 2019-01-14 2021-11-26 北京领主科技有限公司 Method and device for determining candidate elements based on block chain proposal random consensus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110298657A (en) * 2018-03-21 2019-10-01 中思博安科技(北京)有限公司 A kind of block chain common recognition method, relevant apparatus and system
CN109165945A (en) * 2018-09-07 2019-01-08 腾讯科技(深圳)有限公司 Represent node device electoral machinery, device, computer equipment and storage medium
CN109819022A (en) * 2019-01-11 2019-05-28 华侨大学 A kind of block chain common recognition method based on credit appraisal
CN110138597A (en) * 2019-04-17 2019-08-16 上海大学 Based on the block chain DPOS of credit score and node clustering common recognition mechanism improved method
CN110535836A (en) * 2019-08-12 2019-12-03 安徽师范大学 A kind of trust block chain common recognition method of based role classification

Also Published As

Publication number Publication date
CN113472825A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
JP6964193B2 (en) How to determine the main chain of the blockchain, devices, equipment and storage media
JP2020501402A5 (en)
EP2597569A1 (en) System and method for distributing processing of computer security tasks
CN112579194B (en) Block chain consensus task unloading method and device based on time delay and transaction throughput
CN107864695A (en) Peer-group is guarded against
US20210067524A1 (en) Detection of a malicious entity within a network
CN109597800B (en) Log distribution method and device
CN114327803A (en) Method, apparatus, device and medium for accessing machine learning model by block chain
CN113472825B (en) NB-IoT terminal transaction processing method and device based on block chain
CN113379539B (en) Delegation rights and benefits proving consensus method and device based on block chain
CN110222297B (en) Identification method of tag user and related equipment
CN111124672A (en) Data distribution method based on Redis cluster and related equipment
CN106357688B (en) A kind of method and apparatus for defending ICMP flood attack
CN115578195A (en) Method, device, storage medium and equipment for electing verification node
CN106846142B (en) Information processing method and server
CN115391148A (en) Anomaly detection method and apparatus
CN115296904A (en) Domain name reflection attack detection method and device, electronic equipment and storage medium
CN111181803B (en) Block chain performance measurement method, system, equipment and storage medium
CN111163055B (en) Weak authentication method and device for non-ground network access
CN112511312A (en) Assembled consensus method and system
CN112911011A (en) Block generation control method applied to block chain and related device
CN109919521B (en) Block chain operation confirmation method and device and electronic equipment
CN112383785A (en) Method and device for processing heat value and electronic equipment
JP6659229B2 (en) POS system, information processing method, and program
CN114615029B (en) Terminal trust evaluation method, device, equipment and storage medium

Legal Events

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