CN108664216B - Data storage method and device - Google Patents

Data storage method and device Download PDF

Info

Publication number
CN108664216B
CN108664216B CN201810294367.7A CN201810294367A CN108664216B CN 108664216 B CN108664216 B CN 108664216B CN 201810294367 A CN201810294367 A CN 201810294367A CN 108664216 B CN108664216 B CN 108664216B
Authority
CN
China
Prior art keywords
data
devices
storage
block
block chain
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.)
Active
Application number
CN201810294367.7A
Other languages
Chinese (zh)
Other versions
CN108664216A (en
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201810294367.7A priority Critical patent/CN108664216B/en
Publication of CN108664216A publication Critical patent/CN108664216A/en
Application granted granted Critical
Publication of CN108664216B publication Critical patent/CN108664216B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a data storage method and device, and belongs to the technical field of terminals. The method comprises the following steps: when detecting that at least two second devices exist in the block chain network, sending data to be stored to the at least two second devices, wherein the first device and the at least two second devices belong to the block chain network; when the storage of at least two second devices is completed, generating first storage event information; and generating a first block based on the first storage event information, and adding the first block into a block chain configured on each device in the block chain network. Through the process, the data in the first equipment can be stored in the second equipment, the storage space of the first equipment is saved, the utilization rate of the second equipment is improved, the data storage is carried out through the block chain technology, the data safety can be guaranteed, the storage events can be conveniently inquired later, and therefore the data storage method is economical, practical, safe and efficient.

Description

Data storage method and device
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a data storage method and apparatus.
Background
With the continuous development of terminal technology, more and more data are stored in a terminal, such as data of pictures, videos, texts, etc., and the data are stored in the terminal and need to occupy a storage space, and the storage space in the terminal is largely occupied, which may reduce the operation speed of the terminal and affect the performance of the terminal, so how to reasonably store the data becomes a very concern of people.
Generally, in order to reduce the occupation of data on the storage space of the terminal, people can perform cloud storage on the data and upload the data to be stored to the cloud server, so that the data is stored in the storage space of the cloud server.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a data storage method and apparatus.
According to a first aspect of the embodiments of the present disclosure, there is provided a data storage method, applied to a first device, including:
when detecting that at least two second devices exist in a block chain network, sending data to be stored to the at least two second devices, wherein the at least two second devices are devices with data storage capacity, and the first device and the at least two second devices belong to the block chain network;
when the storage of the at least two second devices is completed, generating first storage event information, wherein the first storage event information is used for indicating data storage events of the first device and the at least two second devices;
and generating a first block based on the first storage event information, and adding the first block into a block chain configured on each device in the block chain network, wherein the first block is used for storing the first storage event information.
In one possible implementation, before sending the data to be stored to the at least two second devices, the method further includes:
sending a data storage inquiry request to a plurality of devices in the blockchain network, wherein the data storage inquiry request is used for inquiring whether each device has data storage capacity;
when storage permission information of at least two devices is received, it is determined that at least two second devices in the blockchain network are detected.
In one possible implementation, before sending the data transmission inquiry request to the plurality of second devices, the method further includes:
acquiring a first character string input by a user on the first equipment;
receiving a second string of the plurality of devices;
comparing the first string to a second string of the plurality of devices;
when the first character string is the same as a second character string of the plurality of devices, the first device and the plurality of devices are combined into the block chain network.
In one possible implementation, the sending the data to be stored to the at least two second devices includes:
signing the characteristic value of the data according to a private key of the first device to obtain signature information;
and adding the signature information into the data, and sending the added data serving as the data to be stored to the at least two second devices.
In a possible implementation manner, after generating a first block based on the first storage event information and adding the first block to a block chain configured on each device in the block chain network, the method further includes:
when a data deletion request for the data is received, determining the at least two second devices according to first storage event information of the data;
sending a data deletion inquiry request to the at least two second devices, where the data deletion inquiry request is used to instruct the at least two second devices to backup the data to at least two third devices in the blockchain network, where the at least two third devices are at least two devices that do not store the data;
and deleting the data when the permission deletion information of the at least two second devices is received.
According to a second aspect of the embodiments of the present disclosure, there is provided a data storage method, applied to a second device, including:
when a data storage inquiry request of a first device is received, detecting whether a second device has data storage capacity, wherein the data storage inquiry request is used for inquiring whether each device has the data storage capacity;
when the second device is determined to have the data storage capacity, sending storage permission information to the first device;
receiving and storing data sent by the first equipment;
and after the storage is finished, acquiring a first block, and adding the first block into a block chain configured on each device in the block chain network, wherein the first block is used for storing the first storage event information.
In one possible implementation manner, the receiving and storing the data transmitted by the first device includes:
receiving data sent by the first equipment;
when the signature information carried by the data is successfully decrypted according to the public key of the first device, a first characteristic value is obtained;
acquiring a second characteristic value of a data part in the data;
storing the data when the first characteristic value and the second characteristic value are the same.
In a possible implementation manner, after generating a first block based on the first storage event information and adding the first block to a block chain configured on each device in the block chain network, the method further includes:
when a data deletion inquiry request of a first device is received, sending the data to at least two third devices, wherein the data deletion inquiry request is used for instructing the second device to backup the data to the at least two third devices in the block chain network, and the at least two third devices are at least two devices which do not store the data;
when the storage of the at least two third devices is completed, generating second storage event information, wherein the second storage event information is used for indicating data storage events of the second device and the at least two third devices;
generating a second block based on the second storage event information, and adding the second block to a block chain configured on each device in the block chain network;
and sending deletion permission information to the first equipment, wherein the deletion permission information is used for indicating the first equipment to delete the data.
According to a third aspect of embodiments of the present disclosure, there is provided a data storage device including:
the device comprises a sending module, a receiving module and a sending module, wherein the sending module is configured to send data to be stored to at least two second devices when the at least two second devices are detected to be in a block chain network, the at least two second devices are devices with data storage capacity, and the first device and the at least two second devices belong to the block chain network;
a generating module configured to generate first storage event information when the storage of the at least two second devices is completed, the first storage event information indicating data storage events of the first device and the at least two second devices;
and the adding module is configured to generate a first block based on the first storage event information, add the first block to a block chain configured on each device in the block chain network, and the first block is used for storing the first storage event information.
In one possible implementation, the apparatus further includes a detection module configured to:
sending a data storage inquiry request to a plurality of devices in the blockchain network, wherein the data storage inquiry request is used for inquiring whether each device has data storage capacity;
when storage permission information of at least two devices is received, it is determined that at least two second devices in the blockchain network are detected.
In one possible implementation, the apparatus further includes a composition module configured to:
acquiring a first character string input by a user on the first equipment;
receiving a second string of the plurality of devices;
comparing the first string to a second string of the plurality of devices;
when the first character string is the same as a second character string of the plurality of devices, the first device and the plurality of devices are combined into the block chain network.
In one possible implementation, the transmitting module is configured to:
signing the characteristic value of the data according to a private key of the first device to obtain signature information;
and adding the signature information into the data, and sending the added data serving as the data to be stored to the at least two second devices.
In one possible implementation, the apparatus further includes a deletion module configured to:
when a data deletion request for the data is received, determining the at least two second devices according to first storage event information of the data;
sending a data deletion inquiry request to the at least two second devices, where the data deletion inquiry request is used to instruct the at least two second devices to backup the data to at least two third devices in the blockchain network, where the at least two third devices are at least two devices that do not store the data;
and deleting the data when the permission deletion information of the at least two second devices is received.
According to a fourth aspect of embodiments of the present disclosure, there is provided a data storage device including:
the detection module is configured to detect whether the second device has data storage capacity or not when receiving a data storage inquiry request of the first device, wherein the data storage inquiry request is used for inquiring whether each device has data storage capacity or not;
a sending module configured to send storage permission information to the first device when it is determined that the second device is data storage capable;
a receiving storage module configured to receive and store data transmitted by the first device;
the acquisition module is configured to acquire a first block after storage is completed, add the first block to a block chain configured on each device in the block chain network, where the first block is used to store the first storage event information.
In one possible implementation, the receiving storage module is configured to:
receiving data sent by the first equipment;
when the signature information carried by the data is successfully decrypted according to the public key of the first device, a first characteristic value is obtained;
acquiring a second characteristic value of a data part in the data;
storing the data when the first characteristic value and the second characteristic value are the same.
In one possible implementation, the apparatus further includes a deletion module configured to:
when a data deletion inquiry request of a first device is received, sending the data to at least two third devices, wherein the data deletion inquiry request is used for instructing the second device to backup the data to the at least two third devices in the block chain network, and the at least two third devices are at least two devices which do not store the data;
when the storage of the at least two third devices is completed, generating second storage event information, wherein the second storage event information is used for indicating data storage events of the second device and the at least two third devices;
generating a second block based on the second storage event information, and adding the second block to a block chain configured on each device in the block chain network;
and sending deletion permission information to the first equipment, wherein the deletion permission information is used for indicating the first equipment to delete the data.
According to a fifth aspect of embodiments of the present disclosure, there is provided a data storage device including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when detecting that at least two second devices exist in a block chain network, sending data to be stored to the at least two second devices, wherein the at least two second devices are devices with data storage capacity, and the first device and the at least two second devices belong to the block chain network;
when the storage of the at least two second devices is completed, generating first storage event information, wherein the first storage event information is used for indicating data storage events of the first device and the at least two second devices;
and generating a first block based on the first storage event information, and adding the first block into a block chain configured on each device in the block chain network, wherein the first block is used for storing the first storage event information.
According to a fifth aspect of embodiments of the present disclosure, there is provided a data storage device including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when a data storage inquiry request of a first device is received, detecting whether a second device has data storage capacity, wherein the data storage inquiry request is used for inquiring whether each device has the data storage capacity;
when the second device is determined to have the data storage capacity, sending storage permission information to the first device;
receiving and storing data sent by the first equipment;
and after the storage is finished, acquiring a first block, and adding the first block into a block chain configured on each device in the block chain network, wherein the first block is used for storing the first storage event information.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, performs the method steps of the first and second aspects.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
The technical scheme provided by the embodiment of the disclosure has the following beneficial effects:
when the first device needs to store data, in a block chain network formed by the first device and a plurality of devices, determining second devices with data storage capacity, storing the data to be stored into at least two second devices through a block chain technology, and adding blocks of the data storage events into block chains configured on each device in the block chain network. Through the process, the data in the first equipment can be stored in the second equipment, the storage space of the first equipment is saved, the utilization rate of the second equipment is improved, the data storage is carried out through the block chain technology, the data safety can be guaranteed, the storage events can be conveniently inquired later, and therefore the data storage method is economical, practical, safe and efficient.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of data storage according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of data storage according to an exemplary embodiment;
FIG. 3 is a flow chart illustrating a method of data storage according to an exemplary embodiment;
FIG. 4 is a block diagram illustrating a data storage device in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating a data storage device in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating a data storage device 600 according to an example embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
FIG. 1 is a flow chart illustrating a method of data storage according to an exemplary embodiment. As shown in fig. 1, the data storage method is applied to a first device and includes the following steps.
In step 101, when it is detected that there are at least two second devices in the blockchain network, the data to be stored is sent to the at least two second devices, where the at least two second devices are devices with data storage capability, and the first device and the at least two second devices both belong to the blockchain network.
In step 102, when the storage of the at least two second devices is completed, first storage event information is generated, the first storage event information indicating data storage events of the first device and the at least two second devices.
In step 103, a first block is generated based on the first storage event information, and the first block is added to a block chain configured on each device in the block chain network, where the first block is used to store the first storage event information.
According to the data storage method provided by the embodiment of the disclosure, when a first device needs to store data, a second device with data storage capacity is determined in a block chain network formed by the first device and a plurality of devices, the data to be stored is stored in at least two second devices through a block chain technology, and a block of the data storage event is added to a block chain configured on each device in the block chain network. Through the process, the data in the first equipment can be stored in the second equipment, the storage space of the first equipment is saved, the utilization rate of the second equipment is improved, the data storage is carried out through the block chain technology, the data safety can be guaranteed, the storage events can be conveniently inquired later, and therefore the data storage method is economical, practical, safe and efficient.
In one possible implementation, before sending the data to be stored to the at least two second devices, the method further includes:
sending a data storage inquiry request to a plurality of devices in the blockchain network, wherein the data storage inquiry request is used for inquiring whether each device has data storage capacity;
when storage permission information of at least two devices is received, it is determined that at least two second devices in the blockchain network are detected.
In one possible implementation, before sending the data transmission inquiry requests to the plurality of second devices, the method further includes:
acquiring a first character string input by a user on the first equipment;
receiving a second string of the plurality of devices;
comparing the first character string with a second character string of the plurality of devices;
and when the first character string is the same as the second character string of the plurality of devices, the first device and the plurality of devices are formed into a block chain network.
In one possible implementation, sending the data to be stored to the at least two second devices comprises:
signing the characteristic value of the data according to a private key of the first device to obtain signature information;
and adding the signature information to the data, and sending the added data as the data to be stored to the at least two second devices.
In a possible implementation manner, after generating a first block based on the first storage event information and adding the first block to a block chain configured on each device in the block chain network, the method further includes:
when a data deletion request for the data is received, determining the at least two second devices according to the first storage event information of the data;
sending a data deletion inquiry request to at least two second devices, wherein the data deletion inquiry request is used for instructing the at least two second devices to backup the data to at least two third devices in the blockchain network, and the at least two third devices are at least two devices which do not store the data;
when the deletion permission information of the at least two second devices is received, the data is deleted.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
FIG. 2 is a flow chart illustrating a method of data storage according to an exemplary embodiment. As shown in fig. 2, the data storage method is applied to the second device and includes the following steps.
In step 201, when a data storage inquiry request of a first device is received, it is detected whether the second device has data storage capability, where the data storage inquiry request is used to inquire whether each device has data storage capability.
In step 202, when it is determined that the second device has data storage capability, storage permission information is sent to the first device.
In step 203, the data transmitted by the first device is received and stored.
In step 204, after the storage is completed, a first block is obtained, and the first block is added to a block chain configured on each device in the block chain network, where the first block is used to store the first storage event information.
According to the data storage method provided by the embodiment of the disclosure, when a first device needs to store data, a second device with data storage capacity is determined in a block chain network formed by the first device and a plurality of devices, the data to be stored is stored in at least two second devices through a block chain technology, and a block of the data storage event is added to a block chain configured on each device in the block chain network. Through the process, the data in the first equipment can be stored in the second equipment, the storage space of the first equipment is saved, the utilization rate of the second equipment is improved, the data storage is carried out through the block chain technology, the data safety can be guaranteed, the storage events can be conveniently inquired later, and therefore the data storage method is economical, practical, safe and efficient.
In one possible implementation, receiving and storing the data transmitted by the first device includes:
receiving data sent by the first equipment;
when the signature information carried by the data is successfully decrypted according to the public key of the first device, a first characteristic value is obtained;
acquiring a second characteristic value of a data part in the data;
when the first characteristic value and the second characteristic value are the same, the data is stored.
In a possible implementation manner, after generating a first block based on the first storage event information and adding the first block to a block chain configured on each device in the block chain network, the method further includes:
when a data deletion inquiry request of a first device is received, sending the data to at least two third devices, wherein the data deletion inquiry request is used for instructing the second device to backup the data to the at least two third devices in the block chain network, and the at least two third devices are at least two devices which do not store the data;
when the storage of the at least two third devices is completed, generating second storage event information, wherein the second storage event information is used for indicating data storage events of the second device and the at least two third devices;
generating a second block based on the second storage event information, and adding the second block to a block chain configured on each device in the block chain network;
and sending allowed deletion information to the first device, wherein the allowed deletion information is used for instructing the first device to delete the data.
FIG. 3 is a flow chart illustrating a method of data storage according to an exemplary embodiment. As shown in fig. 3, the following steps are included.
In step 301, when a first character string of a first device is identical to a second character string of a plurality of devices, the first device and the plurality of devices are grouped into a blockchain network.
The first device and the multiple devices may be storage devices with a network transmission function, such as a mobile phone, a computer, or a tablet device, which is not particularly limited in this disclosure.
The first character string is a character string input by a user in a first device, the second character string is a character string input by the user in a plurality of devices except the first device, the character string may be a character string customized by the user or a character string preset in the device.
In the embodiment of the present disclosure, forming a blockchain network by the first device and the plurality of devices based on the input character string includes the following steps 301A to 301D:
in step 301A, a first device obtains a first string entered by a user on the first device.
The specific process includes that when the first device detects a specified operation, an input box is displayed, and when the first device obtains a character string input by a user through the input box, the character string is used as a first character string.
The specific operation may be an operation of triggering establishment of a blockchain network, for example, when the first device detects a start operation of a user on a specific application, the specific application is started, the specific operation may be a click operation on a blockchain establishment option provided by the specific application, and when the click operation is detected, an input box and subsequent processes may be displayed. The designated application is an application for data storage based on blockchain.
Further, in order to form a blockchain network by the multiple devices and the first device, the multiple devices need to acquire the second character string input by the user on the multiple devices, and a process of acquiring the second character string by the multiple devices is the same as a process of acquiring the first character string by the first device, which is not described herein again.
In step 301B, the first device receives a second string of the plurality of devices.
When the plurality of devices acquire the second character string, the second character string is sent to the first device. The sending process may be triggered manually by the user, for example, by displaying a sending option in a designated application of the device, and sending the second character string to the first device when the user's triggering operation on the sending option is detected. Of course, the sending process may also be automatically performed by the device, for example, the device automatically sends the second character string after acquiring the second character string, which is not specifically limited in this embodiment of the present disclosure.
The above process is described based on an example in which the device acquires the second character string input by the user in real time, and in an actual scenario, the first device sends a block chain establishment request to the multiple devices, and when any device receives the block chain establishment request, the pre-stored second character string is sent to the first device. The pre-stored second character string may be a preset character string that is user-defined and stored into or in the device.
In step 301C, the first device compares the first string with a second string of the plurality of devices.
When the first device obtains the second character strings of the multiple devices, comparing each second character string with the first character string one by one.
In step 301D, when the first string of the first device is the same as the second string of the plurality of devices, the first device and the plurality of devices are grouped into the blockchain network.
In the embodiment of the present disclosure, for example, the multiple devices send the second character strings, and the second character strings sent by the multiple devices are all the same as the first character string, actually, the second character strings sent by the multiple devices may not be all the same as the first character string, but some of the second character strings are the same as the first character string, that is, only some of the multiple devices may form a blockchain network with the first device.
Wherein, the block chain network comprises three or more devices in total. Since the character string is defined by the user, the first device with the same character string and a plurality of devices form a block chain network, and the user can be helped to establish the small block chain network. Further, when the number of the devices with the same character string acquired by the first device is less than two, the blockchain network cannot be formed.
In the embodiment of the disclosure, the first character string and the second character string are used for verifying whether the first device and the plurality of devices form the blockchain, and the blockchain network can be formed according to the user requirement through verification of the character strings, so that when the first character string is different from the second character string, the device cannot be added into the blockchain network, and privacy and security of the blockchain network are ensured.
In step 302, the first device sends a data storage inquiry request to a plurality of devices in the blockchain network, wherein the data storage inquiry request is used for inquiring whether each device has data storage capacity.
After a first device and a plurality of devices form a blockchain network, when the first device needs to store data into a device in the blockchain network, a data storage inquiry request may be sent to each device in the blockchain network to detect a device having a data storage capability in the blockchain network, so as to ensure normal storage of the data, where the data storage inquiry request carries a data volume of the data, and the data volume is used to indicate a size of a storage space occupied by the data.
In this embodiment of the disclosure, the process of the first device sending the data storage query request to the multiple devices in the blockchain network may be: when the first device detects that a user selects data in the first device, a data storage option is displayed, the data storage option is used for indicating that the data are stored in the devices in the block chain network, and when the data storage option is triggered by the user, a data storage inquiry request is generated and sent to the devices in the block chain network where the first device is located. The data in the first device may be data such as pictures, videos, or texts in the first device, which is not specifically limited in this disclosure.
In step 303, when the device receives a data storage inquiry request from the first device, it detects whether the device has data storage capability.
The specific process of the detection comprises the following steps: and the equipment judges whether the equipment capability information indicates that the equipment has a storage function or not according to the equipment capability information. And when the device capability information indicates that the device does not have the storage function, determining that the device does not have the data storage capability. When the device capability information indicates that the device has a storage function, detecting the residual capacity of the device, and comparing the residual capacity with the data volume, wherein the residual capacity is used for indicating the size of the residual storage space in the device, when the residual capacity is larger than the data volume, determining that the device has the data storage capability, and when the residual capacity is smaller than the data volume, determining that the device does not have the data storage capability.
In step 304, the device sends storage permission information to the first device when it is determined that the device is data storage capable.
Wherein the storage permission information is used to indicate information that permits the first device to store the data to the device. When the device determines that the data storage capability is available, storage permission information is generated and sent to the first device.
Optionally, when the device detects that the device does not have the data storage capability, generating storage prohibition information, and sending the storage prohibition information to the first device, so as to prompt the user to view the device without the data storage capability in time, so as to perform corresponding processing on the device, for example, deleting the device from the blockchain network or cleaning a storage space of the device, so as to recover the data storage capability of the device, and the like.
In the embodiment of the present disclosure, the storage permission information and the storage prohibition information carry the device identifier of the device, so that the first device can identify the device according to the device identifier of the device.
In step 305, when the first device receives storage permission information of at least two devices, it is determined that at least two second devices in the blockchain network are detected.
The second device is a device with data storage capacity. When the first device receives at least two pieces of storage permission information, the at least two pieces of device are identified according to the device identification carried in the storage permission information, and the at least two pieces of device are called as at least two second devices.
In step 306, when the first device detects that there are at least two second devices in the blockchain network, the data to be stored is sent to the at least two second devices.
In the embodiment of the present disclosure, the sending, by the first device, the data to be stored to the at least two second devices includes the following steps 306A to 306B:
in step 306A, the first device signs the characteristic value of the data according to the private key of the first device, and obtains signature information.
A private key is stored in the first device, the private key having an associated public key, and a pair of the public key and the private key may be used by different devices to verify the authenticity of the information source based on an asymmetric algorithm. The characteristic value of the data is a string of character strings calculated according to a characteristic value algorithm based on the data, and the characteristic value can be used for uniquely identifying the data.
In step 306B, the first device adds the signature information to the data and sends the added data as data to be stored to the at least two second devices.
The data are stored in at least two devices in the block chain network, so that the same data are stored in the at least two devices, the data safety can be guaranteed, and when one device storing the data fails, the data can be checked through other devices in the block chain network.
Further, the data to be stored may be transmitted to the second device through a Wireless network, such as WI-FI (Wireless local area network), and may also be transmitted to the second device through a mobile communication network, such as 2G (2nd Generation, second Generation mobile communication technology), 3G (3rd Generation, third Generation mobile communication technology), 4G (4th Generation, fourth Generation mobile communication technology), or 5G (5rd Generation, fifth Generation mobile communication technology), and the like, which is not specifically limited in this embodiment of the present invention.
In the above steps, the data to be stored is sent to two second devices when the first device detects that there are two second devices in the blockchain network. In an actual scenario, when the first device detects that there are two or more second devices in the blockchain network, the data to be stored may be sent to two or more of the two or more second devices, which is not specifically limited in this embodiment of the present disclosure.
In step 307, the second device receives and stores the data transmitted by the first device.
And after the first equipment sends the data to be stored to the second equipment, the second equipment receives and stores the data according to the signature information in the data to be stored.
In the embodiment of the present disclosure, the process of receiving and storing data by the second device includes the following steps 307A to 307E:
in step 307A, the second device receives data transmitted by the first device.
In step 307B, the second device decrypts the signature information carried by the data according to the public key of the first device.
And the second equipment acquires the public key of the first equipment from the corresponding relation between the stored equipment and the public key according to the equipment identifier in the data, and decrypts the signature information based on the public key. When the decryption of the second device is successful, it indicates that the data to be stored is sent by the first device, and the next storage process can be continuously executed. When the second device cannot successfully decrypt, it is indicated that the data to be stored may not be sent by the first device, and in order to protect the security of the second device and prevent malicious attacks from other devices, the data is no longer stored.
Through the decryption process, the data stored in the second device can be guaranteed to be sent by the first device, and malicious access of other devices is prevented.
In step 307C, when the second device succeeds in decryption, the first feature value is obtained.
In step 307D, the second device obtains a second characteristic value of the portion of data in the data.
The first and second of the first characteristic value and the second characteristic value do not relate to any limitation on the magnitude of the values or the order of acquisition, the first characteristic value is used only to indicate the characteristic value decrypted based on the signature information provided by the first device, and the second characteristic value is used to indicate the characteristic value generated in real time based on the received data.
When the second device determines that the data is sent by the first device, a data portion of the data to be stored is obtained, and a second eigenvalue of the data is calculated according to the data portion by the above eigenvalue algorithm same as that in step 306A.
In step 307E, the second device compares the first characteristic value with the second characteristic value.
When the first characteristic value and the second characteristic value are the same, the data is stored. And when the second equipment finishes storing the data, generating storage finishing information and sending the storage finishing information to the first equipment. Optionally, when the first characteristic value is different from the second characteristic value, the data is not stored, and the second device may also send storage incomplete information to the first device, so as to prompt the first device that the storage process is incomplete, so that the user can grasp the situation in time and perform corresponding processing.
By verifying whether the second characteristic value is the same as the first characteristic value, the received data can be guaranteed to be complete data sent by the first device, and malicious tampering of the data by other devices can be prevented.
In step 308, after the data storage is completed, the first device obtains first storage event information of the data, where the first storage event information is used to indicate data storage events of the first device and the at least two second devices, and the first block is used to store the first storage event information.
The first storage event information at least comprises a characteristic value of the data, a device identification of the first device and a device identification of the second device. The first device generates first storage event information according to the storage process of the data, and the first device can conveniently inquire the storage condition of the data.
When the first device receives at least two pieces of storage completion information, the first device determines that the data is stored in at least two second devices in the block chain network, and the first device generates first storage event information according to the storage event.
In step 309, the first device generates a first block based on the first storage event information, and adds the first block to a block chain configured on each device in the block chain network.
When the first device generates the first block, the first block is sent to other devices in the block chain network, the other devices are devices in the block chain network except the first device, and when the other devices receive the first block, the block is added into a block chain configured by the device, so that all the devices in the block chain network are ensured to be configured with the same block chain.
Furthermore, when a data storage event occurs between a first device and at least two second devices in the blockchain network, if any one or more devices in the blockchain network are in a power-off state at this time, the blockchain network will automatically add the first block to the blockchain configured by the device once the devices are in the power-on state, so as to ensure that the blocks in the blockchain configured by each device in the blockchain network are the same.
When the first device needs to store data, in a block chain network formed by the first device and a plurality of devices, determining second devices with data storage capacity, storing the data to be stored into at least two second devices through a block chain technology, and adding blocks of the data storage events into block chains configured on each device in the block chain network. Through the process, the data in the first equipment can be stored in the second equipment, the storage space of the first equipment is saved, the utilization rate of the second equipment is improved, the data storage is carried out through the block chain technology, the data safety can be guaranteed, the storage events can be conveniently inquired later, and therefore the data storage method is economical, practical, safe and efficient.
Further, the data in the first device may be deleted, for example, when the data stored in the storage space of the first device is excessive, the occupation of the storage space of the first device may be reduced by deleting the data, so as to ensure the performance of the first device, in order to ensure that the data is not lost, when the data is stored on a device in the blockchain network, the data may be further backed up before the data is deleted, and the step of deleting the data after the data is backed up includes the following steps 310A to 310F:
in step 310A, when the first device receives a data deletion request for the data, the at least two second devices are determined according to the first storage event information of the data.
The specific process includes that when the first device detects that the user selects data in the first device, a data deletion option is generated, the data deletion option is used for indicating that the data are deleted in the first device, and when the triggering operation of the user on the data deletion option is detected, a data deletion request is generated, wherein the data deletion request at least comprises a device identifier of the first device and a characteristic value of the data. And the first equipment searches first storage event information of the data in the block chain according to the data deletion request, and determines second equipment for storing the data in the block chain network according to the first storage event information.
In step 310B, the first device sends a data deletion query request to the at least two second devices, where the data deletion query request is used to instruct the at least two second devices to backup the data to at least two third devices in the blockchain network.
The at least two third devices are at least two devices that do not store the data, and the at least two third devices may be determined by the at least two second devices through detection, and the detection process of the at least two third devices is the same as the process of the at least two second devices detected by the first device, which is described in step 302 and 305, and is not described herein again.
And when the first device determines the second device storing the data in the blockchain network according to the first storage event information, generating a data deletion inquiry request, and sending the data deletion inquiry request to the at least two second devices.
In step 310C, when the second device receives the data deletion query request of the first device, the second device transmits the data to at least two third devices.
In step 310D, when the at least two third devices are completely stored, the second device generates second storage event information indicating data storage events of the second device and the at least two third devices. And then, generating a second block based on the second storage event information, and adding the second block into a block chain configured on each device in the block chain network, wherein the second block is used for storing the second storage event information.
The process of storing the data to the at least two third devices in the blockchain network by the at least two second devices is the same as the process of storing the data to the at least two second devices by the first device, which is described in the above steps 302 and 307, and is not described herein again.
In step 310E, when the second device determines that the storage of the at least two third devices is completed, the second device sends deletion permission information to the first device, where the deletion permission information is used to instruct the first device to delete the data.
In step 310F, when the first device receives the deletion permission information of the at least two second devices, the data is deleted.
When the first device deletes data, the second device storing the data to be deleted is determined according to the block chain configured in the first device, the data is backed up to the third device from the second device, and the data is deleted after the first device determines that the third device is backed up, so that the occupation of the data on the storage space in the first device is reduced, the storage safety of the data is guaranteed, and even if the second device fails, such as the data is lost or the data cannot be checked, the user can check the data stored in the third device.
FIG. 4 is a block diagram illustrating a data storage device in accordance with an exemplary embodiment. Referring to fig. 4, the apparatus includes a transmitting module 401, a generating module 402, and a joining module 403.
The sending module 401 is configured to send data to be stored to at least two second devices when it is detected that there are at least two second devices in the blockchain network, where the at least two second devices are devices with data storage capability, and the first device and the at least two second devices belong to the blockchain network.
The generating module 402 is configured to generate first storage event information when the at least two second devices are completely stored, the first storage event information indicating data storage events of the first device and the at least two second devices.
The adding module 403 is configured to generate a first block based on the first storage event information, add the first block to a block chain configured on each device in the block chain network, where the first block is used to store the first storage event information.
According to the data storage device provided by the embodiment of the disclosure, when a first device needs to store data, a second device with data storage capability is determined in a block chain network formed by the first device and a plurality of devices, the data to be stored is stored in at least two second devices through a block chain technology, and a block of the data storage event is added to a block chain configured on each device in the block chain network. Through the process, the data in the first equipment can be stored in the second equipment, the storage space of the first equipment is saved, the utilization rate of the second equipment is improved, the data storage is carried out through the block chain technology, the data safety can be guaranteed, the storage events can be conveniently inquired later, and therefore the data storage method is economical, practical, safe and efficient.
In one possible implementation, the apparatus further includes a detection module 405 configured to:
sending a data storage inquiry request to a plurality of devices in the blockchain network, wherein the data storage inquiry request is used for inquiring whether each device has data storage capacity;
when storage permission information of at least two devices is received, it is determined that at least two second devices in the blockchain network are detected.
In one possible implementation, the apparatus further includes a composition module 406 configured to:
acquiring a first character string input by a user on the first equipment;
receiving a second string of the plurality of devices;
comparing the first character string with a second character string of the plurality of devices;
and when the first character string is the same as a second character string of the plurality of devices, the first device and the plurality of devices are combined into the block chain network.
In one possible implementation, the sending module 407 is configured to:
signing the characteristic value of the data according to a private key of the first device to obtain signature information;
and adding the signature information to the data, and sending the added data as the data to be stored to the at least two second devices.
In one possible implementation, the apparatus further includes a deletion module 408 configured to:
when a data deletion request for the data is received, determining the at least two second devices according to the first storage event information of the data;
sending a data deletion inquiry request to the at least two second devices, where the data deletion inquiry request is used to instruct the at least two second devices to backup the data to at least two third devices in the blockchain network, where the at least two third devices are at least two devices that do not store the data;
when the deletion permission information of the at least two second devices is received, the data is deleted.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 5 is a block diagram illustrating a data storage device according to an exemplary embodiment. Referring to fig. 5, the apparatus includes a detection module 501, a transmission module 502, a reception storage module 503, and an acquisition module 504.
The detecting module 501 is configured to detect whether the second device has a data storage capability when receiving a data storage query request of the first device, where the data storage query request is used to query whether each device has a data storage capability.
The sending module 502 is configured to send storage permission information to the first device when it is determined that the second device has data storage capability.
The receiving and storing module 503 is configured to receive and store the data transmitted by the first device.
The obtaining module 504 is configured to, after the storage is completed, obtain a first block, and add the first block to a block chain configured on each device in the block chain network, where the first block is used to store the first storage event information.
According to the data storage device provided by the embodiment of the disclosure, when a first device needs to store data, a second device with data storage capability is determined in a block chain network formed by the first device and a plurality of devices, the data to be stored is stored in at least two second devices through a block chain technology, and a block of the data storage event is added to a block chain configured on each device in the block chain network. Through the process, the data in the first equipment can be stored in the second equipment, the storage space of the first equipment is saved, the utilization rate of the second equipment is improved, the data storage is carried out through the block chain technology, the data safety can be guaranteed, the storage events can be conveniently inquired later, and therefore the data storage method is economical, practical, safe and efficient.
In one possible implementation, the receiving storage module 503 is configured to:
receiving data sent by the first equipment;
when the signature information carried by the data is successfully decrypted according to the public key of the first device, a first characteristic value is obtained;
acquiring a second characteristic value of a data part in the data;
when the first characteristic value and the second characteristic value are the same, the data is stored.
In one possible implementation, the apparatus further includes a deletion module 504 configured to:
when a data deletion inquiry request of a first device is received, sending the data to at least two third devices, wherein the data deletion inquiry request is used for instructing the second device to backup the data to the at least two third devices in the block chain network, and the at least two third devices are at least two devices which do not store the data;
when the storage of the at least two third devices is completed, generating second storage event information, wherein the second storage event information is used for indicating data storage events of the second device and the at least two third devices;
generating a second block based on the second storage event information, and adding the second block to a block chain configured on each device in the block chain network;
and sending allowed deletion information to the first device, wherein the allowed deletion information is used for instructing the first device to delete the data.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 6 is a block diagram illustrating a data storage device 600 according to an example embodiment. For example, the data storage device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 6, apparatus 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 608, audio component 610, input/output (I/O) interface 612, sensor component 614, and communication component 616.
The processing component 602 generally controls overall operation of the device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the apparatus 600. Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply component 606 provides power to the various components of device 600. The power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 600.
The multimedia component 608 includes a screen that provides an output interface between the device 600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 600 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, audio component 610 includes a Microphone (MIC) configured to receive external audio signals when apparatus 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the apparatus 600. For example, the sensor component 614 may detect an open/closed state of the device 600, the relative positioning of the components, such as a display and keypad of the apparatus 600, the sensor component 614 may also detect a change in position of the apparatus 600 or a component of the apparatus 600, the presence or absence of user contact with the apparatus 600, orientation or acceleration/deceleration of the apparatus 600, and a change in temperature of the apparatus 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communications between the apparatus 600 and other devices in a wired or wireless manner. The apparatus 600 may access a wireless network based on a communication standard, such as Wi-Fi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 504 comprising instructions, executable by the processor 520 of the apparatus 500 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer-readable storage medium is also provided, for example, comprising at least one instruction, which is loadable and executable by a processor to perform the data storage method of the above embodiments. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random-Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (19)

1. A data storage method, applied to a first device, the method comprising:
when detecting that at least two second devices exist in a block chain network, sending data to be stored to the at least two second devices, wherein the at least two second devices are devices with data storage capacity, and the first device and the at least two second devices belong to the block chain network;
when the storage of the at least two second devices is completed, generating first storage event information, wherein the first storage event information is used for indicating data storage events of the first device and the at least two second devices;
and generating a first block based on the first storage event information, and adding the first block into a block chain configured on each device in the block chain network, wherein the first block is used for storing the first storage event information.
2. The method of claim 1, wherein prior to sending the data to be stored to the at least two second devices, the method further comprises:
sending a data storage inquiry request to a plurality of devices in the blockchain network, wherein the data storage inquiry request is used for inquiring whether each device has data storage capacity;
when storage permission information of at least two devices is received, it is determined that at least two second devices in the blockchain network are detected.
3. The method of claim 2, wherein prior to sending a data storage query request to a plurality of devices in the blockchain network, the method further comprises:
acquiring a first character string input by a user on the first equipment;
receiving a second string of the plurality of devices;
comparing the first string to a second string of the plurality of devices;
when the first character string is the same as a second character string of the plurality of devices, the first device and the plurality of devices are combined into the block chain network.
4. The method of claim 1, wherein sending the data to be stored to the at least two second devices comprises:
signing the characteristic value of the data according to a private key of the first device to obtain signature information;
and adding the signature information into the data, and sending the added data serving as the data to be stored to the at least two second devices.
5. The method of claim 1, wherein after generating a first block based on the first storage event information and adding the first block to a blockchain configured on each device in the blockchain network, the method further comprises:
when a data deletion request for the data is received, determining the at least two second devices according to first storage event information of the data;
sending a data deletion inquiry request to the at least two second devices, where the data deletion inquiry request is used to instruct the at least two second devices to backup the data to at least two third devices in the blockchain network, where the at least two third devices are at least two devices that do not store the data;
and deleting the data when the permission deletion information of the at least two second devices is received.
6. A data storage method, applied to a second device, the method comprising:
when a data storage inquiry request of a first device is received, detecting whether a second device has data storage capacity, wherein the data storage inquiry request is used for inquiring whether each device has the data storage capacity;
when the second device is determined to have the data storage capacity, sending storage permission information to the first device;
receiving and storing data sent by the first equipment;
and after the storage is finished, acquiring a first block, and adding the first block into a block chain configured on each device in the block chain network, wherein the first block is used for storing first storage event information.
7. The method of claim 6, wherein the receiving and storing the data transmitted by the first device comprises:
receiving data sent by the first equipment;
when the signature information carried by the data is successfully decrypted according to the public key of the first device, a first characteristic value is obtained;
acquiring a second characteristic value of a data part in the data;
storing the data when the first characteristic value and the second characteristic value are the same.
8. The method of claim 6, wherein after generating a first block based on the first storage event information, and adding the first block to a blockchain configured on each device in the blockchain network, the method further comprises:
when a data deletion inquiry request of a first device is received, sending the data to at least two third devices, wherein the data deletion inquiry request is used for instructing the second device to backup the data to the at least two third devices in the block chain network, and the at least two third devices are at least two devices which do not store the data;
when the storage of the at least two third devices is completed, generating second storage event information, wherein the second storage event information is used for indicating data storage events of the second device and the at least two third devices;
generating a second block based on the second storage event information, and adding the second block to a block chain configured on each device in the block chain network;
and sending deletion permission information to the first equipment, wherein the deletion permission information is used for indicating the first equipment to delete the data.
9. A data storage apparatus, for use with a first device, the apparatus comprising:
the device comprises a sending module, a receiving module and a sending module, wherein the sending module is configured to send data to be stored to at least two second devices when the at least two second devices are detected to be in a block chain network, the at least two second devices are devices with data storage capacity, and the first device and the at least two second devices belong to the block chain network;
a generating module configured to generate first storage event information when the storage of the at least two second devices is completed, the first storage event information indicating data storage events of the first device and the at least two second devices;
and the adding module is configured to generate a first block based on the first storage event information, add the first block to a block chain configured on each device in the block chain network, and the first block is used for storing the first storage event information.
10. The apparatus of claim 9, further comprising a detection module configured to:
sending a data storage inquiry request to a plurality of devices in the blockchain network, wherein the data storage inquiry request is used for inquiring whether each device has data storage capacity;
when storage permission information of at least two devices is received, it is determined that at least two second devices in the blockchain network are detected.
11. The apparatus of claim 9, further comprising a composition module configured to:
acquiring a first character string input by a user on the first equipment;
receiving a second string of the plurality of devices;
comparing the first string to a second string of the plurality of devices;
when the first character string is the same as a second character string of the plurality of devices, the first device and the plurality of devices are combined into the block chain network.
12. The apparatus of claim 9, wherein the transmitting module is configured to:
signing the characteristic value of the data according to a private key of the first device to obtain signature information;
and adding the signature information into the data, and sending the added data serving as the data to be stored to the at least two second devices.
13. The apparatus of claim 9, further comprising a deletion module configured to:
when a data deletion request for the data is received, determining the at least two second devices according to first storage event information of the data;
sending a data deletion inquiry request to the at least two second devices, where the data deletion inquiry request is used to instruct the at least two second devices to backup the data to at least two third devices in the blockchain network, where the at least two third devices are at least two devices that do not store the data;
and deleting the data when the permission deletion information of the at least two second devices is received.
14. A data storage apparatus, for application to a second device, the apparatus comprising:
the detection module is configured to detect whether the second device has data storage capacity or not when receiving a data storage inquiry request of the first device, wherein the data storage inquiry request is used for inquiring whether each device has data storage capacity or not;
a sending module configured to send storage permission information to the first device when it is determined that the second device is data storage capable;
a receiving storage module configured to receive and store data transmitted by the first device;
the acquisition module is configured to acquire a first block after storage is completed, add the first block to a block chain configured on each device in a block chain network, where the first block is used to store first storage event information.
15. The apparatus of claim 14, wherein the receive storage module is configured to:
receiving data sent by the first equipment;
when the signature information carried by the data is successfully decrypted according to the public key of the first device, a first characteristic value is obtained;
acquiring a second characteristic value of a data part in the data;
storing the data when the first characteristic value and the second characteristic value are the same.
16. The apparatus of claim 14, further comprising a deletion module configured to:
when a data deletion inquiry request of a first device is received, sending the data to at least two third devices, wherein the data deletion inquiry request is used for instructing the second device to backup the data to the at least two third devices in the block chain network, and the at least two third devices are at least two devices which do not store the data;
when the storage of the at least two third devices is completed, generating second storage event information, wherein the second storage event information is used for indicating data storage events of the second device and the at least two third devices;
generating a second block based on the second storage event information, and adding the second block to a block chain configured on each device in the block chain network;
and sending deletion permission information to the first equipment, wherein the deletion permission information is used for indicating the first equipment to delete the data.
17. A data storage device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when detecting that at least two second devices exist in the block chain network, sending data to be stored to the at least two second devices, wherein the at least two second devices are devices with data storage capacity, and the first device and the at least two second devices belong to the block chain network;
when the storage of the at least two second devices is completed, generating first storage event information, wherein the first storage event information is used for indicating data storage events of the first device and the at least two second devices;
and generating a first block based on the first storage event information, and adding the first block into a block chain configured on each device in the block chain network, wherein the first block is used for storing the first storage event information.
18. A data storage device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when a data storage inquiry request of a first device is received, detecting whether a second device has data storage capacity, wherein the data storage inquiry request is used for inquiring whether each device has the data storage capacity;
when the second device is determined to have the data storage capacity, sending storage permission information to the first device;
receiving and storing data sent by the first equipment;
and after the storage is finished, acquiring a first block, adding the first block to a block chain configured on each device in the block chain network, wherein the first block is used for storing first storage event information.
19. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 8.
CN201810294367.7A 2018-04-04 2018-04-04 Data storage method and device Active CN108664216B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810294367.7A CN108664216B (en) 2018-04-04 2018-04-04 Data storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810294367.7A CN108664216B (en) 2018-04-04 2018-04-04 Data storage method and device

Publications (2)

Publication Number Publication Date
CN108664216A CN108664216A (en) 2018-10-16
CN108664216B true CN108664216B (en) 2021-06-04

Family

ID=63782218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810294367.7A Active CN108664216B (en) 2018-04-04 2018-04-04 Data storage method and device

Country Status (1)

Country Link
CN (1) CN108664216B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210375409A1 (en) * 2018-10-19 2021-12-02 Longenesis Ltd. Systems and methods for blockchain-based health data validation and access management
CN110581854B (en) * 2019-09-12 2021-09-17 北京笔新互联网科技有限公司 Intelligent terminal safety communication method based on block chain
CN112434040B (en) * 2020-11-30 2023-09-22 泰康保险集团股份有限公司 Data storage method, data acquisition method, device, system and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
CN107273455A (en) * 2017-05-31 2017-10-20 深圳前海微众银行股份有限公司 Block chain data access method and device
CN107273410A (en) * 2017-05-03 2017-10-20 上海点融信息科技有限责任公司 Distributed storage based on block chain
CN107332876A (en) * 2017-05-31 2017-11-07 深圳前海微众银行股份有限公司 The synchronous method and device of block chain state

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11276038B2 (en) * 2016-08-07 2022-03-15 Verifi Media, Inc. Distributed data store for managing media

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
CN107273410A (en) * 2017-05-03 2017-10-20 上海点融信息科技有限责任公司 Distributed storage based on block chain
CN107273455A (en) * 2017-05-31 2017-10-20 深圳前海微众银行股份有限公司 Block chain data access method and device
CN107332876A (en) * 2017-05-31 2017-11-07 深圳前海微众银行股份有限公司 The synchronous method and device of block chain state

Also Published As

Publication number Publication date
CN108664216A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
CN109146470B (en) Method and device for generating payment code
CN106453052B (en) Message interaction method and device
CN106211159B (en) Bluetooth-based identity recognition method and device
CN105847243B (en) Method and device for accessing intelligent camera
EP3179397A1 (en) Methods and devices for managing automatic parallel login and logout in several applications
CN109219036B (en) Method and device for unbinding equipment and electronic equipment
KR102421657B1 (en) Method, apparatus and medium for controlling door guard
CN104486083A (en) Supervisory video processing method and device
CN110765434A (en) Identity authentication method and device, electronic equipment and storage medium
CN106454392A (en) Live broadcast processing method, device and terminal
CN109039860B (en) Method and device for sending and displaying message and method and device for identity authentication
EP3076632A2 (en) Method and apparatus for accessing a network
EP3016349B1 (en) Method and apparatus for verifying terminal and computer program product
CN108664216B (en) Data storage method and device
EP2985979A1 (en) Method and device for backing up data and electronic device
US20180239915A1 (en) Methods, apparatuses, and storage mediums for protecting information
CN106302528B (en) Short message processing method and device
CN107147815B (en) Call processing method and device based on taxi taking
EP3447666A1 (en) Processing fingerprint information
US20170286927A1 (en) Method and device for online payment
CN115333813A (en) Data encryption transmission method and device, electronic equipment and storage medium
CN113055169B (en) Data encryption method and device, electronic equipment and storage medium
CN104852800A (en) Data transmission method and device
US10402562B2 (en) Method and device for encrypting application
CN105635249B (en) Session management method and device

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
GR01 Patent grant
GR01 Patent grant