Blockchain traceability method and system applied to energy credible space data

By acquiring and processing data within the trusted energy space, constructing a data feature association network, and utilizing blockchain consensus mechanisms and smart contract verification, the problem of low data authenticity and traceability efficiency in energy data management is solved, achieving efficient and reliable data traceability and management.

CN120875903BActive Publication Date: 2026-07-24INNER MONGOLIA ELECTRIC POWER (GRP) CO LTD DIGITAL RES BRANCH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INNER MONGOLIA ELECTRIC POWER (GRP) CO LTD DIGITAL RES BRANCH
Filing Date
2025-07-25
Publication Date
2026-07-24

Smart Images

  • Figure CN120875903B_ABST
    Figure CN120875903B_ABST
Patent Text Reader

Abstract

The application provides a kind of blockchain traceability method and system applied to energy credible space data, first, the original data information of each data acquisition node in energy credible space is acquired in continuous time period, encapsulated as initial data set, then the features of initial data set are extracted, a data feature correlation network is constructed to generate feature set, then a blockchain on-chain processing module is called, initial data set and feature set are combined and encapsulated into to-be-chained data unit, after being verified by consensus mechanism, it is linked to the main chain of blockchain to generate block record, a smart contract containing verification rules and traceability logic is deployed to blockchain network, when receiving data traceability request, smart contract is triggered to traverse and search block record and verify compliance, generate intermediate data, finally, according to target data identifier, relevant block record is screened, arranged and combined in time sequence, key information is extracted to generate traceability report containing whole process information of data flow, realizing credible storage and efficient traceability of energy data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and more specifically, to a blockchain traceability method and system for energy trusted spatial data. Background Technology

[0002] In the energy sector, with the intelligent and information-based development of energy systems, energy data has experienced explosive growth and comes from a wide range of sources, covering all aspects of energy production, transmission, distribution, and consumption. This energy data not only contains important information such as the operating status of energy systems and equipment parameters, but also plays a crucial role in the efficient use of energy, security, and decision-making.

[0003] However, existing energy data management methods have many problems. On the one hand, the lack of effective and reliable mechanisms during the collection, transmission, and storage of energy data makes it difficult to guarantee the authenticity and integrity of the data, making it susceptible to tampering and forgery, leading to data distortion and consequently affecting the accuracy of analysis and decision-making based on this data. On the other hand, traditional methods for energy data traceability often rely on centralized database records, which poses a single point of failure risk, and the traceability process is cumbersome and inefficient, failing to meet the stringent requirements of the energy industry for data security and traceability. Summary of the Invention

[0004] In view of the aforementioned problems, and in conjunction with the first aspect of the present invention, embodiments of the present invention provide a blockchain traceability method for trusted spatial data of energy, the method comprising: The raw data information generated by each data acquisition node within the energy trusted space during a continuous time period is obtained, and the raw data information is encapsulated and processed according to a preset data format to generate an initial data set. Feature extraction is performed on the initial dataset to identify key data elements in the business data content. A data feature association network is constructed based on the key data elements to generate a feature set containing the association relationships of data elements. The blockchain underlying architecture calls the on-chain processing module to combine and encapsulate the initial data set and the feature set to generate a data unit to be uploaded to the blockchain that includes data subject information, data feature information and timestamp information. The integrity and consistency of the data unit to be uploaded to the blockchain are verified through the consensus mechanism. The verified data units to be uploaded to the blockchain main chain are linked to the blockchain main chain in chronological order to generate the corresponding block record. Deploy a pre-defined smart contract to the blockchain network. The smart contract contains verification rules and traceability logic for trusted energy space data. When a data traceability request is received, the smart contract is triggered to traverse and search the block records on the main blockchain. According to the verification rules, the initial data set and feature set in the block records are verified for compliance, and intermediate data containing the verification results is generated. Based on the target data identifier in the data tracing request, all block records associated with the target data identifier are selected from the block records that have passed compliance verification. The selected block records are arranged and combined in chronological order, and the device identifier, data collection timestamp, business data content and feature set in each block record are extracted to generate a tracing report containing information on the entire data flow process.

[0005] In another aspect, embodiments of the present invention also provide a blockchain traceability system for trusted energy spatial data, including a processor and a machine-readable storage medium connected to the processor. The machine-readable storage medium is used to store programs, instructions, or code, and the processor is used to execute the programs, instructions, or code in the machine-readable storage medium to implement the above-described method.

[0006] Based on the above, this embodiment of the invention obtains the original data information generated by each data acquisition node within a continuous time period in the trusted energy space, and encapsulates it according to a preset data format to generate an initial data set. This effectively avoids the processing difficulties caused by chaotic data formats. Feature extraction is performed on the initial data set, and a data feature association network is constructed to generate a feature set. This allows for in-depth exploration of the intrinsic connections between data elements. The initial data set and the feature set are combined and encapsulated to generate a data unit to be uploaded to the blockchain. After verifying its integrity and consistency using the blockchain's consensus mechanism, the data is uploaded to the blockchain. Leveraging the immutable and decentralized characteristics of the blockchain, the authenticity and credibility of energy data are ensured. A smart contract containing verification rules and traceability logic is deployed. When a data traceability request is received, the block records on the main blockchain can be quickly traversed and retrieved for compliance verification. Finally, a traceability report containing information on the entire data flow process is generated based on the target data identifier. This achieves efficient and accurate traceability of energy data, improving the reliability, security, and traceability of energy data management. Attached Figure Description

[0007] Figure 1 This is a schematic diagram of the execution flow of the blockchain traceability method for trusted spatial data of energy provided in an embodiment of the present invention.

[0008] Figure 2 This is a schematic diagram of exemplary hardware and software components of a blockchain traceability system for trusted spatial data of energy, provided in an embodiment of the present invention. Detailed Implementation

[0009] The present invention will now be described in detail with reference to the accompanying drawings. Figure 1 This is a flowchart illustrating a blockchain traceability method for energy trusted spatial data provided in an embodiment of the present invention. The following is a detailed description of this blockchain traceability method for energy trusted spatial data.

[0010] Step S110: Obtain the raw data information generated by each data acquisition node in the energy trusted space within a continuous time period, encapsulate the raw data information according to a preset data format, and generate an initial data set.

[0011] In energy system data management, to achieve effective traceability of energy trusted space data, the first step is to acquire the raw data information generated by each data acquisition node within the energy trusted space over a continuous time period. The energy trusted space encompasses the entire energy process from production to consumption, with data acquisition nodes distributed across energy production equipment, energy transmission equipment, and energy consumption equipment. These devices generate a large amount of energy-related data during operation, such as energy production, transmission, and consumption, as well as their own operational status data, such as voltage, current, and power.

[0012] After acquiring the raw data, it needs to be packaged according to a preset data format. This preset format is designed to standardize the data representation and facilitate subsequent data processing and analysis. The packaging process includes organizing the data, adding necessary identification information, and ultimately generating an initial dataset containing the raw data from each stage of the energy system.

[0013] Step S111: Based on the geographical range and equipment layout within the trusted energy space, for each data acquisition node, collect the raw data information it generates in real time within a continuous time period. The distribution range of the data acquisition nodes covers the physical location areas corresponding to energy production equipment, energy transmission equipment, and energy consumption equipment.

[0014] To accurately acquire data within the energy trusted space, the location of data acquisition nodes needs to be determined based on the geographical extent and equipment layout of the energy trusted space. Geographic Information Systems (GIS) can provide a detailed understanding of the geographical location and distribution of energy production equipment, energy transmission equipment, and energy consumption equipment within the energy system. Energy production equipment may include power plants and wind turbines, energy transmission equipment such as power lines and pipelines, and energy consumption equipment such as factories and residential buildings.

[0015] For each data acquisition node, real-time data acquisition should be performed within a continuous time period. The time period needs to be determined based on the operating characteristics and data generation frequency of different devices. For example, for some devices whose operating status changes rapidly, a shorter time period may be required for data acquisition to ensure that changes in the device's status can be captured in a timely manner; while for some relatively stable devices, the time period can be appropriately extended.

[0016] During data collection, data acquisition nodes gather equipment operating status data and related business data. Equipment operating status data reflects the real-time operation of the equipment, such as parameters like voltage, current, and power; business data relates to energy production, transmission, and consumption, such as energy production volume, transmission volume, and consumption volume. All this equipment operating status data is recorded, forming raw data information containing equipment identification, data collection timestamps, and business data content.

[0017] Step S1111: Obtain the geographical scope and equipment layout of the energy trusted space through the geographic information system, determine the location coordinates of energy production equipment, the route of energy transmission equipment and the installation location of energy consumption equipment, and construct a spatial distribution model of data acquisition nodes. The spatial distribution model includes two-dimensional planar coordinates or three-dimensional solid coordinates.

