A multi-source data encryption aggregation reporting method based on blockchain and privacy computing fusion
By standardizing data locally at the data source node and verifying it on the blockchain network, a consistent and secure reporting result is generated, which solves the problems of privacy leakage and caliber drift in multi-source data reporting and achieves trustworthy and verifiable data aggregation.
Patent Information
- Application Number
- CN202610577009.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-28
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2046-04-28
AI Technical Summary
Existing technologies suffer from privacy leaks, data drift, structural inconsistencies, and lack of effective verification of on-chain records in multi-source data reporting scenarios, resulting in unreliable and unverifiable final results.
The reporting template is standardized locally on the data source node to generate a standard reporting sequence and homomorphically encrypted. The sequence is then verified through the blockchain network and smart contracts to form a valid on-chain object. The aggregation node performs encrypted aggregation and structural verification.
It achieves the technical effect of data semantic uniformity, structural consistency, and reliable and verifiable results in multi-source data reporting, ensuring privacy protection, consistency of standards, and traceability of the source of the final results.
Smart Images

Figure CN122226249B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of blockchain and privacy computing, and particularly relates to a method for encrypted aggregation and reporting of multi-source data based on the integration of blockchain and privacy computing. Background Technology
[0002] As the requirements for the real-time performance, authenticity, consistency, and traceability of reported data continue to increase, reporting tasks increasingly rely on multiple data source nodes to complete the task, rather than being generated independently by a single system. Different nodes often come from different business systems, organizational units, or regional institutions. The underlying data generally differs in field naming, category systems, time granularity, statistical definitions, and data organization order. Therefore, multi-source data reporting is not merely about aggregating data from various nodes; more importantly, it's about achieving standardization, encryption, verification, and aggregation under a unified reporting semantic. Existing technologies typically employ two paths: one is to centrally aggregate the raw or anonymized data to a central platform, where standardization, statistics, and reporting are then uniformly performed; the other is for each node to perform simple statistical or encryption processing locally before uploading the results to the blockchain or a regulatory platform for record-keeping. While the former approach facilitates centralized processing, the large exposure of raw and intermediate data during the transfer process can easily lead to privacy breaches, unauthorized access, and unclear accountability. The latter approach, while reducing the risk of plaintext aggregation, still has several key drawbacks: First, the field mappings, category merging, time merging, and numerical definitions used by different nodes to generate reports are often inconsistent, resulting in a drift in the final aggregation result. Second, many solutions only encrypt or hash the results themselves, lacking constraints on the order of reported items, structural integrity, and template consistency, thus failing to guarantee that encrypted results uploaded by multiple nodes are consistent across all nodes. First, aggregation can be directly performed under the given reporting semantics. Second, in existing solutions, blockchain often only serves a passive evidence storage function. On-chain records can only prove that an object has been submitted, but it is difficult to further confirm whether the object comes from a legitimate node, belongs to the current reporting batch, meets the established template structure, and is qualified to enter the aggregation process. Third, privacy computing and blockchain are mostly in a simple splicing state, with off-chain handling encryption computing and on-chain handling digest recording. There is a lack of a linkage control mechanism organized around the reporting task, which makes it impossible for the system to simultaneously solve coupling problems such as consistency of standards, structural consistency, cryptographic aggregation, and verifiable results in multi-source reporting. Especially in scenarios with fixed reporting templates, the correctness of the reported value itself does not mean that the reporting result is reliable. If different nodes form cryptographic results locally, the order of reported items is misaligned, the category is missing, or the structure is inconsistent, even if the encryption aggregation is finally completed, the result with incorrect business meaning may be obtained.
[0003] Therefore, for multi-source data reporting scenarios, there is still a lack of a complete technical solution that can achieve semantic convergence of reporting at the data source end, maintain structural consistency in dense state results, form valid reporting objects on the chain, and continue to verify the result structure after aggregation. Summary of the Invention
[0004] The purpose of this invention is to propose a multi-source data encryption aggregation and reporting method based on the integration of blockchain and privacy computing to solve the above-mentioned problems.
[0005] To achieve the above objectives, this invention provides a method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing, the method comprising the following steps: S1. On each data source node, the reporting template corresponding to the current reporting item is pre-set and standardized to generate the reporting item statistics and the standard reporting sequence arranged in order of the reporting items. The reporting template includes a field list, reporting period, category field and numerical scope. S2. At each data source node, the standard reporting sequence is converted into a encrypted reporting result through local homomorphic encryption. S3. Submit the encrypted reporting result to the blockchain network, generate a digest value using a standard hash algorithm based on the number of reported items, and use a smart contract to perform a status determination on the encrypted reporting result, registering the reported objects that pass the determination as valid on-chain reported objects; wherein, the valid on-chain reported object includes the status value of the corresponding node, the digest value, and the storage index of the off-chain encrypted reporting result; S4. The aggregation node reads the valid on-chain reporting objects of the current batch from the blockchain network, obtains the encrypted reporting results of each node by combining the corresponding off-chain index, performs positional encrypted aggregation of the verified node ciphertext in the encrypted domain, decrypts it to obtain the aggregated reporting results, verifies the aggregated reporting results, and outputs the final reporting results.
[0006] Furthermore, the pre-defined standardization processes include field mapping, time merging, category merging, and numerical conversion.
[0007] Furthermore, S1 specifically refers to: The system reads the preset order and quantity of reporting items in the reporting template, extracts the corresponding records from the local business system, converts the local fields into unified field meanings through field mapping, groups the records into the current reporting period through time grouping, maps the local category codes into unified category fields through category grouping, converts the record values into unified numerical standards through numerical conversion, and then groups and accumulates them according to the reporting category to obtain the reporting item statistics of the corresponding reporting items arranged in the template order. Organize all data source nodes and related reporting items into a standard reporting sequence.
[0008] Furthermore, S2 specifically refers to: Locally on each data source node, the statistical values of the reporting items are read from the node standard reporting table in the order of the categories defined by the reporting template. And generate a structural consistency code based on the statistical values and position numbers of each reporting item in the standard reporting sequence; The statistical values of the sequentially read reporting items and the corresponding structural consistency codes are encapsulated together into a fixed-length encrypted reporting result.
[0009] Furthermore, the step of generating a structural consistency code based on the statistical values and position numbers of each reporting item in the standard reporting sequence specifically involves: The position number of each reporting item in the standard reporting sequence is combined with the statistical value corresponding to that position, and then the product of all reporting items is summed to obtain a weighted sum code value that is bound to the order of the reporting template, which is the structural consistency code.
[0010] Furthermore, the step of encapsulating the sequentially read statistical values of the reported items and the corresponding structural consistency codes into a fixed-length encrypted reporting result specifically involves: According to the order of the reporting template, the statistical value of each reporting item is generated into ciphertext through homomorphic encryption algorithm. The structure consistency code is then used as an additional item and homomorphically encrypted in the same way. The encrypted reporting item ciphertext and the structure consistency ciphertext are concatenated in a fixed position order to form a fixed-length encrypted reporting result.
[0011] Furthermore, the standard hash algorithm is implemented by the on-chain virtual machine calling the underlying encryption library, with a byte stream as input and a fixed-length digest value as output; The step of submitting the encrypted reporting result to the blockchain network, and generating a digest value using a standard hash algorithm based on the number of reported items, specifically involves: The byte stream obtained by serializing the encrypted reporting results in a fixed order, and the number of reporting items in the reporting template as additional input, are concatenated with the byte stream and then input into a hash function to generate a unique digest value.
[0012] Furthermore, the step of using a smart contract to perform a status determination on the encrypted reporting result, and registering the reporting objects that pass the determination as valid on-chain reporting objects, specifically involves: The smart contract verifies whether the submitting node's identity is in the authorized list, whether the submission batch number is consistent with the currently activated batch, and whether the number of ciphertexts in the encrypted reporting result is equal to the number of reporting items plus one. When all three verifications pass, the status value is set to one; otherwise, it is set to zero. Only reporting objects with a status value of one are registered as valid reporting objects on the chain.
[0013] Furthermore, the step of performing position-based dense-state aggregation on the verified node ciphertext within the dense-state domain specifically involves: The aggregation node reads the encrypted reporting results corresponding to all valid reporting objects on the chain, performs homomorphic addition on the ciphertext at the same position in each encrypted reporting result, and obtains the aggregated ciphertext sequence. The decrypted aggregated reporting result includes the aggregated statistical value of all corresponding reporting items and an aggregated structural consistency code value; The aggregated statistics are the sum of the standard reporting statistics for the corresponding reporting item of all valid data source nodes that have passed on-chain verification in the same reporting batch.
[0014] Furthermore, the verification of the aggregated reporting result specifically includes: The statistical value of the next position in the aggregated reporting result is calculated by combining the position number of each reporting item in the aggregated reporting result with the aggregated statistical value of that position. The statistical value of the next position in the aggregated reporting result is compared with the aggregated structural consistency code value. If the two are equal, the verification passes and the aggregated result is confirmed to meet the structural requirements of the reporting template.
[0015] The beneficial technical effects of the present invention are at least as follows: This invention focuses on a specific business link of encrypted aggregation and reporting of multi-source data. It organizes source standardization, encrypted generation, on-chain valid object formation, and aggregation result verification into a coherent process. First, at each data source node, instead of directly uploading raw business data or simple statistical values, a standard reporting sequence is formed based on the reporting template and arranged in the order of reporting items. This ensures that different nodes have completed field mapping, category merging, time merging, and numerical standardization before entering subsequent processing, thus converging the reporting semantics from the source. Second, when generating encrypted reporting results based on this standard reporting sequence at the source, not only are the statistical values of each reporting item encrypted for aggregation, but a structurally consistent code corresponding to the order of reporting items is also generated simultaneously. This ensures that the encrypted object carries both reporting value information and structural information at the time of formation, thereby guaranteeing that subsequent cross-node aggregation deals with bit-based data. First, a unified object with identifiable alignment and structure is established. Second, during the on-chain processing phase, the submitted results are not simply stored as evidence. Instead, the encrypted reporting results, template length, node identity, reporting batch, and structural integrity are all incorporated into the verification logic to form a valid reporting object with a digest index and state constraints. This allows the on-chain results to directly serve as the admission criteria for subsequent aggregations. Finally, during the aggregation phase, only the reported objects confirmed as valid on-chain are aggregated in encrypted form. The structural information in the aggregation results is further verified for consistency. This ensures that the final reporting output is not only credible in origin but also proves that it still meets the order and structural relationships required by the original reporting template. Thus, the technical improvement of this invention goes beyond simple data encryption, on-chain traceability, or aggregation calculation. Instead, in multi-source reporting scenarios, it integrates unified reporting semantics, preserved encrypted structure, on-chain qualification confirmation, and aggregation result verification into a continuous closed-loop processing chain. This results in a final reporting result that simultaneously possesses the technical effects of privacy protection, unified standards, correct structure, traceable origin, and on-chain verifiability. Attached Figure Description
[0016] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.
[0017] Figure 1 This is a flowchart of a multi-source data encryption aggregation and reporting method based on the integration of blockchain and privacy computing according to the present invention. Detailed Implementation
[0018] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0019] like Figure 1 As shown in the figure, an embodiment of the present invention provides a method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing. The method includes: S1. On each data source node, the reporting template corresponding to the current reporting item is pre-set and standardized to generate the reporting item statistics and the standard reporting sequence arranged in order of the reporting items. The reporting template includes a field list, reporting period, category field and numerical scope.
[0020] Specifically, on each data source node, based on the reporting template corresponding to the current reporting item, necessary fields are extracted from the local business system to complete field mapping, time merging, category merging, and numerical standardization, forming standard reporting data. This step addresses how to converge data corresponding to the same reporting item into a unified data representation when multiple source nodes differ in local table structure, field naming, and record granularity, ensuring that subsequent encrypted reporting results are based on consistent business semantics. The input to this step is the original reporting data. , of which The raw reporting data of each data source node Reporting records from existing business systems on this node are typically obtained through the node's internal database query interface, report detail export interface, or business service internal call interface.
[0021] Furthermore, in actual implementation, the reporting template first provides a list of fields corresponding to the current reporting item. This list typically includes three categories: reporting time, reporting category, and reporting value. Then, the local data access module on the node reads the set of records for the current reporting period from the business table according to this field list. For example, the field names in the business table within one node might be "Registration Date," "Project Code," and "Accounting Value," while another node might use "Occurrence Time," "Business Type," and "Business Amount." When reading, the local data access module uses a pre-configured field mapping table to map these local fields to a unified set of reporting fields. This field mapping table is pre-configured on the node by the implementation personnel based on the reporting template and the local database table structure, typically stored in the node configuration file or node configuration table, and is directly loaded and used by the data access module at runtime. Thus, after field mapping, the original reporting data... Records related to the current reporting item already have unified field meanings, and subsequent processing will deal with the same reporting semantics.
[0022] Furthermore, after the field mapping is completed, the node locally performs time merging and category merging on the record set. Time merging is done by the local time processing module, which takes the mapped time field as input and the preset reporting cycle configuration in the reporting template as input, and outputs the reporting cycle identifier to which each record belongs. In practice, if the template specifies reporting by calendar month, the local time processing module reads the time value of each record and assigns it to the corresponding month identifier; if the template specifies reporting by calendar day, it assigns it to the corresponding date identifier.
[0023] Category merging is handled by the local category mapping module. The inputs are the mapped category fields and the pre-defined category mapping table in the reporting template, and the output is the unified reporting category identifier. For example, if a node records the same type of business as multiple sub-category codes locally, the category mapping module will merge these codes into the target category required by the reporting item based on the mapping relationship.
[0024] The standardization of numerical data is handled by a local conversion module. The input consists of the mapped numerical fields and the conversion parameters provided in the template; the output is the standardized reported value. This conversion module is typically implemented by a rule processing unit within the node program. After reading the record, it performs the numerical conversion according to the configured parameters and then writes the converted result to a standardized intermediate table. After these three steps, each record is organized into a unified structure, including a reporting cycle identifier, a reporting category identifier, and the standardized reported value.
[0025] When the current reporting item requires the formation of basic statistics on the node side, the node further reduces the above-mentioned unified structure records to generate standard reporting data. Here Instead of representing a single statistical value, it represents a standard reporting sequence arranged according to the reporting template order. The reduction process is completed by the local aggregation module. The aggregation module uses the reporting cycle identifier and reporting category identifier as grouping keys, and accumulates the reporting values corresponding to each reporting item after standardization, first obtaining the statistical values of each reporting item, and then writing these statistical values into the node standard reporting table according to the template order. The relationship is written as follows: ; in, Indicates the first Each data source node forms a standard reporting sequence for the current reporting batch, which is output by the local aggregation module and written into the node standard reporting table. Indicates the first The data source node in the current reporting batch is the [number]th [node]. The standard reporting statistics for each reporting item are generated by the local aggregation module according to the order of the reporting template. This indicates the number of items submitted in the current batch. This number is given by the category configuration in the submission template and stored in the node's local template configuration file.
[0026] The standard reporting statistics for each reporting item are obtained from the same set of reduction rules, and their relationship is written as follows: ; in, Indicates the first The data source node belongs to the [number]th ... The first item of the reporting section The reported values obtained after field mapping, time merging, category merging, and numerical standardization of each valid record are output by the local conversion module. Indicates the first The data source node is classified as the first in the current reporting batch. The number of valid records for each reporting item is obtained by the local aggregation module when scanning by grouping reporting categories. The statistical value for the corresponding reported item represents the reduction result for that item. After this processing, In this step, it is an ordered statistical sequence, and in step two... Directly from here, with no further change in meaning. Location number. As an order factor, all statistical values maintain the same numerical scale before and after reduction; when there are configuration differences in the numerical scale of the original records between nodes, the record values are first converted to a unified scale through the conversion module before entering the summary module.
[0027] To illustrate with a natural implementation scenario, suppose the current reporting batch contains three reporting items, corresponding to three target business categories. A node's local business system stores all business records for the current month. The data access module reads three columns related to reporting through a database query interface: "Registration Date," "Project Code," and "Accounting Value." After field mapping, these three columns are converted into unified reporting time, reporting category, and reporting value fields. The time processing module merges the "Registration Date" into the current month, the category mapping module merges the local project codes into the first, second, and third reporting items respectively, and the conversion module converts the "Accounting Value" into a unified reporting value. Assuming the cumulative valid records in the first reporting item amount to 120, the cumulative valid records in the second reporting item amount to 80, and the cumulative valid records in the third reporting item amount to 250, the local aggregation module obtains the following values according to the above relationships: , , This leads to the formation of a standard reporting sequence. Even if the field names and record formats in the original table differ, as long as the same field mapping, time merging, category merging, and numerical caliber are performed using the same reporting template, and the statistical values for each reporting item are generated in the same order, the final result will be... Having the exact same business and location meanings, step two can directly read and generate the corresponding encrypted reporting results based on location. After this processing, the original reporting data of each data source node and the current reporting item are organized into a standard reporting sequence with a unified structure and unified definition. The positional order, structural encoding, and on-chain verification in subsequent steps are all based on this sequence.
[0028] S2. At each data source node, the standard reporting sequence is converted into a encrypted reporting result through local homomorphic encryption.
[0029] Specifically, step one has already included the first The original reporting data related to the current reporting item from each data source node is organized into a standard reporting sequence. This step uses the fixed reporting cycle identifier, reporting category identifier, and corresponding statistical value order from the results to directly convert the standard reporting data into dense reporting results locally on the node. The reason for this approach is that subsequent on-chain verification and cross-node aggregation in the reporting scenario both rely on unified location semantics: data at the same location must always correspond to the same reporting item; otherwise, even if each node completes encryption, the aggregated result will still exhibit category misalignment. Based on this, this step standardizes the reporting data. First, the data is expanded into a fixed-length statistical sequence arranged according to the template order. Then, encrypted reporting values and structural consistency ciphertexts are simultaneously generated on this sequence. This ensures that the encrypted reporting result carries both the reported statistical values themselves and the current node's adherence to the reporting template order. The local implementation path on the node can be specifically implemented in three sub-modules: the sequential loading module reads statistical values from the node's standard reporting table according to the category order defined in the reporting template; the consistency encoding module generates structural codes for the loaded statistical sequence; and the encryption execution module calls the local homomorphic encryption component to jointly encrypt the statistical sequence and structural codes into a fixed-structure encrypted result. This process generates... It can directly proceed to subsequent on-chain verification, and can also perform dense state summation by position during the aggregation stage.
[0030] Furthermore, the original source of consistent coding is the weighted sum representation in discrete mathematics. For an ordered sequence, the most direct way to preserve order is not simply by summing, but by introducing different order weights to each position, so that the same set of statistical values yields different coding results under different permutations. Step one forms... This is already a standard reporting sequence arranged by reporting item. This step directly reads the first item from the sequence. Statistical values Then based on its location As weights, structural consistency coding is obtained. This derivation does not introduce new abstract symbols, but rather transforms the classic weighted sum from "sequence evaluation" into a coded expression of "submission template order binding," with the following relationship: ; in, Indicates the first The data source node in the current reporting batch is the [number]th [node]. The standard reporting statistics value corresponding to each reporting item is directly derived from the standard reporting data output in step one. The sequential loading module reads the data from the node standard reporting table according to the template order. This indicates the number of reporting items included in the current reporting batch. This number is given by the category configuration in the reporting template and stored in the node's local template configuration file. Indicates the first in the template The location number of each reported item is automatically assigned by the sequential loading module during reading; Indicates the first The structural consistency code generated by each data source node for the current batch is calculated and output by the consistency coding module. The derivation logic of this formula comes from the ordinary summation formula. In the reporting scenario, the summation term is expanded to "location number multiplied by the corresponding statistical value". The result of this is that when the sequence of statistical values matches the template order, This corresponds one-to-one with the order; when two reported items are mistakenly replaced locally on the node, the sum is... It can remain unchanged, but This can change, so subsequent steps can use this encoding to identify whether the structure is consistent. Here, the position number... As a dimensionless order factor and The left-right relationship holds true if the same numerical scale is maintained.
[0031] Furthermore, after obtaining Subsequently, the node-local encryption execution module encrypts the statistical sequence obtained in step one together with the structural consistency code to generate a unified structured encrypted reporting result. The original algorithm used here originates from the additive homomorphic encryption concept in public-key cryptography. Its application involves encoding each statistical value as a ciphertext object that can participate in subsequent addition operations at the node level. To enable position-by-position aggregation of results from different nodes, this step does not... Instead of encrypting everything at once, the encryption proceeds item by item according to the template order established in step one, with the structural consistency code placed at the end and encapsulated together. The logical relationship of this design is clear: the formula obtained from the previous step... This is the structural representation of the current standard reported data in the template order. The next formula will... arrive as well as This is all converted into a fixed-position ciphertext sequence, so subsequent on-chain verification can perform a digest check on the entire structure, and subsequent aggregation can accumulate the ciphertext at the same position item by item. The relationship is as follows: ; in, This represents the encryption process in the node's local homomorphic encryption component, which is specifically completed sequentially by the numerical encoder, key loader, and ciphertext generator. The numerical encoder converts the input statistical values into integer or polynomial encoding forms used internally by the encryption algorithm. The key loader reads the public key parameters corresponding to this batch from the node's local secure storage area. The ciphertext generator combines random numbers to output ciphertext objects. This represents the standard reporting data output in step one. The statistical values of each submitted item are arranged in the order of the template. This indicates that the node's local secure random number generator generates a sequence of random numbers for the current batch, which is then used by the ciphertext generator according to the encryption position. This represents the structural consistency code obtained from the previous equation; Indicates the first The encrypted reporting results output by each data source node are internally composed of... Each reported statistical value encrypted message and The structure is composed of several consistent ciphertexts, which are written to the node's local encrypted result table in a fixed order. This formula is derived from the classic item-by-item encryption expression, with the last digit added in this application. This allows the encrypted object to store not only the reported value but also structural information; this additional term is a special term added specifically for the reporting scenario, because the reporting task not only focuses on whether the total amount is correct but also on whether the position of the reported item corresponds to the template definition. In the formula... Each position corresponds to a reported value, and the last position corresponds to a structural code. The whole is a mapping relationship of information representation, and the output object maintains a one-to-one correspondence with the input sequence.
[0032] Applying the above formula to a complete computational scenario clearly illustrates the operational process of this step. Suppose a node has already generated standard reporting data in step one. The current batch has three submission items, therefore The three statistical values read in template order are as follows: , , The consistency coding module calculates the result according to the previous formula. The encryption execution module then reads four random numbers from the node's secure random number generator. , , and And respectively, the homomorphic encryption component is called to generate four ciphertext objects with fixed positions, ultimately obtaining... .
[0033] If the other node obtains three statistical values in the same batch , and Then we get This results in a dense state with identical structure. Subsequent steps processing the data from these two nodes simply involve reading their ciphertext sequences by position. This allows for aggregation of the reported values at the first three positions and aggregation of the structure encoding at the last position without accessing the plaintext. Since both nodes use the template order determined in Step 1, each position after aggregation still corresponds to the same reported item. Furthermore, the aggregation result of the last structure encoding retains comprehensive information about the sequential structure of each node, which can be used for subsequent on-chain verification combined with the digest for judgment.
[0034] S3. Submit the encrypted reporting result to the blockchain network, generate a digest value using a standard hash algorithm based on the number of reported items, and use a smart contract to perform a status determination on the encrypted reporting result, registering the reported objects that pass the determination as valid on-chain reported objects; wherein, the valid on-chain reported object includes the status value of the corresponding node, the digest value, and the storage index of the off-chain encrypted reporting result.
[0035] Specifically, in this step, the dense state reporting result generated in step two... The input objects are directly used as on-chain processing, combined with the number of reporting items already determined in the reporting template. And node identity information, which is transformed into a valid reporting object in the blockchain network, qualifying it to participate in subsequent encrypted aggregation. This process revolves around whether the dense state results can be aggregated under the same reporting semantics. Specifically, it is achieved through two consecutive calculation processes: structure binding summary and on-chain state determination. This allows the reporting structure information that has been solidified in step two to be retained on-chain and participate in subsequent judgments.
[0036] Furthermore, the results of the closed-state reporting After being generated locally on the node, the data is first serialized using the submission module. The serialization module transmits the encrypted data in the fixed order specified in step two. Each ciphertext object is sequentially converted into a byte representation and concatenated into a continuous byte stream. This byte stream is then fed as input to the on-chain hash calculation module to generate a unique identifier for the reported object. In classical cryptography, hash functions are used to map data of arbitrary length to a fixed-length digest; this step introduces a reporting template length based on this original mechanism. As an additional input, the summary reflects not only the dense-state reporting result itself, but also its structural boundaries. The calculation relationship is as follows: ; in, This indicates the standard hash algorithm implementation provided in the blockchain environment, which is completed by the on-chain virtual machine calling the underlying cryptographic library. The input is a byte stream, and the output is a fixed-length digest value. This indicates the result of the closed-state reporting. The byte stream obtained by serialization in a fixed order is submitted by the node's local reporting module; symbols This indicates a byte concatenation operation; This indicates the number of items submitted in the current batch, and this value comes from the submission template configuration pre-registered on the blockchain; This represents the final generated digest value, output by the on-chain hash module and stored in the blockchain state database. This formula originates from the standard hash construction. In this application, it is extended to include... The joint mapping is derived based on: step two Position structure and template length One-to-one correspondence, After incorporating the input, it ensures that the abstract is sensitive to both "ciphertext content" and "structure length." When two nodes... When there are differences in numerical values or positions, the serialization results or the concatenated inputs will be different, resulting in different outcomes. This ensures the uniqueness of objects on the chain. Both input and output are in discrete encoding form, but the overall relationship remains consistent.
[0037] After obtaining the summary value Afterwards, the smart contract performs a status check on the submitted object to determine whether it meets the conditions for entering the reporting aggregation. This check is based on the product representation method in discrete logic, where the result is one when multiple conditions are true simultaneously, and zero otherwise. The smart contract calculates the node identity matching bit, batch consistency bit, and structure matching bit separately, and multiplies the three to obtain the final state value. The determination of the structural matching bit directly depends on step two. The construction method, that is, the number of ciphertext positions should be equal to... , among which the former The first position contains the encrypted statistical values, and the last position contains the encrypted structural consistency code. The calculation relationship is as follows: ; in, Indicates the first The identity matching bit of each data source node is obtained by the smart contract querying the on-chain node registry. When the node is in the authorized state in the current reporting batch, the value is one. This represents the batch consistency bit, which is obtained by the smart contract by comparing the batch number in the submitted data with the currently active batch on the chain. When a match is found, the value is one. Indicates the structure matching bit, read by the smart contract. The number of ciphertext locations and their relationship with The comparison shows that when they are equal, the value is one. This represents the overall state determination result, calculated by the smart contract and written into the on-chain state. This formula originates from the AND operation in Boolean logic. Numerically equivalent to multiplication, this application applies it to reporting scenarios, unifying node identity, batch consistency, and cryptographic structure integrity into a single computable on-chain state variable. Because , , All values are discrete. Both are discrete results, and they satisfy logical consistency.
[0038] In actual implementation, the feasibility of this calculation can be illustrated by substituting specific numerical values. Assume a node generates a dense state reporting result in step two. For the three reporting items, then The ciphertext sequence length should be four. After a node submits this sequence, the on-chain hash module compares its serialization result with... The concatenated input is processed to obtain the summary value. The smart contract then determines its execution status. If the node is already registered on the chain and the current batch allows submission, then... If the submitted batch number matches the current batch, then If the number of ciphertext positions is four, then .at this time This indicates that the submitted object meets all the conditions. If the ciphertext sequence submitted by another node is three characters long, then... ,correspond This object will not be registered as a valid reporting object. This numerical calculation process shows that the status determination result directly reflects whether the reporting object meets the preset structure and permission requirements. When the value is set to one, the smart contract will store the node identifier, batch number, and digest value. and state values They are jointly written into the blockchain state database and corresponding valid reporting objects are generated. The object exists on the chain as a structured record, where the digest value... This serves as a unique index, used to associate the corresponding encrypted reporting results in subsequent steps. ; Status value The node identifier and batch number are used to identify that the object has been verified on-chain; they are used to confirm the source and time range during subsequent aggregation.
[0039] S4. The aggregation node reads the valid on-chain reporting objects of the current batch from the blockchain network, obtains the encrypted reporting results of each node by combining the corresponding off-chain index, performs positional encrypted aggregation of the verified node ciphertext in the encrypted domain, decrypts it to obtain the aggregated reporting results, verifies the aggregated reporting results, and outputs the final reporting results.
[0040] Specifically, in this step, step three has already transmitted the encrypted reporting results of each data source node. Transform into a valid on-chain reporting object Each of them Each contains the state value of the corresponding node. Abstract value And the storage index of the off-chain encrypted reporting results. This step directly uses these... Using the input as input, the final aggregated reporting result is generated through a combination of on-chain filtering and off-chain dense-state computation. In practice, the aggregation node first reads the set of all valid reporting objects in the current reporting batch through the blockchain query interface, with the reading condition being the status value. This equals one, thus obtaining the set of objects that satisfy the on-chain verification constraints. Subsequently, the aggregation node, based on each... The off-chain index stored in the node is used to read the corresponding encrypted data reporting results in batches through the encrypted data access interface inside the node. Since step two has already processed each The organization is a fixed-length ciphertext sequence (preface) Each position corresponds to a reported statistical value, and the last position corresponds to a structural consistency code. Therefore, after reading, the aggregation node can directly perform position alignment on all positions. Perform dense state operations.
[0041] Furthermore, the basis of dense-state aggregation stems from the additive homomorphism property in number theory, which states that in a homomorphic encryption system, performing an addition operation on multiple ciphertexts results in a decryption result equal to the sum of the corresponding plaintexts. This step, based on this original property, uses the state values obtained in step three... Introduced as a gating factor, allowing on-chain verification results to directly participate in the dense-state aggregation calculation. The specific derivation process is as follows: the dense-state reporting results of a single node... The corresponding plaintext statistical sequence after decryption The aggregation goal of multiple nodes is to obtain ;because This indicates whether a node has passed on-chain verification, so it is added as a multiplication factor to obtain an expression that only accumulates valid nodes. Under homomorphic encryption, the corresponding cryptomorphic operation can be written as: ; in, This indicates the decryption operation performed by the local decryption module of the aggregation node. This module loads the private key through a secure execution environment and decrypts the ciphertext sequence item by item. Indicates a valid reporting object from the chain. The state value read in the process is calculated by the smart contract in step three; This indicates the secret state reporting result of the corresponding node, which is read by the aggregation node through the off-chain index; This indicates the number of valid on-chain reporting objects in the current reporting batch, which is obtained from the blockchain query interface. This indicates the decrypted aggregated report result, whose internal structure is similar to... Consistent, including Each reported item has a statistical value and a structural consistency code value. The formula is derived from the classic homomorphic addition formula. Based on this, state values are introduced. This item enables direct constraints on the dense-state aggregation process based on on-chain verification results. Because... For discrete logic quantities, It is a dense numerical sequence, and its product is equivalent to selective accumulation in homomorphic operations. The overall calculation result still maintains the same dimensional relationship as the statistical value in step one after decryption.
[0042] Furthermore, after completing the dense-state aggregation and decryption, we obtain... Next, this step further verifies the structural consistency of the results. This verification relationship directly inherits the construction method of the structural consistency encoding in Step Two, and its original source is the weighted summation formula. The structural encoding generated for each node in Step Two is... After performing aggregation on all nodes in step four, the corresponding result is obtained. Expanding this expression yields... ,and It is the result of aggregation The Middle The statistical value of each position, i.e. Therefore, the following structural verification relationship can be obtained: ; in, Indicates the aggregated reporting results The Middle The statistical values of each position are output by the decryption module and then read according to position; express The structural consistency code value at the last position in the code; This indicates the position number of the submitted item in the template; This indicates the number of reported items. This formula is derived from the weighted coding formula in step two, and is obtained by linearly superimposing the coding results of multiple nodes. It is the standard reporting statistic for the j-th reporting item among all valid data source nodes that have passed on-chain verification in the same reporting batch. The sum of all elements. Due to the position number... Dimensionless ordinal number and Maintaining the same numerical scale ensures the validity of the left-right relationship. The significance of this verification relationship lies in the fact that when all nodes generate dense-state reporting results according to a unified template, the aggregated structure encoding will necessarily satisfy this equation; if a node fails to construct data according to the template order in step two, its corresponding encoding will violate this relationship and thus be detected in this step.
[0043] Furthermore, the feasibility of this step will be explained with reference to the specific calculation process. Assume that the current reporting batch has three reporting items, namely... There are two valid reporting objects on the chain, namely In step two, the standard reporting data for node one is... Node 2 is The corresponding structure codes are respectively and In this step, the aggregation node reads the state values of both objects as... Then, summation is performed at the corresponding positions in the dense state domain, and the result is obtained after decryption. At this point, a structural check is performed, and the calculation on the right side is... , and the left side Complete consistency indicates that the aggregation result meets the reporting template requirements at both the numerical and structural levels. Subsequently, the aggregation node will... The serialization module generates a byte stream, and the on-chain hash interface is called to generate a corresponding digest, which is then written to the blockchain to form the final reporting record for this batch.
[0044] As can be seen from the above process, this step completes two layers of integration at the computational level: the first layer is the aggregation of dense-state reported values based on homomorphic addition, directly transforming the valid objects selected in step three into inputs that can participate in the calculation; the second layer is the structural consistency verification based on weighted summation, which verifies the structural information embedded in step two again after aggregation. The resulting aggregated reported value... It possesses both numerical accuracy and structural consistency, ensuring that the entire reporting process can still be verified and traced under privacy protection conditions.
[0045] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0046] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or units may be electrical, mechanical, or other forms.
[0047] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0048] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for encrypted aggregation and reporting of multi-source data based on the integration of blockchain and privacy computing, characterized in that, The method includes: S1. On each data source node, the reporting template corresponding to the current reporting item is pre-set and standardized to generate the reporting item statistics and the standard reporting sequence arranged in order of the reporting items. The reporting template includes a field list, reporting period, category field and numerical scope. S2. At each data source node, the standard reporting sequence is converted into a encrypted reporting result through local homomorphic encryption. S3. Submit the encrypted reporting result to the blockchain network, generate a digest value using a standard hash algorithm based on the number of reported items, and use a smart contract to perform a status determination on the encrypted reporting result. Register the reported items that pass the determination as valid on-chain reported items. The valid on-chain reported items include the status value of the corresponding node, the digest value, and the storage index of the off-chain encrypted reporting result. The status determination refers to: the smart contract verifying whether the identity of the submitting node is in the authorized list, whether the submission batch number is consistent with the current activated batch, and whether the number of ciphertext in the encrypted reporting result is equal to the number of reported items plus one. S4. The aggregation node reads the valid on-chain reporting objects of the current batch from the blockchain network, obtains the encrypted reporting results of each node by combining the corresponding off-chain index, performs positional encrypted aggregation of the verified node ciphertext in the encrypted domain, decrypts it to obtain the aggregated reporting results, verifies the aggregated reporting results, and outputs the final reporting results.
2. The method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing as described in claim 1, characterized in that, The pre-defined standardization processes include field mapping, time merging, category merging, and numerical conversion.
3. The method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing as described in claim 1, characterized in that, Specifically, S1 is: The system reads the preset order and quantity of reporting items in the reporting template, extracts the corresponding records from the local business system, converts the local fields into unified field meanings through field mapping, groups the records into the current reporting period through time grouping, maps the local category codes into unified category fields through category grouping, converts the record values into unified numerical standards through numerical conversion, and then groups and accumulates them according to the reporting category to obtain the reporting item statistics of the corresponding reporting items arranged in the template order. Organize all data source nodes and related reporting items into a standard reporting sequence.
4. The method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing as described in claim 1, characterized in that, Specifically, S2 is: Locally on each data source node, the statistical values of the reporting items are read from the node standard reporting table in the order of the categories defined by the reporting template. And generate a structural consistency code based on the statistical values and position numbers of each reporting item in the standard reporting sequence; The statistical values of the sequentially read reporting items and the corresponding structural consistency codes are encapsulated together into a fixed-length encrypted reporting result.
5. The method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing as described in claim 4, characterized in that, The step of generating a structural consistency code based on the statistical values and position numbers of each reporting item in the standard reporting sequence is specifically as follows: The position number of each reporting item in the standard reporting sequence is multiplied by the statistical value corresponding to that position to obtain the product of the reporting item. Then, the products of all reporting items are summed to obtain a weighted sum code value that is bound to the order of the reporting template, which is the structural consistency code.
6. The method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing according to claim 4, characterized in that, The process of encapsulating the sequentially read statistical values of the reported items and the corresponding structural consistency codes into a fixed-length encrypted reporting result is as follows: According to the order of the reporting template, the statistical value of each reporting item is generated into ciphertext through homomorphic encryption algorithm. The structure consistency code is then used as an additional item and homomorphically encrypted in the same way. The encrypted reporting item ciphertext and the structure consistency ciphertext are concatenated in a fixed position order to form a fixed-length encrypted reporting result.
7. The method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing according to claim 1, characterized in that, The standard hash algorithm is implemented by the on-chain virtual machine calling the underlying encryption library. The input is a byte stream and the output is a fixed-length digest value. The step of submitting the encrypted reporting result to the blockchain network, and generating a digest value using a standard hash algorithm based on the number of reported items, specifically involves: The byte stream obtained by serializing the encrypted reporting results in a fixed order, and the number of reporting items in the reporting template as additional input, are concatenated with the byte stream and then input into a hash function to generate a unique digest value.
8. The method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing according to claim 1, characterized in that, The step of using a smart contract to perform a status determination on the encrypted reporting result, and registering the reporting objects that pass the determination as valid on-chain reporting objects, specifically involves: The smart contract verifies whether the submitting node's identity is in the authorized list, whether the submission batch number is consistent with the currently activated batch, and whether the number of ciphertexts in the encrypted reporting result is equal to the number of reporting items plus one. When all three verifications pass, the status value is set to one; otherwise, it is set to zero. Only reporting objects with a status value of one are registered as valid reporting objects on the chain.
9. A method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing as described in claim 4, characterized in that, The specific steps of performing position-based dense-state aggregation on the verified node ciphertext within the dense-state domain are as follows: The aggregation node reads the encrypted reporting results corresponding to all valid reporting objects on the chain, performs homomorphic addition on the ciphertext at the same position in each encrypted reporting result, and obtains the aggregated ciphertext sequence. The decrypted aggregated reporting result includes the aggregated statistical value of all corresponding reporting items and an aggregated structural consistency code value; The aggregated statistics are the sum of the standard reporting statistics for the corresponding reporting item of all valid data source nodes that have passed on-chain verification in the same reporting batch.
10. A method for encrypted aggregation and reporting of multi-source data based on the fusion of blockchain and privacy computing as described in claim 9, characterized in that, The verification of the aggregated reporting result specifically involves: The statistical value of the next position in the aggregated reporting result is calculated by combining the position number of each reporting item in the aggregated reporting result with the aggregated statistical value of that position. The statistical value of the next position in the aggregated reporting result is compared with the aggregated structural consistency code value. If the two are equal, the verification passes and the aggregated result is confirmed to meet the structural requirements of the reporting template.
Citation Information
Patent Citations
Multi-source data fusion platform based on block chain
CN113538149A
Intelligent submission method and device for manual measurement and reading data
CN121053638A
