Safe transmission method for financial data queryTechnical Field
The invention relates to the field of digital information transmission, in particular to a safe transmission method for financial data query.
Background
At present, with the increasingly wide application of computer technology and network communication and the increasingly abundant variety of services in different fields, it becomes more and more important to perform secure data transmission through a network. While data is transmitted in a network, security and privacy are very important basic features, especially in the financial or financial field.
In the prior art, a blockchain is a technical scheme for collectively maintaining a reliable database in a decentralized and distrust manner, and has decentralized, distributed storage and traceable characteristics. The distributed network is an infrastructure of a block chain, data generated on each node is broadcast to other nodes through the distributed network, and the other nodes verify the authenticity of the data through workload certification. The invention disclosed in publication number CN111259070A discloses a method and related device for storing and acquiring service data, including: the method comprises the steps that a block chain application service platform obtains set service data; performing multi-stage encryption on set service data to obtain a target hash value; and performing uplink storage on the target hash value according to the type of the set service data, and performing uplink storage according to the type of the set service data after performing multi-stage encryption on the set service data, thereby improving the safety of the service data and the orderliness of data storage.
However, the traditional block chain has the characteristics of high construction cost, high energy consumption and large resource occupation, and the distributed storage enables all nodes to store a large amount of data, but the responsibilities and functions of all nodes are almost not different, so that the larger the number of the nodes is, the lower the resource utilization rate is, and although the advantages in tamper resistance are obvious, the advantages in processing efficiency and data security are not obvious. Therefore, how to fully release the advantage of the number when the number of the nodes is increased is a direction worthy of research, and efficient utilization of resources is realized through the differentiated functions of the nodes, so that the safety of information transmission is improved.
Disclosure of Invention
Aiming at the problem of poor information transmission safety caused by repeated node responsibilities in the prior art, the invention provides a safety transmission method for financial data query, which has the advantages that the node responsibilities are divided and the contents are stored in a differentiated mode, so that the utilization rate of node resources is higher, the integrity degree of information stored by a single node is reduced, and the safety is improved.
The technical scheme of the invention is as follows.
A secure transmission method for financial data queries, comprising:
step S01, calculating hash values for each piece of financial data stored in the database, broadcasting keywords and hash values of each piece of financial data to a node cluster, selecting a first node and a second node from the node cluster, sending first address information and hash values of each piece of financial data to the first node, and sending second address information and hash values of each piece of financial data to the second node;
step S02, the user terminal verifies the identity of the operator, connects any node in the node cluster after passing through, inquires the keyword or hash value stored in the node according to the input keyword or hash value, and broadcasts the corresponding hash value to the node cluster if matching information exists;
step S03, after receiving the broadcasted hash value, the first node sends a first task request to the reading unit, and after the first task request passes the first address information corresponding to the hash value, the first address information is input to the reading unit, the reading unit reads the content stored in the data storage unit according to the first address information, and forwards the financial data corresponding to the first address information to the user terminal, and meanwhile, broadcasts a stage take-over signal to the node cluster;
step S04, the second node enters a preparation mode after receiving the reading instruction, after receiving the phase succession signal broadcasted by the reading unit, the second node sends a second task request to the reading unit, after the second task request passes the phase succession signal, the second address information corresponding to the hash value is input to the reading unit, the reading unit continues to read the data storage unit according to the second address information until the second task request is completed, the financial data corresponding to the second address information is forwarded to the user terminal, meanwhile, the completion signal is broadcasted, and the reading unit clears all address information.
The financial data are stored in the database, the node clusters store the address information in a dispersing way and execute different tasks, the advantages of the number of the nodes are utilized, the processing efficiency is high, the user terminal is not directly connected with the database, the user terminal cannot predict which node the address information corresponding to the required financial information is stored in, the address of one financial data is divided into two parts for storage, a malicious user can steal the target data only by just cracking two correct nodes at the same time, and the reading unit clears the address information after reading each time, so that the safety is guaranteed.
Preferably, the first address information is a start address, the second address information is the number of remaining addresses or an end address, when the second address information is the number of remaining addresses, the reading unit counts addresses synchronously while continuing to read until the number of read addresses meets a condition, and when the second address information is the end address, the reading unit continues to read the end address. Typically, a single address has a certain capacity limit, and one item of financial data is often stored in a plurality of consecutive addresses. When the starting address and the ending address of a financial data are A and B respectively, the content recorded by the corresponding first address information is A, the content recorded by the second address information is the difference value of B-A when the second address information is the rest addresses, and the content recorded by the second address information is B when the second address information is the ending address; when the second address information is the rest of the address number, the reading unit reads the data of B-A addresses after the address A has been read, and then the address number condition is met.
Preferably, the forwarding the financial data corresponding to the first address information to the user terminal includes: and the reading unit forwards the financial data to the user terminal through a third node, wherein the third node is randomly selected from the node cluster every time.
Preferably, the forwarding the financial data corresponding to the second address information to the user terminal includes: and the reading unit forwards the financial data to the user terminal through a fourth node, wherein the fourth node is randomly selected from the node cluster every time. That is, the node returning the information cannot predict unless just two correct nodes are broken, so that at least four kinds of nodes are involved in the whole transmission process, and the safety is high.
Preferably, the first node and the second node are randomly selected from the node cluster each time.
Preferably, if a plurality of task requests need to be processed simultaneously, the reading unit binds the task requests with the hash value and the address information, matches the hash value of the first task request when each second task request arrives, finds the first address information again, and continues to read according to the second address information; the reading unit selects to perform multi-thread simultaneous processing or single-thread sequential processing according to hardware or software conditions. As a checking means, the tasks before and after the same hash value are spliced to prevent reading of wrong addresses.
Preferably, the number of the first nodes and the number of the second nodes are 3n, n is a natural number greater than or equal to 1, the number of the first nodes and the number of the second nodes include m pseudo first nodes and m pseudo second nodes, 1 < m < n, the pseudo first nodes store false first address information, the pseudo second nodes store false second address information, when all the first nodes or the second nodes send task requests to the reading unit, the reading unit verifies the received first address information or the received second address information, if more than half of information of each kind is consistent, reading is carried out, and if not, an error is reported. A plurality of nodes are simultaneously selected in each class, a small amount of false address information exists, and the correctness of information stored in the nodes cannot be known before verification, so that even if an individual node is hijacked, the information cannot be accurately acquired, distributed storage of the same address information is superposed on the first address information and the second address information on the basis of distributed storage is realized, and compared with the traditional distributed storage, the distributed storage can only prevent tampering, and the method can also prevent stealing.
Preferably, after step S01 is completed, the sent address information in the database is cleared, and only the address information stored in the node is retained.
Preferably, after a complete reading process is completed, the original first node sends the used first address information and the hash value to the new first node and clears the used first address information of the original first node, and the original second node sends the used second address information and the hash value to the new second node and clears the used second address information of the original second node. The dynamic storage of the address in the node cluster is realized, and theoretically, all nodes need to be broken to know complete address information.
The beneficial effects of the invention include: through distributing to different tasks of node and different storage data, the quantity advantage of full play node improves the treatment effeciency, through the incompleteness of node information storage, prevents that complete information from revealing, and complete transmission step relates to a plurality of nodes, prevents that information from stealing to utilize the basis of scattered storage to overlap distributed storage and mix false information, guarantee information security.
Drawings
FIG. 1 is a flow chart of an embodiment of the present invention.
Detailed Description
The technical solution of the present application will be described with reference to the following examples. In addition, numerous specific details are set forth below in order to provide a better understanding of the present invention. It will be understood by those skilled in the art that the present invention may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present invention.
Example 1:
a secure transmission method for financial data query, as shown in fig. 1, comprising:
step S01, calculating hash values for each piece of financial data stored in the database, broadcasting keywords and hash values of each piece of financial data to the node cluster, selecting a first node and a second node from the node cluster, sending first address information and hash values of each piece of financial data to the first node, and sending second address information and hash values of each piece of financial data to the second node. The first node and the second node are randomly selected from the node cluster each time.
The reading unit synchronously counts the addresses when continuing reading until the number of the read addresses meets the condition. Typically, a single address has a certain capacity limit, and one item of financial data is often stored in a plurality of consecutive addresses. For example, when the start address of a piece of financial data is 0x00DC 0198 and the end address is 0x00DC EF05, the content described in the corresponding first address information is 0x00DC 0198, and the content described in the second address information is 60781 bytes; the reading unit satisfies the address number condition by reading 60781 bytes of data after having read the address 0x00DC 0198. In addition, since addresses are generally divided into blocks in a large-capacity storage system, recording can be performed directly in units of blocks, and recording is not performed in units of bytes, and the counting principle is the same as above.
And step S02, the user terminal verifies the identity of the operator, connects any node in the node cluster after passing through, inquires the keyword or the hash value stored in the node according to the input keyword or hash value, and broadcasts the corresponding hash value to the node cluster if matching information exists.
Step S03, after receiving the broadcasted hash value, the first node sends a first task request to the reading unit, and after passing the first task request, inputs the first address information corresponding to the hash value to the reading unit, and the reading unit reads the content stored in the data storage unit according to the first address information, and the reading unit forwards the financial data to the user terminal through a third node, where the third node is randomly selected from the node cluster each time, and simultaneously broadcasts a stage take-over signal to the node cluster.
Step S04, the second node enters a preparation mode after receiving the reading instruction, after receiving the phase succession signal broadcasted by the reading unit, the second node sends a second task request to the reading unit, after the second task request passes the phase succession signal, the second address information corresponding to the hash value is input to the reading unit, the reading unit continues to read the data storage unit according to the second address information until the second task request is completed, the reading unit forwards the financial data to the user terminal through a fourth node, the fourth node randomly selects from the node cluster every time, and simultaneously broadcasts a completion signal, and the reading unit clears all address information. That is, the node returning the information cannot predict unless just two correct nodes are broken, so that at least four kinds of nodes are involved in the whole transmission process, and the safety is high.
If a reading unit of this embodiment needs to process multiple task requests at the same time, the reading unit binds the task requests with hash values and address information, matches the hash value of the first task request when each second task request arrives, and finds the first address information again, and then continues to read according to the second address information; the reading unit selects to perform multi-thread simultaneous processing or single-thread sequential processing according to hardware or software conditions. As a checking means, the tasks before and after the same hash value are spliced to prevent reading of wrong addresses.
In the embodiment, financial data is stored in the database, address information is stored in a node cluster in a dispersing manner, different tasks are executed, the advantage of the number of nodes is utilized, the processing efficiency is high, no direct connection exists between the user terminal and the database, the user terminal cannot predict which node the address information corresponding to the required financial information is stored in, the address of one financial data is divided into two parts for storage, a malicious user just needs to crack two correct nodes at the same time to steal target data, the reading unit clears the address information after reading is completed every time, and the safety is guaranteed.
Example 2:
the present embodiment is generally consistent with the previous embodiment, and the difference is that after step S01 is completed, the sent address information in the database is cleared, and only the address information stored in the node is retained; and the number of the first nodes and the second nodes is 9, the pseudo-first nodes and the pseudo-second nodes are included, the pseudo-first nodes store false first address information, the pseudo-second nodes store false second address information, when all the first nodes or the second nodes send task requests to the reading unit, the reading unit verifies the received first address information or the received second address information, if more than half of the information of each kind is consistent, reading is carried out, and if not, errors are reported. A plurality of nodes are simultaneously selected in each class, a small amount of false address information exists, and the correctness of information stored in the nodes cannot be known before verification, so that even if an individual node is hijacked, the information cannot be accurately acquired, distributed storage of the same address information is superposed on the first address information and the second address information on the basis of distributed storage is realized, and compared with the traditional distributed storage, the distributed storage can only prevent tampering, and the method can also prevent stealing.
After a complete reading process is completed, the original first node sends the used first address information and the hash value to the new first node and eliminates the used first address information of the original first node, and the original second node sends the used second address information and the hash value to the new second node and eliminates the used second address information of the original second node. The dynamic storage of the address in the node cluster is realized, and theoretically, all nodes need to be broken to know complete address information.
The embodiment gives full play to the quantity advantage of the nodes through distributing different tasks and different storage data to the nodes, improves the processing efficiency, prevents complete information leakage through the incompleteness of node information storage, prevents information stealing through the complete transmission step involving a plurality of nodes, and ensures information safety by overlapping distributed storage and mixing false information on the basis of utilizing the dispersed storage.
Through the description of the above embodiments, those skilled in the art will understand that, for convenience and simplicity of description, only the division of the above functional modules is used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of a specific device is divided into different functional modules to complete all or part of the above described functions.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.