[0018] Geographic Information Systems (GIS) are powerful tools that provide detailed geographic information about the reliable spatial distribution of energy resources. GIS allows for the precise acquisition of the location coordinates of energy production equipment, which can be two-dimensional planar coordinates (such as latitude and longitude) or three-dimensional coordinates (taking into account factors such as altitude). The routes of energy transmission equipment can also be depicted using GIS, allowing for an understanding of the specific paths of transmission lines or pipelines. Similarly, the installation locations of energy consumption equipment can be determined using GIS, including the specific addresses of factories, residences, and other similar facilities.

[0019] Based on this geographic information, a spatial distribution model of data acquisition nodes can be constructed. This spatial distribution model represents the location information of data acquisition nodes in the form of two-dimensional planar coordinates or three-dimensional solid coordinates, intuitively showing the distribution of data acquisition nodes in the energy trusted space. This spatial distribution model helps to rationally arrange data acquisition work and ensure that data in the energy system can be obtained comprehensively and accurately.

[0020] Step S1112: Number and identify energy production equipment, energy transmission equipment and energy consumption equipment, and establish a correspondence table between equipment identification and physical location. The equipment identification is composed of letters and numbers and includes equipment type code and serial number.

[0021] To facilitate the management and identification of equipment in energy systems, energy production equipment, energy transmission equipment, and energy consumption equipment need to be numbered and identified. Equipment identification uses a combination of letters and numbers, including an equipment type code and a serial number. The equipment type code distinguishes different types of equipment, such as energy production equipment, energy transmission equipment, and energy consumption equipment; the serial number uniquely identifies a specific piece of equipment within the same type.

[0022] Establish a table mapping device identifiers to physical locations, recording the identifier of each device and its corresponding physical location. When data is collected, the source device and its physical location can be quickly determined through the device identifier; during data tracing, the flow of data can also be tracked based on the device identifier and physical location information.

[0023] Step S1113: Based on the operating cycle and data generation frequency of different types of equipment, set a continuous time period to constrain the time interval of data acquisition.

[0024] Different types of equipment have different operating cycles and data generation frequencies. Energy production equipment may operate according to a certain production plan, and its data generation frequency is relatively stable; the data generation frequency of energy transmission equipment may be related to the energy transmission flow rate; while the data generation frequency of energy consumption equipment is affected by user habits.

[0025] Based on these characteristics, a continuous time period needs to be set to constrain the data acquisition interval. For devices that generate data frequently, a shorter time period can be set to ensure timely capture of changes in device status; for devices that generate data infrequently, the time period can be appropriately extended to reduce unnecessary data acquisition. The setting of the time period should comprehensively consider factors such as the operating characteristics of the device, the importance of the data, and the cost of data acquisition.

[0026] Step S1114: At the beginning of each time period, a data acquisition command is sent to the data acquisition node so that after receiving the data acquisition command, the data acquisition node can collect equipment operation status data and related business data in real time, and generate raw data information containing equipment identifier, data acquisition timestamp and business data content. The equipment operation status data includes equipment voltage parameters, current parameters and power parameters, and the business data content includes energy production information, transmission information and consumption information.

[0027] At the start of each pre-defined time period, the system sends a data acquisition command to the data acquisition nodes. Upon receiving the command, the data acquisition nodes can immediately begin real-time acquisition of equipment operating status data and related business data. Equipment operating status data includes parameters such as voltage, current, and power, reflecting the real-time operating status of the equipment. Business data includes information on energy production, transmission, and consumption, which are closely related to the energy production, transmission, and consumption processes.

[0028] While collecting data, device identifiers, data collection timestamps, and business data content can be recorded to generate raw data information. Device identifiers are used to uniquely identify the source device of the data; data collection timestamps record the specific time of data collection, facilitating subsequent data sorting and analysis; business data content is the core part of the data, containing key information about the operation of the energy system.

[0029] Step S112: Perform format verification processing on the collected raw data information. For raw data information that passes the format verification, process it according to the preset data encapsulation format, and add a data source identifier and a data integrity check code to the raw data information. The format verification processing includes: checking whether the device identifier conforms to the preset device coding rules, verifying whether the data collection timestamp is consistent with the actual collection time, and checking the field integrity of the business data content. The data source identifier is used to uniquely identify the physical location and device type of the data collection node. The data integrity check code is generated by calculating the raw data information using a hash algorithm.

[0030] After collecting the raw data, it needs to undergo format validation. Only data that passes the format validation can be processed and analyzed further. Format validation includes checks in several aspects.

[0031] First, check whether the equipment identification conforms to the preset equipment coding rules. These rules define the format and content of the equipment identification, ensuring its uniqueness and standardization. If the equipment identification does not conform to the rules, it may lead to inaccurate identification of the data source, affecting data traceability and management.

[0032] Secondly, verify that the data collection timestamp matches the actual collection time. The data collection timestamp records the specific time of data collection and should match the actual collection time. By comparing the data collection timestamp with the actual collection time, potential time errors or anomalies during the data collection process can be identified.

[0033] In addition, the completeness of the fields in the business data content must be verified. Business data content contains critical information from the energy system, and its fields should be complete and intact. Incomplete fields in the business data content may lead to incomplete data information, affecting subsequent data analysis and decision-making.

[0034] For raw data that passes format verification, it is processed according to a preset data encapsulation format. During the encapsulation process, a data source identifier and a data integrity check code are added. The data source identifier is used to uniquely identify the physical location and device type of the data acquisition node, allowing for quick determination of the data's origin. The data integrity check code is generated by calculating the raw data using a hash algorithm and is used to verify whether the data has been tampered with during transmission and storage.

[0035] Step S113: Sort the encapsulated raw data information according to the order of the data collection timestamps to generate an initial data set with a time sequence relationship. Each data unit in the initial data set includes a device identifier, a data collection timestamp, business data content, a data source identifier, and a data integrity verification code.

[0036] After encapsulation, the raw data needs to be sorted according to the chronological order of the data collection timestamps. The purpose of sorting is to generate an initial dataset with a time-series relationship, allowing the data to be arranged in chronological order, which facilitates subsequent data analysis and tracing.

[0037] Each data unit in the initial dataset contains a device identifier, a data acquisition timestamp, business data content, a data source identifier, and a data integrity check code. The device identifier uniquely identifies the source device of the data; the data acquisition timestamp records the specific time of data acquisition; the business data content contains key information from the energy system; the data source identifier determines the data's source location and device type; and the data integrity check code verifies the data's integrity.

[0038] Step S114: Establish a mapping table between data units and acquisition nodes, and record the physical location, device type, and acquisition time window of the acquisition node corresponding to each data unit.

[0039] To better manage and trace data, a mapping table between data units and acquisition nodes needs to be established. This mapping table records the physical location, device type, and acquisition time window of the acquisition node corresponding to each data unit. Through this mapping table, the source acquisition node of each data unit can be quickly located, and the specific location, device type, and time range of data acquisition can be understood.

[0040] In the process of data tracing, when it is necessary to trace a certain data unit, its corresponding collection node can be found according to the mapping relationship table, thereby understanding the collection background and related information of the data unit.

[0041] Step S120: Extract features from the initial dataset, identify key data elements in the business data content, construct a data feature association network based on the key data elements, and generate a feature set containing the association relationships of data elements.

[0042] After obtaining the initial dataset, feature extraction is required. Feature extraction is the process of extracting key information from a large amount of data, which helps to deeply understand the inherent meaning and relationships of the data. By analyzing the business data content in the initial dataset, key data elements are identified. These key data elements are important information reflecting the operating status and business logic of the energy system, such as the energy flow status, the order in which data is generated, and dependencies.

[0043] Based on these key data elements, a data feature association network is constructed. This network uses data units as nodes and the relationships between key data elements as edges, visually illustrating the connections between these elements. Analysis of this network reveals potential connections and patterns among the data.

[0044] Finally, a feature set containing the relationships between data elements is generated based on the data feature association network. This feature set includes various relationships between data units.

[0045] Step S121: Perform semantic parsing on the business data content of each data unit in the initial dataset, and extract the flow direction identifier reflecting the energy flow status through natural language processing technology.

[0046] This step aims to extract flow direction identifiers reflecting the energy flow status from the data unit business data content of the initial dataset using natural language processing technology.

[0047] Step S1211: For the business data content of each data unit, segment it into a sequence of word units using word segmentation technology in natural language processing. The word segmentation technology includes rule-based word segmentation methods and statistical word segmentation methods.

[0048] For each data unit's business data content, word segmentation is required to form a sequence of word units. Rule-based word segmentation methods segment the business data content based on pre-defined grammatical rules and a lexicon. For example, sentences are divided according to word boundaries based on common energy terms and grammatical structures. Statistical word segmentation methods, on the other hand, learn from large amounts of text data to statistically analyze word frequency and co-occurrence relationships, using this as the basis for word segmentation. In practical applications, these two methods can be combined to improve the accuracy of word segmentation.

