Node risk assessment method and financial transaction data processing method
By evaluating the technical security capabilities, stability and reputation data of blockchain nodes, using mapping relationships or neural network models to determine risk scores, and electing stable nodes as main nodes, the problem of risk assessment in the blockchain system is solved, and the stability of the system and the accuracy of risk scores are improved.
Patent Information
- Application Number
- CN202411380678.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Blockchain systems are prone to various risks in the process of generating blockchain, such as forging transactions or stealing assets, and require effective node risk assessment methods to improve system stability.
By obtaining the node's technical security capability data, stability data and reputation data, using mapping relationships or neural network models to evaluate node risk scores, and predict when the model consistency is good, nodes with less risk are elected as master nodes to generate blocks.
It reduces the risk probability of the blockchain system in the process of generating the blockchain, improves the stability of the system and the accuracy of the risk score.
Smart Images

Figure CN119276564B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, specifically to the field of blockchain for financial transaction data, and particularly to a method for evaluating node risks and a method for processing financial transaction data. Background Art
[0002] Blockchain is essentially a decentralized database that uses cryptographic methods to combine a series of data blocks (i.e., blocks) in a sequential and connected manner into a chain structure. Each data block contains information about network transactions, which is used to verify the validity of the information and generate the next block.
[0003] Blockchain technology can be used to achieve fast, secure, and low-cost cross-border payments and settlements, improving transaction efficiency and reducing transaction costs. At the same time, it can also be used in financial services such as securities trading, lending, and insurance.
[0004] However, various risks are prone to occur during the process of generating a blockchain in a blockchain system. For example, forging transactions or stealing assets. Therefore, how to evaluate the risks of nodes in a blockchain system has become a necessity for us. Summary of the Invention
[0005] This application provides a method for evaluating node risks and a method for processing financial transaction data, which are used to provide a method for evaluating the risks of nodes in a blockchain system, reduce the probability of various risks occurring during the process of generating a blockchain in the blockchain system, and improve the stability of the blockchain system.
[0006] In a first aspect, this application provides a method for evaluating node risks, which is applied to a first node among multiple nodes of a financial transaction data processing system; the method includes: the first node obtains risk assessment data of each node among the multiple nodes; the risk assessment data includes at least one of the following: technical security capability data, stability data, and reputation data; the first node determines a corresponding risk score for each node according to the risk assessment data of each node.
[0007] Optionally, the technical security capability data includes computing power and the version number of the node operating software; the stability data includes online duration, failure rate, and failure recovery duration; the reputation data includes the number of malicious attacks and the number of times of publishing false information.
[0008] Optionally, the first node determines the risk score corresponding to each node according to the risk assessment data of each node, including: the first node determines the technical security capability score of each node according to the technical security capability data of each node; the first node determines the stability score of each node according to the stability data of each node; the first node determines the reputation score of each node according to the reputation data of each node; the first node determines the risk score corresponding to each node according to the technical security capability score of each node, the preset technical security capability weight, the stability score of each node, the preset stability weight, the reputation score of each node, and the preset reputation weight.
[0009] Optionally, the first node determines the risk score corresponding to each node according to the risk assessment data of each node, including: the first node determines the risk score corresponding to each node according to the risk assessment data of each node and a risk assessment model; the risk assessment model is obtained by training a preset neural network based on a training sample set; the training sample set includes multiple training samples, each training sample includes training risk assessment data, and the label corresponding to each training sample is a risk score.
[0010] Optionally, the method further includes: the first node obtains a training sample set; the training sample set includes multiple training samples, each training sample includes training risk assessment data, and the label corresponding to each training sample is a risk score; the first node trains a preset neural network based on the training sample set to obtain a risk assessment model.
[0011] Optionally, the first node determines the risk score corresponding to each node according to the risk assessment data of each node and a risk assessment model, including: the first node obtains a test sample and broadcasts it to the remaining nodes; the test sample includes test risk assessment data; the first node predicts the test sample according to the trained risk assessment model to obtain the test score predicted by the first node; the first node receives the test scores sent by each of the remaining nodes; the test scores are obtained by the corresponding nodes based on the risk assessment model after training the risk assessment model to predict the test sample; when the maximum difference between the test scores of multiple nodes is less than a preset difference threshold, the first node determines the risk score corresponding to each node according to the risk assessment data of each node and the risk assessment model.
[0012] In the node risk evaluation method provided by this application, the first node can obtain the risk assessment data of each node among multiple nodes, and determine the risk score corresponding to each node according to the risk assessment data of each node, so as to provide a method for evaluating the risk of nodes in a blockchain system. In this way, each node can evaluate the risk scores of the other nodes. When the main node for generating blocks is elected later, the node with a smaller risk can be voted as the main node according to the risk scores, thereby reducing the probability of various risks generated during the process of generating the blockchain in the blockchain system and improving the stability of the blockchain system.
[0013] In addition, when multiple nodes in a financial transaction data processing system predict risk scores using their respective trained risk assessment models, the risk scores may vary greatly due to inconsistent model performances. The first node can also broadcast test samples to the other nodes, receive the test scores obtained by the other nodes using their respective trained risk assessment models to predict the test samples, and use the risk assessment model for prediction only when the maximum difference between the test scores of multiple nodes is less than a preset difference. At this time, the consistency of the risk assessment models of multiple nodes is relatively good, and the accuracy of the predicted risk scores is relatively high, improving the accuracy of the predicted risk scores.
[0014] In a second aspect, this application provides a node evaluation device, which includes various functional modules for the node risk evaluation method described in the first aspect above.
[0015] In a third aspect, this application provides a financial transaction data processing method, which is applied to the first node among multiple nodes of a financial transaction data processing system; the method includes: the first node determines the risk score corresponding to each node among multiple nodes according to the node risk evaluation method described in the first aspect above; the first node determines the election score corresponding to each node among multiple nodes according to the risk scores; when the election score of the first node is the highest, the first node broadcasts main node election information to the other nodes among multiple nodes; the main node election information includes the identity identifier of the first node; the first node receives votes from the other nodes; the vote is cast by the corresponding node when the election score of the first node is the highest among the election scores of each node calculated based on that node; when the number of votes is greater than a preset threshold, the first node generates a block according to the financial transaction data within a preset period and adds the block to the blockchain; the blockchain includes multiple historical blocks; each historical block is used to record historical financial transaction data.
[0016] In a fourth aspect, this application provides a financial transaction data processing device, which includes various functional units for the financial transaction data processing method described in the third aspect above.
[0017] Fifth aspect, the present application provides an electronic device, which includes: a processor and a memory; the memory stores instructions executable by the processor; when the processor is configured to execute the instructions, the electronic device implements the method described in the first aspect or the third aspect above.
[0018] Sixth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions run on an electronic device, the electronic device implements the method described in the first aspect or the third aspect above.
[0019] Seventh aspect, the present application provides a computer-readable storage medium, which includes: computer software instructions; when the computer software instructions run in an electronic device, the electronic device implements the method described in the first aspect or the third aspect above.
[0020] The beneficial effects of the second aspect to the seventh aspect above can be referred to those described in the first aspect and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0022] Figure 1 It is a schematic diagram of the composition of the financial transaction data processing system provided by the embodiment of the present application;
[0023] Figure 2 It is a schematic flowchart of the node risk assessment method provided by the embodiment of the present application;
[0024] Figure 3 It is a schematic flowchart of the financial transaction data processing method provided by the embodiment of the present application;
[0025] Figure 4 It is a schematic diagram of the composition of the node risk assessment device provided by the embodiment of the present application;
[0026] Figure 5 It is a schematic diagram of the composition of the financial transaction data processing device provided by the embodiment of the present application;
[0027] Figure 6 It is a schematic diagram of the composition of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0029] It should be noted that in the embodiments of the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, the use of words such as "exemplarily" or "for example" is intended to present relevant concepts in a specific manner.
[0030] In order to facilitate a clear description of the technical solutions in the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and roles. Those skilled in the art can understand that the words such as "first" and "second" do not limit the quantity and execution order.
[0031] Blockchain is essentially a decentralized database. It uses cryptographic methods to combine a series of data blocks (i.e., blocks) into a chain structure in a sequential connection manner. Each data block contains information about network transactions, which is used to verify the validity of the information and generate the next block.
[0032] Blockchain technology can be used to achieve fast, secure and low-cost cross-border payments and settlements, improve transaction efficiency and reduce transaction costs. At the same time, it can also be used in financial services such as securities trading, lending, and insurance.
[0033] However, various risks are likely to occur in the process of generating a blockchain in a blockchain system. For example, forging transactions or stealing assets, etc. Therefore, how to evaluate the node risks in a blockchain system has become our need.
[0034] Based on this, the embodiments of the present application provide a node risk evaluation method and a financial transaction data processing method, which can evaluate the risk score of each node through risk assessment data.
[0035] The following is an introduction in conjunction with the accompanying drawings.
[0036] Figure 1 It is a schematic diagram of the composition of the financial transaction data processing system provided by the embodiments of the present application. As Figure 1 shown, the system may include multiple nodes ( Figure 1Taking a total of three nodes, namely node 1, node 2, and node 3, as an example (shown in the figure). There is a communication connection between the multiple nodes.
[0037] Each of the multiple nodes can be an electronic device with computing and processing capabilities, such as a computer or a server.
[0038] Among them, the server can be a single server, or it can also be a server cluster composed of multiple servers. In some embodiments, the server cluster can also be a distributed cluster. Optionally, the server can also be implemented on a cloud platform. For example, the cloud platform can include private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, inter-cloud, and multi-cloud, etc., or any combination thereof. The embodiments of the present application do not limit this.
[0039] Each of the multiple nodes can be used to obtain and record financial transaction data.
[0040] In some embodiments, the multiple nodes can include a master node. The master node can be used to generate a block based on the financial transaction data and add the generated block to the blockchain. The specific process can be referred to in the financial transaction data processing method provided in the following embodiments, and will not be elaborated here.
[0041] In some embodiments, any one of the multiple nodes can also obtain the risk assessment data of each node and determine the risk score of each node according to the risk assessment data. The specific process can be referred to in the node risk evaluation method provided in the following embodiments, and will not be elaborated here.
[0042] The execution subject of the node risk evaluation method and the financial transaction data processing method provided in the embodiments of the present application can be understood as any one of the first nodes in the above financial transaction data processing system. Optionally, the execution subject of the node risk evaluation method and the financial transaction data processing method provided in the embodiments of the present application can also be the processor (such as a central processing unit (CPU)) in the foregoing first node; or, it can also be an application installed in the foregoing first node for executing the node risk evaluation method and the financial transaction data processing method; or, it can also be a software system or platform deployed in the foregoing first node; or, it can also be a functional module in the foregoing first node for executing the node risk evaluation method and the financial transaction data processing method, etc. The embodiments of the present application do not limit this.
[0043] For simplicity of description, the following will uniformly introduce the first node as the execution subject.
[0044] Figure 2 This is a schematic flowchart of the node risk assessment method provided by the embodiments of the present application. As Figure 2 shown, the method includes the following steps:
[0045] S101. The first node obtains the risk assessment data of each node among multiple nodes.
[0046] Among them, the risk assessment data includes at least one of the following: technical security capability data, stability data, and reputation data.
[0047] Optionally, the technical security capability data may include: computing power and the version number of the node operating software.
[0048] Among them, the node with higher computing power has a greater voice in the consensus process and a higher probability of becoming the target of an attack. Moreover, when a node controls more than 50% of the computing power or holds more than 50% of the tokens in a blockchain system (i.e., the above-mentioned financial transaction data processing system), the node can launch a 51% attack, thereby performing malicious behaviors such as double-spending attacks and blocking transactions. Such attacks seriously threaten the decentralization and security of the blockchain system.
[0049] The newer the version number of the node operating software, or the smaller the difference from the latest version number, the more timely the node updates the operating software. And the updated operating software may update security patches for existing vulnerability risks. Therefore, the version number of the node operating software is directly related to the node's ability to resist known vulnerabilities and attacks.
[0050] Optionally, the stability data may include: online duration, failure rate, and fault recovery duration.
[0051] Among them, the online duration of the node reflects its stability and reliability. Nodes that are online for a long time are more likely to provide continuous services to the blockchain system. Nodes with a shorter online duration may be attacked and go offline. Therefore, nodes with a longer online duration have lower risks, and nodes with a shorter online duration have higher risks.
[0052] For example, each node among multiple nodes in a blockchain system (financial transaction data processing system) can broadcast heartbeat packets to other nodes at a preset interval. If other nodes receive the heartbeat packets broadcast by a certain node, it can be considered that the node is online. If other nodes do not receive the heartbeat packets broadcast by a certain node for more than the preset duration, it can be considered that the node is offline.
[0053] The failure rate and the failure recovery duration are important indicators for evaluating the reliability of nodes and the emergency response capabilities. The lower the failure rate of a node and the shorter the failure recovery duration, the better the reliability of the node and the stronger the emergency response capabilities, and thus the lower the risk; the higher the failure rate of a node and the longer the failure recovery duration, the worse the reliability of the node and the weaker the emergency response capabilities, and thus the higher the risk.
[0054] For example, the time difference between two consecutive online times of a node can be used as the failure recovery duration.
[0055] Optionally, the reputation data may include: the number of malicious attacks and the number of times of publishing false information.
[0056] The more the number of malicious attacks and the number of times of publishing false information, the more the number of bad records of the node, and the higher the risk of the node. The fewer the number of malicious attacks and the number of times of publishing false information, the fewer the number of bad records of the node, and the lower the risk of the node.
[0057] In some embodiments, the risk assessment data may further include a third-party rating. For example, the third-party rating may come from a security assessment or rating by an authoritative institution, or may also come from the evaluation and feedback of users in the blockchain community on the node. The embodiments of the present application do not limit this.
[0058] S102. The first node determines the risk score corresponding to each node according to the risk assessment data of each node.
[0059] In a possible implementation manner, several weights corresponding to several types of data may be preset in the first node, and the first node may comprehensively determine the risk score according to the weights corresponding to each type of data. In this case, the above S102 may specifically include the following steps:
[0060] Step 1a. The first node determines the technical security capability score of each node according to the technical security capability data of each node.
[0061] For example, the first node may determine the technical security capability score according to the technical security capability data and the first mapping relationship.
[0062] Among them, the first mapping relationship may be used to represent the mapping relationship between the technical security capability data and the technical security capability score.
[0063] Exemplarily, the first mapping relationship may be specifically as shown in Table 1 below:
[0064] Table 1
[0065]
[0066] As shown in Table 1, if the computing power of a node accounts for 40% to 50% of the (financial transaction data processing) system, or the version number of the running software differs from the latest version number by 5 versions, the technical security capability score of this node is 1 point. If the computing power of a node accounts for 30% to 40% of the (financial transaction data processing) system, or the version number of the running software differs from the latest version number by 4 versions, the technical security capability score of this node is 2 points. If the computing power of a node accounts for 20% to 30% of the (financial transaction data processing) system, or the version number of the running software differs from the latest version number by 3 versions, the technical security capability score of this node is 3 points. If the computing power of a node accounts for 10% to 20% of the (financial transaction data processing) system, or the version number of the running software differs from the latest version number by 2 versions, the technical security capability score of this node is 4 points. If the computing power of a node accounts for 0% to 10% of the (financial transaction data processing) system, or the version number of the running software differs from the latest version number by 1 version, the technical security capability score of this node is 5 points.
[0067] Step 2a, the first node determines the stability score of each node according to the stability data of each node.
[0068] For example, the first node can determine the stability score according to the stability data and the second mapping relationship.
[0069] Among them, the second mapping relationship can be used to represent the mapping relationship between the stability data and the stability score.
[0070] Exemplarily, the second mapping relationship can be specifically as shown in Table 2 below:
[0071] Table 2
[0072]
[0073]
[0074] As shown in Table 2, if the online duration of a node is less than one month, or the failure rate is greater than 25%, or the failure recovery duration is greater than 5 days, the stability score of this node is 1 point. If the online duration of a node is from one month to two months, or the failure rate is 20% to 25%, or the failure recovery duration is 4 days to 5 days, the stability score of this node is 2 points. If the online duration of a node is from two months to three months, or the failure rate is 15% to 20%, or the failure recovery duration is 3 days to 4 days, the stability score of this node is 3 points. If the online duration of a node is from three months to four months, or the failure rate is 10% to 15%, or the failure recovery duration is 2 days to 3 days, the stability score of this node is 4 points. If the online duration of a node is greater than four months, or the failure rate is less than 10%, or the failure recovery duration is less than 2 days, the stability score of this node is 5 points.
[0075] Step 3a: The first node determines the reputation score of each node according to the reputation data of each node.
[0076] For example, the first node can determine the reputation score according to the reputation data and the third mapping relationship.
[0077] Among them, the third mapping relationship can be used to represent the mapping relationship between the reputation data and the reputation score.
[0078] Exemplarily, the third mapping relationship can be specifically as shown in Table 3 below:
[0079] Table 3
[0080]
[0081] As shown in Table 3, if a node maliciously attacks 4 times or publishes false information 4 times, the reputation score of this node is 1 point. If a node maliciously attacks 3 times or publishes false information 3 times, the reputation score of this node is 2 points. If a node maliciously attacks 2 times or publishes false information 2 times, the reputation score of this node is 3 points. If a node maliciously attacks 1 time or publishes false information 1 time, the reputation score of this node is 4 points. If a node maliciously attacks 0 times or publishes false information 0 times, the reputation score of this node is 5 points.
[0082] Step 4a: The first node determines the respective risk score of each node according to the technical security ability score of each node, the preset technical security ability weight, the stability score of each node, the preset stability weight, the reputation score of each node, and the preset reputation weight.
[0083] For example, the first node can perform a weighted sum of the technical security ability score, the stability score, and the reputation score according to the technical security ability weight, the stability weight, and the reputation weight to obtain the risk score.
[0084] In another possible implementation, the first node can use a neural network model to predict the respective risk score of each node. In this case, S102 above can specifically include the following steps:
[0085] Step 1b: The first node determines the respective risk score of each node according to the risk assessment data of each node and the risk assessment model.
[0086] Among them, the risk assessment model is obtained by training a preset neural network based on a training sample set; the training sample set includes multiple training samples, each training sample includes training risk assessment data, and the label corresponding to each training sample is the risk score.
[0087] In some embodiments, before the above-mentioned step 1b, the first node may also obtain a trained risk assessment model.
[0088] Optionally, the first node may directly obtain a trained risk assessment model from other devices.
[0089] For example, multiple nodes may include a training node, which can be used to train the risk assessment model, and the first node may obtain the trained risk assessment model from the training node.
[0090] Optionally, the first node may also train to obtain the risk assessment model by itself. In this case, before the above-mentioned step 1b, the method may further include the following steps:
[0091] Step 1c: The first node obtains a training sample set.
[0092] Wherein, the training sample set includes multiple training samples, each training sample includes training risk assessment data, and the label corresponding to each training sample is a risk score.
[0093] Step 2c: The first node trains a preset neural network based on the training sample set to obtain a risk assessment model.
[0094] Wherein, the preset neural network may be, for example, a Back Propagation Neural Network (BP), a Convolutional Neural Network (CNN), or a Long Short-Term Memory networks (LSTM), etc. The specific type of the preset neural network is not limited in the embodiments of the present application.
[0095] Optionally, as described above, the training sample set may include multiple training samples. The first node may input one or more training samples into the preset neural network each time to obtain a predicted value (predicted risk score) output by the preset neural network, calculate a loss function (loss) based on the predicted value (predicted risk score) and the risk score in the training sample label, and adjust the parameters in the preset neural network according to the loss function until the preset neural network converges.
[0096] Optionally, the conditions for the preset neural network to converge may include: the number of times the first node inputs the training samples into the preset neural network reaches a threshold number of times, and / or the error of the preset neural network is less than an error threshold.
[0097] Among them, the number threshold can be preset by the administrator in the first node. For example, the number threshold can be set to 1000 times, 2000 times, or 5000 times, etc. The embodiments in this community do not limit the specific value of the number threshold. The error threshold can also be preset by the administrator in the first node. For example, the error threshold can be set to 5%, 8%, or 10%, etc. The embodiments of this application do not limit the specific value of the error threshold.
[0098] In some possible embodiments, as described above, the first node can train its own risk assessment model, and the other models can also train their own risk assessment models respectively. To avoid large differences in the performance of the risk assessment models trained by different nodes, the first node can also perform a consistency assessment and then use the risk assessment model for prediction. In this case, step 1b above can specifically include the following steps:
[0099] Step 1.1b: The first node obtains test samples and broadcasts them to the other nodes.
[0100] Among them, the test samples include test risk assessment data.
[0101] Step 1.2b: The first node predicts the test samples according to the trained risk assessment model to obtain the test scores predicted by the first node.
[0102] Step 1.3b: The first node receives the test scores sent by each of the other nodes respectively.
[0103] Among them, the test scores sent by the other nodes are obtained by the corresponding nodes based on the risk assessment model after training the risk assessment model and predicting the test samples.
[0104] Step 1.4b: When the maximum difference between the test scores of multiple nodes is less than the preset difference threshold, the first node determines the respective risk scores corresponding to each node according to the risk assessment data and risk assessment model of each node.
[0105] Among them, the preset difference threshold can be preset by the administrator in the first node. For example, the preset difference threshold can be set to 1 point or 2 points, etc. The embodiments of this application do not limit the specific value of the preset difference threshold.
[0106] For example, when the maximum difference between the test scores of multiple nodes is less than the preset difference threshold, the first node can broadcast the model consistency test result to the other nodes, so that multiple nodes agree to use the currently trained risk assessment model for prediction.
[0107] In the node risk assessment method provided by the embodiments of the present application, the first node can obtain the risk assessment data of each node among multiple nodes, and determine the risk score corresponding to each node according to the risk assessment data of each node, so as to provide a method for evaluating the risk of nodes in a blockchain system. And in this way, each node can evaluate the risk scores of the other nodes. When electing the main node for generating blocks subsequently, the node with a smaller risk can be voted as the main node according to the risk score, thereby reducing the probability of various risks generated in the process of generating the blockchain in the blockchain system and improving the stability of the blockchain system.
[0108] In addition, when multiple nodes in a financial transaction data processing system predict risk scores using their respective trained risk assessment models, the risk scores may vary greatly due to inconsistent model performances. The first node can also broadcast test samples to the other nodes, receive the test scores obtained by the other nodes using their respective trained risk assessment models to predict the test samples, and use the risk assessment model for prediction only when the maximum difference between the test scores of multiple nodes is less than a preset difference. At this time, the risk assessment models of multiple nodes are in good agreement, and the accuracy of the predicted risk scores is relatively high, improving the accuracy of the predicted risk scores.
[0109] In some possible embodiments, after determining the risk score corresponding to each node, the first node can also determine the election score corresponding to each node according to the risk score corresponding to each node.
[0110] For example, the first node can perform a weighted sum of scores such as the risk score and the computing power score to obtain the election score.
[0111] In some possible embodiments, when the election score of the first node is the highest, the first node can broadcast main node election information to the other nodes among the multiple nodes. The main node election information can include the identity identifier of the first node. The first node receives votes from the other nodes. The vote is cast by the corresponding node when the election score of the first node is the highest among the election scores of each node calculated based on that node. When the number of votes is greater than a preset threshold, the first node generates a block according to the financial transaction data within a preset period and adds the block to the blockchain. The blockchain includes multiple historical blocks. Each historical block is used to record historical financial transaction data.
[0112] Based on the understanding of the above embodiments, in an exemplary embodiment, the embodiments of the present application further provide a financial transaction data processing method, which can also be applied to the above-mentioned first node. Figure 3 It is a schematic flowchart of the financial transaction data processing method provided by the embodiments of the present application. As Figure 3As shown, the method includes the following steps:
[0113] S201. The first node determines the risk score corresponding to each node among multiple nodes.
[0114] For the specific steps of S201, reference can be made to the description at S101 to S102 above, and details will not be elaborated here.
[0115] S202. The first node determines the campaign score corresponding to each node among multiple nodes according to the risk score.
[0116] For example, the first node can perform a weighted sum of scores such as the risk score and the computing power score to obtain the campaign score.
[0117] S203. When the campaign score of the first node is the highest, the first node broadcasts the main node campaign information to the remaining nodes among the multiple nodes.
[0118] Among them, the main node campaign information includes the identity identifier of the first node.
[0119] S204. The first node receives votes from the remaining nodes.
[0120] Among them, the vote is cast by the corresponding node when the campaign score of the first node is the highest among the campaign scores of each node calculated based on that node.
[0121] For example, the remaining nodes may include a second node. The second node can also calculate the campaign score corresponding to each node according to the process of S201 to S202 above. When the second node receives the main node campaign information broadcast by the first node and the campaign score of the first node is the highest among the campaign scores calculated by the second node, the second node can vote for the first node.
[0122] S205. When the number of votes is greater than a preset threshold, the first node generates a block based on the financial transaction data within a preset period and adds the block to the blockchain.
[0123] Among them, the blockchain includes multiple historical blocks; each historical block is used to record historical financial transaction data. The preset threshold can be preset by the administrator in the first node. For example, taking the financial transaction data processing system including n nodes as an example, where n is a positive integer, the preset threshold can be set to (n / 2)+1, (n / 2)+2, or (n / 2)+3, etc. The specific value of the preset threshold is not limited in the embodiments of the present application.
[0124] The above mainly introduced the solution provided by the embodiments of the present application from the perspective of methods. To implement the above functions, it includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0125] In an exemplary embodiment, the embodiments of the present application further provide a node risk assessment device, and this device can be applied to the above-mentioned first node. Figure 4 It is a schematic diagram of the composition of the node risk assessment device provided by the embodiments of the present application. As Figure 4 shown, this device includes: an acquisition module 401 and a processing module 402.
[0126] The acquisition module 401 is used to acquire the risk assessment data of each node among multiple nodes; the risk assessment data includes at least one of the following: technical security capability data, stability data, and reputation data.
[0127] The processing module 402 is used to determine the risk score corresponding to each node according to the risk assessment data of each node.
[0128] In some possible embodiments, the technical security capability data includes computing power and the version number of the software running on the node; the stability data includes online duration, failure rate, and failure recovery duration; the reputation data includes the number of malicious attacks and the number of times of publishing false information.
[0129] In some other possible embodiments, the processing module 402 is specifically used to determine the technical security capability score of each node according to the technical security capability data of each node; determine the stability score of each node according to the stability data of each node; determine the reputation score of each node according to the reputation data of each node; and determine the risk score corresponding to each node according to the technical security capability score of each node, the preset technical security capability weight, the stability score of each node, the preset stability weight, the reputation score of each node, and the preset reputation weight.
[0130] In some other possible embodiments, the processing module 402 is specifically configured to determine the risk score corresponding to each node according to the risk assessment data and the risk assessment model of each node; the risk assessment model is obtained by training a preset neural network based on a training sample set; the training sample set includes a plurality of training samples, each training sample includes training risk assessment data, and the label corresponding to each training sample is a risk score.
[0131] In some other possible embodiments, the obtaining module 401 is further configured to obtain a training sample set; the training sample set includes a plurality of training samples, each training sample includes training risk assessment data, and the label corresponding to each training sample is a risk score; the processing module 402 is further configured to train a preset neural network based on the training sample set to obtain a risk assessment model.
[0132] In some other possible embodiments, the processing module 402 is specifically configured to obtain a test sample and broadcast it to the other nodes; the test sample includes test risk assessment data; predict the test sample according to the trained risk assessment model to obtain the test score predicted by the processing module 402; receive the test scores sent by each of the other nodes; the test score is predicted by the corresponding node based on the risk assessment model after the risk assessment model is trained; in the case that the maximum difference between the test scores of multiple nodes is less than a preset difference threshold, determine the risk score corresponding to each node according to the risk assessment data and the risk assessment model of each node.
[0133] In an exemplary embodiment, the embodiment of the present application further provides a financial transaction data processing device, which can be applied to the above-mentioned first node. Figure 5 It is a schematic diagram of the composition of the financial transaction data processing device provided by the embodiment of the present application. As Figure 5 shown, the device includes: a risk assessment unit 501, a campaign unit 502, and a generation unit 503.
[0134] The risk assessment unit 501 is configured to determine the risk score corresponding to each node among multiple nodes.
[0135] The campaign unit 502 is configured to enable the first node to determine the campaign score of each node among multiple nodes according to the risk score; in the case that the campaign score of the first node is the highest, the first node broadcasts the master node campaign information to the other nodes among the multiple nodes; the master node campaign information includes the identity identifier of the first node; the first node receives the votes from the other nodes; the vote is cast by the corresponding node when the campaign score of the first node is the highest among the campaign scores of each node calculated based on that node.
[0136] A generating unit 503, configured to, when the number of votes in the voting is greater than a preset threshold, generate a block by the first node according to financial transaction data within a preset period and add the block to the blockchain; the blockchain includes a plurality of historical blocks; each historical block is used to record historical financial transaction data.
[0137] As described above, the node of the financial transaction data processing system may be an electronic device with computing and processing functions such as a computer or a server. In an exemplary embodiment, the embodiment of the present application further provides an electronic device. Figure 6 It is a schematic diagram of the composition of the electronic device provided by the embodiment of the present application. As Figure 6 shown, the electronic device may include: a processor 10, a memory 20, a communication line 30, a communication interface 40, and an input / output interface 50.
[0138] Among them, the processor 10, the memory 20, the communication interface 40, and the input / output interface 50 may be connected through the communication line 30.
[0139] The processor 10 is configured to execute instructions stored in the memory 20 to implement the node risk assessment method and the financial transaction data processing method provided in the above embodiments of the present application. The processor 10 may be a CPU, a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a micro control unit (MCU) / single-chip microcomputer / single-chip microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 10 may also be any other device with processing functions, such as a circuit, a device, or a software module, and the embodiments of the present application do not limit this. In one example, the processor 10 may include one or more CPUs, such as Figure 6 the CPU0 and CPU1 in Figure 6 which are shown by dotted lines as an example. As an optional implementation manner, the electronic device may include multiple processors. For example, in addition to the processor 10, it may further include a processor 60 (
[0140] A memory 20 for storing instructions. For example, the instructions can be a computer program. Optionally, the memory 20 can be a read-only memory (ROM) or other types of static storage devices that can store static information and / or instructions, or it can be a random access memory (RAM) or other types of dynamic storage devices that can store information and / or instructions. It can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, etc. The embodiments of the present application do not limit this.
[0141] It should be noted that the memory 20 can exist independently of the processor 10 or be integrated with the processor 10. The memory 20 can be located inside the electronic device or outside the electronic device. The embodiments of the present application do not limit this.
[0142] A communication line 30 for transmitting information between the components included in the electronic device.
[0143] A communication interface 40 for communicating with other devices or other communication networks. The other communication network can be an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 40 can be a module, a circuit, a transceiver, or any device capable of implementing communication.
[0144] An input / output interface 50 for implementing human-computer interaction between the user and the electronic device. For example, it realizes action interaction or information interaction between the user and the electronic device.
[0145] Exemplarily, the input / output interface 50 can be a mouse, a keyboard, a display screen, or a touch display screen, etc. Action interaction or information interaction between the user and the electronic device can be realized through a mouse, a keyboard, a display screen, or a touch display screen, etc.
[0146] It should be noted that Figure 6 the structure shown in Figure 6 does not constitute a limitation on the electronic device. In addition to the components shown, the electronic device can include more or fewer components than shown in the figure, or a combination of certain components, or a different component arrangement.
[0147] In an exemplary embodiment, the embodiment of the present application further provides a computer program product, which includes computer instructions. When the computer instructions run on an electronic device, the computer is enabled to implement the method in the foregoing method embodiment.
[0148] In an exemplary embodiment, the embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored; when the computer program instructions are executed by an electronic device, the electronic device is enabled to implement the method as described in the foregoing embodiment. The computer-readable storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0149] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer-executable instructions. When the computer-executable instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer-executable instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer-executable instructions may be transmitted from a website, a computer, a server, or a data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.).
[0150] Although the present application has been described in conjunction with various embodiments herein, however, in the process of implementing the claimed present application, those skilled in the art can understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "one" does not exclude a plurality of cases. A single processor or other unit may implement several functions recited in the claims. Certain measures are recited in mutually different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0151] Although the present application has been described in connection with specific features and their embodiments, it is obvious that various modifications and combinations can be made without departing from the spirit and scope of the present application. Accordingly, the present specification and the drawings are merely exemplary illustrations of the present application defined by the appended claims, and are considered to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these changes and modifications.
[0152] As described above, the above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A node risk assessment method, characterized in that, The method is applied to a first node among multiple nodes of a financial transaction data processing system; the method includes: The first node obtains risk assessment data of each node among the multiple nodes; the risk assessment data includes at least one of the following: technical security capability data, stability data, and reputation data; The first node determines a respective risk score for each node according to the risk assessment data of each node, including: the first node determines a respective risk score for each node according to the risk assessment data of each node and a risk assessment model; The risk assessment model is obtained by training a preset neural network based on a training sample set; the training sample set includes multiple training samples, each training sample includes training risk assessment data, and the label corresponding to each training sample is a risk score; The first node determines a respective risk score for each node according to the risk assessment data of each node and the risk assessment model, including: the first node obtains a test sample and broadcasts it to the remaining nodes; the test sample includes test risk assessment data; the first node predicts the test sample according to the trained risk assessment model to obtain a test score predicted by the first node; the first node receives the test scores respectively sent by each of the remaining nodes; the test scores are predicted by the corresponding nodes based on the risk assessment model after the risk assessment model is trained; when the maximum difference between the test scores of the multiple nodes is less than a preset difference threshold, the first node determines a respective risk score for each node according to the risk assessment data of each node and the risk assessment model; When the maximum difference between the test scores of the multiple nodes is less than a preset difference threshold, the first node broadcasts a model consistency test result to the remaining nodes, so that the multiple nodes agree to use the currently trained risk assessment model for prediction.
2. The method according to claim 1, wherein The technical security capability data includes computing power and the version number of the node operating software; the stability data includes online duration, failure rate, and failure recovery duration; the reputation data includes the number of malicious attacks and the number of times of publishing false information.
3. The method according to claim 1 or 2, characterized in that, The first node determines a respective risk score for each node according to the risk assessment data of each node, including: the first node determines a technical security capability score for each node according to the technical security capability data of each node; the first node determines a stability score for each node according to the stability data of each node; the first node determines a reputation score for each node according to the reputation data of each node; the first node determines a respective risk score for each node according to the technical security capability score of each node, a preset technical security capability weight, the stability score of each node, a preset stability weight, the reputation score of each node, and a preset reputation weight.
4. The method according to claim 1, wherein The method further includes: the first node obtains a training sample set; the training sample set includes a plurality of training samples, each training sample includes training risk assessment data, and the label corresponding to each training sample is a risk score; the first node trains the preset neural network based on the training sample set to obtain the risk assessment model.
5. A method for processing financial transaction data, characterized in that, The method is applied to the first node among multiple nodes of a financial transaction data processing system; the method includes: the first node determines the risk score corresponding to each of the multiple nodes according to the method described in any one of claims 1-4; the first node determines the election score corresponding to each of the multiple nodes according to the risk score; when the election score of the first node is the highest, the first node broadcasts master node election information to the remaining nodes among the multiple nodes; the master node election information includes the identity identifier of the first node; the first node receives votes from the remaining nodes; the vote is cast by the corresponding node when the election score of the first node is the highest among the election scores of each node calculated based on that node; when the number of votes of the vote is greater than a preset threshold, the first node generates a block according to the financial transaction data within a preset period and adds the block to the blockchain; the blockchain includes a plurality of historical blocks; each historical block is used to record historical financial transaction data.
6. A node risk assessment device, characterized in that, The device is applied to the first node among multiple nodes of a financial transaction data processing system; the device includes: an acquisition module and a processing module; the acquisition module is used to acquire the risk assessment data of each of the multiple nodes; the risk assessment data includes at least one of the following: technical security capability data, stability data, and reputation data; the processing module is used to determine the risk score corresponding to each of the multiple nodes according to the risk assessment data of each node, specifically: the first node determines the risk score corresponding to each of the multiple nodes according to the risk assessment data and the risk assessment model of each node. The risk assessment model is obtained by training a preset neural network based on a training sample set; the training sample set includes a plurality of training samples, each training sample includes training risk assessment data, and the label corresponding to each training sample is a risk score. The first node determines the risk score corresponding to each node according to the risk assessment data and risk assessment model of each node, including: the first node obtains a test sample and broadcasts it to the remaining nodes; the test sample includes test risk assessment data; the first node predicts the test sample according to the trained risk assessment model to obtain a test score predicted by the first node; the first node receives the test scores sent by each of the remaining nodes; the test score is predicted by the corresponding node based on the risk assessment model after the risk assessment model is trained; in the case that the maximum difference between the test scores of the multiple nodes is less than a preset difference threshold, the first node determines the risk score corresponding to each node according to the risk assessment data and risk assessment model of each node; In the case that the maximum difference between the test scores of the multiple nodes is less than a preset difference threshold, the first node broadcasts the model consistency test result to the remaining nodes, so that the multiple nodes agree to use the currently trained risk assessment model for prediction.
7. A financial transaction data processing device, characterized in that, The device is applied to the first node among multiple nodes of a financial transaction data processing system; the device includes: a risk assessment unit, a campaign unit, and a generation unit; the risk assessment unit is configured to determine the risk score corresponding to each node among the multiple nodes according to the method of any one of claims 1-4; the campaign unit is configured to determine the campaign score corresponding to each node among the multiple nodes by the first node according to the risk score; in the case that the campaign score of the first node is the highest, the first node broadcasts the main node campaign information to the remaining nodes among the multiple nodes; the main node campaign information includes the identity identifier of the first node; the first node receives the votes from the remaining nodes; the vote is cast by the corresponding node in the case that the campaign score of the first node is the highest among the campaign scores of each node calculated based on that node; the generation unit is configured to, in the case that the number of votes is greater than a preset threshold, the first node generates a block according to the financial transaction data within a preset period and adds the block to the blockchain; the blockchain includes multiple historical blocks; each historical block is used to record historical financial transaction data.
8. An electronic device, characterized in that, The electronic device includes: a processor and a memory; the memory stores instructions executable by the processor; when the processor is configured to execute the instructions, the electronic device implements the method of any one of claims 1-4.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes: computer software instructions; when the computer software instructions run in an electronic device, the electronic device implements the method of any one of claims 1-4.
10. A computer program product, characterized in that, The computer program product includes computer instructions, and when the computer instructions run on an electronic device, the electronic device executes the method of any one of claims 1-4.
Citation Information
Patent Citations
Consensus method and system for block chain and Internet of Things fusion scene
CN112163856A
Safety control method for financial account
CN118469577A