Block chain-based power event management method and device, equipment and medium
By introducing blockchain technology and dual index structure into power event management, a behavioral data chain of power events and power resources is constructed, which solves the problem of power data tampering and achieves high credibility and full-process recording of power events.
Patent Information
- Application Number
- CN202511272254.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2045-09-08
AI Technical Summary
Traditional power event management systems are prone to power data tampering, resulting in low credibility of power events.
Blockchain technology is used to construct an event record index for power events and an index of power resource status changes, forming a behavioral data chain to ensure the mapping relationship between power events and power resources. The decentralized, tamper-proof and transparent characteristics of blockchain are utilized, combined with hash processing and smart contracts to achieve data security and reliability.
Effectively prevent the loss and tampering of power event records, ensure the security and reliability of power event records, achieve clear recording of the entire process of power events and the full cycle status of power resources, improve the credibility of power events, and support multi-dimensional data tracking and tracing.
Smart Images

Figure CN120780709A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain-based power event management method, device, equipment and medium. Background Art
[0002] With the rapid development of the power industry, more and more power events have occurred. How to effectively manage these power events has become an urgent problem that needs to be solved.
[0003] In traditional technologies, power events are usually managed by the local management system of the power industry. However, this approach is prone to power data tampering, resulting in low credibility of power events. Summary of the Invention
[0004] Based on this, it is necessary to provide a blockchain-based power event management method, device, equipment and medium that can improve the credibility of power events in response to the above technical problems.
[0005] In the first aspect, the present application provides a blockchain-based power event management method, which is applied to a blockchain platform and includes:
[0006] When receiving an event record for a power event reported by the power management system, extracting a power event identifier of the power event and a resource identifier of a power resource associated with the power event from the event record;
[0007] Based on the power event identifier, an event record index of the power event is constructed;
[0008] When the power resource triggers a state change due to a power event, a state change index of the power resource is constructed based on the resource identifier;
[0009] The behavior data chain of the power event is determined according to the event record index and the state change index; the behavior data chain is used to characterize the mapping relationship between the power event and the power resource.
[0010] In one embodiment, the blockchain-based power event management method further includes:
[0011] Perform hash processing on the event record to obtain the hash value of the event record;
[0012] Based on the power event identifier, an event record index of the power event is constructed, including:
[0013] The power event identifier, hash value and resource identifier are combined to obtain an event record index of the power event.
[0014] In one embodiment, when a power resource triggers a state change due to a power event, a state change index of the power resource is constructed based on the resource identifier, including:
[0015] When the power resource triggers a state change due to a power event, obtaining resource state information of the power resource;
[0016] extracting a resource identifier of the power resource from the resource status information;
[0017] Based on the resource identifier and the power event identifier, a state change index of the power resource is constructed.
[0018] In one embodiment, the power event includes at least one target power event, the event record index includes a target event record index of the target power event, the state change index includes at least one target state change index, and the target state change index corresponds to the target event record index in a one-to-one manner;
[0019] The behavioral data chain of the power event is determined based on the event record index and state change index, including:
[0020] Obtaining the first index generation time of each target event record index and the second index generation time of each target state change index respectively;
[0021] Arrange the target event record indexes in sequence according to the first index generation time to obtain an event data chain, and arrange the target state change indexes in sequence according to the second index generation time to obtain a state data chain;
[0022] The event data chain and the state data chain are combined to obtain the behavior data chain.
[0023] In one embodiment, the blockchain-based power event management method further includes:
[0024] In response to the power event query request, extracting a query identifier from the power event query request;
[0025] Perform query path matching based on the query identifier to obtain a query path that matches the query identifier;
[0026] Query the behavior data chain according to the query path to obtain the power event query results.
[0027] In one embodiment, when an event record for a power event reported by a power management system is received, extracting a power event identifier of the power event from the event record includes:
[0028] When receiving an event record for a power event reported by the power management system, performing a compliance check on the power event based on the event record to obtain a compliance check result of the power event;
[0029] In a case where the compliance check result meets the compliance condition, extracting a power event identifier of the power event from the event record.
[0030] In a second aspect, the present application further provides a power event management device based on a blockchain, applied to a blockchain platform, comprising:
[0031] An identifier extraction module is configured to extract, when receiving an event record of a power event reported by a power management system, a power event identifier of the power event and a resource identifier of a power resource associated with the power event from the event record;
[0032] An event record index construction module is configured to construct an event record index of the power event based on the power event identifier;
[0033] A state change index construction module is configured to construct a state change index of the power resource based on the resource identifier when the power resource triggers a state change due to the power event;
[0034] A behavior data chain generation module is configured to determine a behavior data chain of the power event according to the event record index and the state change index; the behavior data chain is used to represent a mapping relationship between the power event and the power resource.
[0035] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0036] When receiving an event record of a power event reported by a power management system, extracting a power event identifier of the power event and a resource identifier of a power resource associated with the power event from the event record;
[0037] Constructing an event record index of the power event based on the power event identifier;
[0038] Constructing a state change index of the power resource based on the resource identifier when the power resource triggers a state change due to the power event;
[0039] Determining a behavior data chain of the power event according to the event record index and the state change index; the behavior data chain is used to represent a mapping relationship between the power event and the power resource.
[0040] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0041] When receiving the event record for the power event reported by the power management system, extracting the power event identifier of the power event and the resource identifier of the power resource associated with the power event from the event record;
[0042] Based on the power event identifier, constructing an event record index of the power event;
[0043] When the power resource triggers a state change due to the power event, constructing a state change index of the power resource based on the resource identifier;
[0044] According to the event record index and the state change index, determining a behavior data chain of the power event; the behavior data chain is used to represent the mapping relationship between the power event and the power resource.
[0045] In a fifth aspect, the present application also provides a computer program product, comprising a computer program which, when executed by a processor, implements the following steps:
[0046] When receiving the event record for the power event reported by the power management system, extracting the power event identifier of the power event and the resource identifier of the power resource associated with the power event from the event record;
[0047] Based on the power event identifier, constructing an event record index of the power event;
[0048] When the power resource triggers a state change due to the power event, constructing a state change index of the power resource based on the resource identifier;
[0049] According to the event record index and the state change index, determining a behavior data chain of the power event; the behavior data chain is used to represent the mapping relationship between the power event and the power resource.
[0050] The above-mentioned blockchain-based power event management method, device, computer equipment, computer-readable storage medium and computer program product are applied to a blockchain platform. When the blockchain platform receives an event record for a power event reported by the power management system, it first extracts the power event identifier of the power event and the resource identifier of the power resource associated with the power event from the event record. An event record index of the power event is constructed based on the power event identifier. And when the power resource triggers a state change due to the power event, a state change index of the power resource is constructed based on the resource identifier. Finally, the behavior data chain of the power event is determined based on the event record index and the state change index, which is used to characterize the mapping relationship between the power event and the power resource. Therefore, on the one hand, the present application introduces blockchain technology to manage power events, and utilizes the characteristics of blockchain that are decentralized, tamper-proof and transparent, which can effectively prevent the risk of power event records being lost and tampered with, ensure the security and reliability of power event records, and thus improve the credibility of power events. On the other hand, dual indexing technology is introduced, that is, the event record index of the power event and the status change index of the power resources affected by the power event are constructed separately, and finally a clear power event behavior data chain is formed, which aims to fully record the entire process of the power event and the full-cycle status of the power resources under the influence of the power event, further improving the credibility of the power event. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 This is a diagram of an application environment of a blockchain-based power event management method in one embodiment;
[0053] Figure 2 1. A flowchart of a blockchain-based power event management method in one embodiment;
[0054] Figure 3 is a schematic diagram of a behavior data chain in one embodiment;
[0055] Figure 4 A schematic diagram of a process for constructing a behavior data chain in one embodiment;
[0056] Figure 5 A schematic diagram of a process for querying power events in one embodiment;
[0057] Figure 61 is a flow chart of a power event compliance check process in one embodiment;
[0058] Figure 7 1. A flowchart of a power event management method based on blockchain in a specific embodiment;
[0059] Figure 8 1 is a structural block diagram of a power event management device based on blockchain in one embodiment;
[0060] Figure 9 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0062] It should be noted that the terms "including" and "having" and any variations thereof used in this application are intended to cover non-exclusive inclusions. The term "plurality" used in this application refers to two or more. The term "and / or" used in this application refers to one or more solutions.
[0063] With the rapid development of the power industry, the industry is actively promoting power events such as carbon emissions and green electricity consumption. Effectively managing these power events has become a pressing issue. Traditionally, power event management is typically implemented by local management systems within the power industry. However, this approach is prone to data tampering, resulting in low credibility of power events.
[0064] Blockchain is a distributed database technology whose core characteristics are decentralization, immutability, and transparency. It can meet the power industry's needs for digital, visual, and trusted management of the entire power event process. Therefore, this solution incorporates blockchain technology to manage power events and ensure the credibility of power event records. Furthermore, this solution considers that traditional blockchain management often uses a single event record approach, which only proves that a power event was recorded at a specific time but fails to understand the entire chain of power event behavior, such as the changes in power resource status caused by the power event. Therefore, traditional blockchain management methods have certain limitations, not only affecting the credibility of power event records but also making it difficult to support data traceability across different dimensions. To address these issues, this solution also introduces dual indexing technology: constructing an event record index for power events and an index for power resource status changes. By combining these two index structures, a clear data chain of power event behavior is formed, which not only further ensures the credibility of power event records but also supports data traceability across different dimensions.
[0065] The power event management method based on blockchain provided in the embodiment of this application can be applied to Figure 1 In the application environment shown, the blockchain platform 102 communicates with the power management system 104 via a network. The power management system 104 is an information system for managing and monitoring various power links. It can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0066] Specifically, upon receiving an event record for a power event reported by the power management system 104, the blockchain platform 102 extracts the power event identifier and the resource identifier of the power resource associated with the power event from the event record. An event record index for the power event is constructed based on the power event identifier. When a power resource triggers a state change due to a power event, a state change index for the power resource is constructed based on the resource identifier. Finally, a behavior data chain for the power event is determined based on the event record index and state change index. The behavior data chain represents the mapping relationship between the power event and the power resource.
[0067] In an exemplary embodiment, Figure 2 As shown in the figure, a power event management method based on blockchain is provided, which is applied to Figure 1 The blockchain platform 102 in FIG. 1 is used as an example to illustrate the following:
[0068] Step S202 : when an event record for a power event reported by the power management system is received, a power event identifier of the power event and a resource identifier of the power resource associated with the power event are extracted from the event record.
[0069] A power event refers to a key operational node in the power management system that generates data changes or power resource flows, and may include, but is not limited to, at least one of green power trading, electricity metering, and carbon trading. Green power trading refers to the purchase or sale of renewable energy power. For example, power companies connect with photovoltaic and wind power generation companies through power trading platforms to purchase electricity with zero or near-zero carbon emissions during production. Electricity metering refers to the real-time reporting of actual electricity usage by the power management system. Carbon trading, or carbon emission rights trading, involves limiting the total amount of greenhouse gas emissions such as carbon dioxide and allocating quotas, allowing companies to trade quotas in the carbon emission rights market, thereby achieving greenhouse gas emission reduction goals. An event record may refer to a record containing details of a power event. For example, an event record may include the type of power event (e.g., green power trading, electricity metering, carbon trading), the power event identifier, the entity executing the power event (i.e., the party directly involved in or controlling the power event (e.g., a power plant, smart meter, carbon trading platform), the timestamp of the power event, and the resource identifier of the power resource associated with the power event. The power event identifier is a unique identifier for a power event. It can be the event number of the power event or another custom identifier. Power resources can be understood as the object entity of the power event, such as carbon data, green power resources, green certificates, etc. This embodiment aims to clarify the power resources affected by the power event to facilitate subsequent resource status tracking. The resource identifier is a unique identifier for the power resource. It can be a resource number or another custom identifier.
[0070] For example, after detecting a power event, the power management system can automatically generate an event record for the power event and report the power event to the blockchain platform via the communication link between the power management system and the blockchain platform. After receiving the event record, the blockchain platform can extract the unique identifier of the power event and the unique identifier of the power resource associated with the power event from the event record to facilitate the subsequent construction of an index structure.
[0071] In some embodiments, there may be multiple power events, and there may also be multiple power resources associated with the power events. For example, the power management system may simultaneously report carbon emissions and green power trading event records, and green power trading may affect both green power resources and carbon emissions data.
[0072] In some embodiments, the power management system can be a single system or multiple different systems, such as a power trading platform, a carbon management system, etc. In different system scenarios, each system can independently connect to the blockchain platform and transmit its own power event records to the blockchain platform.
[0073] Step S204: constructing an event record index of the power event based on the power event identifier.
[0074] An index is an on-chain data structure that improves blockchain data query efficiency. In this embodiment, the first step is to construct an event record index, which can include the power event type, power event identifier, executing entity, timestamp, resource identifier, and more. The event record index can be used to construct an event data chain—a complete chain of events related to power resources.
[0075] For example, after extracting the power event identifier, the blockchain platform can use the power event identifier as the index primary key and, through a smart contract, structure the fields in the event record as an on-chain index record. For example, the event record index might include power event identifier: E001; execution entity: A; power event type: carbon emissions; timestamp: xx / xx / xx; and resource identifier: D001. It is understood that each power event can correspond to one event record index.
[0076] Step S206: When the power resource triggers a state change due to a power event, a state change index of the power resource is constructed based on the resource identifier.
[0077] The state change index can be an index structure used to record the state changes of power resources. Taking carbon emissions data as an example, the state change index can include at least one of the following: measured, confirmed, traded, and written off. Of course, in addition to the specific resource state type, the state change index can also record resource identifiers, associated power event identifiers, timestamps, and other information. The state change index can also be used to construct a state data chain, that is, the state of power resources at each stage under the influence of a series of power events.
[0078] For example, when a power resource's state changes due to a power event, the blockchain platform can use the acquired resource identifier as the index primary key and, through a smart contract, structure and store the relevant field information of the power resource as an on-chain index record. For example, a state change index might include resource identifier: D001; resource status: measured; timestamp: xx / xx / xx; and power event identifier: E001. It is understood that a power resource can have a state change index under the influence of different power events.
[0079] In some embodiments, the blockchain platform can obtain information about changes in power resources through the power management system. Specifically, when the power management system detects a change in the state of a power resource, it reports the relevant information back to the blockchain platform. Alternatively, when a power event triggers a change in the state of a power resource, the power management system can report the event record and the state change information to the blockchain platform.
[0080] In some embodiments, the event record index and state change index may be stored in an on-chain queryable structure, such as a mapping table embedded in a smart contract or an on-chain indexable node database.
[0081] Step S208 , determining a behavior data chain of the power event according to the event record index and the state change index; the behavior data chain is used to characterize the mapping relationship between the power event and the power resource.
[0082] Among them, the behavior data chain can be understood as a logical data chain constructed by cross-correlating event record index and state change index. The logical data chain can include an event data chain constructed based on event record index and a state data chain constructed based on state change index.
[0083] For example, after the event record index and the state change index are constructed, the event record index and the state change index can be combined to form a complete behavior data chain. Figure 3 A schematic diagram of a behavior data chain is shown, in which power events 1, 2, and 3 occur, corresponding to event record indexes 1, 2, and 3. Under the influence of power events 1, 2, and 3, the power resource undergoes a state change, resulting in state change indexes 1, 2, and 3. Since event record index 1 is associated with state change index 1, event record index 2 is associated with state change index 2, and event record index 3 is associated with state change index 3, the event data chain consisting of event record indexes 1, 2, and 3 is associated with the state data chain consisting of state change indexes 1, 2, and 3. Ultimately, the event data chain and the state data chain are combined to form a complete behavior data chain. This behavior data chain clearly illustrates the entire process of power event behavior and the state changes of power resources throughout their lifecycle. This facilitates data tracing from different dimensions, such as querying resource status based on event identifiers or querying power events based on resource identifiers.
[0084] In some embodiments, the blockchain platform can use smart contracts to automatically query the behavior data chain and output power event behavior reports to the power management system to perform audits or generate resource certificates for the power management system.
[0085] In some embodiments, based on this behavioral data chain, the blockchain platform can query all power events and corresponding power resource changes for a specific execution entity, query all power events that affect a specific power resource, and query the power events preceding and following a specific power event. The query interface can be designed to support multi-dimensional queries such as by execution entity, power event identifier, resource identifier, and power event type.
[0086] In this embodiment, when a blockchain platform receives an event record for a power event reported by the power management system, it first extracts the power event identifier of the power event and the resource identifier of the power resource associated with the power event from the event record. An event record index for the power event is constructed based on the power event identifier. Furthermore, when a power resource triggers a state change due to a power event, a state change index for the power resource is constructed based on the resource identifier. Finally, a behavior data chain for the power event is determined based on the event record index and the state change index, which is used to characterize the mapping relationship between the power event and the power resource. Therefore, this embodiment, on the one hand, introduces blockchain technology for power event management. By leveraging the decentralized, immutable, and transparent characteristics of blockchain, it effectively prevents the risk of power event record loss and tampering, ensuring the security and reliability of power event records and thus improving the credibility of power events. On the other hand, it introduces dual indexing technology, constructing both an event record index for the power event and a state change index for the power resource affected by the power event. This ultimately forms a clear power event behavior data chain, aiming to fully record the entire process of the power event and the full cycle status of the power resources under the influence of the power event, further improving the credibility of the power event.
[0087] In an exemplary embodiment, the blockchain-based power event management method further includes: performing hash processing on the event record to obtain a hash value of the event record.
[0088] Hashing is the process of converting an input of arbitrary length into an output of fixed length using a hash function. The core idea is to use a hash function to map data from a larger space to a smaller space while preserving certain data properties. In this embodiment, a hash function is used to convert the event record of a power event into a unique string of fixed length. This unique string is the hash value. The hash value can then be used to construct an event record index.
[0089] For example, after receiving the event record reported by the power management system, the blockchain can use at least one hash function such as MD5, SHA-1, SHA-256, SHA-3, BLAKE2, etc. to hash the event record to obtain a hash value.
[0090] In some embodiments, constructing an event record index of a power event based on the power event identifier includes: combining the power event identifier, the hash value, and the resource identifier to obtain the event record index of the power event.
[0091] For example, after obtaining the hash value of the event record, the power event identifier, hash value and resource identifier can be combined and stored in a structured manner as an on-chain index record to obtain the event record index.
[0092] In this embodiment, an event record index is constructed based on the hash value, power event identifier and resource identifier of the event record, which can not only ensure the integrity and non-tamperability of the event record index, but also associate the power event with the power resource, which is conducive to the subsequent realization of efficient multi-dimensional data traceability.
[0093] In an exemplary embodiment, when the power resource triggers a state change due to the power event, a state change index of the power resource is constructed based on the resource identifier, including: when the power resource triggers a state change due to the power event, obtaining the resource state information of the power resource; extracting the resource identifier of the power resource from the resource state information; and constructing the state change index of the power resource based on the resource identifier and the power event identifier.
[0094] Among them, resource status information is information used to describe the status changes of power resources, which may include but is not limited to status type (such as measured, confirmed, traded, written off, etc.), timestamp, resource type (such as carbon emission data, green electricity resources, etc.), resource identification, etc.
[0095] For example, when a power resource triggers a state change due to a power event, the blockchain platform can obtain the resource state information of the power resource. If there are multiple power resources, the resource state information of each power resource can be obtained separately. The resource identifier is extracted from the resource state information, and then a state change index of the power resource is constructed based on the resource identifier and the power event identifier.
[0096] In this embodiment, a state change index of power resources is constructed based on resource identifiers and power event identifiers, aiming to associate power resources with power events, thereby facilitating subsequent efficient multi-dimensional data traceability.
[0097] In an exemplary embodiment, Figure 4 As shown, the behavior data chain of the power event is determined based on the event record index and the state change index, including:
[0098] Step S402 : Obtain the first index generation time of each target event record index and the second index generation time of each target state change index.
[0099] Among them, the power event may include at least one target power event, and the target power event may refer to a key operation node in the power management system that generates data changes or power resource flows, and may include but is not limited to any one of green power trading, electricity metering, carbon trading, etc. The event record index may include the target event record index corresponding to each target power event, and the target event record index refers to the event record index of the target power event. Similarly, the state change index may also include at least one target state change index, and the target state change index refers to an index structure that records a certain change state of power resources, such as measured, confirmed, traded, or written off. The target state change index and the target event record index may correspond one to one, which means that a target power event will trigger a change in power resources. The first index generation time may refer to the generation time of the target event record index, and the second index generation time may refer to the generation event of the target state change index.
[0100] For example, when there are multiple power events, the generation time of each target event record index and the generation time of each target state change index can be obtained respectively for subsequent construction of event data chain and state data chain.
[0101] It can be understood that, when there is one power event, the event record index of the power event can independently constitute an event data chain, and the corresponding state change index can also independently constitute a state data chain.
[0102] Step S404: Arrange the target event record indexes in sequence according to the first index generation time to obtain an event data chain, and arrange the target state change indexes in sequence according to the second index generation time to obtain a state data chain.
[0103] For example, the target event record indexes are arranged in sequence according to the time of generation of the first index to obtain an event data chain. And the target state change indexes are arranged in sequence according to the time of generation of the second index to obtain a state data chain. Figure 3 For example, the generation time of event record index 1 is earlier than that of event record index 2, and the generation time of event record index 2 is earlier than that of event record index 3. Similarly, the generation time of state change index 1 is earlier than that of state change index 2, and the generation time of state change index 2 is earlier than that of state change index 3.
[0104] Step S406: Merge the event data chain and the state data chain to obtain a behavior data chain.
[0105] For example, the event data chain and the state data chain obtained by the arrangement are finally merged to obtain the behavior data chain. If a power event affects multiple power resources, the event data chain can be merged with each state data chain to obtain the behavior data chain.
[0106] In some embodiments, the behavior data chain can also be based on power resources, such as the status data chain of a certain type of power resources, and the event data chain corresponding to all power events that have triggered the state change of the power resource, together forming a behavior data chain.
[0107] In this embodiment, the target event record index and target state change index are arranged according to the index generation time to obtain the event data chain and the state data chain. The event data chain and the state data chain can be merged to obtain a complete behavior data chain, which is conducive to the subsequent efficient multi-dimensional data traceability.
[0108] In an exemplary embodiment, Figure 5 As shown, the blockchain-based power event management method also includes:
[0109] Step S502: In response to the power event query request, extract a query identifier from the power event query request.
[0110] The power event query request may refer to a request for information related to a power event and / or information related to power resources associated with the power event. The query identifier may refer to an identifier of a query parameter, such as an event number, a resource identifier, or the like, which serves as an index primary key. Of course, in practical applications, auxiliary queries may also be performed based on the execution subject, time range, etc., that is, this embodiment supports both single parameter queries and combined queries with multiple query parameters.
[0111] For example, upon receiving a power event query request, the blockchain platform may first extract a query parameter identifier from the power event query request for subsequent matching of the query path.
[0112] Step S504: performing query path matching based on the query identifier to obtain a query path matching the query identifier.
[0113] Among them, the query path refers to the information retrieval path selected according to the query parameters. The information retrieval path can be a bidirectional retrieval path. Forward retrieval can be understood as querying power resources from power events, and reverse retrieval is querying power events from power resources. It should be noted that forward and reverse here do not indicate direction. Forward retrieval can also be querying power events from power resources, and reverse retrieval is querying power resources from power events.
[0114] For example, after obtaining the query identifier, the query path that matches the query identifier can be determined. For example, if the query identifier is the power event identifier E001, the query path is to query the power resources from the power event, then the associated resource identifier D001 can be queried based on the power event identifier E001, and then the resource status can be queried. Of course, if the query requirement only requires querying the event record of the power event, then the event record query can be performed directly based on the power event identifier E001. Similarly, if the query identifier is the resource identifier D001, the event records of all power events associated with it can be traced back based on the resource identifier D001.
[0115] Step S506: query the behavior data chain according to the query path to obtain the power event query result.
[0116] For example, after matching the query path based on the query identifier, the behavior data chain can be queried according to the query path to obtain the power event query results, which may include but are not limited to at least one result such as event record, resource status, query duration, query event stamp, etc. For example, if the query identifier is power event identifier E001, the associated resource identifier D001 can be queried, and then the status data chain can be queried to obtain the full life cycle changes of the power resource. If the query identifier is resource identifier D001, all power event identifiers associated with it can be queried, and then the behavior data chain can be queried to trace the behavior trajectory of the power event.
[0117] In this embodiment, query path matching is performed based on multi-dimensional query identifiers, so that the behavior data chain is queried according to the query path to obtain power event query results, which significantly improves the query efficiency of power data.
[0118] In an exemplary embodiment, Figure 6 As shown, when an event record for a power event reported by the power management system is received, the power event identifier of the power event is extracted from the event record, including:
[0119] Step S602: When an event record for a power event reported by the power management system is received, a compliance check is performed on the power event based on the event record to obtain a compliance check result of the power event.
[0120] Step S604: When the compliance check result satisfies the compliance condition, extract the power event identifier of the power event from the event record.
[0121] Among them, the compliance check result can be used to characterize whether the power event is compliant, and specifically may include two results: compliance and non-compliance. The compliance check dimensions may include but are not limited to data integrity check, such as whether required fields are missing or formatted incorrectly, and logical consistency check, such as whether the power event matches the resource status. Of course, other verification methods can also be set in actual applications. This embodiment does not limit the specific method of compliance verification. Compliance conditions refer to conditions set in advance for compliance check results. For example, if both the data integrity check result and the logical consistency check result pass, the power event is considered compliant. On the contrary, if at least one of the data integrity check result and the logical consistency check result fails, the power event can be considered non-compliant, and the event record can be refused to be uploaded to the chain.
[0122] For example, when receiving an event record for a power event reported by the power management system, the blockchain platform can first perform a data integrity check on the event record. If the data integrity check passes, the power event will then be checked for logical consistency. For example, the preceding power event of the power event will be determined, and the resource status under the preceding power event will be obtained. When the resource status is logically consistent with the current power event, the logical consistency check is considered to have passed. For example, a "carbon trading" event requires carbon data to be in a "confirmed" state. At this point, the power event can be considered compliant, and the blockchain platform can extract the power event identifier and proceed with the subsequent event record index construction process.
[0123] In this embodiment, by performing compliance verification on power events, the compliance of power events can be guaranteed, thereby further ensuring the credibility of power event records.
[0124] Figure 7 A flowchart of a power event management method based on blockchain in a specific embodiment is shown, which is applied to a blockchain platform and includes the following steps:
[0125] S1: When the blockchain platform receives event records for multiple target power events reported by the power management system, it performs compliance verification on each target power event based on the event records;
[0126] S2: If the compliance check passes, extracting the target power event identifier of the target power event and the resource identifier of the power resource associated with the target power event from the event record;
[0127] S3: Hash the event record to obtain the hash value of the event record;
[0128] S4: Using the power event ID as the index primary key, and constructing a target event record index of the target power event based on the hash value of the event record, the power event ID, and the resource ID;
[0129] S5: When the power resource triggers a state change due to a target power event, construct a target state change index of the power resource based on the target power event identifier and the resource identifier;
[0130] S6: Obtain the first index generation time of each target event record index and the second index generation time of each target state change index respectively;
[0131] S7: Arrange the target event record indexes in sequence according to the time sequence of the first index generation to obtain an event data chain; and arrange the target state change indexes in sequence according to the time sequence of the second index generation to obtain a state data chain;
[0132] S8: The event data chain and the state data chain are combined to obtain a behavior data chain; the behavior data chain is used to characterize the mapping relationship between each target power event and the power resource.
[0133] In this embodiment, when a blockchain platform receives an event record for a power event reported by the power management system, it first extracts the power event identifier of the power event and the resource identifier of the power resource associated with the power event from the event record. An event record index for the power event is constructed based on the power event identifier. Furthermore, when a power resource triggers a state change due to a power event, a state change index for the power resource is constructed based on the resource identifier. Finally, a behavior data chain for the power event is determined based on the event record index and the state change index, which is used to characterize the mapping relationship between the power event and the power resource. Therefore, this embodiment, on the one hand, introduces blockchain technology for power event management. By leveraging the decentralized, immutable, and transparent characteristics of blockchain, it effectively prevents the risk of power event record loss and tampering, ensuring the security and reliability of power event records and thus improving the credibility of power events. On the other hand, it introduces dual indexing technology, constructing both an event record index for the power event and a state change index for the power resource affected by the power event. This ultimately forms a clear power event behavior data chain, aiming to fully record the entire process of the power event and the full cycle status of the power resources under the influence of the power event, further improving the credibility of the power event.
[0134] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps. It is understandable that the various steps in different embodiments can be freely combined as needed, and the various non-contradictory schemes formed by the combination all fall within the scope of protection of this application.
[0135] Based on the same inventive concept, the embodiments of the present application also provide a blockchain-based power event management device for implementing the aforementioned blockchain-based power event management method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of one or more blockchain-based power event management device embodiments provided below can be found in the limitations of the blockchain-based power event management method above, and will not be repeated here.
[0136] In an exemplary embodiment, Figure 8 As shown, a blockchain-based power event management device is provided, which is applied to a blockchain platform and includes:
[0137] The identifier extraction module 802 is configured to, upon receiving an event record for a power event reported by the power management system, extract the power event identifier of the power event and the resource identifier of the power resource associated with the power event from the event record;
[0138] An event record index building module 804 is used to build an event record index of a power event based on the power event identifier;
[0139] A state change index building module 806 is configured to build a state change index of the power resource based on the resource identifier when the power resource triggers a state change due to a power event;
[0140] The behavior data chain generation module 808 is used to determine the behavior data chain of the power event according to the event record index and the state change index; the behavior data chain is used to characterize the mapping relationship between the power event and the power resource.
[0141] In one embodiment, the blockchain-based power event management device is further used to: hash the event record to obtain a hash value of the event record.
[0142] In one embodiment, the event record index building module 804 is further configured to combine the power event identifier, the hash value, and the resource identifier to obtain an event record index of the power event.
[0143] In one embodiment, the state change index building module 806 is further configured to:
[0144] When the power resource triggers a state change due to a power event, obtaining resource state information of the power resource;
[0145] extracting a resource identifier of the power resource from the resource status information;
[0146] Based on the resource identifier and the power event identifier, a state change index of the power resource is constructed.
[0147] In one embodiment, the power event includes at least one target power event, the event record index includes a target event record index of the target power event, the state change index includes at least one target state change index, and the target state change index corresponds to the target event record index in a one-to-one manner; the behavior data chain generation module 808 is further configured to:
[0148] Obtaining the first index generation time of each target event record index and the second index generation time of each target state change index respectively;
[0149] Arrange the target event record indexes in sequence according to the first index generation time to obtain an event data chain, and arrange the target state change indexes in sequence according to the second index generation time to obtain a state data chain;
[0150] The event data chain and the state data chain are combined to obtain the behavior data chain.
[0151] In one embodiment, the blockchain-based power event management device is further used to:
[0152] In response to the power event query request, extracting a query identifier from the power event query request;
[0153] Perform query path matching based on the query identifier to obtain a query path that matches the query identifier;
[0154] Query the behavior data chain according to the query path to obtain the power event query results.
[0155] In one embodiment, the identification extraction module 802 is further configured to:
[0156] When receiving an event record for a power event reported by the power management system, performing a compliance check on the power event based on the event record to obtain a compliance check result of the power event;
[0157] When the compliance check result meets the compliance condition, the power event identifier of the power event is extracted from the event record.
[0158] Each module in the blockchain-based power event management device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0159] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 9 As shown. The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, memory and I / O interface are connected via a system bus, and the communication interface is connected to the system bus via the I / O interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store blockchain-based power event management data. The I / O interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, a blockchain-based power event management method is implemented.
[0160] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0161] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0162] When receiving an event record for a power event reported by the power management system, extracting a power event identifier of the power event and a resource identifier of a power resource associated with the power event from the event record;
[0163] Based on the power event identifier, an event record index of the power event is constructed;
[0164] When the power resource triggers a state change due to a power event, a state change index of the power resource is constructed based on the resource identifier;
[0165] The behavior data chain of the power event is determined according to the event record index and the state change index; the behavior data chain is used to characterize the mapping relationship between the power event and the power resource.
[0166] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0167] Perform hash processing on the event record to obtain the hash value of the event record;
[0168] Based on the power event identifier, an event record index of the power event is constructed, including:
[0169] The power event identifier, hash value and resource identifier are combined to obtain an event record index of the power event.
[0170] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0171] When the power resource triggers a state change due to a power event, obtaining resource state information of the power resource;
[0172] extracting a resource identifier of the power resource from the resource status information;
[0173] Based on the resource identifier and the power event identifier, a state change index of the power resource is constructed.
[0174] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0175] Obtaining the first index generation time of each target event record index and the second index generation time of each target state change index respectively;
[0176] Arrange the target event record indexes in sequence according to the first index generation time to obtain an event data chain, and arrange the target state change indexes in sequence according to the second index generation time to obtain a state data chain;
[0177] The event data chain and the state data chain are combined to obtain the behavior data chain.
[0178] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0179] In response to the power event query request, extracting a query identifier from the power event query request;
[0180] Perform query path matching based on the query identifier to obtain a query path that matches the query identifier;
[0181] Query the behavior data chain according to the query path to obtain the power event query results.
[0182] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0183] When receiving an event record for a power event reported by the power management system, performing a compliance check on the power event based on the event record to obtain a compliance check result of the power event;
[0184] When the compliance check result meets the compliance condition, the power event identifier of the power event is extracted from the event record.
[0185] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0186] When receiving an event record for a power event reported by the power management system, extracting a power event identifier of the power event and a resource identifier of a power resource associated with the power event from the event record;
[0187] Based on the power event identifier, an event record index of the power event is constructed;
[0188] When the power resource triggers a state change due to a power event, a state change index of the power resource is constructed based on the resource identifier;
[0189] The behavior data chain of the power event is determined according to the event record index and the state change index; the behavior data chain is used to characterize the mapping relationship between the power event and the power resource.
[0190] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0191] Perform hash processing on the event record to obtain the hash value of the event record;
[0192] Based on the power event identifier, an event record index of the power event is constructed, including:
[0193] The power event identifier, hash value and resource identifier are combined to obtain an event record index of the power event.
[0194] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0195] When the power resource triggers a state change due to a power event, obtaining resource state information of the power resource;
[0196] extracting a resource identifier of the power resource from the resource status information;
[0197] Based on the resource identifier and the power event identifier, a state change index of the power resource is constructed.
[0198] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0199] Obtaining the first index generation time of each target event record index and the second index generation time of each target state change index respectively;
[0200] Arrange the target event record indexes in sequence according to the first index generation time to obtain an event data chain, and arrange the target state change indexes in sequence according to the second index generation time to obtain a state data chain;
[0201] The event data chain and the state data chain are combined to obtain the behavior data chain.
[0202] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0203] In response to the power event query request, extracting a query identifier from the power event query request;
[0204] Perform query path matching based on the query identifier to obtain a query path that matches the query identifier;
[0205] Query the behavior data chain according to the query path to obtain the power event query results.
[0206] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0207] When receiving an event record for a power event reported by the power management system, performing a compliance check on the power event based on the event record to obtain a compliance check result of the power event;
[0208] When the compliance check result meets the compliance condition, the power event identifier of the power event is extracted from the event record.
[0209] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0210] When receiving an event record for a power event reported by the power management system, extracting a power event identifier of the power event and a resource identifier of a power resource associated with the power event from the event record;
[0211] Based on the power event identifier, an event record index of the power event is constructed;
[0212] When the power resource triggers a state change due to a power event, a state change index of the power resource is constructed based on the resource identifier;
[0213] The behavior data chain of the power event is determined according to the event record index and the state change index; the behavior data chain is used to characterize the mapping relationship between the power event and the power resource.
[0214] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0215] Perform hash processing on the event record to obtain the hash value of the event record;
[0216] Based on the power event identifier, an event record index of the power event is constructed, including:
[0217] The power event identifier, hash value and resource identifier are combined to obtain an event record index of the power event.
[0218] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0219] When the power resource triggers a state change due to a power event, obtaining resource state information of the power resource;
[0220] extracting a resource identifier of the power resource from the resource status information;
[0221] Based on the resource identifier and the power event identifier, a state change index of the power resource is constructed.
[0222] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0223] Obtaining the first index generation time of each target event record index and the second index generation time of each target state change index respectively;
[0224] Arrange the target event record indexes in sequence according to the first index generation time to obtain an event data chain, and arrange the target state change indexes in sequence according to the second index generation time to obtain a state data chain;
[0225] The event data chain and the state data chain are combined to obtain the behavior data chain.
[0226] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0227] In response to the power event query request, extracting a query identifier from the power event query request;
[0228] Perform query path matching based on the query identifier to obtain a query path that matches the query identifier;
[0229] Query the behavior data chain according to the query path to obtain the power event query results.
[0230] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0231] When receiving an event record for a power event reported by the power management system, performing a compliance check on the power event based on the event record to obtain a compliance check result of the power event;
[0232] When the compliance check result meets the compliance condition, the power event identifier of the power event is extracted from the event record.
[0233] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0234] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0235] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0236] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A power event management method based on blockchain, characterized in that: Applied to a blockchain platform, the method includes: When receiving an event record for a power event reported by the power management system, extracting a power event identifier of the power event and a resource identifier of a power resource associated with the power event from the event record; Based on the power event identifier, construct an event record index of the power event; When the power resource triggers a state change due to the power event, constructing a state change index of the power resource based on the resource identifier; A behavior data chain of the power event is determined according to the event record index and the state change index; the behavior data chain is used to characterize the mapping relationship between the power event and the power resource.
2. The method according to claim 1, characterized in that The method further comprises: Performing hash processing on the event record to obtain a hash value of the event record; The step of constructing an event record index of the power event based on the power event identifier includes: The power event identifier, the hash value, and the resource identifier are combined to obtain an event record index of the power event.
3. The method according to claim 1, characterized in that When the power resource triggers a state change due to the power event, constructing a state change index of the power resource based on the resource identifier includes: When the power resource triggers a state change due to the power event, obtaining resource state information of the power resource; extracting a resource identifier of the power resource from the resource status information; Based on the resource identifier and the power event identifier, a state change index of the power resource is constructed.
4. The method according to claim 1, wherein The power event includes at least one target power event, the event record index includes a target event record index of the target power event, the state change index includes at least one target state change index, and the target state change index corresponds to the target event record index in a one-to-one manner; The determining of the behavior data chain of the power event according to the event record index and the state change index includes: Respectively obtaining a first index generation time of each target event record index and a second index generation time of each target state change index; Arranging the target event record indexes in sequence according to the generation time of the first index to obtain an event data chain, and arranging the target state change indexes in sequence according to the generation time of the second index to obtain a state data chain; The event data chain and the state data chain are combined to obtain the behavior data chain.
5. The method according to claim 1, wherein The method further comprises: In response to a power event query request, extracting a query identifier from the power event query request; Perform query path matching based on the query identifier to obtain a query path that matches the query identifier; The behavior data chain is queried according to the query path to obtain a power event query result.
6. The method according to claim 1, characterized in that The step of extracting a power event identifier of the power event from the event record when receiving the event record for the power event reported by the power management system includes: When receiving an event record for a power event reported by the power management system, performing a compliance check on the power event based on the event record to obtain a compliance check result of the power event; In a case where the compliance check result meets the compliance condition, the power event identifier of the power event is extracted from the event record.
7. A blockchain-based power event management device, characterized in that: Applied to a blockchain platform, the device includes: an identifier extraction module, configured to, upon receiving an event record for a power event reported by the power management system, extract from the event record a power event identifier of the power event and a resource identifier of a power resource associated with the power event; An event record index building module, configured to build an event record index of the power event based on the power event identifier; a state change index building module, configured to build a state change index of the power resource based on the resource identifier when the power resource triggers a state change due to the power event; A behavior data chain generation module is used to determine the behavior data chain of the power event according to the event record index and the state change index; the behavior data chain is used to characterize the mapping relationship between the power event and the power resource.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Resource management method, resource management system, electronic device and storage medium
CN114328745A
Log recording and querying method and device, computer equipment and storage medium
CN115687505A
Streaming traceability graph real-time attack detection method and system based on label and graph alignment
CN117560228A
System and method for operational workflow transparency and end-to-end events tracking
US20230044404A1
Systems and methods for creating a reorganization-immune blockchain index using mono-increasing sequence records
US20240004851A1