CN111400316A - Data acquisition method and device, storage medium and electronic device - Google Patents

Data acquisition method and device, storage medium and electronic device Download PDF

Info

Publication number
CN111400316A
CN111400316A CN202010145007.8A CN202010145007A CN111400316A CN 111400316 A CN111400316 A CN 111400316A CN 202010145007 A CN202010145007 A CN 202010145007A CN 111400316 A CN111400316 A CN 111400316A
Authority
CN
China
Prior art keywords
sensor detection
detection data
data
distributed storage
record information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202010145007.8A
Other languages
Chinese (zh)
Inventor
徐小丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Minglue Artificial Intelligence Group Co Ltd
Original Assignee
Shanghai Minglue Artificial Intelligence Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Minglue Artificial Intelligence Group Co Ltd filed Critical Shanghai Minglue Artificial Intelligence Group Co Ltd
Priority to CN202010145007.8A priority Critical patent/CN111400316A/en
Publication of CN111400316A publication Critical patent/CN111400316A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data acquisition method, a data acquisition device, a storage medium and an electronic device. The method comprises the following steps: under the condition that an acquisition instruction for requesting to acquire sensor detection data is detected, acquiring record information corresponding to the sensor detection data in a block chain ledger, wherein the record information at least comprises a check code of the sensor detection data; the method comprises the steps that record information is checked in a plurality of distributed storage nodes corresponding to a block chain ledger, and a check result of each distributed storage node is obtained, wherein the block chain ledger distributes the record information to the plurality of distributed storage nodes for storage; and under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data. The invention can improve the data acquisition reliability.

Description