[0049] Step S1212: Using part-of-speech tagging and named entity recognition technology, identify the energy type names and named entity sequences of verbs and nouns related to energy flow involved in the word unit sequence.

[0050] After obtaining the word unit sequence, part-of-speech tagging technology is used to label the part of speech of each word, such as noun, verb, adjective, etc. Simultaneously, named entity recognition technology is used to identify verbs and nouns related to energy type names and energy flow from the word unit sequence. For example, energy type names may include electrical energy, thermal energy, hydropower, etc., verbs related to energy flow include transmission, distribution, consumption, etc., and nouns include power plant, substation, user, etc.

[0051] Step S1213: Analyze the syntactic relationships and semantic associations between the named entities in the named entity sequence, determine the starting point, ending point, and intermediate equipment or links of the energy flow, and construct a path model of the energy flow, which includes linear paths, branching paths, or cyclic paths.

[0052] A thorough analysis of the identified named entity sequences is conducted, considering the syntactic and semantic relationships between the entities. By analyzing these relationships, the starting and ending points of energy flows, as well as the intermediate equipment or links, can be determined. For example, if the named entity sequence contains "electrical energy is transmitted from a power plant to a substation and then distributed to users," it is clear that the starting point of the energy flow is the power plant, the ending point is the user, and the substation is involved. Based on different energy flow scenarios, different types of path models can be constructed, such as linear paths (energy flows directly from one point to another), branching paths (energy flows from one point to multiple points), or circular paths (energy circulates within a closed system).

[0053] Step S1214: Based on the energy flow path model, extract the flow direction identifier that reflects the energy flow status. The flow direction identifier includes the specific flow path and direction information of energy from production equipment to transmission equipment and then to consumption equipment.

[0054] Based on the established energy flow path model, flow direction identifiers that reflect the energy flow status are extracted. These identifiers should include the specific flow path and direction information of energy from production equipment to transmission equipment and then to consumption equipment. For example, the flow direction identifier can clearly indicate which power plant the energy is produced from, which substations it passes through, and which users it ultimately reaches for consumption. Through these flow direction identifiers, the flow of energy throughout the entire system can be clearly understood.

[0055] Step S1215: Associate the extracted flow direction identifier with the device identifier and data acquisition timestamp in the data unit so that the flow direction identifier can accurately reflect the time and space information of energy flow.

[0056] To ensure that the flow direction identifiers more accurately reflect energy flow, the extracted flow direction identifiers are associated with the device identifiers and data acquisition timestamps in the data units. The device identifiers identify the specific equipment involved in the energy flow, while the data acquisition timestamps record the time when the energy flow occurred. Through this association, the flow direction identifiers not only contain the path and direction information of the energy flow but also reflect its temporal and spatial information.

[0057] Step S122: Analyze the logical relationships between the data fields in the business data content, determine the order and dependency of data generation, and extract the association identifiers that reflect the data generation logic. The association identifiers are used to describe the causal relationships and data transmission paths between different data units.

[0058] Analyzing the logical relationships between data fields within business data is another aspect of feature extraction. Through in-depth analysis of business data content, the chronological order and dependencies of data generation can be determined. For example, energy production data may influence energy transmission data, and energy transmission data may in turn influence energy consumption data; these data exhibit causal relationships and data transmission paths.

[0059] Based on the above logical relationships, we extract the association identifiers that reflect the logic of data generation. These association identifiers describe the causal relationships and data transmission paths between different data units, aiding in understanding the background and flow of data. Through these association identifiers, we can trace the source and destination of data.

[0060] Step S123: Obtain the device identifier and data source identifier corresponding to the data unit. Combine the physical location and device type of the data acquisition node to determine the environmental parameters and device operating status during data acquisition. Extract the scene identifier that represents the data acquisition environment. The scene identifier includes ambient temperature, device load and network connection status information.

[0061] To gain a more comprehensive understanding of the data acquisition context, it is necessary to obtain the device identifier and data source identifier corresponding to the data unit. Combining the physical location and device type of the data acquisition node, the environmental parameters and device operating status during data acquisition can be determined. Environmental parameters include ambient temperature and humidity, while device operating status includes device load and equipment malfunction status.

[0062] Based on this information, scene identifiers characterizing the data acquisition environment are extracted. These scene identifiers include information such as ambient temperature, device load, and network connection status, reflecting the specific environment and conditions during data acquisition. Scene identifiers can aid in understanding the background of data acquisition and factors that may affect data quality during data tracing.

[0063] Step S124: Construct a data feature association network with each data unit as a node and flow direction identifier, association identifier, and scene identifier as edges. In the data feature association network, nodes represent data units, and edges represent feature association relationships between data units.

[0064] A data feature association network is constructed, with each data unit as a node and flow direction identifier, association identifier, and scene identifier as edges. In this network, nodes represent data units, and edges represent the feature association relationships between data units. Flow direction identifiers reflect the direction and path of energy flow, association identifiers describe the logical relationships in which data is generated, and scene identifiers reflect the environmental conditions for data collection.

[0065] By constructing a data feature association network, the relationship between data units can be displayed intuitively, and potential connections and patterns between data can be discovered from the data feature association network.

[0066] Step S125: Perform a traversal analysis on the data feature association network, extract the association edge information between each node and other nodes, and generate a feature set containing the association relationship of data elements. Each feature entry in the feature set corresponds to a specific association relationship between data units. The specific association relationship includes energy flow path association, data generation logic association, and acquisition environment association.

[0067] The constructed data feature association network is traversed and analyzed to extract the association edge information between each node and other nodes. The association edge information includes flow direction identifier, association identifier, and scene identifier, reflecting the specific association relationship between data units.

[0068] Based on this association edge information, a feature set containing the relationships between data elements is generated. Each feature entry in the feature set corresponds to a specific relationship between data units, such as energy flow path association, data generation logic association, and acquisition environment association, which helps to deeply understand the data flow process and its internal logic.

[0069] Step S130: Call the on-chain processing module in the underlying blockchain architecture to combine and encapsulate the initial data set and the feature set to generate a data unit to be uploaded to the chain containing data subject information, data feature information and timestamp information. Verify the integrity and consistency of the data unit to be uploaded to the chain through the consensus mechanism. Link the verified data unit to be uploaded to the blockchain main chain in chronological order to generate the corresponding block record.

[0070] After obtaining the initial data set and feature set, they need to be stored on the blockchain to ensure data security and traceability. This involves calling the blockchain's underlying architecture's on-chain processing module, which is responsible for combining and encapsulating the initial data set and feature set.

[0071] During the assembly and encapsulation process, the device identifier, data acquisition timestamp, and business data content are extracted from the initial data set as the data subject information, and the flow identifier, association identifier, and scenario identifier are extracted from the feature set as the data feature information. The data subject information, data feature information, and the timestamp information generated by the current system time are combined to generate a data unit to be uploaded to the blockchain according to the blockchain data format requirements.

[0072] The data unit to be added to the blockchain consists of two parts: a data header and a data body. The data header contains timestamp information and the hash value of the previous block, which are used to ensure the time order and chain structure of the data; the data body contains data body information and data feature information, which is the core content of the data.

[0073] The data unit to be added to the blockchain is broadcast to all nodes in the blockchain network, triggering the consensus mechanism to verify its integrity and consistency. Each node confirms that the data unit to be added to the blockchain has not been tampered with and that its data elements are complete by recalculating the data integrity check code and comparing feature associations.

[0074] For data units to be added to the blockchain that have been verified through the consensus mechanism, they are linked to the end of the main blockchain in chronological order of their timestamp information, generating new block records. Each block record contains the hash value of the previous block, the hash value of the current block, and all information of the data unit to be added to the blockchain, ensuring chained storage and traceability of the data.

[0075] Step S131: Locate the interface address of the on-chain processing module in the underlying blockchain architecture, and pass the initial data set and feature set as input parameters to the on-chain processing module.

[0076] Locating the interface address of the on-chain processing module within the blockchain's underlying architecture is the primary operation for uploading data to the blockchain. This module is responsible for encapsulating data and uploading it to the blockchain. The initial data set and feature set can be passed to the on-chain processing module via the interface address. Locating the interface address requires referring to the design and documentation of the blockchain's underlying architecture to find the interface used to receive data input. This involves consulting and parsing the blockchain system's configuration files, codebases, or related documents to accurately obtain the interface address of the on-chain processing module.

