CN111783918B - Safe two-dimensional code distribution method and system - Google Patents

Safe two-dimensional code distribution method and system Download PDF

Info

Publication number
CN111783918B
CN111783918B CN202010637302.5A CN202010637302A CN111783918B CN 111783918 B CN111783918 B CN 111783918B CN 202010637302 A CN202010637302 A CN 202010637302A CN 111783918 B CN111783918 B CN 111783918B
Authority
CN
China
Prior art keywords
dimensional code
packet data
data
code
fragment packet
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
CN202010637302.5A
Other languages
Chinese (zh)
Other versions
CN111783918A (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.)
Fujian Zefu Software Co ltd
Original Assignee
Fujian Zefu Software 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 Fujian Zefu Software Co ltd filed Critical Fujian Zefu Software Co ltd
Priority to CN202010637302.5A priority Critical patent/CN111783918B/en
Publication of CN111783918A publication Critical patent/CN111783918A/en
Application granted granted Critical
Publication of CN111783918B publication Critical patent/CN111783918B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a safe two-dimensional code distribution method and a system, wherein the method comprises the following steps: each node stores the same two-dimensional code generation and analysis rules; the current node generates a two-dimensional code by using the current node identification code, the effective time length, the payment amount and the other side identification code according to the two-dimensional code rule; the current node generates two-dimension code index information according to the two-dimension code; the two-dimensional code is divided into two-dimensional code fragments with preset number by the current node, the two-dimensional code fragments with the same size after division are generated according to the sequence where the two-dimensional code fragments are located, the current node identification code, the two-dimensional code index information, each sequence number and the corresponding two-dimensional code fragments are packaged into one fragment packet data, and the fragment packet data with the preset number are formed. The invention realizes the decentralization of two-dimensional code generation and response.

Description