Data acquisition method and device, storage medium and electronic device
Technical Field
The invention relates to the field of computers, in particular to a data acquisition method, a data acquisition device, a storage medium and an electronic device.
Background
At present, with the continuous progress of the internet of things technology, data acquisition through internet of things equipment is widely applied to various technical fields, for example, in the process of information construction of a farm, the internet of things equipment can be used for acquiring breeding data and the like.
Generally, after data is collected by using the internet of things device, the data can be stored, and specifically, the data can be stored in a designated position, such as the data is stored in a computer, or the data is stored in an external storage medium. However, these data can often be tampered with by entering a storage medium inside or outside the computer to perform corresponding read and write operations. If the data is acquired after the data is tampered, a user cannot distinguish whether the data is tampered, so that the acquired data is unreliable.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a data acquisition method, a data acquisition device, a storage medium and an electronic device, which are used for at least improving the reliability of data acquisition.
According to an aspect of an embodiment of the present invention, there is provided a data acquisition method, including: under the condition that an acquisition instruction for requesting to acquire sensor detection data is detected, acquiring record information corresponding to the sensor detection data in a block chain ledger, wherein the record information at least comprises a check code of the sensor detection data; verifying the record information in a plurality of distributed storage nodes corresponding to the block chain ledger to obtain a verification result of each distributed storage node, wherein the block chain ledger distributes the record information to the plurality of distributed storage nodes for storage; and under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data.
According to another aspect of the embodiments of the present invention, there is also provided a data acquisition apparatus, including: a first obtaining unit, configured to, when an obtaining instruction for requesting to obtain sensor detection data is detected, obtain record information corresponding to the sensor detection data in a blockchain ledger, where the record information at least includes a check code of the sensor detection data; a second obtaining unit, configured to verify the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger, and obtain a verification result of each of the distributed storage nodes, where the blockchain ledger distributes the record information to the plurality of distributed storage nodes for storage; and the output unit is used for marking the sensor detection data as reliable data and outputting the sensor detection data under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number.
According to still another aspect of the embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is configured to execute the above data acquisition method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the data acquisition method through the computer program.
In the embodiment of the invention, under the condition that an acquisition instruction for requesting to acquire the sensor detection data is detected, record information corresponding to the sensor detection data is acquired in the blockchain ledger, wherein the record information at least comprises a check code of the sensor detection data; the method comprises the steps that record information is checked in a plurality of distributed storage nodes corresponding to a block chain ledger, and a check result of each distributed storage node is obtained, wherein the block chain ledger distributes the record information to the plurality of distributed storage nodes for storage; and under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data. According to the process, when the sensor detection data are acquired, the plurality of distributed storage nodes in the block chain ledger can be used for verifying the record information of the sensor detection data, and the sensor detection data are reliable as long as the distributed storage nodes exceeding the target number are successfully verified, so that the reliable sensor detection data are output, and the reliability of data acquisition is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of a network environment for an alternative data acquisition method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of an alternative data acquisition method according to an embodiment of the present invention;
FIG. 3 is a flow diagram of an alternative data acquisition method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart diagram of an alternative method of storing sensor test data in accordance with an embodiment of the present invention;
FIG. 5 is a schematic diagram of an alternative data acquisition device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, a data acquisition method is provided, and optionally, as an optional implementation manner, the data acquisition method may be applied, but not limited, to a data acquisition system in a network environment as shown in fig. 1, where the data acquisition system includes a sensor 102, a network 110, and a server 112. The sensor 102 includes a processor 104 and a memory 106, the memory 106 may store data collected by the sensor 102, and the processor 104 may perform a fragmentation operation and an encryption operation on the data, and send the data after the encryption operation to the server 112 through the network 110. Server 112 includes a database 114 and a processing engine 116. The database 114 may be a database for copying, sharing and synchronizing digital data among network members, and the data stored in the database 114 may be distributed and stored in a plurality of distributed storage nodes, i.e., a plurality of sites in the network. Further, the processing engine 116 may check the recorded information in a plurality of distributed storage nodes corresponding to the database 114 to obtain a check result of each distributed storage node, where the check result may be a check success or a check failure, and if the check result indicates that the number of distributed storage nodes that are checked successfully reaches the target number, mark the sensor detection data that needs to be obtained as reliable data and output the reliable data. Specifically, the following steps may be performed:
s101, the sensor 102 sends sensor detection data to a network 110;
s102, the network 110 sends the sensor detection data to the server 114;
s103, the server 114 stores the sensor detection data;
s104, under the condition that the server 114 detects an acquisition instruction for requesting to acquire the sensor detection data, acquiring record information corresponding to the sensor detection data in the blockchain ledger, wherein the record information at least comprises a check code of the sensor detection data;
s105, the server 114 checks the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger to obtain a check result of each distributed storage node, wherein the blockchain ledger distributes the record information to the plurality of distributed storage nodes for storage;
s106, the server 114 marks the sensor detection data as reliable data and outputs the reliable data when determining that the distributed storage nodes in the acquired verification result that are the target verification result reach the target number.
In an embodiment of the present invention, the sensor 102 may perform sensor detection data acquisition, where the acquired sensor detection data may include, but is not limited to, feature data of cultured organisms, human body sign data, and the like, and is not limited in the embodiment of the present invention. After the sensor 102 collects the sensor detection data, the sensor detection data may be sent to the server 114 through the network 110, wherein if the sensor 102 is directly connected to the server 114, the sensor 102 may also directly send the sensor detection data to the server 114 without going through the network 110. The server 114 may store the sensor detection data by using a blockchain technique, that is, store the data in a distributed manner in a plurality of distributed storage nodes corresponding to the blockchain ledger. Optionally, to ensure data security, the sensor 102 may encrypt the collected sensor detection data and send the encrypted sensor detection data to the server 114 for storage. After the server 114 stores the sensor detection data, if the sensor detection data needs to be acquired, an acquisition instruction for acquiring the sensor detection data may be sent to the server 114, and in a case that the server 114 receives the acquisition instruction, record information corresponding to the sensor detection data may be acquired in the blockchain ledger, where the record information at least includes a check code of the sensor detection data, and the check code is used for verifying the record information by the plurality of distributed storage nodes. The check code may be a hash value corresponding to an encryption key when the sensor detection data is encrypted. When the sensor detection data is stored, the plurality of distributed storage nodes store the record information, that is, each distributed storage node stores a corresponding hash value, and if the sensor detection data stored in the distributed storage nodes is tampered after the sensor detection data is stored, the hash value stored in the distributed storage node is changed, so that whether the hash value in the record information of the distributed storage node is the previous hash value is checked, and the check of the record information by the distributed storage node can be realized. And if the number of the successfully checked distributed storage nodes reaches the target number, determining that the sensor detection data is not tampered, and marking the sensor detection data as reliable data and outputting the reliable data. The target number may be the total number of the distributed storage nodes multiplied by a preset proportional value, for example, the total number of the distributed storage nodes multiplied by ninety-nine percent, and if verification of the ninety-nine percent distributed storage nodes is successful, it is stated that the sensor detection data is reliable.
In the embodiment of the invention, under the condition that an acquisition instruction for requesting to acquire the sensor detection data is detected, record information corresponding to the sensor detection data is acquired in the blockchain ledger, wherein the record information at least comprises a check code of the sensor detection data; the method comprises the steps that record information is checked in a plurality of distributed storage nodes corresponding to a block chain ledger, and a check result of each distributed storage node is obtained, wherein the block chain ledger distributes the record information to the plurality of distributed storage nodes for storage; and under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data. According to the process, when the sensor detection data are acquired, the plurality of distributed storage nodes in the block chain ledger can be used for verifying the record information of the sensor detection data, and the sensor detection data are reliable as long as the distributed storage nodes exceeding the target number are successfully verified, so that the reliable sensor detection data are output, and the reliability of data acquisition is improved.
Optionally, in this embodiment, the sensor may be, but is not limited to, a wearable device with a sensor function, a culture data acquisition sensor, and the like, and is not limited in this embodiment of the present invention. The server and the sensor may realize data interaction through a network, and the network may include, but is not limited to, a wireless network or a wired network. Wherein, this wireless network includes: bluetooth, WIFI, and other networks that enable wireless communication. Such wired networks may include, but are not limited to: wide area networks, metropolitan area networks, and local area networks. The above is merely an example, and this is not limited in this embodiment.
Optionally, as an optional implementation manner, as shown in fig. 2, the data obtaining method may include:
s201, under the condition that an acquisition instruction for requesting to acquire sensor detection data is detected, acquiring record information corresponding to the sensor detection data in a block chain ledger, wherein the record information at least comprises a check code of the sensor detection data;
s202, verifying the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger to obtain a verification result of each distributed storage node, wherein the blockchain ledger distributes the record information to the plurality of distributed storage nodes for storage;
s203, under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data.
In the embodiment of the invention, the sensor detection data is data uploaded and stored by the sensor, for example, the sensor applied in the culture field can collect the characteristic data of cultured organisms and upload the data to the server for storage at regular intervals. The storage mode of the detection data of the sensors in the embodiment of the invention depends on the block chain technology. And storing record information corresponding to the sensor detection data in a plurality of distributed storage nodes corresponding to the blockchain ledger by using a blockchain technology, wherein the record information contains a check code of the sensor detection data, the check code is used for verifying data tampering, and if the check code is detected to be changed under the condition of acquiring the sensor detection data, the current sensor detection data is proved to be tampered. Specifically, the check code may be a fixed-length and unrepeatable character string generated by an encryption key for detecting data by a sensor, such as a hash value corresponding to the encryption key, but may also be other check codes used for data verification, which is not limited in the embodiment of the present invention. After the sensor detection data is stored in the server, the user may send an acquisition instruction for requesting acquisition of the sensor detection data to the server if the user needs to acquire the sensor detection data, and after the server acquires the acquisition instruction, the server may acquire record information corresponding to the sensor detection data in the blockchain ledger. For example, a user needs to acquire target sensor detection data uploaded in a target time period, at this time, an acquisition instruction is sent to the server, the server responds to the acquisition instruction, record information corresponding to the target sensor detection data can be acquired in the blockchain ledger, and the record information can also include parameters such as uploading time and data format of the target sensor detection data. Further, whether the corresponding record is tampered or not can be determined in the distributed storage nodes corresponding to the blockchain ledger according to the record information, or whether the corresponding record is abnormal or not can be detected, so that the record information can be verified by the distributed storage nodes corresponding to the blockchain ledger, a verification result of each distributed storage node is obtained, and the verification result can be a verification success or a verification failure. And if the verification result is that the number of the successfully verified distributed storage nodes reaches the target number, the sensor detection data can be marked as reliable data, and the sensor detection data is output. If the verification result is that the number of the distributed storage nodes which are successfully verified does not reach the target number, it is indicated that the sensor detection data may be tampered, optionally, the sensor detection data may be marked as unreliable data, further optionally, the recorded information of the unreliable data may be output, and the recorded information of the unreliable data includes both the recorded information of the distributed storage nodes which are successfully verified and the recorded information of the distributed storage nodes which are failed to be verified.
It should be noted that the blockchain ledger may be a database for copying, sharing and synchronizing digital data among network members, and data storage is implemented by using the blockchain ledger, and data needs to be stored in multiple sites of a network in a distributed manner, that is, data needs to be stored in multiple distributed storage nodes in a distributed manner. By storing data in this manner, an auditable history may be provided using the synchronous database system, and each distributed storage node may be used to perform data audits.
In the embodiment of the invention, under the condition that an acquisition instruction for requesting to acquire the sensor detection data is detected, record information corresponding to the sensor detection data is acquired in the blockchain ledger, wherein the record information at least comprises a check code of the sensor detection data; the method comprises the steps that record information is checked in a plurality of distributed storage nodes corresponding to a block chain ledger, and a check result of each distributed storage node is obtained, wherein the block chain ledger distributes the record information to the plurality of distributed storage nodes for storage; and under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data. According to the process, when the sensor detection data are acquired, the plurality of distributed storage nodes in the block chain ledger can be used for verifying the record information of the sensor detection data, and the sensor detection data are reliable as long as the distributed storage nodes exceeding the target number are successfully verified, so that the reliable sensor detection data are output, and the reliability of data acquisition is improved.
Optionally, as another optional implementation, as shown in fig. 3, the data obtaining method may include:
s301, acquiring sensor detection data uploaded by a sensor;
s302, encrypting the sensor detection data to obtain encrypted sensor detection data;
s303, adding a hash value generated by an encryption key of the encryption operation and encrypted sensor detection data to record information of the blockchain ledger so that a plurality of distributed storage nodes corresponding to the blockchain ledger store the record information, wherein the hash value is a check code of the sensor detection data;
s304, under the condition that an acquisition instruction for requesting to acquire the sensor detection data is detected, acquiring record information corresponding to the sensor detection data in the block chain ledger, wherein the record information at least comprises a check code of the sensor detection data;
s305, verifying the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger to obtain a verification result of each distributed storage node, wherein the blockchain ledger distributes the record information to the plurality of distributed storage nodes for storage;
s306, under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data.
In the embodiment of the invention, the sensor detection data uploaded by the sensor can be encrypted, so that the security of the data in the process of uploading the data to the server is improved, wherein optionally, the mode of acquiring the sensor detection data uploaded by the sensor can be that a data uploading instruction is periodically sent to the sensor, so that the sensor responds to the data uploading instruction, and the data acquired within a period of time is uploaded to the server. Furthermore, an encryption key adopted when the sensor detection data is encrypted can be obtained, a hash value matched with the encryption key is generated, the encrypted sensor detection data and the hash value can be added to record information of the blockchain ledger, the blockchain ledger can distribute the record information to a plurality of distributed storage nodes corresponding to the blockchain ledger for storage, and at the moment, the hash value is used as a check code of the sensor detection data.
As an alternative embodiment, the encrypting operation is performed on the sensor detection data, and obtaining the encrypted sensor detection data may include the following steps:
s1, carrying out fragmentation processing on the sensor detection data to obtain a plurality of data fragments, wherein the sensor detection data are distributed and stored in the plurality of data fragments;
and S2, encrypting each data fragment of the plurality of data fragments to obtain encrypted sensor detection data, wherein the encrypted sensor detection data are distributed and stored in the plurality of encryption fragments, and one data fragment corresponds to one encryption fragment.
In the embodiment of the invention, the sensor detection data can be subjected to fragmentation processing to obtain a plurality of data fragments, and the data fragments are used for performing operations such as encryption calculation, management and uploading on the sensor detection data. Wherein the sensor detection data may be randomly distributed and stored in a plurality of data slices. When the encryption operation is executed on the sensor detection data, the encryption operation can be executed on each data fragment in the multiple data fragments to obtain multiple encryption fragments, the encrypted sensor detection data is distributed and stored in the multiple encryption fragments, and one data fragment corresponds to one encryption fragment. The process can dispersedly store the mass sensor detection data in a plurality of data fragments, thereby reducing the operation load of encryption operation.
As an alternative embodiment, after the sensor detection data is encrypted to obtain encrypted sensor detection data, the following steps may be further performed:
s1, copying the encrypted sensor detection data to obtain an encrypted data copy;
and S2, distributing the encrypted data copies to a plurality of distributed storage nodes corresponding to the blockchain ledger for storage.
In the embodiment of the invention, after the encrypted sensor detection data is obtained, the encrypted sensor detection data can be copied to obtain the encrypted data copy, and the encrypted data copy is directly distributed to a plurality of distributed storage nodes corresponding to the blockchain ledger for storage. In the process of uploading the encrypted sensor detection data and the hash value generated by the encryption key to the record information of the blockchain ledger for storage, if data loss occurs, a data copy is still kept in one distributed storage node of the blockchain ledger pair. Optionally, the hash value may also be copied to obtain a hash value copy, and the encrypted data copy and the hash value copy are correspondingly stored in a plurality of distributed storage nodes corresponding to the blockchain ledger.
As an optional implementation manner, the checking the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger, and obtaining the checking result of each distributed storage node may include the following steps:
s1, obtaining a hash value of the record information of each distributed storage node in a plurality of distributed storage nodes corresponding to the block chain ledger;
s2, matching the hash value of each distributed storage node with a target hash value to obtain a matching value corresponding to each distributed storage node, wherein the target hash value is generated according to an encryption key of the sensor detection data;
and S3, determining the verification result of the distributed storage node with the matching value higher than the target threshold value as the target verification result.
In the embodiment of the present invention, a hash value of record information of each distributed storage node in a plurality of distributed storage nodes corresponding to a blockchain ledger may be obtained, and since the hash value is a unique character string generated by an encryption key of sensor detection data to be obtained, if the sensor detection data to be obtained is not tampered, the hash value is a target hash value when the sensor detection data is stored in the original blockchain ledger. Therefore, the hash value of each distributed storage node is matched with the originally stored target hash value to obtain a matching value corresponding to each distributed storage node, and the target hash value is generated according to the encryption key of the sensor detection data under the condition of storing the sensor detection data. The target threshold is a preset matching value, for example, may be ninety nine percent, and if the matching value is higher than the target threshold, the verification result of the distributed storage node is determined as the target verification result.
Referring to fig. 4, fig. 4 is a schematic flow chart of a method for storing sensor detection data according to an embodiment of the present invention, and as shown in fig. 4, after the sensor detection data is obtained, the sensor detection data may be subjected to a slicing process to obtain a plurality of data slices, where the sensor detection data is distributed and stored in the plurality of data slices. Optionally, the edge device may be used to perform fragment processing on the data detected by the sensor, and the edge device is a device with data processing capability, may be embedded in the sensor, and may also be a device independent of the sensor, which is not limited in the embodiment of the present invention. After the sensor detection data is distributed and stored in a plurality of data fragments, each data fragment can manage, encrypt and calculate the data stored in the data fragment. For example, in order to achieve data security performance of the sensor detection data in the storage process, encryption operation may be performed on each data slice to obtain a plurality of encryption slices, at this time, encryption of the sensor detection data is implemented, and the encrypted sensor detection data is distributed and stored in the plurality of encryption slices. Furthermore, the encrypted fragments can be copied to generate copies of the encrypted fragments, and the copies of the encrypted fragments are distributed to a plurality of distributed storage nodes corresponding to the block chain ledger, so that data backup is realized, and the data security performance is further improved. In addition, a hash value corresponding to the encryption key can be generated according to the encryption key used by the encryption fragmentation to complete the encryption operation, and the hash value is added to the record information corresponding to the blockchain ledger. Further, the blockchain ledger may synchronize the record information among all distributed nodes. After the storage of the sensor detection data is completed by adopting the method shown in fig. 4, if the sensor detection data needs to be acquired, the record information corresponding to the sensor detection data can be determined from the blockchain ledger, and the record information is verified by the plurality of distributed storage nodes, and if the verification of the target number of distributed storage nodes is successful, the sensor detection data can be determined as reliable data and output, so that the reliability of data acquisition is improved.
In the embodiment of the invention, under the condition that an acquisition instruction for requesting to acquire the sensor detection data is detected, record information corresponding to the sensor detection data is acquired in the blockchain ledger, wherein the record information at least comprises a check code of the sensor detection data; the method comprises the steps that record information is checked in a plurality of distributed storage nodes corresponding to a block chain ledger, and a check result of each distributed storage node is obtained, wherein the block chain ledger distributes the record information to the plurality of distributed storage nodes for storage; and under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data. According to the process, when the sensor detection data are acquired, the plurality of distributed storage nodes in the block chain ledger can be used for verifying the record information of the sensor detection data, and the sensor detection data are reliable as long as the distributed storage nodes exceeding the target number are successfully verified, so that the reliable sensor detection data are output, and the reliability of data acquisition is improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiment of the invention, a data acquisition device for implementing the data acquisition method is also provided. As shown in fig. 5, the apparatus includes:
a first obtaining unit 501, configured to, when an obtaining instruction for requesting to obtain sensor detection data is detected, obtain record information corresponding to the sensor detection data in a blockchain ledger, where the record information at least includes a check code of the sensor detection data;
a second obtaining unit 502, configured to verify the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger, and obtain a verification result of each distributed storage node, where the blockchain ledger distributes the record information to the plurality of distributed storage nodes for storage;
an output unit 503, configured to mark the sensor detection data as reliable data and output the sensor detection data when it is determined that the number of distributed storage nodes in the obtained verification result, which is a target verification result, reaches a target number.
In the embodiment of the invention, the sensor detection data is data uploaded and stored by the sensor, for example, the sensor applied in the culture field can collect the characteristic data of cultured organisms and upload the data to the server for storage at regular intervals. The storage mode of the detection data of the sensors in the embodiment of the invention depends on the block chain technology. And storing record information corresponding to the sensor detection data in a plurality of distributed storage nodes corresponding to the blockchain ledger by using a blockchain technology, wherein the record information contains a check code of the sensor detection data, the check code is used for verifying data tampering, and if the check code is detected to be changed under the condition of acquiring the sensor detection data, the current sensor detection data is proved to be tampered. Specifically, the check code may be a fixed-length and unrepeatable character string generated by an encryption key for detecting data by a sensor, such as a hash value corresponding to the encryption key, but may also be other check codes used for data verification, which is not limited in the embodiment of the present invention. After the sensor detection data is stored in the server, the user may send an acquisition instruction for requesting acquisition of the sensor detection data to the server if the user needs to acquire the sensor detection data, and after the server acquires the acquisition instruction, the server may acquire record information corresponding to the sensor detection data in the blockchain ledger. For example, a user needs to acquire target sensor detection data uploaded in a target time period, at this time, an acquisition instruction is sent to the server, the server responds to the acquisition instruction, record information corresponding to the target sensor detection data can be acquired in the blockchain ledger, and the record information can also include parameters such as uploading time and data format of the target sensor detection data. Further, whether the corresponding record is tampered or not can be determined in the distributed storage nodes corresponding to the blockchain ledger according to the record information, or whether the corresponding record is abnormal or not can be detected, so that the record information can be verified by the distributed storage nodes corresponding to the blockchain ledger, a verification result of each distributed storage node is obtained, and the verification result can be a verification success or a verification failure. And if the verification result is that the number of the successfully verified distributed storage nodes reaches the target number, the sensor detection data can be marked as reliable data, and the sensor detection data is output. If the verification result is that the number of the distributed storage nodes which are successfully verified does not reach the target number, it is indicated that the sensor detection data may be tampered, optionally, the sensor detection data may be marked as unreliable data, further optionally, the recorded information of the unreliable data may be output, and the recorded information of the unreliable data includes both the recorded information of the distributed storage nodes which are successfully verified and the recorded information of the distributed storage nodes which are failed to be verified.
As an optional implementation, the apparatus may further include:
the third acquisition unit is used for acquiring the sensor detection data uploaded by the sensor before acquiring the record information corresponding to the sensor detection data in the block chain ledger;
the fourth acquisition unit is used for carrying out encryption operation on the sensor detection data to obtain encrypted sensor detection data;
and the adding unit is used for adding a hash value generated by an encryption key of the encryption operation and the encrypted sensor detection data to the record information of the blockchain ledger so as to enable a plurality of distributed storage nodes corresponding to the blockchain ledger to store the record information, wherein the hash value is a check code of the sensor detection data.
As an optional implementation, the fourth obtaining unit may include:
the first acquisition subunit is used for carrying out fragmentation processing on the sensor detection data to obtain a plurality of data fragments, and the sensor detection data are distributed and stored in the plurality of data fragments;
and the second acquisition subunit is used for carrying out encryption operation on each data fragment in the plurality of data fragments to obtain encrypted sensor detection data, and the encrypted sensor detection data is distributed and stored in the plurality of encryption fragments, wherein one data fragment corresponds to one encryption fragment.
As an optional implementation, the apparatus may further include:
the fifth acquisition unit is used for copying the encrypted sensor detection data to obtain an encrypted data copy after the sensor detection data is encrypted to obtain the encrypted sensor detection data;
and the storage unit is used for distributing the encrypted data copies to a plurality of distributed storage nodes corresponding to the blockchain ledger for storage.
As an optional implementation manner, the second obtaining unit is configured to check the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger, and a manner of obtaining a check result of each distributed storage node may specifically be:
the second acquisition unit is used for acquiring a hash value of the record information of each distributed storage node in a plurality of distributed storage nodes corresponding to the block chain ledger; matching the hash value of each distributed storage node with a target hash value to obtain a matching value corresponding to each distributed storage node, wherein the target hash value is a hash value generated according to an encryption key of data detected by a sensor; and determining the verification result of the distributed storage node with the matching value higher than the target threshold value as a target verification result.
In the embodiment of the invention, under the condition that an acquisition instruction for requesting to acquire the sensor detection data is detected, record information corresponding to the sensor detection data is acquired in the blockchain ledger, wherein the record information at least comprises a check code of the sensor detection data; the method comprises the steps that record information is checked in a plurality of distributed storage nodes corresponding to a block chain ledger, and a check result of each distributed storage node is obtained, wherein the block chain ledger distributes the record information to the plurality of distributed storage nodes for storage; and under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data. According to the process, when the sensor detection data are acquired, the plurality of distributed storage nodes in the block chain ledger can be used for verifying the record information of the sensor detection data, and the sensor detection data are reliable as long as the distributed storage nodes exceeding the target number are successfully verified, so that the reliable sensor detection data are output, and the reliability of data acquisition is improved.
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus for implementing the virtual object control method, as shown in fig. 6, the electronic apparatus includes a memory 602 and a processor 604, the memory 602 stores therein a computer program, and the processor 604 is configured to execute the steps in any one of the method embodiments by the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, under the condition that an acquisition instruction for requesting to acquire the sensor detection data is detected, acquiring record information corresponding to the sensor detection data in the blockchain ledger, wherein the record information at least comprises a check code of the sensor detection data;
s2, verifying the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger to obtain a verification result of each distributed storage node, wherein the blockchain ledger distributes the record information to the plurality of distributed storage nodes for storage;
and S3, under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 6 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 6 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 6, or have a different configuration than shown in FIG. 6.
The memory 602 may be used to store software programs and modules, such as program instructions/modules corresponding to the virtual object control method and apparatus in the embodiments of the present invention, and the processor 604 executes various functional applications and data processing by running the software programs and modules stored in the memory 602, that is, implementing the virtual object control method described above. The memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 602 may further include memory located remotely from the processor 604, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 602 may be used to store information such as operation instructions, but is not limited thereto. As an example, as shown in fig. 6, the memory 602 may include, but is not limited to, the first obtaining unit 501, the second obtaining unit 502, and the output unit 503 in the data obtaining apparatus. In addition, the data acquisition device may further include, but is not limited to, other module units in the data acquisition device, which is not described in detail in this example.
Optionally, the transmitting device 606 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 606 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmitting device 606 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In addition, the electronic device further includes: a display 608 for displaying sensor detection data; and a connection bus 610 for connecting the respective module parts in the above-described electronic apparatus.
According to a further aspect of embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, under the condition that an acquisition instruction for requesting to acquire the sensor detection data is detected, acquiring record information corresponding to the sensor detection data in the blockchain ledger, wherein the record information at least comprises a check code of the sensor detection data;
s2, verifying the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger to obtain a verification result of each distributed storage node, wherein the blockchain ledger distributes the record information to the plurality of distributed storage nodes for storage;
and S3, under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method of data acquisition, comprising:
under the condition that an acquisition instruction for requesting to acquire sensor detection data is detected, acquiring record information corresponding to the sensor detection data in a block chain ledger, wherein the record information at least comprises a check code of the sensor detection data;
checking the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger to obtain a checking result of each distributed storage node, wherein the blockchain ledger distributes the record information to the plurality of distributed storage nodes for storage;
and under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number, marking the sensor detection data as reliable data and outputting the sensor detection data.
2. The method of claim 1, further comprising, before obtaining the log information corresponding to the sensor detection data in the blockchain ledger,:
acquiring sensor detection data uploaded by a sensor;
encrypting the sensor detection data to obtain encrypted sensor detection data;
adding a hash value generated by an encryption key of the encryption operation and the encrypted sensor detection data to the record information of the blockchain ledger so that a plurality of distributed storage nodes corresponding to the blockchain ledger store the record information, wherein the hash value is a check code of the sensor detection data.
3. The method of claim 2, wherein the encrypting the sensor detection data to obtain encrypted sensor detection data comprises:
carrying out fragmentation processing on the sensor detection data to obtain a plurality of data fragments, wherein the sensor detection data are distributed and stored in the data fragments;
and encrypting each data fragment in the plurality of data fragments to obtain encrypted sensor detection data, wherein the encrypted sensor detection data is distributed and stored in a plurality of encryption fragments, and one data fragment corresponds to one encryption fragment.
4. The method of claim 2, wherein after the encrypting the sensor detection data to obtain the encrypted sensor detection data, further comprising:
copying the encrypted sensor detection data to obtain an encrypted data copy;
and distributing the encrypted data copies to a plurality of distributed storage nodes corresponding to the blockchain ledger for storage.
5. The method according to any one of claims 1 to 4, wherein the checking the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger to obtain a check result of each distributed storage node includes:
acquiring a hash value of record information of each distributed storage node in a plurality of distributed storage nodes corresponding to the blockchain ledger;
matching the hash value of each distributed storage node with a target hash value to obtain a matching value corresponding to each distributed storage node, wherein the target hash value is generated according to an encryption key of the sensor detection data;
and determining the verification result of the distributed storage node with the matching value higher than the target threshold value as the target verification result.
6. A data acquisition apparatus, comprising:
the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring record information corresponding to sensor detection data in a block chain ledger under the condition that an acquisition instruction for requesting to acquire the sensor detection data is detected, and the record information at least comprises a check code of the sensor detection data;
a second obtaining unit, configured to verify the record information in a plurality of distributed storage nodes corresponding to the blockchain ledger, and obtain a verification result of each distributed storage node, where the blockchain ledger distributes the record information to the plurality of distributed storage nodes for storage;
and the output unit is used for marking the sensor detection data as reliable data and outputting the sensor detection data under the condition that the number of distributed storage nodes which are the target verification result in the obtained verification results reaches the target number.
7. The apparatus of claim 6, further comprising:
the third acquisition unit is used for acquiring the sensor detection data uploaded by the sensor before acquiring the record information corresponding to the sensor detection data in the block chain ledger;
the fourth acquisition unit is used for carrying out encryption operation on the sensor detection data to obtain encrypted sensor detection data;
an adding unit, configured to add a hash value generated by an encryption key of the encryption operation and the encrypted sensor detection data to the record information of the blockchain ledger, so that a plurality of distributed storage nodes corresponding to the blockchain ledger store the record information, where the hash value is a check code of the sensor detection data.
8. The apparatus of claim 7, wherein the fourth obtaining unit comprises:
the first acquisition subunit is configured to perform fragmentation processing on the sensor detection data to obtain a plurality of data fragments, where the sensor detection data is distributed and stored in the plurality of data fragments;
and the second acquisition subunit is configured to perform encryption operation on each data slice in the plurality of data slices to obtain encrypted sensor detection data, where the encrypted sensor detection data is distributed and stored in a plurality of encryption slices, and one data slice corresponds to one encryption slice.
9. A storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 5.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 5 by means of the computer program.
CN202010145007.8A 2020-03-04 2020-03-04 Data acquisition method and device, storage medium and electronic device Withdrawn CN111400316A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010145007.8A CN111400316A (en) 2020-03-04 2020-03-04 Data acquisition method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010145007.8A CN111400316A (en) 2020-03-04 2020-03-04 Data acquisition method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN111400316A true CN111400316A (en) 2020-07-10