[0077] Once the interface address is successfully located, the initial data set and feature set are passed as input parameters to the on-chain processing module. The initial data set contains the raw data information generated by each data acquisition node within the energy trusted space over a continuous time period. After encapsulation and processing, it forms a data set with a time-series relationship. Each data unit contains information such as device identifier, data acquisition timestamp, business data content, data source identifier, and data integrity check code. The feature set is generated by extracting features from the initial data set and constructing a data feature association network. It contains the association relationships of data elements, such as flow direction identifier, association identifier, and scene identifier.

[0078] Step S132: After receiving the input parameters, the on-chain processing module integrates the initial data set and the feature set, extracts the device identifier, data collection timestamp, and business data content from the initial data set as the main data information, and extracts the flow identifier, association identifier, and scene identifier from the feature set as the data feature information.

[0079] Upon receiving the initial data set and feature set, the on-chain processing module first integrates these two sets. This integration process ensures data consistency and accuracy, preventing data loss or errors. For the initial data set, device identifiers, data acquisition timestamps, and business data content are extracted as the main data information. Device identifiers uniquely identify the source device of the data, allowing traceability to specific energy production, transmission, or consumption equipment. Data acquisition timestamps record the specific time of data acquisition, serving as crucial information for the data time series and facilitating chronological sorting and analysis. Business data content includes specific data related to energy production, transmission, and consumption, such as energy production volume, transmission volume, and consumption volume; this is the core content of the data.

[0080] For the feature set, flow direction identifiers, association identifiers, and scenario identifiers are extracted as data feature information. Flow direction identifiers reflect the flow status of energy in the energy system, including the starting point, ending point, and intermediate equipment or links of the energy flow, which can help understand the transmission path and direction of energy. Association identifiers describe the causal relationship and data transmission path between different data units, reflecting the logical relationship of data generation. Through association identifiers, the source and destination of data can be tracked. Scenario identifiers include environmental parameters and equipment operating status at the time of data collection, such as ambient temperature, equipment load, and network connection status, which reflect the specific background and conditions of data collection.

[0081] Step S133: Combine the data subject information, data feature information, and timestamp information generated by the current system time to generate a data unit to be uploaded to the blockchain according to the blockchain data format requirements. The data unit to be uploaded to the blockchain includes two parts: a data header and a data body. The data header includes timestamp information and the hash value of the previous block, and the data body includes data subject information and data feature information.

[0082] After extracting the data subject information and data feature information, they need to be combined with the timestamp information generated by the current system time. The timestamp information generated by the current system time records the specific time when the data was uploaded to the blockchain. It is different from the data collection timestamp, which records the time when the data was generated, while the system timestamp records the time when the data was uploaded to the blockchain.

[0083] Data units to be uploaded to the blockchain are generated according to the blockchain data format requirements. These units typically consist of a header and a body. The header is a crucial component, containing a timestamp and the hash value of the previous block. The timestamp records the order in which data is uploaded, ensuring the data is arranged chronologically on the blockchain. The hash value of the previous block is key to the blockchain's chain structure; it connects the current data unit to previous blocks, forming an immutable chain.

[0084] The data body comprises data subject information and data characteristic information. Data subject information, such as device identifiers, data acquisition timestamps, and business data content, reflects the actual data situation within the energy system. Data characteristic information, such as flow identifiers, association identifiers, and scenario identifiers, reflects the relationships between data and the background of data acquisition. Combining this information forms a complete data unit to be uploaded to the blockchain, preparing for subsequent data upload and storage.

[0085] Step S134: Broadcast the data unit to be uploaded to the blockchain to all nodes in the blockchain network, triggering the consensus mechanism to verify its integrity and consistency. Each node confirms that the data unit to be uploaded to the blockchain has not been tampered with and that the data elements are complete by recalculating the data integrity check code and comparing the feature association relationship.

[0086] After generating the data unit to be added to the blockchain, it is broadcast to all nodes in the blockchain network. The blockchain network is a distributed network composed of multiple nodes, each with the right to participate in data verification and storage. The process of broadcasting the data unit to be added to the blockchain involves sending the data to every node in the network, giving all nodes the opportunity to verify the data.

[0087] The consensus mechanism is triggered to verify the integrity and consistency of the broadcast data units to be added to the blockchain. The consensus mechanism is one of the core mechanisms of blockchain, ensuring consistent data acceptance among all nodes in the blockchain network. During the verification process, each node recalculates the data integrity check code. The data integrity check code is generated by calculating the original data information using a hash algorithm during data encapsulation and is used to verify whether the data has been tampered with during transmission and storage. Nodes use the same hash algorithm to calculate the check code in the data unit to be added to the blockchain, and then compare the calculated check code with the check code inherent in the data unit. If they match, it means the data has not been tampered with during transmission.

[0088] Simultaneously, nodes also compare feature relationships. Feature relationships, such as flow direction identifiers, association identifiers, and scenario identifiers, reflect the inherent connections and logical relationships between data. Nodes check whether these relationships are reasonable and whether they match the main data information. For example, does the energy flow path represented by the flow direction identifier conform to the actual situation of the energy system? Is the causal relationship described by the association identifier logically correct? By comparing feature relationships, it can be confirmed that the data elements of the data unit to be uploaded to the chain are complete and logically correct.

[0089] Step S135: For data units to be added to the chain that have been verified through the consensus mechanism, link them to the end of the blockchain main chain in chronological order of their timestamp information to generate new block records. Each block record contains the hash value of the previous block, the hash value of the current block, and all information of the data unit to be added to the chain. All information includes data subject information, data feature information, and timestamp information.

[0090] For data units that have passed the consensus mechanism and are ready to be added to the blockchain, the next step is to link them to the end of the main blockchain chain. The main blockchain chain is the primary chain in the blockchain network, and all verified data is added to the main chain sequentially, forming a continuously growing chain. The data units are linked according to the order of their timestamps to ensure that the data is arranged chronologically on the blockchain, facilitating subsequent data retrieval and traceability.

[0091] During the linking process, new block records are generated. Each block record contains the hash value of the previous block, the hash value of the current block, and all information about the data unit to be added to the chain. An immutable chain structure is formed using the hash value of the previous block; the hash value of the current block is obtained by hashing all data within the current block and is used to uniquely identify the current block. All information about the data unit to be added to the chain includes data subject information (device identifier, data acquisition timestamp, business data content), data characteristic information (flow identifier, association identifier, scenario identifier), and timestamp information (data acquisition timestamp and system timestamp). This information comprehensively records the data situation and relationships within the trusted energy space.

[0092] Step S140: Deploy a pre-defined smart contract to the blockchain network. The smart contract contains verification rules and traceability logic for energy trusted space data. When a data traceability request is received, the smart contract is triggered to traverse and search the block records on the main blockchain. According to the verification rules, the initial data set and feature set in the block records are verified for compliance, and intermediate data containing the verification results is generated.

[0093] Deploying pre-defined smart contracts to a blockchain network is a crucial step in achieving data traceability and verification. A smart contract is an automatically executing contract that contains verification rules and traceability logic for trusted energy spatial data. In a blockchain development environment, the first step is to write the pre-defined smart contract code. Writing the smart contract code requires defining data verification rules and traceability logic algorithms based on the characteristics of the trusted energy spatial data and business needs.

[0094] The data verification rules define compliance standards for energy trust space data, including data format requirements, data element integrity requirements, and data relationship rationality requirements. Data format requirements specify the form in which data is expressed, such as the type, length, and order of each field in a data unit; data element integrity requirements ensure that the data contains necessary information, such as equipment identification, data acquisition timestamps, and business data content; and data relationship rationality requirements check whether the relationships between data conform to the actual situation and business logic of the energy system.

[0095] The tracing logic algorithm is used to traverse and retrieve block records on the main blockchain when a data tracing request is received. When the blockchain network receives a data tracing request, it can parse the target data identifier and the tracing time range in the request. The target data identifier can be a unique identifier for a data unit, or a feature identifier related to the business data content, such as an energy type identifier, equipment identifier fragment, or collection time interval identifier; the tracing time range is used to limit the time interval for retrieval, improving the efficiency and accuracy of the retrieval.

[0096] Once triggered, the smart contract begins executing its tracing logic. The smart contract iterates through and retrieves block records on the main blockchain based on the target data identifier and the tracing time range. During the retrieval process, all block records that meet the criteria are extracted. For each extracted block record, the initial data set is format-validated and its element integrity is checked according to data verification rules. The reasonableness of the association relationships within the feature set is also verified.

[0097] For the initial dataset, each data unit is checked to ensure it contains a device identifier, data acquisition timestamp, business data content, data source identifier, and data integrity check code. The number and names of fields in each data unit are verified to conform to the preset data format. Simultaneously, the device identifier within each data unit is verified to conform to the preset device coding rules, and the data acquisition timestamp is verified to be within a reasonable time range and logically consistent with the timestamps of other related data units. Logical consistency includes the timestamp increment order and the matching of the acquisition period. Furthermore, the data integrity check code is recalculated and compared with the check code embedded in the data unit to verify whether the initial dataset has been tampered with during transmission and storage.

