Block chain data informed management method and system based on multi-party consensus
By employing a blockchain-based data information management method based on multi-party consensus, and utilizing API gateways and smart contracts, the problems of data tampering and lack of trust in centralized databases are solved, enabling efficient and flexible data management and querying. This method is applicable to industries such as mobile communications and cyberspace security governance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, centralized databases suffer from problems such as data tampering, lack of trust between departments, and limited audit traceability in data storage and management. Furthermore, the integration complexity of blockchain technology into existing business systems is high, making it difficult to achieve loosely coupled applications.
We adopt a blockchain data information management method based on multi-party consensus. By combining API gateway services with blockchain client modules, we provide a lightweight HTTP RESTful interface to enable data writing and querying. We use a multi-party consensus mechanism to ensure that the data is immutable and use smart contracts to classify and manage different types of data.
It achieves the highest level of data credibility, prevents unilateral tampering, reduces integration complexity, provides flexible data management and efficient query capabilities, and supports compliance supervision and liability determination.
Smart Images

Figure CN121814348A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of blockchain and data security, and particularly relates to a blockchain data informed management method and system based on multi-party consensus. BACKGROUND
[0002] In the information highly sensitive industries such as mobile communication, network space security governance and finance, the integrity, authenticity and traceability of data are the core basis for business operation. Taking the protection of personal data in the interaction between cloud and network in mobile communication as an example, its business systems, such as the interaction platform between cloud and network of operators, user data management system and personal information authorization platform, generate a large amount of key data every day, including but not limited to user authorization records, data access logs, administrator operation logs, data cross-border flow metadata, etc. These data are not only the basis for protecting user privacy and data compliance, but also the key to security audit and responsibility identification. At present, most of such data rely on traditional centralized database technology for storage and management. The centralized architecture of the prior art has inherent security defects: firstly, the data is easy to be tampered with. Whether it is from external malicious attacks or internal personnel's violation of regulations, the key information stored in the database may be modified or deleted, which may even threaten the security of personal data in serious cases. Secondly, there is a lack of trust among departments. When data sharing or compliance evidence is provided, the data receiving party cannot trust the data provided by the data providing party to be original and unaltered, and the data credibility verification is difficult. Finally, the audit traceability is limited. Although there are database logs, the database logs themselves are also at risk of being tampered with, resulting in incomplete chain of post-facto accountability and audit.
[0003] In the prior art, blockchain technology has been introduced to solve the above-mentioned trust problem. The decentralization, data tamper resistance and multi-party consensus of blockchain can theoretically provide high security for data evidence. However, the existing blockchain application scheme often has high technical threshold and is closely coupled with the existing business system, resulting in high integration complexity. The existing business systems of mobile communication and network governance industries are mostly large systems that have been running stably for many years, and it is unrealistic to perform bottom-up transformation to adapt to the blockchain SDK (software development kit). Therefore, there is an urgent need in the field for a new technical solution that can not only utilize the multi-party consensus and tamper resistance of blockchain to protect data credibility, but also provide a low-coupling and convenient integration method for the existing business system to realize informed management of key data. SUMMARY
[0004] To solve the above technical problems, the application adopts the following technical solution:
[0005] A blockchain data informed management method based on multi-party consensus, comprising:
[0006] data storage stage, writing data to the blockchain;
[0007] data query stage, reading data from the blockchain, and reading data from the blockchain by acquiring a user contract function getUserContract.
[0008] A multi-party consensus-based blockchain data informed management system, comprising:
[0009] a data storage module for writing data to the blockchain;
[0010] a data query module for reading data from the blockchain, and reading data from the blockchain by acquiring a user contract function getUserContract.
[0011] An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the multi-party consensus-based blockchain data informed management method when executing the program.
[0012] A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the multi-party consensus-based blockchain data informed management method.
[0013] The present application has the following beneficial effects:
[0014] (1) The present application deeply binds the write operation of key data with a multi-party consensus mechanism. All data written to the blockchain must be signed and endorsed by multiple preset management parties before being chained, which can ensure the highest credibility of the data and eliminate the possibility of single-party tampering with the data from a mechanism; Corresponding to solve the technical problems of traditional centralized database data easy to be tampered with, lack of trust between departments.
[0015] (2) The lightweight API gateway service provided by the present application encapsulates the complex blockchain SDK call, key management, contract interaction and other underlying logic into a standard and simple HTTP (Hypertext Transfer Protocol) RESTful (Representational State Transfer) interface. It realizes the loose coupling of the business system and the blockchain trust system, and the existing business system does not need to be modified at the bottom; solve the technical problems of high technical threshold of existing blockchain application solutions, and high integration complexity caused by close coupling with existing business systems.
[0016] (3) This invention utilizes different smart contracts to classify and manage different types of business data. For high-frequency, structured operation logs, a key-field-value (kfv) model is used for efficient access; for low-frequency, high-importance factual evidence, a fact storage model is used to store its file hash and metadata. This improves the system's flexibility and scalability, and fulfills the need for efficient and flexible informed management of various key data.
[0017] (4) This invention provides a clear and efficient data query interface, allowing authorized users or auditing systems to easily retrieve tamper-proof historical data from the blockchain. It provides strong and reliable technical support for compliance supervision, liability determination, and post-event auditing in industries such as cyberspace security governance, and solves the technical problems of limited audit traceability capabilities in traditional solutions and the risk of audit logs being tampered with. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the system architecture of the present invention;
[0019] Figure 2 This is a flowchart illustrating the data storage (write) operation of the present invention;
[0020] Figure 3 This is a flowchart illustrating the data query (reading) operation of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0022] This invention provides a blockchain data awareness management method and system based on multi-party consensus. The method uses blockchain technology as a trusted foundation and provides data awareness management capabilities externally through an API (Application Programming Interface) gateway service. The system mainly consists of an API gateway program running on a server and a blockchain client module.
[0023] like Figure 1As shown, the system architecture of this invention includes: an external business system layer, an API gateway service layer, a blockchain client layer, and a blockchain network layer. The external business system layer communicates with the API gateway service layer via the HTTP (Hypertext Transfer Protocol) protocol. The API gateway service layer is used to parse requests and invoke the blockchain client layer. The blockchain client layer is used to encapsulate SDK (Software Development Kit) calls and interact with the smart contracts of the blockchain network layer.
[0024] In practice, the system first executes the `main` function upon startup. The program retrieves the configuration file path for the blockchain SDK from command-line arguments. Subsequently, the system calls the `setupRouter` function to initialize the API gateway. Inside the `setupRouter` function, it first calls `CreateSimpleClient` to create a `SimpleClient` instance. The `CreateSimpleClient` function initializes the underlying `sdk.ChainClient` based on the configuration file; this client is the foundation for all subsequent blockchain operations.
[0025] After initializing the client, the `setupRouter` function uses the World Wide Web Services framework to define a series of API routing rules. For example, it defines ` / api / saveLog` to receive POST requests to store logs, ` / api / getLog / :userid` to receive GET requests to query logs, and ` / api / invoke` for general contract calls. Finally, it starts the HTTP-based RESTful API gateway service using the command `r.Run(":18080")`, enabling it to listen on port 18080 and begin receiving requests.
[0026] The core functions of this invention are divided into two stages: data storage and data retrieval.
[0027] Data storage stage, such as Figure 2 As shown, this stage corresponds to the operation of writing data to the blockchain, which is crucial for achieving data immutability. Taking the on-chaining of personal data operation logs from cloud-network-device interactions in mobile communication as an example, its specific implementation is as follows:
[0028] Step 11: After performing a critical operation, the cloud-network-edge interactive security platform sends a POST data storage request to the / api / saveLog interface of the API gateway. The request body contains data in JSON (JavaScript Object Notation, where JavaScript is a lightweight, interpreted programming language mainly used to enhance the interactivity and dynamism of web pages) format, including: user ID (userid), operation timestamp (timestamp), and operation details (logitem).
[0029] Step 12: After receiving the POST data storage request, the API gateway calls the BindJSON function of the context object (ctx) to complete the binding of JSON data. This binds the JSON-formatted data in the request body to the structure variable, thereby completing the format conversion and data validation of the request parameters.
[0030] Step 13: The gateway encapsulates the parsed business data into a parameter structure KeyFieldValue required by the smart contract, and serializes it into a JSON (JavaScript Object Notation) string param variable using json.Marshal (JSON serialization).
[0031] Step 14: The gateway calls the invokeUserContract function. In the invokeUserContract function, kfv is the contract name, save_key_field_value is the contract function, string(param) is the passed parameter, and the true parameter is syncResult (synchronization result), indicating that the gateway will synchronously wait for the blockchain to return the transaction execution result.
[0032] Step 15: Inside the `invokeUserContract` function (calling the user contract), the system executes the consensus mechanism, including:
[0033] Step 151: Call client.CreatePayload to create the transaction payload for this call.
[0034] Step 152 involves calling `util.MakeAdminInfo` (to generate administrator information) and `util.MakeEndorsement` (to generate endorsements) to obtain signature endorsements from one or more administrators or consensus nodes for the transaction payload, based on system configuration. This is the core mechanism of the invention, ensuring that data writing is mutually agreed upon by multiple parties, rather than a unilateral action.
[0035] Step 153: Call client.GenerateTxRequest to assemble a complete transaction request with multiple endorsements.
[0036] Step 154: Call client.SendTxRequest (send transaction request) to send the complete transaction request to the blockchain network.
[0037] Step 16: The blockchain network executes consensus: After verifying and passing the signature, the log data is persistently stored in the blockchain ledger. Upon receiving the success receipt, the API gateway returns a JSON response to the business system (such as a cloud-network-edge security platform) with the message {"success":true, "msg": "success"} (indicating "operation successful").
[0038] For other types of data, such as hash-based notarization of electronic evidence, the ` / api / invoke` interface can be called, specifying `method` as `save`. The gateway will call the `save` method of the `fact` contract, storing the `FactSchema` structure (fact data structure), including `FileHash` and `FileName`, into the blockchain after going through the same multi-party consensus process, i.e., steps 151 to 154 above.
[0039] During the data query phase, such as Figure 3 As shown, this stage corresponds to the operation of reading data from the blockchain. This invention implements the operation of reading data from the blockchain through the getUserContract (get user contract) function.
[0040] Taking the query of a user's operation log by an auditing system for cyberspace security governance as an example:
[0041] Step 21: The auditing system sends a GET request to the API gateway's / api / getLog / :userid (get log) interface, where userid is the user ID (identity identifier) being queried.
[0042] Step 22: The API gateway calls the Param function of the context object to obtain the path parameter, i.e., userid.
[0043] Step 23: The gateway constructs a query parameter JSON, sets the Key to the user ID being queried: userid, and specifies a query range, that is, sets StartField to "0" (meaning starting from the earliest record) and LimitField to the current timestamp (meaning the query ends at the current time).
[0044] Step 24: The gateway calls the getUserContract function of the simpleClient instance, passing in the contract name kfv and the contract function name find_by_key_field_range to execute the query.
[0045] Step 25: Inside the `getUserContract` function, the system calls the `QueryContract` function. This operation is a read-only query; it directly requests data from the blockchain node, does not create a transaction, and does not consume consensus resources, thus resulting in a fast response time.
[0046] Step 26: The blockchain node executes the find_by_key_field_range function in the contract, returning the serialized data result queryRes.
[0047] Step 27: After receiving queryRes, the API gateway uses json.Unmarshal (json deserialization) to deserialize it into a list of keyfield values.
[0048] Step 28: The gateway performs format conversion on the KeyFieldValue structure list data. For example, it converts the general KeyFieldValue list into a more business-meaning ResponseStruct list responseList, where the Key is renamed to userid and the Field is renamed to timestamp.
[0049] In step 29, the API gateway finally returns a JSON (JavaScript object notation) response containing a responseList to the auditing system. Because the data originates from the blockchain, the auditing system can be confident that the obtained log list is complete and tamper-proof.
[0050] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The embodiments of the present invention can be implemented using various computer languages.
[0051] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0052] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0053] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0054] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0055] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
[0056] The above description is merely an embodiment of the present invention and does not limit the scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related system fields, are similarly included within the protection scope of the present invention.
[0057] The contents not described in detail in this specification are existing technologies known to those skilled in the art.
Claims
1. A blockchain data information management method based on multi-party consensus, characterized in that, include: During the data storage phase, data is written to the blockchain; During the data query phase, data is read from the blockchain by retrieving the user contract function getUserContract.
2. The blockchain data information management method based on multi-party consensus as described in claim 1, characterized in that, For uploading personal data operation logs of cloud-network-device interactions in mobile communications to the blockchain, the data storage stages include: Step 11: After performing a critical operation, the cloud network-endpoint interaction security platform sends a data storage submission request to the API gateway's save log / api / saveLog interface. Step 12: After receiving the data storage request, the API gateway calls the BindJSON function of the context object to complete the binding of JSON data. This binds the JSON-formatted data in the request body to the structure variable, thereby completing the format conversion and data validation of the request parameters. Step 13: The gateway encapsulates the parsed business data into a parameter structure KeyFieldValue required by the smart contract, and serializes it into a JSON string parameter variable using json.Marshal; Step 14: The gateway calls the invokeUserContract function; Step 15: Inside the invokeUserContract function, the system executes the consensus mechanism; Step 16: The blockchain network performs consensus: After the signature is verified and passed, the log data is persistently stored in the blockchain ledger.
3. The blockchain data information management method based on multi-party consensus as described in claim 2, characterized in that, In step 11, the request body contains data in JSON format, including the user ID, operation timestamp, and operation details.
4. The blockchain data informed management method based on multi-party consensus as described in claim 2, characterized in that, Step 15 includes: Step 151: Call client.CreatePayload to create the transaction payload for this call; Step 152: Call util.MakeAdminInfo to generate administrator information and util.MakeEndorsement to generate endorsements. Based on the system configuration, obtain signature endorsements from one or more administrators or consensus nodes for the transaction payload to ensure that the data writing is jointly recognized by multiple parties. Step 153: Call `client.GenerateTxRequest` to assemble a complete transaction request including multiple endorsements; Step 154: Call client.SendTxRequest to send the complete transaction request to the blockchain network.
5. The blockchain data informed management method based on multi-party consensus as described in claim 4, characterized in that, For other types of data besides personal data operation logs from cloud-network-terminal interactions in mobile communications, the general call to the / api / invoke interface is invoked, specifying the method as save; the gateway invokes the save method of the fact storage contract, and stores the FactSchema structure into the blockchain after steps 151 to 154.
6. The blockchain data information management method based on multi-party consensus according to claim 1, characterized in that, The data query phase includes: Step 21: The auditing system sends a request to the API gateway's ` / api / getLog / :userid` interface to retrieve logs, where `userid` is the ID of the user being queried. Step 22: The API gateway calls the Param function of the context object to obtain the path parameter userid; Step 23: The gateway constructs a query parameter JSON, sets the key to the user ID being queried: userid, and specifies a query range; Step 24: The gateway calls the getUserContract function of the simpleClient instance, passing in the contract name kfv and the contract function name find_by_key_field_range to execute the query; Step 25: Inside the getUserContract function, the system calls the QueryContract function; Step 26: The blockchain node executes the find_by_key_field_range function in the contract to find the key and field range, and returns the serialized data result queryRes; Step 27: After receiving queryRes, the API gateway uses json.Unmarshal to deserialize it into a list of KeyFieldValue structures. Step 28: The gateway performs format conversion on the structure list data of the key field value KeyFieldValue; Step 29: The API gateway finally returns a JSON response containing a response list to the auditing system.
7. The blockchain data informed management method based on multi-party consensus as described in claim 6, characterized in that, In step 23, specifying a query range includes: setting StartField to "0", indicating starting from the earliest record; and setting LimitField to the current timestamp, indicating that the query ends at the current time.
8. A blockchain-based data information management system based on multi-party consensus, characterized in that, include: Data storage module, used to write data to the blockchain; The data query module is used to read data from the blockchain. It retrieves data from the blockchain by using the user contract function getUserContract.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the blockchain data information management method based on multi-party consensus as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the blockchain data informed management method based on multi-party consensus as described in any one of claims 1 to 7.