Family

ID=71435974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010145007.8A Withdrawn CN111400316A (en) 2020-03-04 2020-03-04 Data acquisition method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN111400316A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000973A (en) * 2020-08-26 2020-11-27 杭州甘道智能科技有限公司 Blood data storage method, device, node server and storage medium
CN112307088A (en) * 2020-11-03 2021-02-02 平安普惠企业管理有限公司 Method, device and equipment for inquiring state of process node and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000973A (en) * 2020-08-26 2020-11-27 杭州甘道智能科技有限公司 Blood data storage method, device, node server and storage medium
CN112307088A (en) * 2020-11-03 2021-02-02 平安普惠企业管理有限公司 Method, device and equipment for inquiring state of process node and storage medium

Similar Documents

Publication Publication Date Title
CN110708171B (en) Block chain consensus voting method, device, equipment and storage medium
US20190213333A1 (en) Decentralized data authentication system for creation of integrated lifetime health records
Fereidooni et al. Fitness trackers: fit for health but unfit for security and privacy
CN111831548B (en) Dependency relationship topological graph drawing method and device
CN110797099B (en) Medical data sharing method and system based on block chain
CN108768972B (en) Vehicle data storage and access method, device, system and electronic equipment
CN105706099B (en) Software renewing apparatus
CN110400164B (en) Data determining method and device, storage medium and electronic device
CN111881481B (en) Medical data processing method, device, equipment and storage medium based on blockchain
CN112699081A (en) File self-certification method and device based on block chain
EP3352525B1 (en) Bluetooth low energy (ble) device, and data update system and method
CN109754226B (en) Data management method, device and storage medium
JP7074371B2 (en) Information management terminal device
CN111400316A (en) Data acquisition method and device, storage medium and electronic device
JP7278299B2 (en) Data management server, data utilization server, data distribution system, data management method and program
CN108924089B (en) Client device identification method and device and client device
CN110287733B (en) File tamper-proofing method and device
CN116112216B (en) Cloud data verification method and device, electronic equipment and nonvolatile storage medium
CN111865924A (en) Method and system for monitoring user side
CN110574352B (en) Migrating information through a storage device
JP2012080425A (en) Instruction system, instruction method, and storage control device
CN106712934B (en) Identification information generation method and device
CN115935414A (en) Block chain based data verification method and device, electronic equipment and storage medium
CN111901305B (en) Memory operation method and device, storage medium and electronic device
CN106998355A (en) Data transmission method, electronic equipment and the data transmission system of electric room

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20200710