[0098] For the feature set, check whether the flow direction identifier, association identifier, and scenario identifier in each feature entry are consistent with the business data content, device identifier, and data source identifier in the initial data set. Analyze whether the association edges between nodes in the data feature association network conform to the physical laws of energy flow and business logic to ensure that the association relationships are reasonable and do not have logical contradictions. The physical laws include the actual process of energy production, transmission, and consumption, and the business logic includes the order of data generation and dependencies.

[0099] Based on the verification results, a verification status and verification details are generated for each block record. All verification results are then aggregated to generate intermediate data containing the verification status and verification details. The verification status can be categorized as verification passed, verification failed, or verification in progress. The verification details include information such as whether the data format meets the requirements, whether the data elements are complete, and whether the data relationships are reasonable.

[0100] Step S141: Write the pre-defined smart contract code in the blockchain development environment. The smart contract code includes data verification rules and traceability logic algorithms. The data verification rules define the compliance standards for energy trusted spatial data, including data format requirements, data element integrity requirements, and data relationship rationality requirements.

[0101] Writing pre-defined smart contract code within a blockchain development environment is fundamental to implementing smart contract functionality. Blockchain development environments provide a suite of tools and libraries for writing, compiling, and deploying smart contracts. When writing smart contract code, it's necessary to define data verification rules and traceability algorithms based on the characteristics of energy trusted spatial data and business requirements.

[0102] Data verification rules define compliance standards for energy trust space data. Data format requirements specify the data's representation, ensuring a uniform structure and standardization. For example, the format of equipment identifiers, the precision of data acquisition timestamps, and the field types and lengths of business data content must all meet the defined requirements. Data element integrity requirements ensure that the data contains necessary information, such as equipment identifiers, data acquisition timestamps, business data content, data source identifiers, and data integrity check codes.

[0103] The rationality of data association requires checking whether the relationships between data conform to the actual situation and business logic of the energy system. For example, is the energy flow path represented by the flow direction identifier reasonable? Is the causal relationship described by the association identifier correct? Does the data collection environment reflected by the scenario identifier match the actual situation? Through the aforementioned verification rules, the quality and reliability of reliable energy spatial data can be guaranteed.

[0104] The tracing logic algorithm is used to traverse and retrieve block records on the main blockchain when a data tracing request is received. The algorithm needs to consider the target data identifier and the tracing time range, accurately locating and extracting relevant block records based on this information. During the retrieval process, block records need to be screened and filtered, retaining only those that meet the criteria, thus improving the efficiency and accuracy of the retrieval.

[0105] Step S142: Deploy the written smart contract code to the blockchain network using a blockchain deployment tool, so that the smart contract can run and be stored on the blockchain node.

[0106] After writing the smart contract code, it needs to be deployed to the blockchain network using a blockchain deployment tool. A blockchain deployment tool is specifically designed for uploading smart contract code to a blockchain network; it helps developers transform smart contract code into a program that can run on blockchain nodes.

[0107] The deployment process typically involves the following steps. First, the smart contract code is compiled into bytecode or other executable formats. The compilation process checks for syntax and logical errors to ensure the code's correctness. Then, a blockchain deployment tool is used to upload the compiled code to the blockchain network. During the upload process, the deployment address and relevant parameters of the smart contract, such as the contract name and version number, need to be specified.

[0108] Once the smart contract code is successfully deployed to the blockchain network, it can run and be stored on blockchain nodes. The blockchain nodes execute the smart contract code, processing and verifying data according to the rules and logic within the contract. Simultaneously, the smart contract's code and state are stored on the blockchain, ensuring its immutability and traceability.

[0109] Step S143: When the blockchain network receives a data tracing request, it parses the target data identifier and tracing time range in the data tracing request and triggers the smart contract to start executing the tracing logic.

[0110] When a blockchain network receives a data tracing request, it first needs to parse the target data identifier and the tracing time range in the request. The target data identifier can be a unique identifier for a data unit or a feature identifier related to the business data content. For example, an energy type identifier can be used to locate specific types of energy data, an equipment identifier fragment can be used to filter data from specific equipment, and a collection time interval identifier can be used to limit the data collection time range.

[0111] The source tracing time range is used to limit the time interval for retrieval, improving the efficiency and accuracy of the search. The process of parsing the target data identifier and the source tracing time range requires format parsing and semantic analysis of the request data to ensure accurate extraction of key information.

[0112] Once the target data identifier and traceability time range are successfully parsed, the smart contract will be triggered to execute the traceability logic. Based on this information, the smart contract will traverse and search the block records on the main blockchain to locate and extract the relevant block records.

[0113] Step S144: The smart contract traverses and searches the block records on the main blockchain based on the target data identifier and the traceability time range, and extracts all block records that meet the conditions.

[0114] Upon receiving a trigger signal, a smart contract can traverse and search the block records on the main blockchain based on the target data identifier and the time range for tracing. The traversal and search process requires starting from the beginning of the main blockchain and checking each block record in turn.

[0115] During the inspection process, block records can be filtered based on target data identifiers and traceability time ranges. For target data identifiers, if it's a unique identifier for a data unit, block records containing that identifier can be directly searched; if it's a feature identifier, the relevant information in the block record can be checked for matching. For example, if the target data identifier is an energy type identifier, the business data content can be checked to see if it contains information about that energy type.

[0116] For tracing the time range, you can check whether the data collection timestamp in the block record is within the specified time interval. Only block records that simultaneously meet the target data identifier and tracing time range conditions will be extracted.

[0117] Step S145: For each extracted block record, perform format verification and element integrity checks on the initial data set according to the data verification rules, verify the reasonableness of the association relationship of the feature set, generate the verification result of each block record, and summarize all verification results to generate intermediate data containing verification status and verification details. The verification details include whether the data format meets the requirements, whether the data elements are complete, and whether the data association relationship is reasonable.

[0118] This step mainly involves a comprehensive verification of the extracted block records to ensure the compliance and rationality of the data.

[0119] Step S1451: For the initial data set, check whether each data unit contains a device identifier, data acquisition timestamp, business data content, data source identifier, and data integrity check code, and verify whether the number of fields and field names of the data unit conform to the preset data format.

[0120] For each data unit in the initial dataset, it is necessary to check whether it contains the necessary elements, including device identifier, data acquisition timestamp, business data content, data source identifier, and data integrity check code. Simultaneously, verify that the number and names of the fields in the data unit are consistent with the preset data format. The preset data format specifies the structural and content requirements of the data unit, ensuring data standardization and consistency. If a data unit lacks necessary elements or its fields do not meet the format requirements, it may affect the accuracy and usability of the data.

[0121] Step S1452: Verify whether the device identifier in the data unit conforms to the preset device coding rules, whether the data acquisition timestamp is within a reasonable time range and has logical consistency with the timestamps of other related data units, the logical consistency including the increment order of the timestamps and the matching of the acquisition period.

[0122] The device identifiers in the data units are verified to ensure they conform to the preset device coding rules. These rules uniquely identify different devices, ensuring the standardization and identifiability of the device identifiers. Simultaneously, the reasonableness of the data acquisition timestamps is verified, checking that they fall within a reasonable time range and are logically consistent with the timestamps of other related data units. Logical consistency includes the increasing order of the timestamps (i.e., data acquisition times should be arranged chronologically) and the matching of acquisition periods (i.e., the acquisition time intervals of adjacent data units should conform to the preset acquisition period).

[0123] Step S1453: Verify whether the initial data set has been tampered with during transmission and storage by recalculating the data integrity check code and comparing it with the check code contained in the data unit. The comparison process includes the hash value generation algorithm and the length matching of the check code.

[0124] To ensure the initial data set has not been tampered with during transmission and storage, the data integrity check code needs to be recalculated and compared with the check code embedded in the data unit. The data integrity check code is typically generated using a hash algorithm that converts data into a fixed-length hash value. During the comparison, it is crucial to ensure that the hash value generation algorithm and the check code length are consistent with the original calculation. If the recalculated check code does not match the original check code, it indicates that the data may have been tampered with, requiring further investigation and processing.

[0125] Step S1454: For the feature set, check whether the flow direction identifier, association identifier, and scenario identifier in each feature entry are consistent with the business data content, device identifier, and data source identifier in the initial data set.

[0126] For each feature entry in the feature set, it is necessary to check whether its flow direction identifier, association identifier, and scenario identifier are consistent with the business data content, device identifier, and data source identifier in the initial data set. The flow direction identifier reflects the energy flow path and direction, the association identifier describes the causal relationship and transmission path between data, and the scenario identifier reflects the environment and conditions of data collection. These identifiers should match the relevant information in the initial data set to ensure consistency and correlation between the feature set and the initial data set.

