Distributed data model tampering risk assessment method and device, electronic equipment, medium and product
By converting distributed data models into a unified model chain in a blockchain network and utilizing smart contract auditing, the problem of timely control over the risk assessment of distributed data model tampering is solved, achieving efficient anti-tampering and simplified management.
Patent Information
- Application Number
- CN202411573520.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-11-05
AI Technical Summary
Distributed data models are at risk of being tampered with when accessed without authorization. Existing anti-tampering strategies are difficult to control in a timely manner and increase the difficulty and complexity of system management.
The original unified data model is converted into a unified model chain in the blockchain network. Through the mapping relationship between virtual unified nodes and model chain nodes, a field chain is constructed, and smart contracts are used for auditing to generate audit reports to assess the risk of tampering.
It achieves timely anti-tampering protection for distributed data models, reduces computational load, improves audit efficiency, promptly detects tampering, and simplifies system management.
Smart Images

Figure CN119475446B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchains, and particularly relates to a distributed data model tampering risk assessment method and device, electronic equipment, a computer readable storage medium and a computer program product. BACKGROUND
[0002] At present, since the distributed data model is distributed in different nodes, an unauthorized malicious user or an internal staff may tamper with the data in the distributed node when accessing a specific distributed node, thereby causing a deviation between the node data and the data of the original model, and thus the data model has a risk of being tampered with. A common strategy to overcome this problem is to encrypt the data or authorize the user's rights, but this management method increases the difficulty of system management (for example, additional encryption and decryption authentication of the data are required). In addition, when a user with permission maliciously or out of range tampers with the data, the management party is difficult to know the tampered data in time (including the time, location, etc. of tampering), so the control effect of the data tampering of the distributed data model is poor.
[0003] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0004] The main purpose of the present application is to provide a distributed data model tampering risk assessment method, device, electronic equipment, computer readable storage medium and computer program product, which aims to solve the technical problem that the traditional anti-tampering strategy of the distributed data model cannot effectively control the tampered data in time.
[0005] To achieve the above purpose, the present application provides a distributed data model tampering risk assessment method, which comprises:
[0006] According to the original deployment scheme corresponding to the original unified data model, the original unified data model is converted into a unified model chain in a blockchain network, wherein the unified model chain at least includes a virtual unified node and a plurality of model chain nodes associated with the virtual unified node;
[0007] According to the fields of the data model corresponding to each model chain node, a corresponding field chain is constructed, wherein the field chain is used to record the field data in the data model;
[0008] When the unified model chain or the field chain produces a modification record, the unified model chain or the field chain is audited based on a preset smart contract, and a corresponding audit result is obtained;
[0009] generate an audit report according to the audit result, wherein the audit report at least includes the tampering risk assessment result.
[0010] In an embodiment, the step of converting the original unified data model into a unified model chain in the blockchain network according to an original deployment scheme corresponding to the original unified data model comprises:
[0011] based on the data model in the original unified data model and the sub-node of the original deployment scheme, a mapping relationship between the data model in the model chain node and the data model in the virtual unified node is established;
[0012] According to the mapping relationship, a virtual unified node and a plurality of model chain nodes associated with the virtual unified node are generated, and a unified model chain is obtained.
[0013] In an embodiment, the mapping relationship at least includes table mapping relationship, field mapping relationship and enumeration value mapping relationship;
[0014] The step of establishing a mapping relationship between the data model in the model chain node and the data model in the virtual unified node based on the data model in the original unified data model and the sub-node of the original deployment scheme comprises:
[0015] According to the content corresponding to the table in the original unified data model and the table in the data model in the sub-node, a table mapping relationship is established;
[0016] On the basis of the table mapping relationship, a field mapping relationship is established according to the field difference between the original unified data model and the data model in the sub-node;
[0017] According to the enumeration value in the original unified data model and the data model in the sub-node, an enumeration value mapping relationship is established.
[0018] In an embodiment, the step of constructing a corresponding field chain according to the fields of the data model corresponding to each model chain node comprises:
[0019] Traverse the data of each model chain node in the unified model chain, read the field content in each model chain node;
[0020] According to the field definition, field value and field format of the field content in each model chain node, a corresponding field chain is generated.
[0021] In an embodiment, the smart contract at least includes a model smart contract and a field smart contract, the audit result at least includes a model audit result and a field audit result, and the step of auditing the unified model chain or the field chain based on the preset smart contract to obtain the corresponding audit result comprises:
[0022] hashing the model data in the model chain node generating the modification record to obtain current model data;
[0023] obtaining a table, a field and an enumeration value corresponding to the model chain node generating the modification record from the virtual unified node to obtain reference model data;
[0024] comparing the current model data and the reference model data based on the auditing rule of the model smart contract to generate a model auditing result;
[0025] hashing the field of the field chain node generating the modification record to obtain current field data;
[0026] obtaining the field corresponding to the initial node in the field chain to obtain reference field data;
[0027] comparing the current field data and the reference field data based on the auditing rule of the field smart contract to generate a field auditing result.
[0028] In an embodiment, before the step of auditing the unified model chain or the field chain based on the preset smart contract, the method further comprises:
[0029] receiving an input auditing rule through a visual page and generating a regular expression corresponding to the auditing rule;
[0030] loading the regular expression into the preset model smart contract and field smart contract respectively;
[0031] The model smart contract is used to audit at least one of the basic information, the deployment node, the version information, the deployment time, the deployment sequence and the deployment integrity of the data model corresponding to each model chain node, and the field smart contract is used to audit at least one of the field name, the data type, the data length, the field enumeration value definition, the publishing node information, the field version information and the field deployment time of the data table of each data model.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides a distributed data model tampering risk assessment device, which comprises:
[0033] A model chain construction module is configured to convert an original unified data model into a unified model chain in a block chain network according to an original deployment scheme corresponding to the original unified data model, wherein the unified model chain at least includes a virtual unified node and a plurality of model chain nodes associated with the virtual unified node.
[0034] a field chain construction module, configured to construct a corresponding field chain according to fields of a data model corresponding to each of the model chain nodes, wherein the field chain is used to record field data in the data model;
[0035] a contract auditing module, configured to, when the unified model chain or the field chain produces a modification record, audit the unified model chain or the field chain based on a preset smart contract, to obtain a corresponding auditing result;
[0036] a report generation module, configured to generate an auditing report according to the auditing result, wherein the auditing report at least includes a tampering risk assessment result.
[0037] In addition, to achieve the above-mentioned purpose, the present application further provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the distributed data model tampering risk assessment method as described above.
[0038] In addition, to achieve the above-mentioned purpose, the present application further provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the distributed data model tampering risk assessment method as described above.
[0039] In addition, to achieve the above-mentioned purpose, the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the distributed data model tampering risk assessment method as described above.
[0040] This application proposes a method for assessing the risk of tampering in a distributed data model. First, based on the original deployment scheme corresponding to the original unified data model, the original unified data model is converted into a unified model chain in a blockchain network. The unified model chain includes at least virtual unified nodes and multiple model chain nodes mapped to the virtual unified nodes. Then, a corresponding field chain is constructed based on the fields of the data model corresponding to each model chain node. The field chain records the field data in the data model. When a modification record is generated in the unified model chain or the field chain, an audit is performed on the unified model chain or the field chain based on a preset smart contract to obtain the corresponding audit result. An audit report is generated based on the audit result, and the audit report includes at least the tampering risk assessment result. The technical solution of this application first achieves the conversion of the distributed deployment data model to the blockchain by constructing a unified model chain and a field chain, and then associates each data model by virtually constructing unified nodes, achieving tamper-proof protection of the distributed data model through blockchain technology itself. Furthermore, when a modification record is generated, data auditing of the unified model chain and the field chain through a smart contract allows for timely detection of tampering of the data model of the distributed nodes. Moreover, the method of auditing the model chain and field chain separately in this embodiment can fully cover the tampering of the data model and avoid omissions. In the case where only the model structure is tampered with, only the model chain needs to be audited, avoiding unnecessary audits and saving a certain amount of computation. Attached Figure Description
[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a flowchart illustrating an embodiment of the distributed data model tampering risk assessment method of this application.
[0044] Figure 2 This is a flowchart illustrating the audit process for the module chain node and field chain node that generate modification records in this embodiment of the application.
[0045] Figure 3 This is a schematic diagram illustrating the overall process of constructing the module chain, field chain, and auditing based on smart contracts in the embodiments of this application.
[0046] Figure 4 Fig. 1 is a schematic diagram of the structure of a distributed data model tampering risk assessment device according to an embodiment of the present application;
[0047] Figure 5 Fig. 1 is a schematic diagram of the structure of a distributed data model tampering risk assessment device according to an embodiment of the present application;
[0048] The object, features and advantages of the present application will be further illustrated in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are merely intended to explain the technical solutions of the present application, and are not intended to limit the present application.
[0050] In order to better understand the technical solutions of the present application, the following will be described in detail in conjunction with the drawings and specific embodiments.
[0051] The execution subject of the present embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, a server, etc., or an electronic device, a control device, etc. capable of realizing the above functions. The following will take a server as an example to illustrate the present embodiment and the following embodiments.
[0052] Although the current business mode for the unified data model deployed in a distributed manner can realize efficient data processing and storage, the unified original model data is easy to be tampered with and the central node is difficult to discover the time limit for the tampering of the model data deployed in a distributed manner. Since the data model deployed in a distributed manner is distributed in different nodes, an unauthorized malicious user or an internal staff may tamper with the data in the distributed node when accessing a specific distributed node, thereby causing a deviation between the data and the original model data. In addition, since the data needs to be transmitted between different nodes through a network in a distributed system, this way also brings the risk of malicious network attacks and data theft by hackers to some extent. The current common solution is to encrypt the data or authorize the user's rights, but this way will increase the difficulty of system management (additional encryption and decryption authentication of the data are required), and also cannot effectively manage the data tampering situation in time (cannot avoid the malicious or out-of-range data tampering by users with rights).
[0053] For example, since the data of the mobile communication system industry is usually distributed in data centers or servers at different geographical locations, due to network delay and transmission time, the central node may not be able to obtain the data state of all distributed nodes in time, thereby causing the central node to fail to discover the data tampering in time. In addition, if the attacker tampers during data transmission, the central node will also fail to discover the data tampering in time, and since the distributed system is relatively large, the central node cannot track the transmission and processing history of the data in time, resulting in the inability to accurately determine which location of the distributed node has been tampered with.
[0054] In order to overcome the above technical defects, the embodiments of the present application provide a distributed data model tampering risk assessment method, which refers to Figure 1 , Figure 1 The flowchart of the first embodiment of the distributed data model tampering risk assessment method of the present application is shown in the figure. The distributed data model tampering risk assessment method comprises:
[0055] Step S10: converting the original unified data model into a unified model chain in the blockchain network according to the original deployment scheme corresponding to the original unified data model, wherein the unified model chain at least includes a virtual unified node and a plurality of model chain nodes associated with the virtual unified node;
[0056] In order to overcome the defect that the data of the data model under the business model of the distributed deployment is easy to be tampered with in the prior art, the embodiments of the present application essentially provide a tamper-proof strategy for the distributed deployment of the data model based on the unified model chain by means of the tamper-proof feature of the blockchain. First, the original unified data model input by the developer and the original deployment scheme (i.e. the distributed deployment scheme) of the original unified data model are received, and then the corresponding unified model chain is generated for the above original unified data model and original deployment scheme. In summary, the purpose of step S10 is to construct the distributed deployment data model into a "unified model chain" based on the principle of the blockchain.
[0057] Specifically, in the process of converting the unified model chain, a virtual unified node is constructed for the original unified data model, and a model chain node is constructed for the data model of each distributed node in the original deployment scheme. In the unified model chain, there is a virtual unified node, and there are also model chain nodes associated with the virtual unified node. The above virtual unified node and each model chain node correspond one-to-one to each node in the original unified data model and the original deployment scheme. Moreover, the virtual unified node and the model chain node jointly constitute the entire blockchain as blockchain nodes. The advantage of designing the unified model chain in this way is that it can prevent unauthorized or unauthorized users from tampering with the model data by using the technology of the blockchain itself, thereby avoiding malicious tampering of the model data by unauthorized users.
[0058] It should be noted that the model structure, model parameters, model modification record and model unique identifier are recorded in the virtual unified node and the model chain node in the embodiments of the present application, and the difference lies in that the data on the virtual unified node and the data model on the model chain node are not completely the same. Specifically, the data in the data model on the model chain node belongs to a subset of the data on the virtual unified node (as a whole set).
[0059] In step S20, a corresponding field chain is constructed according to the fields of the data model corresponding to each model chain node, wherein the field chain is used to record the field data in the data model.
[0060] The purpose of step S20 is to construct a corresponding field chain based on the unified model chain generated in the previous step. Specifically, for the fields in the data of each model chain node in the unified model chain, a corresponding field chain node is constructed, and the field chain is formed by combination.
[0061] The field chain records the field data of each field of the data in each model chain node, and the field data includes field definition, field value and field format. It should be noted that each data model in the distributed deployment of the embodiments of the present application corresponds to a model chain node in the unified model chain, and each model chain node is deployed with a field chain node corresponding to the current data model. The unified model chain is a consortium blockchain, which is open to users with access to the distributed node, while the field chain is a private blockchain, which is open to users logging in to the current distributed deployment node.
[0062] In step S30, when a modification record is generated in the unified model chain or the field chain, the unified model chain or the field chain is audited based on a preset smart contract to obtain a corresponding audit result.
[0063] In order to realize the tampering risk assessment of each data model in the blockchain, when a modification record is generated in the model chain node in the unified model chain or the field chain node in the field chain, a pre-established smart contract is used for automatic auditing. The smart contract on the blockchain is a contract that can be triggered and executed by a transaction on the blockchain system, which is usually defined in the form of code. The smart contract compares the data in the model chain node or the field chain node according to the pre-defined auditing rules to determine whether the data content is normal.
[0064] It should be noted that the audit result includes auditing each dimension index of the data in the model chain node or the field chain node, for example, verifying the correctness of the data layer of the model chain node and the correctness of the data table layer of the field chain. When the verified data does not conform to the normal situation in the pre-set auditing rules, it is recorded until the data of each dimension is verified to obtain the audit result.
[0065] In step S40, an audit report is generated according to the audit result, wherein the audit report at least includes the tampering risk assessment result.
[0066] After determining the audit result, a more visual audit report is generated, which is mainly used to summarize the audit result and list the data dimensions concerned by the staff for comprehensive evaluation of the modified data model. Specifically, for the data model of each distributed deployment node, the quality of the data model is judged according to the audit results of the model smart contract and the field smart contract respectively. If there are multiple audit rules for the data model of the same distributed node, a probability value is obtained according to the ratio of the audit results of the multiple audit rules to the audit results of all audit rules, and the quality of the current data model is evaluated according to the probability value. If the quality of the current data model is lower than the set threshold, the deployment personnel are notified to redeploy the model to reduce the risk caused by tampering of the data model.
[0067] Exemplarily, the content of the audit report can include: model basic information, current node contract execution result (including contract content, execution time, model audit and field audit result), consensus of model chain nodes on the audit result (mainly referring to the recognition conclusion of the nodes to be deployed on the current node audit result), anti-tampering risk assessment conclusion (whether there is tampering, tampering risk reason positioning, for example, when the result of the node is inconsistent with the consensus of other nodes, it can be considered that the model data of the node is tampered; when the result of the node is consistent with part of other nodes on the chain, and inconsistent with part of the nodes, it can be considered that the publishing node has tampering risk).
[0068] The embodiments of the present application provide a convenient way for users to comprehensively audit the distributed data model, and provide detailed audit reports to help users better manage and control the quality of the model. Here, in the subsequent work, the information of whether the data source end of the field attribute of the distributed deployed data model is marked (marked according to the mapping relationship) and the target end audit is passed (according to the audit result of the field chain smart contract) can be marked in the annotation of the field attribute. If the user changes the audit rule corresponding to the smart contract in the subsequent work, the data model corresponding to the audit rule can be obtained through the corresponding relationship between the field attribute annotation and the audit rule, and then the model quality audit is performed again using the smart contract corresponding to the updated audit rule, thereby realizing more flexible data audit and improving the audit efficiency.
[0069] The unified original data model distributedly deployed is converted into a unified model chain by means of the principle of the blockchain in the embodiments of the present application, and the unified model chain is constructed with a virtual unified node corresponding to the unified original model data and a model chain node corresponding to the data model under each distributedly deployed distributed node. Further, the field chain for the current data model is constructed for each model chain node by means of the blockchain technology. Since the unified model chain and the field chain both belong to the blockchain, only the members in the blockchain alliance have the right to access, and each data modification in the access will leave a modification record, thereby achieving the effect of preventing the distributedly deployed unified original model data from being tampered with.
[0070] Further, in a feasible embodiment, the step of converting the original unified data model into a unified model chain in the blockchain network according to the original deployment scheme corresponding to the original unified data model can include:
[0071] In step S11, the mapping relationship between the data model in the model chain node and the data model in the virtual unified node is established based on the data model in the original unified data model and the original deployment scheme.
[0072] Before constructing the unified model chain, the mapping relationship between the data model in the model node in the model chain to be constructed and the data model in the virtual unified node needs to be established based on the mapping relationship between the data models in the original unified data model and the original deployment scheme. The mapping relationship of the two is corresponding respectively, that is, the mapping relationship of the data models in the original unified data model and the original deployment scheme needs to be transplanted into the unified model chain. In addition, the mapping relationship between the data model in the model chain node and the data model in the virtual unified node is established at the same time, and a model standard library also needs to be constructed, wherein the model standard library is used to store the mapping relationship and the data content.
[0073] Specifically, the mapping relationship includes at least table mapping relationship, field mapping relationship and enumeration value mapping relationship; specifically, the mapping relationship includes the table mapping relationship between the table of the data model in the virtual unified node and the table of the data model in the model chain node, the field mapping relationship between the field of the data model in the virtual unified node and the field of the data model in the model chain node, and the enumeration value mapping relationship between the enumeration value of the data model in the virtual unified node and the enumeration value of the data model in the model chain node.
[0074] The step of establishing the mapping relationship between the data model in the model chain node and the data model in the virtual unified node based on the data model in the original unified data model and the original deployment scheme can include:
[0075] Step S111, a table mapping relationship is established according to the contents corresponding to the tables in the original unified data model and the data model in the subnode respectively.
[0076] Exemplarily, the data model in the current distributed subnode and the original unified data model are acquired first, and the tables in the distributed subnode and the tables in the original unified data model are identified and a mapping relationship is established to obtain the table mapping relationship.
[0077] The table mapping relationship constructed in the embodiment of the present application can define the corresponding relationship between each table in the data model in the distributed subnode and the corresponding table in the original unified data model.
[0078] Step S112, a field mapping relationship is established according to the field differences between the original unified data model and the data model in the subnode on the basis of the table mapping relationship.
[0079] Exemplarily, the data model in the current distributed subnode and the original unified data model and the table mapping relationship are acquired first, and then the field differences between the data model in the current distributed subnode and the original unified data model are analyzed on the basis of the table mapping relationship, and a mapping relationship is established to obtain the field mapping relationship.
[0080] The field mapping relationship constructed in the embodiment of the present application can correctly map each field in the data model in the current distributed subnode to the corresponding field in the original unified data model.
[0081] Step S113, an enumeration value mapping relationship is established according to the enumeration values in the original unified data model and the data model in the subnode.
[0082] Exemplarily, the data model in the current distributed subnode and the original unified data model are acquired, and it is judged whether there are enumeration values (such as state, type and other enumeration values). If there are enumeration values, a mapping relationship is established between the enumeration values in the data model in the current distributed subnode and the original unified data model to obtain the enumeration value mapping relationship.
[0083] The enumeration value mapping relationship constructed in the embodiment of the present application can ensure the consistency and accuracy of the enumeration values when the data query and retrieval service is used.
[0084] Step S12, a virtual unified node and a plurality of model chain nodes associated with the virtual unified node are generated according to the mapping relationship, and a unified model chain is obtained.
[0085] In determining the above table mapping relationship, field mapping relationship and enumeration value mapping relationship, a unified model chain is established by constructing the association between the data model in the unified model chain node and the data model in the virtual unified node. The mapping relationship between the data model of the virtual unified node in the unified model chain and the data model of each model chain node follows the above determined table mapping relationship, field mapping relationship and enumeration value mapping relationship.
[0086] In a feasible embodiment, the step of constructing a corresponding field chain according to the fields of the data model corresponding to each model chain node can include:
[0087] Step S21, traversing the data of each model chain node in the unified model chain, reading the field content in each model chain node;
[0088] Step S22, generating a corresponding field chain according to the field definition, field value and field format of the field content in each model chain node.
[0089] In the process of constructing the field chain of the field of the data model in the model chain node, a corresponding field chain node needs to be constructed for the field content in the data of each model chain node, and the field data of each field is recorded and transcribed into the field chain node. Specifically, the field chain at least includes field definition, field value and field format, etc.
[0090] On the basis of the unified model chain, the field chain is established, which can further record the specific data of the field in the block chain in detail, so as to convert the original unified model and the field content in each node in the distributed deployment scheme to the block chain, so as to manage the model structure and the field content respectively in the block chain, so as to timely audit after the model structure or the field is modified, determine the position distribution of the change in which node, and improve the management and control efficiency of the distributed data model.
[0091] In a feasible embodiment, the smart contract at least includes a model smart contract and a field smart contract, and the audit result at least includes a model audit result and a field audit result. Referring to Figure 2 , the step S30 of auditing the unified model chain or the field chain based on the preset smart contract to obtain the corresponding audit result can include:
[0092] Step S31, performing hash calculation on the model data in the model chain node generating the modification record to obtain current model data;
[0093] Step S32, obtaining the table, field and enumeration value corresponding to the model chain node generating the modification record from the virtual unified node to obtain the reference model data;
[0094] Step S33, comparing the current model data and the reference model data based on the auditing rule of the model smart contract to generate a model auditing result;
[0095] Step S34, performing hash calculation on the field of the field chain node that generates the modification record to obtain current field data;
[0096] Step S35, obtaining the field corresponding to the initial node in the field chain to obtain reference field data;
[0097] Step S36, comparing the current field data and the reference field data based on the auditing rule of the field smart contract to generate a field auditing result.
[0098] It should be noted that the steps S31 to S33 and the steps S34 to S36 in the embodiments of the present application are relatively independent, and are executed respectively in the case of generating a modification record in the model chain node and the field chain node, or part or all of them can be executed according to the actual situation.
[0099] Exemplarily, when the model chain node or the field chain node generates a modification record, the related instructions of the smart contract are triggered to make the smart contract (model smart contract and field smart contract) execute the corresponding auditing steps.
[0100] Specifically, in the process of executing the auditing step by the model smart contract, the model smart contract first obtains a virtual uniform node in the uniform model chain as a permission node, and a model chain node that generates a model modification record as an execution node, then calculates the latest model data in the execution node to obtain current model data through a hash algorithm, obtains reference model data composed of a table, a field and an enumeration value from the permission node according to the determined mapping relationship, audits the current model data and the reference model data according to the pre-defined model auditing rule, and generates a corresponding model auditing result.
[0101] Specifically, in the process of executing the auditing step by the field smart contract, first, an initial node in the field chain is obtained as a permission node, and a field chain node that generates a field modification record is obtained as an execution node, the field in the execution node is calculated to obtain current field data through a hash algorithm, the current field data is audited with the reference field data in the permission node according to the field auditing rule, and a corresponding auditing result is generated. Among them, the field auditing rule at least includes abnormal value auditing and field structure auditing, and the combination data of field definition and field format is taken as the current field data container through hash algorithm in the field structure auditing, and the field value is taken as the current field data through hash algorithm in the abnormal value auditing.
[0102] It needs to be particularly pointed out that, generally, the initial node of the field chain of each model chain node is always checked correctly, because the modification authority of the initial node is higher than that of other field chain nodes and module chain nodes, and will not be tampered by ordinary users who only have node login use authority. Therefore, the field smart contract can take the initial node as the authority node without comparing with the original unified data model in the virtual unified node, which also reduces the amount of calculation to a certain extent. In addition, the model auditing rule in the model smart contract audits the model structure of the data model. The advantage of this design is not only to ensure the comprehensiveness of the audit, but also to avoid unnecessary audit (if only the modification of the model structure of the data model is tampered, only the model structure needs to be audited, and the field does not need to be audited).
[0103] In the embodiment of the present application, a virtual unified node is designed when constructing the corresponding unified data chain for the distributed deployment scheme, and a mapping relationship between the model chain node and the virtual unified node is established in the unified model chain. Once a model modification record is generated in the subsequent model use stage, the model smart contract can be combined with the mapping relationship and the virtual unified node to realize rapid and efficient data model auditing, improve the auditing efficiency, and timely discover the case that the data model is tampered. Similarly, the initial node of the field chain records the field of the current data model. Once a field modification record occurs in the subsequent model use stage, the field smart contract can be combined with the initial node in the field chain to realize rapid and efficient field auditing. The smart contract in the embodiment of the present application can trigger the smart contract to perform auditing at the first time when a model modification or a field modification occurs, and the field auditing and the model structure auditing do not interfere with each other to realize efficient auditing.
[0104] Further, before the step of auditing the unified model chain or the field chain based on the preset smart contract, the method can further include:
[0105] Step A10, receiving the inputted auditing rule through the visual page, and generating a regular expression corresponding to the auditing rule;
[0106] Step A20, loading the regular expression into the preset model smart contract and field smart contract respectively;
[0107] The model smart contract is used to audit at least one of the basic information, deployment node, version information, deployment time, deployment sequence and deployment integrity of the data model corresponding to each model chain node, and the field smart contract is used to audit at least one of the field name, data type, data length, field enumeration value definition, publishing node information, field version information and field deployment time of the data table of each data model.
[0108] The embodiments of the present application correspond to providing a method for editing a smart contract. Specifically, a user can edit an audit rule (including a model audit rule and a field audit rule) on a visual page and generate a corresponding regular expression as an implementable audit rule in the background and load it into a corresponding smart contract. The audit rule configured by the user can support integration with a database to achieve a flexible and accurate data audit function. The generated query SQL (Structured Query Language) statement executes the audit rule through a smart contract.
[0109] Exemplarily, the model audit rule is mainly used for correctness checking and verification of a data model layer. Main contents include basic information of a model (such as a model name and a table name of a data table contained in the model, for a non-mandatory constraint model name, a generation rule of the basic information can also be regarded as an audit rule), a node of model deployment, model version information, model deployment time (including update time, such as whether deployment is completed on time, etc.), model deployment sequence (including a node sequence and a deployment sequence of a data table in the model), model deployment integrity, and a contract execution trigger condition based on the audit rule, so as to realize distributed control of a data model overall layer through the model audit rule.
[0110] Further, when a user with a login use permission of a block chain node uses a data model of a corresponding model chain node in the "uniform model chain", a model modification record is generated. At this time, the "model smart contract" is set through code to access the model chain node of the newly generated model modification record to execute the model audit rule when the model modification record is learned. The specific model audit rule is freely edited and set by the user on the visual page.
[0111] Exemplarily, the field audit rule is mainly used for correctness checking and verification of a specific definition of a data table in a data model. Main contents include a DDL (Data Definition Language) of a data table in a data model, such as a field name (a field name must be consistent with a model definition when a constraint is mandatory, and only a naming rule needs to be consistent with the model definition when the constraint is non-mandatory), a data type, a data length, an enumeration value definition of a field, and the like; and publishing node information, field version information, and field deployment time of the field, and the like (this part is similar to the model audit rule, but is lower in level).
[0112] Further, when a user having the permission of the blockchain node uses the data model of the corresponding model chain node in the "uniform model chain", if the field is edited, the field chain record field modification record is triggered, and the "field smart contract" is set by code to access the corresponding field chain to execute the field audit rule when the field modification record is learned. The specific field audit rule is freely edited and set by the user on the visual page.
[0113] The technical scheme of the embodiment of the application realizes the custom editing of the audit rule, converts the audit rule in the traditional mode into the smart contract under the blockchain to execute the data audit, and realizes the low-data-volume data audit by distinguishing the model smart contract for the uniform model chain and the field smart contract for the field chain, and taking the initial node of the field chain as the permission node and taking the virtual uniform node as the right node of the model smart contract.
[0114] In combination with the content of the foregoing embodiments, the core principle of the distributed data model tampering risk assessment method provided by the application lies in that the multi-node computing capability of the multi-node system of the blockchain is utilized, and the similarity and consistency requirement of the model multi-node of the distributed deployed data model after deployment, the distributed deployed data model is constructed into the blockchain data structure with the alliance chain characteristics from three levels of deployment scheme, uniform model, and data table constituting the model, then the chain data of the model is created and controlled through the uniform model chain construction module and the field chain construction module, and the contract of the checking and verifying rules or business actions of the uniform model data is realized through the smart contract editing, executing and other modules matched with the chain data, automatic execution, no human intervention, and the real and effective model data audit is ensured.
[0115] Exemplarily, referring to Figure 3 The distributed data model tampering risk assessment method of the application can be applied in a blockchain system, which can include a uniform model chain construction unit, a field chain construction unit, a smart contract editing unit, a smart contract execution unit, and the like. Specifically, the uniform model chain construction unit (including a table mapping sub-unit, a field mapping sub-unit, and an enumerated value mapping sub-unit) maps the original uniform model and the distributed node in the input distributed deployment scheme to generate a uniform model chain including a virtual uniform node and a model chain node, and the field chain construction unit generates a corresponding field chain; when a modification record is generated, the audit is executed by the smart contract execution unit to generate an audit result and an audit report, in addition to which, the smart contract editing unit is used to pre-edit the model smart contract (including the model audit rule) and the field smart contract (including the field audit rule).
[0116] The technical scheme of the embodiment of the present application can be applied to the audit management scene of a distributed large data model. In the traditional scene, the data model of the large data is stored in a distributed framework, data encryption or user permission control is used to avoid data tampering, but it cannot avoid data tampering by users with permission, and the control logic of the whole system is complex. The technical scheme of the embodiment of the present application not only can simply and efficiently reduce the tampering of the data model with the help of the blockchain technology, but also can make the central node obtain the tampering of the distributed data model at the first time, reduce the system management and design cost, and improve the data security.
[0117] In addition, the technical scheme of the embodiment of the present application can also be applied to the audit rule modification scene of the large data model. The traditional audit rule modification needs to be re-edited by a special developer, and especially when the data volume of the data model is too large, the traditional scheme cannot effectively modify the audit rule. After the technical scheme of the embodiment of the present application is adopted, the user can quickly modify the audit rule through the smart contract editing mode, and realize the self-defined modification of the audit rule of the large data model.
[0118] It should be noted that the above examples are only used for understanding the present application and do not constitute a limitation on the distributed data model tampering risk assessment method of the present application. More forms of simple transformation based on the technical concept are within the protection scope of the present application.
[0119] The present application also provides a distributed data model tampering risk assessment device, which refers to Figure 4 The distributed data model tampering risk assessment device comprises:
[0120] A model chain construction module 10 is configured to convert an original unified data model into a unified model chain in a blockchain network according to an original deployment scheme corresponding to the original unified data model, wherein the unified model chain at least comprises a virtual unified node and a plurality of model chain nodes which are associated with the virtual unified node.
[0121] A field chain construction module 20 is configured to construct a corresponding field chain according to the fields of the data model corresponding to each model chain node, wherein the field chain is used to record the field data in the data model.
[0122] A contract audit module 30 is configured to perform audit on the unified model chain or the field chain based on a preset smart contract when a modification record is generated in the unified model chain or the field chain, and obtain a corresponding audit result.
[0123] A report generation module 40 is configured to generate an audit report according to the audit result, wherein the audit report at least comprises a tampering risk assessment result.
[0124] In an embodiment, the model chain construction module 10 is further configured to:
[0125] establish a mapping relationship between the data model in the model chain node and the data model in the virtual unified node based on the original unified data model and the data model in the child node of the original deployment scheme;
[0126] generate the virtual unified node and a plurality of model chain nodes associated with the virtual unified node according to the mapping relationship, to obtain a unified model chain.
[0127] In an embodiment, the mapping relationship at least includes a table mapping relationship, a field mapping relationship and an enumeration value mapping relationship, and the model chain construction module 10 is further configured to:
[0128] establish a table mapping relationship according to the contents corresponding to the tables in the original unified data model and the data model in the child node respectively;
[0129] establish a field mapping relationship according to the field differences between the original unified data model and the data model in the child node based on the table mapping relationship;
[0130] establish an enumeration value mapping relationship according to the enumeration values in the original unified data model and the data model in the child node.
[0131] In an embodiment, the field chain construction module 20 is further configured to:
[0132] read the field contents in each of the model chain nodes by traversing the data in each of the model chain nodes in the unified model chain;
[0133] generate a corresponding field chain according to the field definition, field value and field format of the field contents in each of the model chain nodes.
[0134] In an embodiment, the smart contract at least includes a model smart contract and a field smart contract, and the audit result at least includes a model audit result and a field audit result, and the contract audit module is further configured to:
[0135] perform hash calculation on the model data in the model chain node that generates the modification record to obtain current model data;
[0136] obtain the table, field and enumeration value corresponding to the model chain node that generates the modification record from the virtual unified node to obtain reference model data;
[0137] compare the current model data and the reference model data based on the audit rule of the model smart contract to generate a model audit result;
[0138] Hash the field of the field chain node that generates the modification record to obtain current field data;
[0139] Obtain the field corresponding to the initial node in the field chain to obtain reference field data;
[0140] Compare the current field data and the reference field data based on the auditing rule of the field smart contract to generate a field auditing result.
[0141] In an embodiment, the distributed data model tampering risk assessment device further comprises a contract editing module, which is configured to:
[0142] Receive the inputted auditing rule through the visual page and generate a regular expression corresponding to the auditing rule;
[0143] Load the regular expression into the preset model smart contract and field smart contract respectively;
[0144] The model smart contract is configured to audit at least one of the basic information, deployment node, version information, deployment time, deployment sequence and deployment integrity of each data model corresponding to the model chain node, and the field smart contract is configured to audit at least one of the field name, data type, data length, field enumeration value definition, publishing node information, field version information and field deployment time of the data table of each data model.
[0145] The distributed data model tampering risk assessment device provided by the present application adopts the distributed data model tampering risk assessment method in the above embodiments, and can solve the technical problem that the traditional distributed data model tampering prevention strategy cannot effectively control the tampered data in a timely manner. Compared with the prior art, the beneficial effects of the distributed data model tampering risk assessment device provided by the present application are the same as those of the distributed data model tampering risk assessment method provided by the above embodiments, and the other technical features in the distributed data model tampering risk assessment device are the same as those disclosed in the previous embodiment method, which will not be repeated here.
[0146] The present application provides an electronic device, which comprises at least one processor and a memory connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the distributed data model tampering risk assessment method in the above embodiment one.
[0147] The following refers to Figure 5The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0148] like Figure 5 As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. While electronic devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0149] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program codes for executing the method shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network through a communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiments disclosed in the present application are executed.
[0150] The electronic device provided by the present application adopts the distributed data model tampering risk assessment method in the above-mentioned embodiments, which can solve the technical problem that the traditional anti-tampering strategy of the distributed data model cannot effectively control the tampered data in time. Compared with the prior art, the electronic device provided by the present application has the same beneficial effects as the distributed data model tampering risk assessment method provided by the above-mentioned embodiments, and other technical features in the electronic device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.
[0151] It should be understood that various parts of the present application can be realized by hardware, software, firmware or a combination thereof. In the description of the above-mentioned embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0152] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within 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.
[0153] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e. computer program) for executing the distributed data model tampering risk assessment method in the above-mentioned embodiments.
[0154] The computer readable storage medium provided in the present application may, for example, be a U disk, but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection with one or more conductive wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to electrical wires, optical cables, RF (Radio Frequency), and the like, or any suitable combination of the above.
[0155] The above computer readable storage medium can be included in an electronic device, or can exist separately without being assembled into an electronic device.
[0156] The above computer readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: convert the original unified data model into a unified model chain in the blockchain network according to an original deployment scheme corresponding to the original unified data model, wherein the unified model chain at least includes a virtual unified node and a plurality of model chain nodes associated with the virtual unified node; construct a corresponding field chain according to the fields of the data model corresponding to each of the model chain nodes, wherein the field chain is used to record the field data in the data model; when the unified model chain or the field chain produces a modification record, audit the unified model chain or the field chain based on a preset smart contract to obtain a corresponding audit result; generate an audit report according to the audit result, wherein the audit report at least includes a tampering risk assessment result.
[0157] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0158] The flow and block diagrams in the drawings show architectural, functional and operational architectures of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flow and block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may
[0159] The modules involved in the embodiments of the present application can be implemented in software or hardware. In some cases, the names of the modules do not constitute a limitation on the modules themselves.
[0160] The readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e., computer programs) for executing the distributed data model tampering risk assessment method described above, and can solve the technical problem that the traditional anti-tampering strategy of the distributed data model cannot effectively control the tampered data in time. Compared with the prior art, the computer readable storage medium provided by the present application has the same beneficial effects as the distributed data model tampering risk assessment method provided by the above embodiments, and will not be described here.
[0161] The application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the distributed data model tampering risk assessment method as described above.
[0162] The computer program product provided by the application can solve the technical problem that the traditional anti-tampering strategy of the distributed data model cannot effectively control the tampered data in a timely manner. Compared with the prior art, the beneficial effects of the computer program product provided by the application are the same as those of the distributed data model tampering risk assessment method provided by the above-mentioned embodiments, and will not be repeated here.
[0163] The above only describes some embodiments of the application, and does not limit the patent scope of the application. Any equivalent structural transformation, direct / indirect application in other related technical fields based on the technical concept of the application, and the contents of the specification and drawings are included in the patent protection scope of the application.
Claims
1. A method for assessing the risk of tampering in a distributed data model, characterized in that, The distributed data model tampering risk assessment method includes: The original unified data model is transformed into a unified model chain in the blockchain network according to the original deployment scheme corresponding to the original unified data model. The unified model chain includes at least a virtual unified node and multiple model chain nodes that are associated and mapped with the virtual unified node. Construct a corresponding field chain based on the fields of the data model corresponding to each model chain node, wherein the field chain is used to record field data in the data model; When the unified model chain or the field chain generates a modification record, the unified model chain or the field chain is audited based on a preset smart contract to obtain the corresponding audit result; An audit report is generated based on the audit results, wherein the audit report includes at least the results of the risk assessment for tampering; The step of converting the original unified data model into a unified model chain in the blockchain network based on the original deployment scheme corresponding to the original unified data model includes: Based on the original unified data model and the data models in the sub-nodes of the original deployment scheme, a mapping relationship is established between the data models in the model chain nodes and the data models in the virtual unified nodes; Based on the mapping relationship, a virtual unified node and multiple model chain nodes associated with and mapped to the virtual unified node are generated to obtain a unified model chain; The step of constructing the corresponding field chain based on the fields of the data model corresponding to each model chain node includes: Traverse the data of each model chain node in the unified model chain and read the field content of each model chain node; Based on the field definitions, field values, and field formats of the field content in each model chain node, a corresponding field chain is generated.
2. The distributed data model tampering risk assessment method as described in claim 1, characterized in that, The mapping relationships include at least table mapping relationships, field mapping relationships, and enumeration value mapping relationships; The step of establishing a mapping relationship between the data model in the model chain node and the data model in the virtual unified node based on the data model in the child node of the original unified data model and the original deployment scheme includes: Establish a table mapping relationship based on the contents corresponding to the tables in the original unified data model and the tables in the data model of the child node; Based on the table mapping relationship, a field mapping relationship is established according to the field differences between the original unified data model and the data model in the child node; Based on the original unified data model and the enumerated values in the data model of the child node, an enumerated value mapping relationship is established.
3. The distributed data model tampering risk assessment method as described in claim 1, characterized in that, The smart contract includes at least a model smart contract and a field smart contract, and the audit result includes at least a model audit result and a field audit result. The step of auditing the unified model chain or the field chain based on the preset smart contract to obtain the corresponding audit result includes: The current model data is obtained by hashing the model data in the model chain node that generated the modification record. The reference model data is obtained by retrieving the table, fields, and enumeration values corresponding to the model chain node that generated the modification record from the virtual unified node. Based on the audit rules of the model smart contract, the current model data and the reference model data are compared to generate model audit results; The fields of the field chain node that generated the modified record are hashed to obtain the current field data; Obtain the field corresponding to the initial node in the field chain to get the reference field data; Based on the audit rules of the smart contract for the field, the current field data and the reference field data are compared to generate the field audit result.
4. The distributed data model tampering risk assessment method as described in claim 3, characterized in that, Before the step of auditing the unified model chain or the field chain based on a preset smart contract, the method further includes: The system receives the input audit rules through a visual page and generates the corresponding regular expressions for the audit rules. The regular expressions are loaded into the preset model smart contract and field smart contract respectively; The model smart contract is used to audit at least one of the following: basic information, deployment node, version information, deployment time, deployment order, and deployment integrity of the data model corresponding to each model chain node. The field smart contract is used to audit at least one of the following: field name, data type, data length, field enumeration value definition, publishing node information, field version information, and field deployment time of the data table of each data model.
5. A distributed data model tampering risk assessment device, characterized in that, The distributed data model tampering risk assessment device includes: The model chain construction module is used to convert the original unified data model into a unified model chain in the blockchain network according to the original deployment scheme corresponding to the original unified data model. The unified model chain includes at least a virtual unified node and multiple model chain nodes that are associated and mapped with the virtual unified node. The field chain construction module is used to construct a corresponding field chain based on the fields of the data model corresponding to each model chain node, wherein the field chain is used to record field data in the data model; The contract audit module is used to audit the unified model chain or the field chain based on a preset smart contract when the unified model chain or the field chain generates a modification record, and obtain the corresponding audit result. The report generation module is used to generate an audit report based on the audit results, wherein the audit report includes at least the tampering risk assessment results; The model chain construction module is further configured to: establish a mapping relationship between the data models in the model chain nodes and the data models in the virtual unified nodes based on the original unified data model and the data models in the sub-nodes of the original deployment scheme; and generate a virtual unified node and multiple model chain nodes associated with the virtual unified node according to the mapping relationship to obtain a unified model chain. The field chain construction module is also used to: traverse the data of each model chain node in the unified model chain, read the field content in each model chain node; and generate the corresponding field chain according to the field definition, field value and field format of the field content in each model chain node.
6. An electronic device, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the distributed data model tampering risk assessment method as described in any one of claims 1 to 4.
7. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the distributed data model tampering risk assessment method as described in any one of claims 1 to 4.
8. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the distributed data model tampering risk assessment method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Data auditing method based on block chain
CN111666287A
Block chain-based pension guarantee data auditing method and device, equipment and medium
CN115827613A