Safe two-dimensional code distribution method and system
Technical Field
The invention relates to the technical field of two-dimensional code distribution, in particular to a safe two-dimensional code distribution method and system.
Background
In the existing payment process, two-dimensional codes are dynamically and randomly generated, the two-dimensional codes are generated by a server and are sent to each user terminal, and then the two-dimensional codes are displayed by the terminal, so that the distribution of the two-dimensional codes of the server is completed, and settlement also occurs on the server. Therefore, the two-dimensional code distribution cannot be finished due to server attack and server failure. And if the server fails, the payment cannot be completed either. And in the case of decentralization, the two-dimensional code distribution of the server is obviously not suitable for the decentralization case.
Disclosure of Invention
Therefore, a secure two-dimensional code distribution method and system are needed to be provided, and the problems that the two-dimensional code distribution needs a server and decentralization cannot be achieved are solved.
In order to achieve the above object, the inventor provides a secure two-dimensional code distribution method, comprising the steps of:
each node stores the same two-dimensional code generation and analysis rules;
the current node generates a two-dimensional code by using the current node identification code, the effective time length, the payment amount and the other side identification code according to the two-dimensional code rule;
the current node generates two-dimension code index information according to the two-dimension code;
the method comprises the steps that a current node divides a two-dimensional code into two-dimensional code fragments with preset number, the size of the two-dimensional code fragments is the same, sequence numbers are generated according to the sequence of the two-dimensional code fragments, and a current node identification code, two-dimensional code index information, each sequence number and the corresponding two-dimensional code fragments are packaged into fragment packet data to form the fragment packet data with the preset number;
sending all fragment packet data to different nodes, wherein each node receives one fragment packet data;
after each node receives one piece of fragment packet data, caching the piece of fragment packet data in a memory, acquiring two-dimension code index information and the current node identification code according to the piece of fragment packet data, judging whether a validity notice of the two-dimension code index information and the current node identification code is contained in a received notice message by the node, and if the validity notice exists, determining whether the piece of fragment packet data is stored according to the result of the validity notice;
if the validity notice does not exist, sending two-dimensional code index information to a current node identification code node in the fragment packet data for verification, if the information passing the verification is received, determining that the verification result is valid, and if not, determining that the verification result is invalid;
if the verification result is legal, storing the fragment packet data into a memory, and if the verification result is illegal, deleting the fragment packet data; broadcasting the two-dimension code index information and the verification result as the validity notice of the two-dimension code index information to other nodes;
one node acquires a two-dimensional code through code scanning, sends the two-dimensional code to other nodes, the other nodes receive the two-dimensional code, generates two-dimensional code index information according to the two-dimensional code, acquires stored fragment packet data according to the two-dimensional code index information, divides the two-dimensional code according to the size and the sequence number of the fragment packet data, compares the divided two-dimensional code data with two-dimensional code fragments in the fragment packet data, generates and broadcasts a comparison result, and the comparison result comprises the two-dimensional code index information and the sequence number;
and after receiving the comparison results of all the sequence numbers and meeting the validity requirement, other nodes analyze the two-dimensional code to obtain the two-dimensional code data, judge whether the two-dimensional code data is legal or not according to the two-dimensional code data and the data chain historical data, if so, update the data chain, and otherwise, ignore the two-dimensional code data.
Further, the determining whether to store the fragmented packet data according to the result of the validity notification includes:
judging whether the number of the legality notices is larger than a first preset value or not, if so, judging whether the number of the same results in the legality notices is larger than a second preset value or not, if so, taking the same results as the results of the verification notices of the two-dimensional code index information, and determining whether the fragment packet data is stored or not according to the results;
if the number of the legal notices is less than or equal to a first preset value, ignoring the legal notices;
and if the number of the same results indicated in the legality notification is less than or equal to a second preset value, ignoring the legality notification.
Further, the current node segmenting the two-dimensional code includes the steps of:
the current node copies the two-dimensional codes into a plurality of groups and generates group identification numbers, each group of two-dimensional codes is combined with the group identification numbers and then is divided, and the preset number of the divided two-dimensional code fragments in each group is different in size;
said packetizing into a fragmented packet data comprises the steps of:
packing the group identification number corresponding to the fragment packet data into the fragment packet data;
the step of comparing the two-dimension code index information with the sequence number includes:
the comparison result comprises two-dimension code index information, sequence number and group identification number.
Further, the transmitting all fragmented packet data to different nodes comprises the steps of:
dividing fields of the IP addresses into IP groups with the same number as the preset number according to the preset number, wherein one IP group corresponds to one fragment packet data;
and then sending the fragment packet data to the node of which the node IP conforms to the corresponding IP group format.
Further, all nodes comprise a master node; after determining the fragmentation packet data, the host node further comprises the following steps:
caching fragment packet data with a preset time length in a memory by a main node;
and when the step "generating two-dimensional code index information according to the two-dimensional code, and acquiring the stored fragment packet data according to the two-dimensional code index information" includes: and the main node acquires the fragment packet data cached in the memory from the memory according to the two-dimensional code index information, and if the fragment packet data which is stored is not acquired from the memory any more.
Further, the judging whether the two-dimensional code data is legal according to the two-dimensional code data and the data chain historical data comprises:
and judging whether the current node identification code has a credit larger than the payment amount or not according to the current node identification code and the payment amount in the two-dimensional code data and the data chain historical data, if so, determining that the current node identification code is legal, and otherwise, determining that the current node identification code is illegal.
The invention provides a safe two-dimensional code distribution system, which comprises a plurality of nodes, wherein each node comprises a memory and a processor, and a computer program is stored in the memory and is executed by the processor to realize the steps of the method according to any one of the embodiments of the invention.
Different from the prior art, each node in the technical scheme can generate the two-dimensional code by itself, then the two-dimensional code data can be divided and distributed to different nodes, the nodes can be checked with the nodes generating the two-dimensional code in the initial stage, then the check result is diffused, and the subsequent nodes can directly store the divided fragment packet data of the two-dimensional code according to the check result. Therefore, the two-dimensional code data are ensured to be partial data for other nodes, original whole data cannot be obtained, and the safety is ensured. The two-dimensional code can be sent to other nodes needing to be traded according to the two-dimensional code, the two-dimensional code is broadcasted after the two-dimensional code is acquired by the other nodes, and the two-dimensional code is verified by the other nodes according to the fragment packet data stored by the other nodes. And after a large number of nodes are verified and pass, responding to the transaction information contained in the data in the two-dimensional code. Therefore, subsequent response can be irrelevant to the node generating the two-dimensional code, and even if the node generating the two-dimensional code is abnormal, the response to the data in the two-dimensional code can be completed. And realizing the decentralization of two-dimensional code generation and response.
Drawings
FIG. 1 is a flow diagram of a method according to an embodiment;
FIG. 2 is a flow diagram of a method according to an embodiment;
FIG. 3 is a schematic illustration of segmentation in accordance with an embodiment.
Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
Referring to fig. 1 to 3, the present embodiment provides a secure two-dimensional code distribution method, including the following steps: each node stores the same two-dimensional code generation and analysis rules; therefore, the two-dimensional code picture can be generated according to the data, and the two-dimensional code picture can be analyzed to obtain the information in the two-dimensional code picture.
Step S101, the current node generates a two-dimensional code by the current node identification code, the effective time length, the payment amount and the opposite side identification code according to the two-dimensional code rule. The aforementioned information is information of transaction, wherein: the payment amount includes a positive number representing that the node of the opposite party identification code is paid to the current node by the current node and a negative number representing that the node of the opposite party identification code is paid to the current node. The effective time length can be set as a cut-off time, after the two-dimensional code is obtained by scanning the code subsequently, the two-dimensional code is analyzed to obtain the effective time, if the effective time is less than the current time, the two-dimensional code is invalid, and the data in the two-dimensional code is not responded subsequently. The current node identification code is used for identifying the current node, and the opposite side identification code represents the identity information of the opposite side node. In some embodiments, the identification code of the other party may not be set, which indicates that the amount corresponding to the two-dimensional code can be obtained by who obtains the two-dimensional code, so that payment of any other party node can be completed.
Step S102, the current node generates two-dimensional code index information according to the two-dimensional code, wherein the generated code is a unique code, such as an MD5 code; of course, in some embodiments, this MD5 value may be further combined with the current node identification code to form a more unique identification code.
Step S103, the current node divides the two-dimensional code into two-dimensional code fragments with preset number, the size of the divided two-dimensional code fragments is the same, sequence numbers are generated according to the sequence of the two-dimensional code fragments, and the current node identification code, the two-dimensional code index information, each sequence number and the corresponding two-dimensional code fragments are packaged into fragment packet data to form the fragment packet data with the preset number. In order to make the two-dimensional code fragments have the same size after being divided, the total data size of the current two-dimensional code can be divided by a preset number to see whether the two-dimensional code fragments can be divided completely, and if the two-dimensional code fragments can be divided, the two-dimensional code fragments have the same size. And if the two-dimension code fragment data cannot be divided completely, subtracting one from the preset number to be used as a divisor, dividing the total data size of the two-dimension code by the divisor to obtain the size of the two-dimension code fragment, wherein the redundant remainder is the last two-dimension code fragment data, and then filling blank data to enable the last two-dimension code fragment data to be the same as the previous two-dimension code fragment data in size.
Step S104, all the fragment packet data are sent to different nodes, and each node receives one fragment packet data; as shown in fig. 3, each node receives a fragment packet data, which includes fragments 1 to N, and since there are more nodes than fragments, different nodes may receive the same fragment packet data.
In step S105, after each node receives one fragment packet data, the fragment packet data is cached in a memory, where the memory is a volatile memory, and is different from a non-volatile memory such as a hard disk. And acquiring two-dimension code index information and the current node identification code from the fragmented packet data, judging whether a validity notice of the two-dimension code index information and the current node identification code is contained in a received notice message by the node, and if the validity notice exists, entering S115 to determine whether the fragmented packet data is stored according to the result of the validity notice. The validity notification is a validity message containing the two-dimension code index information and is a validity message verified by other nodes. Of course, if the current node subsequently has the verification, the validity notification is generated, and other nodes receive the validity notification. Through the validity notification, each node does not need to be checked, and the node can be broadcasted in the whole network as long as the nodes with the number larger than the preset number pass the check, and the subsequent nodes can directly operate according to the received node information. And determining whether to store the fragmented packet data according to the result of the validity notification, wherein the number of validity notifications is generally greater than a preset number, such as 100 node notifications. If more than the predetermined number of notifications are received and the notifications indicate legitimacy, the fragment package is stored. If more than the preset number of notifications are received and the notifications indicate an illegal one, the fragment packets are deleted. If the notification result indicates legality and illegally exists at the same time, the condition that the number of the same result is large is taken as the criterion.
If the validity notification does not exist, step S106 sends two-dimensional code index information to the node of the current node identification code in the fragmented packet data for verification, if the information that the verification passes is received, the verification result is considered to be valid, otherwise, the verification result is considered to be invalid. Since the two-dimensional code index information is unique and the current node identification code therein is also unique, the two-dimensional code index information needs to be verified by the node which originally generates the data (i.e. the current node above) before no other node verification notification exists. If the two-dimension code index information is generated by the current node, the previous node replies legal information which passes the verification, and if the two-dimension code index information is not generated by the node, the previous node replies illegal information.
If the verification result is legal, step S107 stores the fragmented packet data into a memory, here a non-volatile memory. To save the fragmented packet data, the fragmented packet data may be packed into a check chain. The check chain is different from the data chain, the data chain is used for storing data information, the check chain is used for storing check information such as fragment packet data, and the performance of different working processes can be improved by separately storing the check information. If the verification result is illegal, the step S108 deletes the fragment packet data; and after the execution of step S107 is completed or the execution of step S108 is completed, the step S109 is proceeded to broadcast the two-dimensional code index information and the check result as the validity notice of the two-dimensional code index information to other nodes. The other nodes may subsequently implement a direct check of the fragmented packet data according to the notification, i.e. the received notification message in step S105. Thus, the previous node generating the fragmented packet data may go down the line, and then the fragmented packet data containing the two-dimensional code data may be received and stored over the entire network.
At this time, other nodes cannot acquire all the two-dimensional code data, and only part of the two-dimensional code data is acquired. And then the current node can release the generated two-dimensional code, and for example, the current node can scan the code for other node users through a mobile phone. And then, in step S201, a certain node acquires the two-dimensional code by scanning the code, and sends the two-dimensional code to other nodes. And then in step S202, other nodes receive the two-dimensional code, generate two-dimensional code index information according to the two-dimensional code, acquire the stored fragment packet data according to the two-dimensional code index information, and divide the two-dimensional code according to the size and the sequence number of the fragment packet data. When the two-dimensional code is divided, the two-dimensional code is divided according to a preset sequence, for example, the two-dimensional code is converted into binary data, and then the received two-dimensional code is divided according to the size of the two-dimensional code data in the fragment packet data, similar to the generation of the fragment packet data. That is, the two-dimensional code is divided reversely in such a way that the two-dimensional code nodes are generated in the past, and if the two-dimensional code nodes are the same in the past, the divided data should be consistent. And then, comparing the two-dimension code data segmented in the step S203 with the two-dimension code fragments in the fragment packet data, generating a comparison result and broadcasting the comparison result to other nodes, wherein the comparison result comprises two-dimension code index information and a sequence number.
And entering step S204, the other nodes receive comparison results of all sequence numbers, where all sequence numbers correspond to all numbers of a complete two-dimensional code. If the two-dimensional code is divided into 20 parts, the sequential encoding should have 1-20. And after the validity requirement is met, the validity requirement is a set requirement, for example, each number needs to have a notification that the verification is passed, wherein the number is greater than a preset number (for example, 100). And then analyzing the two-dimensional code to obtain two-dimensional code data, judging whether the two-dimensional code data is legal or not according to the two-dimensional code data and data chain historical data in step S205, if the two-dimensional code data is legal, entering step S206, updating the data chain, and if not, entering step S207, and ignoring the two-dimensional code data. Judging whether the legal condition is included as follows: if the payment amount of the current node identification code in the two-dimensional code is 100 and the balance of the current node identification code in the two-dimensional code in the data chain is 50, the balance is not enough to pay the service data of the two-dimensional code. Ignoring the two-dimensional code data, if the balance is 150, updating the balance of the current node identification code to 150-. Or the identification code of the other party in the two-dimensional code is inconsistent with the identification code of the node which sends the two-dimensional code at present, the situation is illegal. Therefore, when the two-dimensional code is distributed, the participation of a central server is not needed. And when the two-dimensional code is processed, the node generating the two-dimensional code can be off-line, a central server is not needed, and decentralization of two-dimensional code distribution and processing is completed.
In some embodiments, said determining whether to store the fragmented packet data according to the result of the validity notification comprises the steps of: judging whether the number of the legality notices is larger than a first preset value or not, if so, judging whether the number of the same results in the legality notices is larger than a second preset value or not, if so, taking the same results as the results of the verification notices of the two-dimensional code index information, and determining whether the fragment packet data is stored or not according to the results; if the number of the legal notices is less than or equal to a first preset value, ignoring the legal notices; and if the number of the same results indicated in the legality notification is less than or equal to a second preset value, ignoring the legality notification. In this way, it can be ensured that the validity notification is relatively reliable.
In order to further improve the security of the two-dimension code fragment packet data, the current node divides the two-dimension code, and the method comprises the following steps: the current node copies the two-dimensional codes into a plurality of groups and generates group identification numbers, each group of two-dimensional codes is combined with the group identification numbers and then is divided, and the preset number of the divided two-dimensional code fragments in each group is different in size; so that different groups of fragmented packet data cannot be combined. Even if the two-dimensional code data are acquired, the original two-dimensional code data cannot be combined and restored, and the safety of the two-dimensional code is guaranteed. Said packetizing into a fragmented packet data comprises the steps of: and packaging the group identification number corresponding to the fragment packet data into the fragment packet data. The step of comparing the two-dimension code index information with the sequence number includes: the comparison result comprises two-dimension code index information, sequence number and group identification number. Then, the group identification number is required to be brought when the package is sent and the follow-up verification is carried out. Therefore, after the verification of all the fragment packets of different groups is completed, the verification of the two-dimensional code can be completed once. And other users are more difficult to acquire all the data of the two-dimensional code corresponding to the original node, so that the safety of the two-dimensional code is ensured.
In order to improve the speed of verification, different fragment packet data can be divided into specific IP groups, namely, IP classification optimization. Then at the time of distribution, said transmitting all fragmented packet data to different nodes comprises the steps of: dividing fields of the IP addresses into IP groups with the same number as the preset number according to the preset number, wherein one IP group corresponds to one fragment packet data; and then sending the fragment packet data to the node of which the node IP conforms to the corresponding IP group format. E.g., IP6 address, last field, predetermined number of fragmented packets is 16 groups, then last field is grouped every 4096 IPs. The first fragmented packet data is then assigned to the first group 4096 of IP addresses, the second fragmented packet data is assigned to the second group 4096 of IP addresses, and so on in sequence. Therefore, when the code is scanned and checked subsequently, part of IP addresses in each group can be preferentially distributed for checking, the checking of all serial numbers of the two-dimensional code can be completed quickly, and the checking speed is improved. When the plurality of two-dimensional codes are copied and randomly divided, the field of the IP address can be divided into the IP groups with the same number as the group identification numbers on the other field of the IP address according to the number of the group identification numbers, and then the other fields in the IP corresponding to each group identification number are divided into the IP groups with the same preset number as the divided groups in the group, so that the speed of subsequent verification can be further improved, and the safety can be improved through the verification of different groups.
In order to ensure the fast operation of the nodes, all the nodes include a master node, and the system processing performance of the master node is higher than that of other nodes, and the master node is generally composed of a server host. After determining the fragmentation packet data, the host node further comprises the following steps: caching fragment packet data with a preset time length in a memory by a main node; and when the step "generating two-dimensional code index information according to the two-dimensional code, and acquiring the stored fragment packet data according to the two-dimensional code index information" includes: and the main node acquires the fragment packet data cached in the memory from the memory according to the two-dimensional code index information, and if the fragment packet data which is stored is not acquired from the memory any more. Therefore, the main node can cache the latest fragment packet data, and subsequently can quickly take out the data for verification when the data is verified, the data does not need to be fetched by a hard disk, and the speed of verifying the two-dimensional code is improved.
In some embodiments, after receiving the two-dimensional code, the other nodes may first determine whether the two-dimensional code data is legal or not from the data in the two-dimensional code and the data link history data, and if the amount of money is illegal, the two-dimensional code data may be directly ignored, and if the amount of money is legal, the two-dimensional code is verified by the fragmented packet data. This improves the efficiency of the service processing.
The invention provides a safe two-dimensional code distribution system, which comprises a plurality of nodes, wherein each node comprises a memory and a processor, and a computer program is stored in the memory and is executed by the processor to realize the steps of the method according to any one of the embodiments of the invention. Through the system, the decentralization of two-dimensional code distribution can be realized.
It should be noted that, although the above embodiments have been described herein, the invention is not limited thereto. Therefore, based on the innovative concepts of the present invention, the technical solutions of the present invention can be directly or indirectly applied to other related technical fields by making changes and modifications to the embodiments described herein, or by using equivalent structures or equivalent processes performed in the content of the present specification and the attached drawings, which are included in the scope of the present invention.