[0127] Step S1455: Analyze whether the association edges between nodes in the data feature association network conform to the physical laws of energy flow and business logic, so that the association relationship is reasonable and there is no logical contradiction. The physical laws include the actual process of energy production, transmission and consumption, and the business logic includes the order of data generation and dependency relationship.

[0128] Analyzing the edges between nodes in a data feature association network examines whether they conform to the physical laws of energy flow and business logic. The physical laws of energy flow include the actual process of energy production, transmission, and consumption, such as energy being produced at power plants, transmitted through transmission lines, and ultimately consumed by users. Business logic includes the sequence and dependencies of data generation, such as the generation of some data depending on the existence of other data. By analyzing whether the edges conform to these laws and logic, it can be ensured that the relationships in the data feature association network are reasonable and free from logical contradictions.

[0129] Step S1456: Based on the above verification results, generate the verification status and verification details for each block record, and summarize the verification results of all block records to generate intermediate data containing the verification status and verification details.

[0130] Based on the verification results of the initial dataset and feature set, a corresponding verification status and verification details are generated for each block record. The verification status can be categorized as verification passed, verification failed, or verification in progress. Verification details include specific information such as whether the data format meets requirements, whether data elements are complete, and whether data relationships are reasonable. The verification results of all block records are then aggregated to generate intermediate data containing the verification status and verification details.

[0131] Step S150: Based on the target data identifier in the data traceability request, select all block records associated with the target data identifier from the block records that have passed compliance verification, arrange and combine the selected block records in chronological order, extract the device identifier, data collection timestamp, business data content and feature set from each block record, and generate a traceability report containing information on the entire data flow process.

[0132] This step is the final stage of the entire blockchain traceability method. It aims to filter relevant information from verified block records based on data traceability requests, generate a traceability report containing information on the entire data flow process, and provide users with comprehensive and accurate data traceability services.

[0133] Step S151: Parse the target data identifier in the data traceability request. The target data identifier is a unique identifier of a data unit or a feature identifier related to the business data content. The feature identifier includes an energy type identifier, a device identifier fragment, or a collection time interval identifier.

[0134] First, the target data identifier in the data tracing request is parsed. The target data identifier can be a unique identifier for a data unit, used to precisely locate a specific data unit; it can also be a feature identifier related to the business data content, such as an energy type identifier, equipment identifier fragment, or collection time interval identifier. The energy type identifier is used to filter data of a specific energy type, the equipment identifier fragment can narrow the search scope to data related to a specific device, and the collection time interval identifier can limit the data collection time range. By parsing the target data identifier, the target and scope of the tracing can be clearly defined.

[0135] Step S152: In the intermediate data that has passed compliance verification, find all block records containing the target data identifier, and identify all block records that are directly or indirectly associated with the target data identifier by traversing the association identifier in the feature set. The direct association includes the same device identifier or consecutive timestamps, and the indirect association includes data units connected by flow identifier or association identifier.

[0136] Within the compliance-verified intermediate data, all block records containing the target data identifier are searched. For each block record containing the target data identifier, other block records directly or indirectly related to the target data identifier are identified by traversing the association identifiers in the feature set. Direct associations include the same device identifier or consecutive timestamps, indicating a direct connection between these block records in terms of device or time. Indirect associations are achieved through data units connected by flow identifiers or association identifiers. These flow identifiers or association identifiers reflect the causal relationship and transmission path between data, allowing the tracing of block records indirectly related to the target data identifier.

[0137] Step S153: Based on the logical relationship between the numerical value of the timestamp and the time order, sort the selected block records according to the order of the data collection timestamps. For each sorted block record, extract the block record feature information in sequence. The block record feature information includes device identifier, data collection timestamp, business data content, flow identifier, association identifier and scene identifier.

[0138] The selected block records are sorted according to the chronological order of their data collection timestamps to clearly present the data flow process. The sorting is based on the numerical value of the timestamps and the logical relationship of time sequence, ensuring that earlier collected data is listed first and later collected data is listed later. For each sorted block record, its characteristic information is extracted sequentially, including device identifier, data collection timestamp, business data content, flow direction identifier, association identifier, and scenario identifier. This characteristic information comprehensively reflects the data source, collection time, business content, relationships between data, and the collection environment.

[0139] Step S154: Organize the block record feature information according to a preset report format to generate a traceability report. The report format may include a table, a timeline, or a flowchart.

[0140] The extracted block record feature information is organized according to a preset report format to generate a traceability report. The report format can be selected according to user needs and actual conditions. Common report formats include table format, timeline format, or flowchart format. The table format can clearly list the feature information of each block record, which is convenient for comparison and analysis; the timeline format uses time as the main line to show the data collection node information, the collected business data content, and the data feature correlation relationship at each time point, which can intuitively present the data flow process; the flowchart format can graphically show the correlation and flow path between data, which is easier to understand.

[0141] Step S155: In the traceability report, the data collection node information, the collected business data content, and the data feature correlation are displayed at each time point, with the time axis as the main line, forming a complete information on the entire data flow process. The traceability report includes the data source, data processing process, data transmission path, and data verification results.

[0142] This step is to present all aspects of data flow in the traceability report in a timeline format, so that users can clearly understand the entire process of data from its generation to its final state.

[0143] For example, step S1551: Create a timeline module in the source tracing report, and arrange all relevant block records in the order of data collection timestamps. The timeline module includes time scales, data unit identifiers and corresponding block record links.

[0144] Creating a timeline module in the source tracing report is fundamental to building a data flow visualization framework. First, all relevant block records must be arranged according to the chronological order of data collection timestamps. The time scale in the timeline module clearly defines each point in time, dividing the entire data flow process into different stages according to chronological order, allowing users to intuitively locate the time of each data event. Data unit identifiers are unique identifiers for each data unit, enabling accurate identification of different data units. Corresponding block record links provide a convenient way for users to directly access the specific block record content and further understand the detailed data information. For example, when a user detects a data unit identifier at a specific time point on the timeline, clicking the corresponding block record link allows them to view the detailed business data content, device identifier, and other information for that data unit.

[0145] Step S1552: For each time point on the time axis, display the device identifier, physical location, and device type of the corresponding data acquisition node. The physical location is represented by geographical coordinates or device installation address, and the device type includes production equipment, transmission equipment, or consumer equipment.

[0146] For each point in time on the timeline, detailed information about the corresponding data acquisition node needs to be displayed. Equipment identifiers uniquely identify the equipment involved in data acquisition, allowing users to trace which specific energy production, transmission, or consumption device generated the data. Physical location can be displayed as geographic coordinates, such as latitude and longitude, accurately pinpointing the device's geographical location; or as the device's installation address, such as the specific street name and house number, providing users with a more intuitive understanding of the device's actual location. Equipment types are categorized as production, transmission, and consumption devices, helping users understand the different sources of data within the energy system. For example, if a user observes that the equipment type corresponding to the displayed equipment identifier at a certain point in time is production equipment, and the physical location is a specific power plant address, they can know that the data at that point in time originated from the energy production stage.

[0147] Step S1553: At each time point, list the collected business data content, including energy type and equipment operating status information. The energy type is consistent with the business data content in the data unit, and the equipment operating status comes from the business data content of the data unit.

[0148] Listing the collected business data at each time point allows users to clearly understand the specific operational status of the energy system at that time. The energy type is consistent with the business data content in the data unit, clearly identifying the type of energy involved, such as electricity, heat, and hydropower. Equipment operating status information reflects the working condition of the equipment at that time point, and this information originates from the business data content of the data unit. For example, for a generator, the equipment operating status information might include parameters such as voltage, current, and power, which intuitively reflect the generator's efficiency and stability. By listing this business data at each time point, users can observe changes in energy type and the dynamic changes in equipment operating status over time.

[0149] Step S1554: Display the data feature relationships between the data unit at this point in time and other data units through charts or text descriptions, including the energy flow direction indicated by the flow direction identifier, the data generation logic relationship indicated by the association identifier, and the collection environment information indicated by the scene identifier. The charts include flowcharts, network diagrams, or tables, and the text descriptions include the specific content of the relationships and influencing factors.

[0150] To more clearly illustrate the relationships between data units, charts or text descriptions are used. For charts, flowcharts visually represent the energy flow path, clearly showing the entire process from energy production equipment, through transmission equipment, to final consumption equipment. Network diagrams can display complex relationships between data, including direct and indirect relationships, helping users understand the interaction of data within the system. Tables clearly list the relationship information between each data unit, facilitating comparison and analysis. Text descriptions detail the specific content of the relationships, such as the flow direction indicator indicating which production equipment the energy flows from, to which transmission equipment, and finally to which consumption equipment; the relationship indicator reflecting the logical relationship of data generation, such as which other data units the generation of a certain data unit depends on; and the scenario indicator showing the impact of environmental information such as ambient temperature, equipment load, and network connection status on data acquisition. For example, at a certain point in time, a flowchart can show the process of electrical energy being transmitted from a power plant through a series of substations to multiple factories, while a text description explains that during transmission, the excessive load on equipment at a certain substation may have affected the transmission efficiency.

