Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described in this specification. Moreover, a single step described in this specification may be broken down into multiple steps in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
Blockchains are generally divided into three types: public chain (Public Blockchain), private chain (Private Blockchain), and federation chain (Consortium Blockchain). In addition, there may be various combinations of the above, such as a combination of a private chain and a federation chain, a combination of a federation chain and a public chain, and so on.
Of the three types of blockchains described above, the most decentralized is the public chain. A party joining the public chain (which may also be referred to as a node in the blockchain) may read the data records on the chain, participate in transactions, compete for accounting rights for new blocks, etc. Moreover, each node can freely join or leave the network and perform related operations.
Private chains are the opposite, with the network's write rights being controlled by an organization or organization and the data read rights being specified by the organization. That is, the private chain can be viewed as a weakly centralized system with strict restrictions on nodes and a small number of nodes. This type of blockchain is more suitable for use within a particular establishment.
The federation chain is between the public chain and the private chain, and partial decentralization can be realized. Each node in a federation chain typically has a physical organization or organization corresponding to it; the nodes are authorized to join the network and form a benefit-related alliance, and the operation of the block chain is maintained together.
In a blockchain network, nodes are logical communication entities; the different types of block chain nodes can run on the same physical server or different physical servers.
For data generated outside the blockchain, it can be constructed into a standard transaction (transaction) format supported by the blockchain and then published to the blockchain, with all nodes in the blockchain network agreeing on the transaction. After the consensus is achieved, the transaction can be persisted in the blockchain by a node in the blockchain network as a billing node.
In practical applications, whether public, private, or alliance, may provide the functionality of a smart contract (smart contract). An intelligent contract on a blockchain is a contract on a blockchain that can be executed triggered by a transaction. An intelligent contract may be defined in the form of code.
The intelligent contracts may be executed independently by each node in the blockchain network in a prescribed manner, and all execution records and related data may be saved on the blockchain. Taking a certain blockchain based on an account model as an example, an intelligent contract deployed on the blockchain is a type of blockchain account, and after a certain intelligent contract is executed, an execution record and related data can be saved in an account storage space (usually, a storage field) of the intelligent contract.
The event mechanism of the intelligent contract is a mode for the interaction between the intelligent contract and the out-of-chain entity. For intelligent contracts deployed on blockchains, direct interaction with out-of-chain entities is generally not possible; for example, the intelligent contract cannot generally send the invocation result of the intelligent contract to the invocation initiator of the intelligent contract point-to-point after the invocation is completed.
The call results (including intermediate results and final call results) generated by the intelligent contract during the call are usually recorded in the form of events (events) to the transaction log (transaction logs) of the transaction that called the intelligent contract, and stored in the memory space of the block link point. And the entity outside the chain which needs to interact with the intelligent contract can acquire the calling result of the intelligent contract by monitoring the transaction log stored in the storage space of the block chain node.
When the data volume of the data requiring uplink certificate is large, if there is not enough storage space on a single blockchain node, it is very likely to cause failure of uplink certificate of data. In addition, even if there is enough memory space on a single blockchain node, a lot of time is consumed for data synchronization between different blockchain nodes.
In order to reduce the data amount of the data for uplink certificate storage, the present specification proposes a technical solution for block chain-based data certificate storage.
In the above technical solution, the data processing platform accessing the block chain may generate, based on a data summary corresponding to source data acquired by a terminal device, an equipment identifier corresponding to the terminal device associated with an abnormal event and abnormal reporting information of event information corresponding to the abnormal event, and issue the abnormal reporting information to the block chain to further invoke a source data acquisition logic in an intelligent contract, and generate a source data acquisition request including the equipment identifier and the event information, when it is determined that the source data includes a source data segment corresponding to the abnormal event; subsequently, the data processing platform may send the source data acquisition request acquired from the block chain to the terminal device corresponding to the device identifier, the terminal device extracts a source data fragment corresponding to the abnormal event from the source data based on the event information, and sends the extracted source data fragment to the data processing platform, and the data processing platform calls a source data certification logic in an intelligent contract to perform uplink certification.
In a specific implementation, the terminal device may collect the source data in real time and generate a data summary corresponding to the collected source data. Subsequently, the terminal device may send the generated data digest to the data processing platform to trigger data storage for the source data.
The data processing platform may determine, in response to the data digest, whether the source data includes a source data segment corresponding to an abnormal event based on the data digest, when receiving the data digest corresponding to the source data collected by the terminal device and sent by the terminal device.
The data processing platform may generate the abnormal report information when the source data acquired by the terminal device includes a source data segment corresponding to the abnormal event. The abnormal reporting information may include a device identifier corresponding to the terminal device associated with the abnormal event, and event information corresponding to the abnormal event.
The data processing platform may, in response to the exception reporting information generated when the exception reporting information is generated, invoke source data acquisition logic in the intelligent contract deployed on the block chain and used for processing data, generate a source data acquisition request, and store the source data acquisition request on the block chain.
The data processing platform may obtain the source data obtaining request from the block chain, where the source data obtaining request includes a device identifier and event information. Subsequently, the data processing platform may send the source data obtaining request to the terminal device corresponding to the device identifier in the source data obtaining request.
The terminal device may extract, in response to the source data acquisition request, a source data segment corresponding to the abnormal event from the acquired source data based on the event information corresponding to the abnormal event in the source data acquisition request, when receiving the source data acquisition request. Subsequently, the terminal device may send the extracted source data segment to the data processing platform.
The data processing platform may, in a case where a source data fragment corresponding to the abnormal event and sent by the terminal device is received, call, in response to the source data fragment, a source data certification storage logic in the intelligent contract, which is deployed on the block chain and used for processing data, and perform certification storage on the block chain for the source data fragment.
By adopting the mode, on one hand, the data processing platform can trigger the uplink certificate of the source data collected by the terminal equipment under the condition that the source data is determined to comprise the source data segment corresponding to the abnormal event based on the data abstract corresponding to the source data collected by the terminal equipment, so that the uplink certificate of the source data can be prevented from being stored under the condition that the abnormal event does not occur, and the data volume of the source data of the uplink certificate can be reduced; on the other hand, because the terminal device can respond to the source data acquisition request, extract the source data segment corresponding to the abnormal event from the acquired source data based on the event information corresponding to the abnormal event, and only chain-link the source data segment for evidence storage, the source data segment for chain-link evidence storage can be guaranteed to be valid data related to the abnormal event, and the data volume of the source data for chain-link evidence storage can be reduced.
The technical means of the present description will be described in detail below.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a network environment associated with a blockchain according to an exemplary embodiment of the present disclosure.
In a network environment as shown in fig. 1, may include a client-side computing device 101, a server-side 102, and at least one blockchain system; such as blockchain system 103, blockchain system 104, and blockchain system 105.
In one embodiment shown, the client-side computing device 101, may comprise a variety of different types of client-side computing devices; for example, client-side computing devices may include devices such as PC computing devices, mobile computing devices, internet of things devices, and other forms of smart devices with certain computing capabilities, among others.
It should be noted that the client-side computing device 101 does not mean that all of the client-side computing devices are in the same communication network, but is merely a general term for the client-side computing devices.
In one embodiment shown, some of the client-side computing devices 101 may be coupled to the server-side 102 through various communication networks; for example, device 3 is coupled to server side 102.
Some of the client-side computing devices 101 may also be coupled directly to the blockchain system instead of being coupled to the server-side 102; for example, device 4 may be directly coupled to the blockchain system 103.
In one embodiment shown, the client-side computing device 101, may also include one or more user-side servers; for example, device 5 and device 6. Some of the client-side computing devices 101 may be coupled to the user-side server; for example, device 1 is coupled to device 5 and device 2 is coupled to device 6. The user-side server may be further coupled to the blockchain system directly or to the server 102 through various communication networks; for example, device 5 may be further coupled directly to the blockchain system, and device 6 is further coupled to server side 102.
In an embodiment shown, the user-side server may be implemented by a service entity that builds a user account system; the service entities may include an operator entity that provides service bearers for various online and/or offline services to users. Correspondingly, the operation entity may include an operator corresponding to the service bearer; for example, the operation entity may include an individual, an organization, a company, an enterprise, and the like that operate and manage the service carrier.
In one embodiment shown, the server side 102 may also be coupled to one or more blockchain systems through various communication networks; for example, the server side 102 is respectively coupled to the blockchain system 103, the blockchain system 104, and the blockchain system 105, and so on.
In one illustrated embodiment, the communication network may include wired and/or wireless communication networks; for example, the Network may be a Local Area Network (LAN), a Wide Area Network (WAN), the internet, or a combination thereof, which may be implemented based on a wired access Network or a wireless access Network provided by an operator (such as a mobile cellular Network).
In one embodiment, each blockchain system may maintain one or more blockchains (e.g., public blockchains, private blockchains, federation blockchains, etc.) and include a plurality of blockchain nodes for carrying the one or more blockchains; for example, a block chain node 1, a block link point 2, a block link point 3, a block link point 4, a block link point i, etc., as shown in fig. 1, may collectively carry one or more block chains. And cross-chain data access can be performed among the blockchains contained in each blockchain system and among the blockchain systems.
In one embodiment shown, the block link points may be physical devices, or may be virtual devices implemented in a server or a server cluster; for example, a block link point may be one physical host in a server cluster, or may be a virtual machine created by virtualizing hardware resources carried by a server or a server cluster based on a virtualization technology. Each blockchain node may be coupled together by various types of communication methods (e.g., TCP/IP, etc.) to form a network to carry one or more blockchains.
In one illustrated embodiment, the server 102 may include a BaaS platform (also referred to as a BaaS cloud) for providing a Blockchain Service (BaaS).
The BaaS platform may provide block chain services to client-side computing devices coupled to the BaaS platform by providing pre-written software for activities that occur on the block chain (such as subscription and notification, user authentication, database management, and remote updates).
For example, a BaaS platform may provide software such as MQ (Message Queue) services; the client-side computing device coupled with the BaaS platform can subscribe an intelligent contract deployed on a certain blockchain in a blockchain system to which the BaaS platform is coupled, and a contract event generated on the blockchain after triggering execution; and the BaaS platform can monitor the event generated on the block chain after the intelligent contract is triggered to execute, and then add the contract event into the message queue in the form of notification message based on the software related to MQ service, so that the client-side computing device subscribing the message queue can obtain the notification related to the contract event.
Referring to fig. 2, fig. 2 is a flowchart illustrating a data verification method based on a blockchain according to an exemplary embodiment of the present disclosure.
In this embodiment, the above data verification method based on a blockchain may be applied to a data processing platform accessing a blockchain.
Intelligent contracts for processing data can be deployed on the block chains.
For the data processing platform, the data processing platform may be a centralized platform outside the blockchain, and is coupled to the blockchain nodes through various communication networks, and interacts with the blockchain nodes, so that the blockchain nodes can call the intelligent contracts deployed on the blockchain to implement data storage. Or, the data processing platform may include a centralized platform outside the block chain, and a block chain node; the centralized platform and the block chain link points can be interacted, so that the block chain nodes can call intelligent contracts deployed on the block chain to realize data storage.
It should be noted that both the centralized platform and the blockchain node may be implemented by software, or may be implemented by hardware or a combination of hardware and software. In this case, the centralized platform and the block link points may be deployed on different facilities, or may be deployed on the same facility.
In conjunction with the network environment shown in fig. 1, the data processing platform may be deployed on the server side 102; alternatively, the data processing platform may include the server 102 and a whole formed by the blockchain link points in the blockchain system 103; this is not limited by the present description.
As shown in fig. 2, the above data verification method based on a blockchain may include the following steps:
step 201: and receiving a data summary which is sent by the terminal equipment and corresponds to the collected source data, and determining whether the source data comprises a source data segment corresponding to the abnormal event or not based on the data summary.
In practical application, the terminal device may specifically be an intelligent terminal device such as a smart phone, a tablet computer, a notebook computer, a wearable device, a vehicle-mounted intelligent terminal, and an intelligent home device.
The terminal devices are generally equipped with sensors, for example: the sensor can collect sensing data in real time or periodically, and upload the collected sensing data to a Central Processing Unit (CPU) of the terminal device, so that the terminal device records the sensing data collected by the sensor.
Alternatively, the CPU of the terminal device may acquire hardware operation data such as a CPU operation speed, a memory read-write speed, and the like, and software log data generated by an APP (Application) deployed on the terminal device during an operation process, and store the acquired hardware operation data and the acquired software log data.
In practical applications, data such as the sensing data, the hardware operating data, or the software log data may be regarded as source data collected by the terminal device. Moreover, the source data collected by the terminal device can be stored for facilitating the subsequent corresponding business processing by using the source data which has been stored for certification, for example: data tracing, anomaly detection, fault repair and the like.
In this embodiment, the terminal device may collect the source data in real time and generate a data summary corresponding to the collected source data.
In order to reduce the data amount of the source data corresponding to the generated data summary and facilitate data processing on the data summary, the terminal device may periodically generate the data summary corresponding to the acquired source data according to a preset time period, where the data summary may include the data summary corresponding to the source data acquired within a time period. For example, assuming that the time period is 5 minutes, the terminal device starts collecting source data from 19.
In this embodiment, in a case that a data digest corresponding to the collected source data is generated, the terminal device may send the generated data digest to the data processing platform, so as to trigger uplink storage of the source data collected by the terminal device.
In order to reduce the number of data transmission times with the data processing platform, the terminal device may periodically transmit the generated data digest to the data processing platform according to a preset time period, and the transmitted data digest may include the data digest generated within a time period.
In this embodiment, when receiving a data digest corresponding to source data collected by the terminal device and sent by the terminal device, the data processing platform may determine, in response to the data digest, based on the data digest, whether the source data includes a source data segment corresponding to an abnormal event.
In practical applications, the abnormal event may include an abnormal event that occurs during the running process of software deployed on the terminal device or hardware mounted on the terminal device, for example: the CPU temperature of the terminal device is too high, the memory read-write speed of the terminal device is too low, the APP running on the terminal device is crashed, the communication between the terminal device and other terminal devices is interrupted, and the like, which can be specifically set according to actual needs, and this specification does not limit this.
For the data summary corresponding to the source data, the data processing platform may determine the specific content of the source data by performing data analysis on the data summary. In this case, the data processing platform may determine whether the source data includes a source data segment corresponding to the abnormal event based on the data digest, that is, determine the specific content of the source data by performing data analysis on the data digest, and determine whether the source data includes a source data segment corresponding to the abnormal event according to the specific content of the source data.
In one embodiment, when determining whether the source data includes a source data segment corresponding to an abnormal event, it may be specifically determined whether the source data includes a source data segment corresponding to an abnormal event that has occurred, and/or whether the source data includes a source data segment corresponding to an occurrence trend of an abnormal event.
In practical application, according to actual requirements, a corresponding abnormal event detection rule may be set for each abnormal event that may occur, so as to perform abnormal event detection on the source data based on the abnormal event detection rule, and determine whether the source data includes a source data segment corresponding to the abnormal event.
For example, the abnormal event detection rule set for the CPU temperature of the terminal device being too high may include: when the CPU temperature in the source data is detected to exceed a safety threshold value all the time within a period of time, determining that the abnormal event occurs, wherein a source data segment in the period of time is a source data segment corresponding to the occurred abnormal event in the source data; when the CPU temperature in the source data is detected to be gradually increased within a period of time and the difference value between the CPU temperature and the safety threshold is small, determining that the abnormal event trend occurs, wherein the source data segment in the period of time is the source data segment corresponding to the abnormal event trend in the source data.
For another example, the abnormal event detection rule set for the APP running crash on the terminal device may include: when detecting that related content of restarting after error reporting of the APP exists in the source data, determining that the abnormal event occurs, wherein a source data segment which shows that the restarting after error reporting of the APP is the source data segment corresponding to the occurred abnormal event in the source data; when detecting that related content of the APP which has errors repeatedly reported but is not restarted exists in the source data and the number of times reaches a restart threshold, determining that a trend of the abnormal event occurs, wherein a source data segment which indicates that the APP has errors repeatedly reported but is not restarted each time is a source data segment corresponding to the occurrence trend of the abnormal event in the source data.
It should be noted that, in the case that the data processing platform is a centralized platform outside the block chain, thestep 201 may be executed by the data processing platform. In the case that the data processing platform includes a centralized platform outside the blockchain and a blockchain node, thestep 201 may be performed by a centralized platform in the data processing platform.
Step 202: if yes, generating abnormal reporting information, and issuing the abnormal reporting information to the block chain; the abnormal reporting information includes a device identifier corresponding to the terminal device associated with the abnormal event and event information corresponding to the abnormal event.
In this embodiment, the data processing platform may generate the exception report information and issue the exception report information to the block chain when it is determined that the source data acquired by the terminal device includes the source data segment corresponding to the exception event.
The abnormal reporting information may include a device identifier corresponding to the terminal device associated with the abnormal event, and event information corresponding to the abnormal event. The device identifier may be used to specify the terminal device, and the event information may be used to specify the source data segment collected by the terminal device.
That is, the terminal device may extract, from the collected source data, a source data segment corresponding to the abnormal event based on the event information corresponding to the abnormal event.
In an embodiment shown, since the event information is used to specify a source data segment collected by the terminal device, in order to facilitate the terminal device to extract the source data segment corresponding to the abnormal event from the collected source data based on the event information corresponding to the abnormal event, the event information may specifically include information such as an event type and/or an event occurrence range. In this case, the terminal device may extract, according to the event type and/or the event occurrence range, source data belonging to the event type and within the event occurrence range from the collected source data, where the source data constitutes a source data segment corresponding to the abnormal event.
Further, in one embodiment, the event occurrence range may specifically include a time range and/or a space range of the event occurrence. In addition, the event occurrence range may also include ranges of other dimensions of event occurrence, and may be specifically set according to actual requirements, which is not limited in this specification.
In practical applications, there may be a plurality of terminal devices associated with one abnormal event, or there may be only one terminal device. For example, the terminal devices associated with an abnormal event of a communication interruption between the terminal device a and the terminal device B may include the terminal device a and the terminal device B. For another example, the terminal device associated with an abnormal event in which the CPU temperature of the terminal device a is too high is only the terminal device a.
When it is determined that the source data acquired by the terminal device includes a source data segment corresponding to an abnormal event, the data processing platform may further determine the terminal device associated with the abnormal event and determine a device identifier corresponding to the associated terminal device, and may further determine event information corresponding to the abnormal event, so that the abnormal report information may be generated based on the device identifier corresponding to the terminal device associated with the abnormal event and the event information corresponding to the abnormal event.
It should be noted that, in the case that the data processing platform is a centralized platform outside the block chain, thestep 202 may be executed by the data processing platform. In the case where the data processing platform includes a centralized platform outside the blockchain and a blockchain node,step 202 may be performed by a centralized platform in the data processing platform.
Step 203: calling source data acquisition logic in the intelligent contract, and generating a source data acquisition request on the block chain; wherein the source data acquisition request includes the device identification and the event information.
In this embodiment, when the data processing platform generates the exception report information, the data processing platform may invoke, in response to the exception report information, a source data obtaining logic in the intelligent contract, which is deployed on the block chain and used for processing data, and generate a source data obtaining request on the block chain.
The abnormal reporting information includes a device identifier corresponding to the terminal device associated with the abnormal event and event information corresponding to the abnormal event, and accordingly, the source data acquisition request may include the device identifier and the event information.
In the illustrated embodiment, in order to further reduce the data volume of the uplink certified data, for an abnormal event associated with a plurality of terminal devices, only the source data segment corresponding to the abnormal event collected by the terminal device associated with the abnormal event may be uplink certified.
The one terminal device may be any one of the plurality of terminal devices associated with the abnormal event, or may be a main terminal device of the plurality of terminal devices associated with the abnormal event. Taking an abnormal event of communication interruption between the terminal equipment a and the terminal equipment B as an example, only the source data segment collected by the terminal equipment a and corresponding to the abnormal event may be uplinked for storage, or only the source data segment collected by the terminal equipment B and corresponding to the abnormal event may be uplinked for storage; or, assuming that the abnormal event is caused by a network card failure of the terminal device a, the terminal device a may be regarded as a main terminal device, and only the source data segment corresponding to the abnormal event, which is acquired by the terminal device a, is uploaded with the certificate.
Specifically, the exception reporting information may include device identifiers respectively corresponding to at least one terminal device associated with the exception event, and event information corresponding to the exception event. In this case, the source data obtaining request may include a device identifier corresponding to any terminal device (which may be referred to as a target terminal device) of the at least one terminal device and the event information.
It should be noted that, in the case that the data processing platform is a centralized platform outside the block chain, the data processing platform may construct, based on the abnormal reporting information, a transaction supported by the block chain and used for invoking an intelligent contract, and send the transaction to a block chain node, so that the block chain node may invoke a source data acquisition logic in the intelligent contract in response to the transaction, and generate a source data acquisition request on the block chain.
Under the condition that the data processing platform comprises a centralized platform outside the block chain and a block chain node, the centralized platform can construct a transaction supported by the block chain and used for calling an intelligent contract based on the abnormal reporting information, and forward the transaction to the block chain link point in the data processing platform, so that the block chain link point can respond to the transaction, call source data acquisition logic in the intelligent contract, and generate a source data acquisition request on the block chain.
The source data acquisition request can be used as a calling result generated in the calling process of the intelligent contract, and is recorded to a transaction log of the transaction calling the intelligent contract in the form of an event and stored in a storage space of a block link point.
Step 204: and acquiring the source data acquisition request from the block chain, sending the source data acquisition request to the terminal equipment corresponding to the equipment identifier, so that the terminal equipment extracts a source data fragment corresponding to the abnormal event from the acquired source data based on the event information, and sends the extracted source data fragment to the data processing platform.
In this embodiment, since the source data obtaining request is certified on the blockchain, the data processing platform may obtain the source data obtaining request from the blockchain, where the source data obtaining request includes a device identifier and event information. Subsequently, the data processing platform may send the source data obtaining request to the terminal device corresponding to the device identifier in the source data obtaining request.
It should be noted that, in the case that the data processing platform is a centralized platform outside the block chain, according to the event mechanism of the intelligent contract, the data processing platform may acquire the invocation result of the intelligent contract by monitoring the transaction log stored in the storage space of the block chain node, acquire the source data acquisition request from the block chain, and send the source data acquisition request to the corresponding terminal device.
Under the condition that the data processing platform comprises a centralized platform outside the block chain and a block chain node, according to the event mechanism of the intelligent contract, the centralized platform in the data processing platform can acquire the calling result of the intelligent contract by monitoring the transaction log stored in the storage space of the block chain node, acquire the source data acquisition request from the block chain, and send the source data acquisition request to the corresponding terminal equipment.
In this embodiment, when receiving the source data acquisition request, the terminal device may extract, in response to the source data acquisition request, a source data segment from the acquired source data based on event information in the source data acquisition request. The event information is the event information corresponding to the abnormal event, and the extracted source data segment is the source data segment corresponding to the abnormal event. Subsequently, the terminal device may send the extracted source data segment to the data processing platform.
In an embodiment shown, in a case that the source data obtaining request includes the device identifier corresponding to the target terminal device and the event information, the data processing platform may send the source data obtaining request to the target terminal device, extract, by the target terminal device, a source data fragment from the collected source data based on the event information in the source data obtaining request, and send the extracted source data fragment to the data processing platform.
Step 205: and calling a source data evidence storing logic in the intelligent contract, and storing the extracted source data fragments on the block chain.
In this embodiment, when receiving a source data fragment corresponding to the abnormal event and sent by the terminal device, the data processing platform may invoke, in response to the source data fragment, source data certification logic in the intelligent contract deployed on the block chain for processing data, and certify the source data fragment on the block chain.
In an embodiment shown in the present invention, in order to ensure correctness of uplink certified data, the data processing platform may invoke a source data certification logic in the intelligent contract, and determine whether a source data segment corresponding to the abnormal event and sent by the terminal device is matched with the abnormal reporting information for the abnormal event, that is, determine whether the source data segment is a source data segment corresponding to the abnormal event, and if so, perform certification on the block chain for the source data segment.
In practical application, in order to reduce the complexity of processing the source data such as verification, storage and the like, the data processing platform may perform collection, format conversion, packaging and the like on data digests and source data fragments sent by different terminal devices, so as to form structured data in a unified data format.
It should be noted that, in the case that the data processing platform is a centralized platform outside the blockchain, the data processing platform may construct, based on the source data fragment, a transaction supported by the blockchain and used for invoking an intelligent contract, and send the transaction to a blockchain node, so that the blockchain node may invoke source data certification logic in the intelligent contract in response to the transaction, and certify the source data fragment on the blockchain.
In a case that the data processing platform includes a centralized platform outside the blockchain and a blockchain node, the centralized platform may construct, based on the source data fragment, a transaction supported by the blockchain and used for invoking an intelligent contract, and forward the transaction in the data processing platform to the blockchain node, so that the blockchain node may invoke a source data evidence storage logic in the intelligent contract in response to the transaction, and store the source data fragment on the blockchain.
Referring to fig. 3, fig. 3 is a flowchart illustrating another block chain-based data verification method according to an exemplary embodiment of the present disclosure.
In this embodiment, the data evidence storage method based on the block chain may be applied to a terminal device.
Intelligent contracts for processing data can be deployed on the block chains.
In conjunction with the network environment shown in fig. 1, the terminal device may be the device 3 or the device 6, which is not limited in this specification.
As shown in fig. 3, the above data verification method based on a blockchain may include the following steps:
step 301: source data is collected, and a data summary corresponding to the source data is generated.
Step 302: and sending the data summary to a data processing platform accessed to the block chain, so that when the data processing platform determines that the source data comprises a source data segment corresponding to an abnormal event based on the data summary, the data processing platform generates abnormal reporting information comprising a device identifier corresponding to a terminal device associated with the abnormal event and event information corresponding to the abnormal event, and issues the abnormal reporting information to the block chain to call a source data acquisition logic in the intelligent contract, and generates a source data acquisition request comprising the device identifier and the event information on the block chain.
Step 303: and receiving the source data acquisition request acquired and sent by the data processing platform from the block chain.
Step 304: and extracting a source data fragment corresponding to the abnormal event from the source data based on the event information, and sending the extracted source data fragment to the data processing platform, so that the data processing platform calls a source data evidence storage logic in the intelligent contract and stores the extracted source data fragment on the block chain.
For a specific implementation of the data evidence storing method based on the block chain shown in fig. 3, reference may be made to the data evidence storing method based on the block chain shown in fig. 2, which is not described herein again.
It should be noted that, for the terminaldevice executing steps 301 to 302, if the device identifier in the source data acquisition request generated by the smart contract instep 302 is the device identifier corresponding to the terminal device, the terminal device may continue to executesteps 303 to 304; if the device identifier in the source data acquisition request generated by the smart contract instep 302 is not the device identifier corresponding to the terminal device, the terminal device will not receive the source data acquisition request, and steps 303 to 304 will not be executed.
In the above technical solution, the data processing platform accessing the block chain may generate, based on a data summary corresponding to source data acquired by a terminal device, an equipment identifier corresponding to the terminal device associated with an abnormal event and abnormal reporting information of event information corresponding to the abnormal event, and issue the abnormal reporting information to the block chain to further invoke a source data acquisition logic in an intelligent contract, and generate a source data acquisition request including the equipment identifier and the event information, when it is determined that the source data includes a source data segment corresponding to the abnormal event; subsequently, the data processing platform may send the source data acquisition request acquired from the block chain to the terminal device corresponding to the device identifier, the terminal device extracts a source data fragment corresponding to the abnormal event from the source data based on the event information, and sends the extracted source data fragment to the data processing platform, and the data processing platform calls a source data evidence logic in the intelligent contract to perform uplink evidence storage.
By adopting the mode, on one hand, the data processing platform can trigger the uplink certificate of the source data collected by the terminal equipment under the condition that the source data is determined to comprise the source data segment corresponding to the abnormal event based on the data abstract corresponding to the source data collected by the terminal equipment, so that the uplink certificate of the source data can be prevented from being stored under the condition that the abnormal event does not occur, and the data volume of the source data of the uplink certificate can be reduced; on the other hand, because the terminal device can respond to the source data acquisition request, extract the source data segment corresponding to the abnormal event from the acquired source data based on the event information corresponding to the abnormal event, and only chain-link the source data segment for evidence storage, the source data segment for chain-link evidence storage can be guaranteed to be valid data related to the abnormal event, and the data volume of the source data for chain-link evidence storage can be reduced.
Corresponding to the foregoing embodiments of the data evidence storing method based on a blockchain, the present specification also provides embodiments of a data evidence storing apparatus based on a blockchain.
The embodiment of the data evidence storing device based on the block chain can be applied to the electronic equipment. The apparatus embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. In terms of hardware, as shown in fig. 4, the present specification is a hardware structure diagram of an electronic device where a data evidence storage apparatus based on a block chain is located, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 4, the electronic device where the apparatus is located in the embodiment may also include other hardware according to an actual function of the data evidence storage apparatus based on the block chain, which is not described again.
Referring to fig. 5, fig. 5 is a block diagram illustrating a data evidence storage apparatus based on a blockchain according to an exemplary embodiment of the present disclosure.
The data evidence storage device based on the block chain can be applied to the electronic equipment shown in fig. 4; the electronic device may serve as a data processing platform that accesses the blockchain.
And intelligent contracts used for processing data are deployed on the blockchains.
The device comprises:
areceiving module 501, configured to receive a data summary corresponding to acquired source data sent by a terminal device, and determine whether the source data includes a source data segment corresponding to an abnormal event based on the data summary;
afirst generating module 502, configured to generate exception reporting information if the block chain exists, and issue the exception reporting information to the block chain; the abnormal reporting information comprises a device identifier corresponding to the terminal device associated with the abnormal event and event information corresponding to the abnormal event;
asecond generating module 503, configured to invoke source data obtaining logic in the intelligent contract, and generate a source data obtaining request on the block chain; wherein the source data acquisition request includes the device identification and the event information;
an obtainingmodule 504, configured to obtain the source data obtaining request from the block chain, and send the source data obtaining request to a terminal device corresponding to the device identifier, so that the terminal device extracts, based on the event information, a source data segment corresponding to the abnormal event from the acquired source data, and sends the extracted source data segment to the data processing platform;
and theevidence storing module 505 is configured to invoke source data evidence storing logic in the intelligent contract, and store the extracted source data segment on the block chain.
Optionally, the receivingmodule 501 is specifically configured to:
determining whether the source data includes a source data segment corresponding to an occurred exceptional event; and/or the presence of a gas in the gas,
determining whether the source data comprises a source data segment corresponding to an occurrence trend of an exceptional event.
Optionally, the exception reporting information includes device identifiers respectively corresponding to at least one terminal device associated with the exception event, and event information corresponding to the exception event; the source data acquisition request comprises a device identifier corresponding to any target terminal device in the at least one terminal device and the event information;
the obtainingmodule 504 is specifically configured to:
and sending the source data acquisition request to the target terminal equipment so that the target terminal equipment extracts a source data segment corresponding to the abnormal event from the acquired source data based on the event information, and sends the extracted source data segment to the data processing platform.
Optionally, theevidence storing module 505 is specifically configured to:
calling source data evidence storage logic in the intelligent contract, and determining whether the extracted source data fragments are matched with the abnormal reported information;
and if so, storing the source data segment on the block chain.
Optionally, the event information includes an event type and/or an event occurrence range.
Optionally, the event occurrence range includes a temporal range and/or a spatial range of event occurrences.
Referring to fig. 6, fig. 6 is a block diagram illustrating a data evidence storage apparatus based on a blockchain according to an exemplary embodiment of the present disclosure.
The data evidence storage device based on the block chain can be applied to the electronic equipment shown in fig. 4; the electronic device may be a terminal device.
And the intelligent contract used for processing the data is deployed on the block chain.
The device comprises:
thegeneration module 601 is configured to collect source data and generate a data summary corresponding to the source data;
a sendingmodule 602, configured to send the data digest to a data processing platform accessing the block chain, so that when determining that the source data includes a source data segment corresponding to an abnormal event based on the data digest, the data processing platform generates abnormal reporting information including a device identifier corresponding to a terminal device associated with the abnormal event and event information corresponding to the abnormal event, and issues the abnormal reporting information to the block chain to call a source data acquisition logic in the intelligent contract, and generates a source data acquisition request including the device identifier and the event information on the block chain;
areceiving module 603, configured to receive the source data acquisition request acquired and sent by the data processing platform from the block chain;
and aevidence storing module 604, configured to extract a source data fragment corresponding to the abnormal event from the source data based on the event information, and send the extracted source data fragment to the data processing platform, so that the data processing platform invokes a source data evidence storing logic in the intelligent contract, and stores the extracted source data fragment on the block chain.
Optionally, the event information includes an event type and/or an event occurrence range.
Optionally, the event occurrence range includes a temporal range and/or a spatial range of event occurrences.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points.
The above-described embodiments of the apparatus are merely illustrative, and the modules described as separate components may or may not be physically separate, and the components displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the technical solution in this specification.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
The above description is intended only to be exemplary of the one or more embodiments of the present disclosure, and should not be taken as limiting the one or more embodiments of the present disclosure, as any modifications, equivalents, improvements, etc. that come within the spirit and scope of the one or more embodiments of the present disclosure are intended to be included within the scope of the one or more embodiments of the present disclosure.