Claims (7)

1. A secure two-dimensional code distribution method is characterized by comprising the following steps:
each node stores the same two-dimensional code generation and analysis rules;
the current node generates a two-dimensional code by using the current node identification code, the effective time length, the payment amount and the other side identification code according to the two-dimensional code rule;
the current node generates two-dimension code index information according to the two-dimension code;
the method comprises the steps that a current node divides a two-dimensional code into two-dimensional code fragments with preset number, the size of the two-dimensional code fragments is the same, sequence numbers are generated according to the sequence of the two-dimensional code fragments, and a current node identification code, two-dimensional code index information, each sequence number and the corresponding two-dimensional code fragments are packaged into fragment packet data to form the fragment packet data with the preset number;
sending all fragment packet data to different nodes, wherein each node receives one fragment packet data;
after each node receives one piece of fragment packet data, caching the piece of fragment packet data in a memory, acquiring two-dimension code index information and the current node identification code according to the piece of fragment packet data, judging whether a validity notice of the two-dimension code index information and the current node identification code is contained in a received notice message by the node, and if the validity notice exists, determining whether the piece of fragment packet data is stored according to the result of the validity notice;
if the validity notice does not exist, sending two-dimensional code index information to the node of the current node identification code in the fragment packet data for verification, if the information passing the verification is received, determining that the verification result is valid, and if not, determining that the verification result is invalid;
if the verification result is legal, storing the fragment packet data into a memory, and if the verification result is illegal, deleting the fragment packet data; broadcasting the two-dimension code index information and the verification result as the validity notice of the two-dimension code index information to other nodes;
one node acquires a two-dimensional code through code scanning, sends the two-dimensional code to other nodes, the other nodes receive the two-dimensional code, generates two-dimensional code index information according to the two-dimensional code, acquires stored fragment packet data according to the two-dimensional code index information, divides the two-dimensional code according to the size and the sequence number of the fragment packet data, compares the divided two-dimensional code data with two-dimensional code fragments in the fragment packet data, generates and broadcasts a comparison result, and the comparison result comprises the two-dimensional code index information and the sequence number;
and after receiving the comparison results of all the sequence numbers and meeting the validity requirement, other nodes analyze the two-dimensional code to obtain the two-dimensional code data, judge whether the two-dimensional code data is legal or not according to the two-dimensional code data and the data chain historical data, if so, update the data chain, and otherwise, ignore the two-dimensional code data.
2. A secure two-dimensional code distribution method according to claim 1, characterized by: the step of determining whether to store the fragmented packet data according to the result of the validity notification includes the steps of:
judging whether the number of the legality notices is larger than a first preset value or not, if so, judging whether the number of the same results in the legality notices is larger than a second preset value or not, if so, taking the same results as the results of the verification notices of the two-dimensional code index information, and determining whether the fragment packet data is stored or not according to the results;
if the number of the legal notices is less than or equal to a first preset value, ignoring the legal notices;
and if the number of the same results indicated in the legality notification is less than or equal to a second preset value, ignoring the legality notification.
3. A secure two-dimensional code distribution method according to claim 1, characterized by:
the current node divides the two-dimensional code, and the method comprises the following steps:
the current node copies the two-dimensional codes into a plurality of groups and generates group identification numbers, each group of two-dimensional codes is combined with the group identification numbers and then is divided, and the preset number of the divided two-dimensional code fragments in each group is different in size;
said packetizing into a fragmented packet data comprises the steps of:
packing the group identification number corresponding to the fragment packet data into the fragment packet data;
the step of comparing the two-dimension code index information with the sequence number includes:
the comparison result comprises two-dimension code index information, sequence number and group identification number.
4. The method of claim 1, wherein the step of sending all fragmented packet data to different nodes comprises the steps of:
dividing fields of the IP addresses into IP groups with the same number as the preset number according to the preset number, wherein one IP group corresponds to one fragment packet data;
and then sending the fragment packet data to the node of which the node IP conforms to the corresponding IP group format.
5. The secure two-dimensional code distribution method of claim 1, wherein all nodes comprise a master node; after determining the fragmentation packet data, the host node further comprises the following steps:
caching fragment packet data with a preset time length in a memory by a main node;
and when the step "generating two-dimensional code index information according to the two-dimensional code, and acquiring the stored fragment packet data according to the two-dimensional code index information" includes: and the main node acquires the fragment packet data cached in the memory from the memory according to the two-dimensional code index information, and if the fragment packet data which is stored is not acquired from the memory any more.
6. A secure two-dimensional code distribution method according to claim 1, characterized by:
the judging whether the two-dimensional code data are legal according to the two-dimensional code data and the data chain historical data comprises the following steps:
and judging whether the current node identification code has a credit larger than the payment amount or not according to the current node identification code and the payment amount in the two-dimensional code data and the data chain historical data, if so, determining that the current node identification code is legal, and otherwise, determining that the current node identification code is illegal.
7. A secure two-dimensional code distribution system, comprising: comprising a plurality of nodes including a memory, a processor, the memory having stored thereon a computer program which, when executed by the processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202010637302.5A 2020-07-03 2020-07-03 Safe two-dimensional code distribution method and system Active CN111783918B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010637302.5A CN111783918B (en) 2020-07-03 2020-07-03 Safe two-dimensional code distribution method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010637302.5A CN111783918B (en) 2020-07-03 2020-07-03 Safe two-dimensional code distribution method and system