[0151] Step S1555: Add an auxiliary section to the traceability report to summarize the data verification results. The data verification results include the verification status of each block record, as well as details of the problems found and their handling during the verification process. The verification status includes verification passed, verification failed, or verification in progress. The handling details include data correction, data deletion, or data supplementation.

[0152] Adding a supplementary section to the source tracing report to summarize data verification results allows users to fully understand the quality and reliability of the data. The verification status of each block record is categorized as verified successfully, failed, or in progress. Verification successful indicates that the data in that block record conforms to the pre-defined verification rules and is of reliable quality; verification failed indicates that the data does not conform to the rules and may require further processing; verification in progress indicates that the data verification process is not yet complete. The issue details record the specific problems found during verification, such as data format non-compliance (e.g., the number or name of fields in a data unit does not match the preset data format); missing data elements (e.g., missing device identifiers or data collection timestamps). The handling details describe the measures taken to address these issues, such as data correction (e.g., correcting incorrect field values); data deletion (removing data from the dataset when serious errors cannot be corrected); and data supplementation (supplementing missing data elements by finding relevant information). For example, in the supplementary section, a user might monitor a block record with a verification failed status, the issue details indicating an incorrect field format in the business data content, and the handling details indicating that the field value was corrected to conform to the preset data format. Through the above summary, users can gain a clear understanding of data quality throughout the entire data flow process, and also understand the measures taken to ensure data quality.

[0153] Step S156: Add an auxiliary section to the traceability report to summarize the data verification results. The data verification results include the verification status of each block record, as well as details of the problems found and their handling during the verification process. The verification status includes verification passed, verification failed, or verification in progress. The handling details include data correction, data deletion, or data supplementation.

[0154] To make the traceability report more comprehensive and detailed, a supplementary section has been added to summarize the data verification results. The data verification results include the verification status of each block, as well as details of any issues discovered during the verification process and their handling. The verification status is categorized as verified passed, failed, or in progress, allowing users to quickly understand the data verification status. Issue details record specific problems discovered during verification, such as non-compliant data formats or missing data elements; handling details explain the measures taken to address these issues, such as data correction, deletion, or supplementation. This supplementary section allows users to gain a deeper understanding of the data verification status and processing procedures.

[0155] Figure 2The illustration shows exemplary hardware and software components of a blockchain traceability system 100 for energy trusted spatial data, which can implement the ideas of this application, according to some embodiments of this application. For example, a processor 120 can be used in the blockchain traceability system 100 for energy trusted spatial data and to perform the functions described in this application.

[0156] The blockchain traceability system 100 for energy trusted spatial data can be a general-purpose server or a special-purpose server; both can be used to implement the blockchain traceability method for energy trusted spatial data of this application. Although only one server is shown in this application, for convenience, the functions described in this application can be implemented in a distributed manner on multiple similar platforms to balance the load.

[0157] For example, a blockchain traceability system 100 for trusted energy spatial data may include a network port 110 connected to a network, one or more processors 120 for executing program instructions, a communication bus 130, and various forms of storage media 140, such as a disk, ROM, or RAM, or any combination thereof. Exemplarily, the blockchain traceability system 100 for trusted energy spatial data may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The methods of this application can be implemented according to these program instructions. The blockchain traceability system 100 for trusted energy spatial data also includes an I / O interface 150 between the computer and other input / output devices.

[0158] For ease of explanation, only one processor is described in the blockchain traceability system 100 for energy trusted spatial data. However, it should be noted that the blockchain traceability system 100 for energy trusted spatial data in this application may also include multiple processors. Therefore, the steps performed by one processor as described in this application may also be performed jointly or individually by multiple processors. For example, if the processor of the blockchain traceability system 100 for energy trusted spatial data performs steps A and B, it should be understood that steps A and B may also be performed jointly by two different processors or individually by one processor. For example, the first processor performs step A, the second processor performs step B, or the first processor and the second processor jointly perform steps A and B.

[0159] Furthermore, this embodiment of the invention also provides a readable storage medium, wherein computer-executable instructions are preset in the readable storage medium, and when the processor executes the computer-executable instructions, the above-mentioned blockchain traceability method applied to trusted energy spatial data is implemented.

[0160] It should be noted that, in order to simplify the description of the present invention and thus help to understand one or more embodiments of the invention, multiple features may sometimes be grouped into one embodiment, drawing or description thereof in the foregoing description of the embodiments of the present invention.

Claims

1. A blockchain traceability method for trusted spatial data in energy, characterized in that, The method includes: The raw data information generated by each data acquisition node within the energy trusted space during a continuous time period is obtained, and the raw data information is encapsulated and processed according to a preset data format to generate an initial data set. Feature extraction is performed on the initial dataset to identify key data elements in the business data content. A data feature association network is constructed based on the key data elements to generate a feature set containing the association relationships of data elements. The blockchain underlying architecture calls the on-chain processing module to combine and encapsulate the initial data set and the feature set to generate a data unit to be uploaded to the blockchain that includes data subject information, data feature information and timestamp information. The integrity and consistency of the data unit to be uploaded to the blockchain are verified through the consensus mechanism. The verified data units to be uploaded to the blockchain main chain are linked to the blockchain main chain in chronological order to generate the corresponding block record. Deploy a pre-defined smart contract to the blockchain network. The smart contract contains verification rules and traceability logic for trusted energy space data. When a data traceability request is received, the smart contract is triggered to traverse and search the block records on the main blockchain. According to the verification rules, the initial data set and feature set in the block records are verified for compliance, and intermediate data containing the verification results is generated. Based on the target data identifier in the data tracing request, all block records associated with the target data identifier are selected from the block records that have passed compliance verification. The selected block records are arranged and combined in chronological order. The device identifier, data collection timestamp, business data content and feature set in each block record are extracted to generate a tracing report containing information on the entire data flow process. The step of extracting features from the initial dataset, identifying key data elements in the business data content, constructing a data feature association network based on the key data elements, and generating a feature set containing the association relationships between data elements includes: Semantic parsing is performed on the business data content of each data unit in the initial dataset, and flow direction identifiers reflecting the energy flow status are extracted using natural language processing technology; Analyze the logical relationships between various data fields in the business data content, determine the order and dependency of data generation, and extract the association identifiers that reflect the logic of data generation. The association identifiers are used to describe the causal relationship and data transmission path between different data units. Obtain the device identifier and data source identifier corresponding to the data unit, and combine the physical location and device type of the data acquisition node to determine the environmental parameters and device operating status during data acquisition. Extract the scene identifier that characterizes the data acquisition environment. The scene identifier includes ambient temperature, device load and network connection status information. A data feature association network is constructed with each data unit as a node and flow direction identifier, association identifier, and scene identifier as edges. In the data feature association network, nodes represent data units and edges represent feature association relationships between data units. The data feature association network is traversed and analyzed to extract the association edge information between each node and other nodes, and a feature set containing the association relationship of data elements is generated. Each feature item in the feature set corresponds to a specific association relationship between data units. The specific association relationship includes energy flow path association, data generation logic association, and collection environment association. The semantic parsing process of the business data content of each data unit in the initial dataset, and the extraction of flow direction identifiers reflecting the energy flow status through natural language processing technology, includes: For the business data content of each data unit, word segmentation technology in natural language processing is used to divide it into a sequence of word units. The word segmentation technology includes rule-based word segmentation methods and statistical word segmentation methods. By using part-of-speech tagging and named entity recognition technology, the names of energy types and named entity sequences of verbs and nouns related to energy flow involved in the word unit sequence are identified; Analyze the syntactic relationships and semantic associations between the named entities in the named entity sequence to determine the starting point, ending point, and intermediate equipment or links of the energy flow, and construct a path model of the energy flow, which includes linear paths, branching paths, or cyclic paths. Based on the energy flow path model, flow direction identifiers reflecting the energy flow status are extracted. These flow direction identifiers contain the specific flow path and direction information of energy from production equipment to transmission equipment and then to consumption equipment. The extracted flow direction identifier is associated with the device identifier and data acquisition timestamp in the data unit so that the flow direction identifier can accurately reflect the time and space information of energy flow.