Publications (2)

Publication Number Publication Date
CN111783918A CN111783918A (en) 2020-10-16
CN111783918B true CN111783918B (en) 2022-04-15

Family

ID=72758652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010637302.5A Active CN111783918B (en) 2020-07-03 2020-07-03 Safe two-dimensional code distribution method and system

Country Status (1)

Country Link
CN (1) CN111783918B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115204860B (en) * 2022-09-14 2022-12-13 北京博思致新互联网科技有限责任公司 Self-service payment system based on unified payment platform
CN117350319B (en) * 2023-12-06 2024-05-28 深圳华龙讯达信息技术股份有限公司 Method and system for preventing error of product associated data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014072714A (en) * 2012-09-28 2014-04-21 Forecast Communications Inc Two-dimensional code image display method, data broadcasting system and program
CN109191108A (en) * 2018-08-07 2019-01-11 广东蓝蜜蜂信息技术有限公司 Two dimensional code polymerization payment system and its working method based on block chain
CN110177088A (en) * 2019-05-08 2019-08-27 矩阵元技术(深圳)有限公司 A kind of temporary identity authentication method, apparatus and system
CN111027036A (en) * 2019-12-09 2020-04-17 武汉信安珞珈科技有限公司 Identity association method based on block chain
CN111241596A (en) * 2020-01-20 2020-06-05 上海佩俪信息科技有限公司 Block chain asset account recovery method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014072714A (en) * 2012-09-28 2014-04-21 Forecast Communications Inc Two-dimensional code image display method, data broadcasting system and program
CN109191108A (en) * 2018-08-07 2019-01-11 广东蓝蜜蜂信息技术有限公司 Two dimensional code polymerization payment system and its working method based on block chain
CN110177088A (en) * 2019-05-08 2019-08-27 矩阵元技术(深圳)有限公司 A kind of temporary identity authentication method, apparatus and system
CN111027036A (en) * 2019-12-09 2020-04-17 武汉信安珞珈科技有限公司 Identity association method based on block chain
CN111241596A (en) * 2020-01-20 2020-06-05 上海佩俪信息科技有限公司 Block chain asset account recovery method and device