2. The blockchain traceability method for trusted spatial data of energy as described in claim 1, characterized in that, The process involves acquiring raw data information generated by each data acquisition node within a continuous time period within the energy trusted space, encapsulating the raw data information according to a preset data format, and generating an initial data set, including: Based on the geographical scope and equipment layout within the trusted energy space, raw data information generated by each data acquisition node is collected in real time over a continuous time period. The distribution range of the data acquisition nodes covers the physical location areas corresponding to energy production equipment, energy transmission equipment, and energy consumption equipment. The collected raw data information undergoes format verification. For raw data information that passes format verification, it is processed according to a preset data encapsulation format. A data source identifier and a data integrity check code are added to the raw data information. The format verification process includes: checking whether the device identifier conforms to a preset device coding rule, verifying whether the data collection timestamp is consistent with the actual collection time, and checking the field integrity of the business data content. The data source identifier is used to uniquely identify the physical location and device type of the data collection node. The data integrity check code is generated by calculating the raw data information using a hash algorithm. The encapsulated raw data information is sorted according to the order of data collection timestamps to generate an initial data set with a time sequence relationship. Each data unit in the initial data set contains a device identifier, a data collection timestamp, business data content, a data source identifier, and a data integrity check code. Establish a mapping table between data units and acquisition nodes, recording the physical location, device type, and acquisition time window of the acquisition node corresponding to each data unit.

3. The blockchain traceability method for trusted spatial data of energy as described in claim 1, characterized in that, The process involves calling the on-chain processing module in the underlying blockchain architecture to combine and encapsulate the initial data set and the feature set, generating a data unit to be uploaded to the blockchain that includes data subject information, data feature information, and timestamp information. The integrity and consistency of the data unit to be uploaded to the blockchain are verified through a consensus mechanism. The verified data units are then linked to the main blockchain in chronological order to generate corresponding block records, including: Locate the interface address of the on-chain processing module in the underlying blockchain architecture, and pass the initial data set and feature set as input parameters to the on-chain processing module; After receiving the input parameters, the on-chain processing module integrates the initial data set and the feature set, extracts the device identifier, data collection timestamp, and business data content from the initial data set as the main data information, and extracts the flow identifier, association identifier, and scene identifier from the feature set as the data feature information. The data subject information, data feature information, and timestamp information generated by the current system time are combined to generate a data unit to be uploaded to the chain according to the blockchain data format requirements. The data unit to be uploaded to the chain includes two parts: a data header and a data body. The data header includes timestamp information and the hash value of the previous block, and the data body includes data subject information and data feature information. The data unit to be uploaded to the blockchain is broadcast to all nodes in the blockchain network, triggering the consensus mechanism to verify its integrity and consistency. Each node confirms that the data unit to be uploaded to the blockchain has not been tampered with and that the data elements are complete by recalculating the data integrity check code and comparing the feature association relationship. For data units to be added to the blockchain that have been verified through the consensus mechanism, they are linked to the end of the main blockchain in chronological order of their timestamp information to generate new block records. Each block record contains the hash value of the previous block, the hash value of the current block, and all the information of the data unit to be added to the blockchain, including data subject information, data feature information, and timestamp information.

4. The blockchain traceability method for trusted spatial data of energy as described in claim 1, characterized in that, The deployment of a pre-defined smart contract to the blockchain network includes verification rules and traceability logic for energy trusted spatial data. When a data traceability request is received, the smart contract is triggered to traverse and retrieve block records on the blockchain main chain. Based on the verification rules, the initial data set and feature set in the block records are verified for compliance, generating intermediate data containing the verification results, including: Write pre-defined smart contract code in a blockchain development environment. The smart contract code includes data verification rules and traceability logic algorithms. The data verification rules define the compliance standards for energy trust space data, including data format requirements, data element integrity requirements, and data association relationship rationality requirements. The written smart contract code is deployed to the blockchain network using blockchain deployment tools, so that the smart contract can run and be stored on the blockchain nodes; When the blockchain network receives a data tracing request, it parses the target data identifier and tracing time range in the data tracing request and triggers the smart contract to start executing the tracing logic. The smart contract traverses and searches the block records on the main blockchain based on the target data identifier and the traceability time range, and extracts all block records that meet the conditions. For each extracted block record, the initial data set is format-checked and element integrity-checked according to the data verification rules. The reasonableness of the association relationship of the feature set is verified, and the verification result of each block record is generated. All verification results are summarized to generate intermediate data containing verification status and verification details. The verification details include whether the data format meets the requirements, whether the data elements are complete, and whether the data association relationship is reasonable.

5. The blockchain traceability method for trusted spatial data of energy, as described in claim 4, is characterized in that... The data verification rules define compliance standards for energy trustworthy spatial data, including data format requirements, data element integrity requirements, and data association relationship rationality requirements. For each extracted block record, the initial data set is format-checked and element integrity-checked according to the data verification rules, and the association relationship rationality is verified on the feature set, generating a verification result for each block record, including: For the initial dataset, check whether each data unit contains a device identifier, data acquisition timestamp, business data content, data source identifier, and data integrity check code, and verify whether the number of fields and field names of the data unit conform to the preset data format; Verify whether the device identifier in the data unit conforms to the preset device coding rules, whether the data acquisition timestamp is within a reasonable time range and has logical consistency with the timestamps of other related data units, the logical consistency including the increment order of the timestamps and the matching of the acquisition period; By recalculating the data integrity check code and comparing it with the check code inherent in the data unit, it is verified whether the initial data set has been tampered with during transmission and storage. The comparison process includes the hash value generation algorithm and check code length matching. For the feature set, check whether the flow direction identifier, association identifier, and scenario identifier in each feature entry are consistent with the business data content, device identifier, and data source identifier in the initial data set; The analysis examines whether the relationships between nodes in the data feature association network conform to the physical laws of energy flow and business logic, so that the relationships are reasonable and free from logical contradictions. The physical laws include the actual processes of energy production, transmission, and consumption, and the business logic includes the order of data generation and dependencies.

6. The blockchain traceability method for trusted energy spatial data according to claim 1, characterized in that, The process involves selecting all block records associated with the target data identifier from the compliance-verified block records based on the target data identifier in the data tracing request, arranging and combining the selected block records in chronological order, extracting the device identifier, data collection timestamp, business data content, and feature set from each block record, and generating a tracing report containing information on the entire data flow process, including: Parse the target data identifier in the data traceability request. The target data identifier is a unique identifier of a data unit or a feature identifier related to the business data content. The feature identifier includes an energy type identifier, a device identifier fragment, or a collection time interval identifier. In the intermediate data that has passed compliance verification, find all block records containing the target data identifier. By traversing the association identifiers in the feature set, identify all block records that are directly or indirectly associated with the target data identifier. The direct association includes the same device identifier or consecutive timestamps, and the indirect association includes data units connected by flow identifiers or association identifiers. Based on the logical relationship between the numerical value of the timestamp and the time order, the filtered block records are sorted according to the order of the data collection timestamps. For each sorted block record, the block record feature information is extracted in sequence. The block record feature information includes device identifier, data collection timestamp, business data content, flow identifier, association identifier and scene identifier. The feature information of the block records is organized according to a preset report format to generate a traceability report. The report format includes table format, timeline format, or flowchart format. The source tracing report uses a timeline as the main thread to display the data collection node information, the collected business data content, and the data feature relationships at each point in time, forming a complete information on the entire data flow process. The source tracing report includes the data source, data processing process, data transmission path, and data verification results.

7. The blockchain traceability method for trusted spatial data of energy, as described in claim 2, is characterized in that... Based on the geographical scope and equipment layout within the energy trusted space, the system collects raw data information generated by each data acquisition node in real time over a continuous time period, including: The geographic scope and equipment layout of the energy trusted space are obtained through a geographic information system, the location coordinates of energy production equipment, the route of energy transmission equipment and the installation location of energy consumption equipment are determined, and a spatial distribution model of data acquisition nodes is constructed. The spatial distribution model includes two-dimensional planar coordinates or three-dimensional solid coordinates. Energy production equipment, energy transmission equipment, and energy consumption equipment are numbered and identified, and a correspondence table between equipment identification and physical location is established. The equipment identification consists of a combination of letters and numbers and includes equipment type code and serial number. Based on the operating cycle and data generation frequency of different types of equipment, a continuous time period is set to constrain the time interval of data acquisition; At the beginning of each time period, a data acquisition command is sent to the data acquisition node so that after receiving the data acquisition command, the data acquisition node can collect equipment operation status data and related business data in real time, and generate raw data information containing equipment identifier, data acquisition timestamp and business data content. The equipment operation status data includes equipment voltage parameters, current parameters and power parameters, and the business data content includes energy production information, transmission information and consumption information.

8. A blockchain traceability system for trusted spatial data in the energy sector, characterized in that, The method includes a processor and a memory, the memory and the processor being connected. The memory is used to store programs, instructions or code, and the processor is used to execute the programs, instructions or code in the memory to implement the blockchain traceability method for energy trusted spatial data as described in any one of claims 1-7.