Also Published As

Publication number Publication date
CN111783918A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN111783918B (en) Safe two-dimensional code distribution method and system
CN107426173B (en) File protection method and device
CN111885050B (en) Data storage method and device based on block chain network, related equipment and medium
CN111488626A (en) Data processing method, device, equipment and medium based on block chain
CN112132574A (en) Block chain data checking method, data processing method, device and equipment
CN114969803A (en) Data storage method, device and storage medium
CN110602051B (en) Information processing method based on consensus protocol and related device
CN106875184B (en) Abnormal scene simulation method, device and equipment
CN112613893A (en) Method, system, equipment and medium for identifying malicious user registration
CN112711696A (en) Request access method, device, electronic equipment and storage medium
CN112256799A (en) Data processing method and device based on block chain, server and storage medium
CN115118504B (en) Knowledge base updating method and device, electronic equipment and storage medium
CN110890979A (en) Automatic deploying method, device, equipment and medium for fortress machine
CN112732676B (en) Block chain-based data migration method, device, equipment and storage medium
US11621977B2 (en) Network forensic system for performing transmission metadata tracking and analysis
CN115081017A (en) Large-field data calling method and system
CN111783156B (en) Cloud electronic contract processing method and system
CN111783155B (en) Electronic certificate processing method and system
CN111770093B (en) Transaction monitoring decision method, device, equipment and computer readable storage medium
CN111800256B (en) Old people two-dimensional code electronic license application method and system
CN110647757A (en) Data processing method based on intelligent contract and related device
CN111783157B (en) Trusted two-dimensional code electronic certificate processing method and system
CN111783154B (en) Old people electronic license generation method and system
CN112685706A (en) Request authentication method and related equipment
CN114980186A (en) Method and device for detecting false sending of short message and electronic equipment

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