CN113420169A - File storage and query method, system, electronic equipment and medium - Google Patents

File storage and query method, system, electronic equipment and medium Download PDF

Info

Publication number
CN113420169A
CN113420169A CN202110694366.3A CN202110694366A CN113420169A CN 113420169 A CN113420169 A CN 113420169A CN 202110694366 A CN202110694366 A CN 202110694366A CN 113420169 A CN113420169 A CN 113420169A
Authority
CN
China
Prior art keywords
image
information
target
block
main 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.)
Granted
Application number
CN202110694366.3A
Other languages
Chinese (zh)
Other versions
CN113420169B (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.)
Chongqing Unisinsight Technology Co Ltd
Original Assignee
Chongqing Unisinsight Technology 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 Chongqing Unisinsight Technology Co Ltd filed Critical Chongqing Unisinsight Technology Co Ltd
Priority to CN202110694366.3A priority Critical patent/CN113420169B/en
Publication of CN113420169A publication Critical patent/CN113420169A/en
Application granted granted Critical
Publication of CN113420169B publication Critical patent/CN113420169B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; 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/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/55Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an archive storage and query method, an archive storage system, electronic equipment and a medium, wherein the archive storage method is used for storing an image to be stored by acquiring the image to be stored and image characteristic information to be stored of the image to be stored, acquiring main chain block image characteristic information in a block chain, and storing the image storage information to be stored and the image characteristic information to be stored in a main chain or a sub chain according to the main chain block image characteristic information and the image characteristic information to be stored, so that the archive storage of the image to be stored is realized. Meanwhile, based on the irreparable modification and safety of the block chain technology, better data safety can be realized for sensitive data.

Description

File storage and query method, system, electronic equipment and medium
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a method, a system, an electronic device, and a medium for storing and querying files.
Background
With the popularization of face recognition technology, more and more face recognition application scenes and application places are provided, when a certain unit needs face recognition, a face recognition result is obtained by adopting a related technology, face recognition data for each person is often scattered in a plurality of units, the distribution of face picture data is centrality and regionality, and the storage of the face recognition data is also scattered.
However, if the face image data and the face image data of a certain person are needed to be searched and called one by one in databases of different units, subsequent data utilization is not facilitated, and therefore a file storage method capable of realizing face recognition and storage through a personal file dimension is urgently needed to realize unified integration of the face recognition data and the face image data based on the personal dimension and facilitate searching and calling of the subsequent data.
Disclosure of Invention
In view of the above shortcomings in the prior art, the present invention provides a method, system, electronic device and medium for storing and querying files, so as to solve the above technical problems.
The invention provides a file storage method, which is characterized by comprising the following steps:
acquiring an image to be stored and the characteristic information of the image to be stored;
storing the image to be stored, and acquiring image storage information to be stored of the image to be stored, wherein the image storage information to be stored comprises a storage address and an access method of the image to be stored;
acquiring characteristic information of each main chain block image in a block chain, wherein the block chain comprises a main chain and a sub chain;
and storing the image storage information to be stored and the image feature information to be stored in the main chain or the sub chain according to the image feature information of each main chain block and the image feature information to be stored, so as to realize the archival storage of the image to be stored.
Optionally, the storing, according to the main chain block image feature information and the image feature information to be stored, the image storage information to be stored and the image feature information to be stored in the main chain or the sub chain includes:
respectively determining first similarity between the image feature information to be stored and the image feature information of each main chain block;
if the first similarity is not higher than the first preset similarity threshold, extending a newly added main chain block on the main chain according to newly added main chain information, wherein the newly added main chain information comprises block characteristic information, main chain identification information, image identity information, the image characteristic information to be stored and the image storage information to be stored.
Optionally, the image to be stored is an image to be archived in an image set to be archived, before extending the new main chain block on the main chain according to the new main chain information, the method further includes determining a qualification of the image to be stored, where a determination manner of the qualification includes clustering processing or comparison processing;
clustering each image to be archived in the image set to be archived to obtain a plurality of image groups, acquiring a first number of first target archived images, and determining qualification information according to the number, wherein the first target archived images comprise the images to be archived in the image groups in which the images to be stored are located;
the comparison processing comprises the steps of obtaining the characteristic information of the images to be archived of other images to be archived except the images to be stored, determining the second similarity between the characteristic information of the images to be archived and the characteristic information of the images to be stored, obtaining the second quantity of second target archived images, and determining qualification information according to the quantity, wherein the second target archived images comprise the images to be archived of which the second similarity is higher than a second preset similarity threshold.
Optionally, determining the qualification according to the number includes, if the first number is greater than a first preset number threshold, the qualification including qualification, and if the second number is greater than the first preset number threshold, the qualification including qualification;
if the qualification includes qualification, extending the new main chain block on the main chain according to the new main chain information.
Optionally, the method further includes:
if the qualification determining mode comprises clustering, acquiring first target archival image characteristic information of the first target archival image, storing the first target archival image, and acquiring first target archival image storage information of the first target archival image, wherein the first target archival image storage information comprises a storage address and an access method of the first target archival image, and the newly added main chain information further comprises the first target archival image storage information and the first target archival image characteristic information;
if the qualification determining mode comprises comparison processing, second target archival image feature information of the second target archival image is obtained, the second target archival image is stored, second target archival image storage information of the second target archival image is obtained, the second target archival image storage information comprises a storage address and an access method of the second target archival image, and the newly added main chain information further comprises the second target archival image storage information and the second target archival image feature information.
Optionally, the method further includes:
if the qualification determination mode comprises clustering, acquiring first target archival image feature information of the first target archival image, storing the first target archival image, and acquiring first target archival image storage information of the first target archival image, wherein the first target archival image storage information comprises a storage address and an access method of the first target archival image, and if the first number is more than a second preset number threshold, the newly added chain information further comprises the first target archival image storage information and the first target archival image feature information, which are obtained by selecting the second preset number threshold number of the first target archival images from each first target archival image;
if the qualification determination mode includes comparison processing, second target archival image feature information of the second target archival image is obtained, the second target archival image is stored, and second target archival image storage information of the second target archival image is obtained, the second target archival image storage information includes a storage address and an access method of the second target archival image, and if the second number is greater than a second preset number threshold, the newly added chain information further includes the second target archival image storage information and the second target archival image feature information, which are selected from each second target archival image, of the second target archival image by the second preset number threshold.
Optionally, the method further includes:
if the qualification determining mode comprises clustering processing, registering a new added sub-chain block in the new added main chain block according to new added sub-chain information, wherein the new added sub-chain information comprises block characteristic information, sub-chain identification information, and first target archival image storage information and first target archival image characteristic information of the first target archival image, which are not included in the new added main chain information;
if the qualification determining mode comprises comparison processing, registering a new added sub-chain block in the new added main chain block according to new added sub-chain information, wherein the new added sub-chain information comprises block characteristic information, sub-chain identification information, and second target archival image storage information and second target archival image characteristic information of the second target archival image, which are not included in the new added main chain information.
Optionally, if one first similarity is higher than a first preset similarity threshold, determining a target main chain block, and extending a new added sub chain block in the target main chain block according to new added sub chain information, where the new added main chain information includes sub chain identification information, to-be-stored image feature information, to-be-stored image storage information, and block feature information of the target main chain block, and the target main chain block includes the main chain block corresponding to the similarity higher than the preset similarity threshold.
Optionally, before the image to be stored is an image to be archived in the image set to be archived and extending the new incremental sub-block in the target main-chain block according to the new incremental sub-block information, any one of the following is further included:
clustering each image to be archived in the image set to be archived to obtain a plurality of image groups, acquiring first target archival image characteristic information of the first target archival image, storing the first target archival image, and acquiring first target archival image storage information of the first target archival image, wherein the new additive chain information further comprises the first target archival image storage information and the first target archival image characteristic information, the first target archival image storage information comprises a storage address and an access method of the first target archival image, and the first target archival image comprises the image to be archived in the image group where the image to be stored is located;
the method comprises the steps of obtaining characteristic information of images to be archived of other images to be archived except images to be stored, determining second similarity between the characteristic information of the images to be archived and the characteristic information of the images to be stored, obtaining second target archived image characteristic information of a second target archived image, storing the second target archived image, obtaining second target archived image storage information of the second target archived image, wherein the new additive chain information further comprises the second target archived image storage information and the second target archived image characteristic information, the second target archived image storage information comprises a storage address and an access method of the second target archived image, and the second target archived image comprises the images to be archived with the second similarity higher than a second preset similarity threshold.
Optionally, the image identity information includes an image identity information hash;
and/or the presence of a gas in the gas,
the image feature information to be stored comprises image feature values and image feature identification model information.
Optionally, the main chain of the block chain includes a plurality of main chain blocks, a plurality of sub-chain blocks extend from one main chain block, the image storage information to be stored and the image feature information to be stored are stored in the main chain block or the sub-chain blocks, and a plurality of main chain blocks form a double-layer block chain structure.
The invention also provides a file query method, which comprises any one of the following steps:
acquiring an image to be inquired, determining characteristic information of the image to be inquired, acquiring characteristic information of each main chain block image in a block chain, wherein each main chain block of the block chain stores main chain block image storage information and main chain block image characteristic information, each sub-chain block of the block chain stores sub-chain block image storage information and sub-chain block image characteristic information,
respectively determining third similarity between the image feature information to be queried and each main chain block image feature information, if one third similarity is larger than a third preset similarity threshold, determining a target main chain block corresponding to the third similarity and a target sub-chain block on the target main chain block, and acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block so as to query an archive of an image stored in the block chain and related to the image to be queried; acquiring information to be inquired of a person to be inquired, performing hash calculation on the information to be inquired to obtain hash to be inquired, acquiring image identity information of each main chain block in a block chain, the image identity information comprises an image identity hash, each main chain block of the block chain stores main chain block image storage information and the image identity hash, each sub-chain block of the block chain stores sub-chain block image storage information, if one hash to be inquired is matched with the image identity hash, determining a target main chain block and a target sub-chain block corresponding to the matched image identity hash, acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block, and the image to be inquired stored in the block chain is inquired by the user.
The invention also provides an archive storage system, comprising:
the device comprises a to-be-stored image acquisition module, a storage module and a storage module, wherein the to-be-stored image acquisition module is used for acquiring an image to be stored and the to-be-stored image characteristic information of the image to be stored;
the image storage module is used for storing the image to be stored and acquiring the image storage information of the image to be stored, wherein the image storage information comprises a storage address and an access method of the image to be stored;
and the block chain is used for acquiring the characteristic information of each main chain block image in the block chain, comprises a main chain and a sub chain, and stores the image storage information to be stored and the image characteristic information to be stored in the main chain or the sub chain according to the characteristic information of each main chain block image and the characteristic information of the image to be stored, so that the archive storage of the image to be stored is realized.
The invention also provides an archive inquiry system, which comprises an image inquiry module or an identity information inquiry module, wherein:
the image query module is used for acquiring an image to be queried, determining characteristic information of the image to be queried, acquiring characteristic information of each main chain block image in a block chain, wherein each main chain block of the block chain stores main chain block image storage information and main chain block image characteristic information, each sub-chain block of the block chain stores sub-chain block image storage information and sub-chain block image characteristic information, respectively determining a third similarity between the characteristic information of the image to be queried and each main chain block image characteristic information, and if one third similarity is larger than a third preset similarity threshold value, determining a target main chain block corresponding to the third similarity and a target sub-chain block on the target main chain block, and acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block, so as to realize the archive inquiry of the image which is stored in the block chain and is related to the image to be inquired;
the identity information query module is used for acquiring the information to be queried of the person to be queried, carrying out Hash calculation on the information to be queried to obtain the Hash to be queried, acquiring the image identity information of each main chain block in the block chain, the image identity information comprises an image identity hash, each main chain block of the block chain stores main chain block image storage information and the image identity hash, each sub-chain block of the block chain stores sub-chain block image storage information, if one hash to be inquired is matched with the image identity hash, determining a target main chain block and a target sub-chain block corresponding to the matched image identity hash, acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block, and the image to be inquired stored in the block chain is inquired by the user.
The invention also provides an electronic device, which comprises a processor, a memory and a communication bus;
the communication bus is used for connecting the processor and the memory;
the processor is configured to execute the computer program stored in the memory to implement the method according to any of the embodiments described above.
The invention also provides a computer-readable storage medium having stored thereon a computer program for causing a computer to perform the method according to any one of the embodiments described above.
The invention has the beneficial effects that: the archive storage method comprises the steps of obtaining an image to be stored and image feature information to be stored of the image to be stored, storing the image to be stored, obtaining image storage information to be stored of the image to be stored, obtaining image feature information of each main chain block in a block chain, storing the image storage information to be stored and the image feature information to be stored in the main chain or the sub chain according to the image feature information of each main chain block and the image feature information to be stored, achieving archive storage of the image to be stored, providing unified integration of image data and image identification data based on individual dimensionality, facilitating search and calling of subsequent data, achieving multi-center distributed storage of archives, and avoiding the need of newly building a data center. Meanwhile, based on the irreparable modification and safety of the block chain technology, better data safety can be realized for sensitive data.
Drawings
Fig. 1 is a flowchart illustrating a file storage method according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a two-layer blockchain architecture according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a main chain structure of a dual-layer blockchain structure according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of a sub-chain structure of a dual-layer blockchain structure according to an embodiment of the present invention.
Fig. 5 is a flowchart illustrating a file storage method according to an embodiment of the present invention.
Fig. 6 is a schematic diagram illustrating a data storage method in the related art according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of a data storage method according to an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of an archive storage system according to a second embodiment of the present invention.
Fig. 9 is a schematic structural diagram of another archive storage system according to a second embodiment of the present invention.
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
In the following description, numerous details are set forth to provide a more thorough explanation of embodiments of the present invention, however, it will be apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details, and in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring embodiments of the present invention.
Example one
As shown in fig. 1, the archive storage method in this embodiment includes:
s101: acquiring an image to be stored and the characteristic information of the image to be stored;
s102: storing an image to be stored, and acquiring image storage information to be stored of the image to be stored;
s103: acquiring characteristic information of each main chain block image in a block chain;
s104: and storing the image storage information to be stored and the image feature information to be stored in the main chain or the sub chain according to the image feature information of each main chain block and the image feature information to be stored, so as to realize the archival storage of the image to be stored.
The block chain comprises a main chain and a sub chain, and the storage information of the image to be stored comprises a storage address and an access method of the image to be stored.
Optionally, the storage information of the image to be stored may be a Uniform Resource Locator (URL) of the image to be stored, and since the block chain itself is not suitable for storing the content with a large data size, the number of the image to be stored may be huge, and is not suitable for being directly stored in the block chain, the image to be stored may be stored by itself in a centralized storage manner, and only the URL of the image to be stored is stored in the block chain, so that access, acquisition, and the like of the image to be stored may be implemented by acquiring the URL from the block chain.
In some embodiments, the obtaining of the image feature information to be stored may be to identify the image to be stored in advance through a preset image identification model to obtain data, such as an image feature value, as the image feature information to be stored. Taking a face image as an example, because faces of different individuals are different, image characteristic values of each individual face image are different, and identification, verification and the like of identity information of the individual corresponding to the face can be realized through the image characteristic values.
In some embodiments, the manner and location of storing the image to be stored may be stored in a manner known to those skilled in the art, and are not limited herein. Optionally, the secure storage of the image to be stored may be implemented by controlling an access rule or the like for storing the address of the image to be stored.
The main chain block image feature information is all image feature information stored in a certain block on the main chain in the block chain, in other words, if a certain block a in the main chain stores image feature information to be stored of three images to be stored, the main chain block image feature information corresponding to the block a is a set of the image feature information to be stored of the three images to be stored.
In some embodiments, storing the image storage information to be stored and the image feature information to be stored in the main chain or the sub-chain according to the image feature information of each main chain block and the image feature information to be stored includes:
respectively determining first similarity between the image feature information to be stored and the image feature information of each main chain block;
if the first similarity is not higher than the first preset similarity threshold, extending a newly-added main chain block on the main chain according to newly-added main chain information, wherein the newly-added main chain information comprises block characteristic information, main chain identification information, image identity information, image characteristic information to be stored and image storage information to be stored.
Each first similarity is not higher than a first preset similarity threshold, that is, no image feature information which is particularly similar to the image feature information to be stored currently is stored in each block of the current main chain, and at this time, it is described that an image which is too similar to the image to be stored is not stored in the block chain, so that the main chain needs to be extended to obtain a new block on the main chain, and the archive storage of the image to be stored is realized on the newly added main chain block. Taking the face images as an example, if the similarity of the two face images is higher than a first preset similarity threshold, it is likely that the two face images belong to the same person, and if a block on a main chain is added to each face image obtained on the block chain, the main chain of the block chain is very long, the information processing speed is very slow, and the subsequent application is not facilitated. By comparing the image characteristic information on the current main chain twice before the main chain block is newly added, the phenomenon that the same person has a plurality of blocks on the main chain can be effectively avoided.
The block feature information includes, but is not limited to, hash, data hash, etc. of the previous block, the main chain identification information is used to identify the newly added main chain block as a block on the main chain, and the image identity information is identity information corresponding to the image to be stored. For example, if the image to be stored is a face image, the image identity information may be person identity identification information corresponding to the face image, such as an identity card number, a job number, a school number, and the like, which may uniquely represent the identity of the person, and all the image identity information corresponding to the image to be stored, which is to be stored in the block chain, is different. The image identity information can be used for conveniently and quickly locking the related information (the storage position of the image, the characteristic information of the image and the like) of the image when the image is searched according to a certain identity in the follow-up process.
Optionally, an exemplary manner of respectively determining the first similarity between the image feature information to be stored and the image feature information of each main chain block may be as follows: comparing the image characteristic information of each main chain block with the image characteristic information to be stored respectively, which can be realized by adopting a similarity comparison mode, and comparing the image characteristic information of the main chain block corresponding to each main chain block with the image characteristic information to be stored one by one.
For example, if the main-chain block image feature information only includes one to-be-stored image feature information M stored previously, the similarity comparison is performed only on the to-be-stored image feature information M and the current to-be-stored image feature information W.
If the main-chain block image feature information includes three pieces of previously stored to-be-stored image feature information M, N, L, similarity comparison is performed between the to-be-stored image feature information M, N, L and the current to-be-stored image feature information W.
In other words, when the first similarity between the image feature information to be stored and the image feature information of each main chain block is determined, it is required to compare each image feature information stored in each block on the main chain with the image feature information to be stored, and when the image feature information of the main chain block includes the image feature information of a plurality of images, the first similarity is the minimum similarity obtained by comparing the image feature information to be stored with each image feature information. For example, the main chain block image feature information includes three stored to-be-stored image feature information M, N, L, and the similarity comparison between the to-be-stored image feature information M, N, L and the current to-be-stored image feature information W is performed to obtain three first similarities S1、S2And S3Three first similarities of S3Has the smallest value of S3As the first similarity of the image feature information of the main chain block.
If the image to be stored is subjected to archival storage every time one image to be stored is obtained, the workload is very large, and in many scenes, a lot of images to be archived are often obtained at one time, so that whether the image to be stored is qualified or not can be checked through presetting a certain condition, and the image to be stored is worthy of archival storage. In addition, if the image identity information of a plurality of images is the same in a plurality of images to be archived acquired at one time, for example, face images at a plurality of positions of the same person are obtained, if the whole process of archive storage is performed on each image to be archived, a lot of computing resources are wasted, the processing efficiency is low, if the image to be archived can be preprocessed before the current image to be stored is determined, a plurality of images corresponding to the same image identity information as the current image to be stored are obtained, and when the image to be stored is subjected to archive storage, other images under the same identity information are also subjected to archive storage, so that a lot of resources are saved, and the data processing efficiency is improved.
In some embodiments, before extending the new main chain block on the main chain according to the new main chain information, the determining of the qualification of the image to be stored further includes clustering or comparing.
The images to be archived are collected into a plurality of images which need to be archived, and the images to be archived can be from the same data source like a camera, and can also be snap-shot images from different data sources such as a plurality of traffic checkpoints, snap-shot images of a plurality of cities and the like.
Wherein the clustering process comprises: clustering the images to be archived in the image set to be archived to obtain a plurality of image groups, obtaining a first number of first target archived images, and determining qualification information according to the number, wherein the first target archived images comprise the images to be archived in the image group where the images to be stored are located.
It should be noted that, clustering is performed on each image to be archived in the image to be archived set, and clustering is performed substantially according to the characteristic information of the image to be archived of each image to be archived, so that a plurality of image groups can be obtained, and generally, the images to be archived in each image group all have the same image identity information.
The comparison treatment comprises the following steps: the method comprises the steps of obtaining feature information of images to be archived of other images to be archived except images to be stored, determining second similarity between the feature information of the images to be archived and the feature information of the images to be stored, obtaining a second number of second target archived images, and determining qualification information according to the number, wherein the second target archived images comprise the images to be archived, the second similarity of which is higher than a second preset similarity threshold value.
The determination of the image characteristic information to be archived may be similar to the way the image characteristic information is to be stored, and will not be described further herein. The preset second similarity threshold may be set by a person skilled in the art as needed, and is not limited herein.
Only when the to-be-archived images with the same image identity information as the to-be-stored images exist in the to-be-archived image set, the qualification of archive storage is carried out based on the to-be-stored images, so that the situation that a certain image which is obtained by accident is stored independently can be effectively avoided, and the archival value of the certain independent image is not very high in many scenes. For example, in archiving the face images and the identity information of people who are present in an office building, if a certain person happens to be present in a certain frame of a monitoring video only on a certain day, it may not be very valuable to store the individual archive of the people who happen, and only if the person appears repeatedly in the monitoring video for many times, that is, only if there are many face images of a certain person, a main chain block is newly added to the main chain of the block chain for the person to store the related information of the person. In addition, there may be a certain error in the image feature information of one image, and if the image feature information stored in the main chain block is only obtained from one image, the reliability is limited, which may result in a high error rate of the whole file. By adopting the method that the image characteristic information of a plurality of images is simultaneously stored in the same main chain block, the stability of the image characteristic information in the main chain block can be effectively ensured, and the comparison result is more reliable in the subsequent comparison process.
In some embodiments, determining the eligibility based on the quantity includes qualifying if the first quantity is greater than a first predetermined quantity threshold, and qualifying if the second quantity is greater than the first predetermined quantity threshold;
if the qualification includes qualification, the new main chain block is extended on the main chain according to the new main chain information.
Optionally, if the qualification includes a disqualification, the processing of the image to be stored is stopped.
In some embodiments, if the determination of the qualification includes clustering, first target archival image feature information of the first target archival image is acquired and the first target archival image is stored, first target archival image storage information of the first target archival image is acquired, the first target archival image storage information includes a storage address and an access method of the first target archival image, and the new main chain information further includes the first target archival image storage information and the first target archival image feature information.
In some embodiments, if the determination of the qualification includes a comparison process, second target archival image feature information of the second target archival image is obtained, the second target archival image is stored, and second target archival image storage information of the second target archival image is obtained, the second target archival image storage information includes a storage address and an access method of the second target archival image, and the new main chain information further includes the second target archival image storage information and the second target archival image feature information.
The first target archival image characteristic information and the second target archival image characteristic information may be obtained in a manner similar to that of the image characteristic information to be stored, or in other manners known to those skilled in the art, and are not limited herein. The first and second target archival images are also stored in a manner similar to that of the image to be stored or in a manner known to those skilled in the art.
The newly added main chain block is generated according to the newly added main chain information, so when the newly added main chain information further comprises first target archival image storage information and first target archival image characteristic information, the image characteristic information to be stored, the image storage information to be stored, the first target archival image storage information and the first target archival image characteristic information are stored in the newly added main chain block extending on the current main chain; when the newly added main chain information further comprises second target archival image storage information and second target archival image feature information, the image feature information to be stored, the image storage information to be stored, the second target archival image storage information and the second target archival image feature information are stored in a newly added main chain block extending on the current main chain. That is, for the same batch of images to be archived, under the condition that the first similarity is not higher than the first preset similarity threshold, the images including the same image identity information are stored in the same newly added main chain block.
Since the storage quantity in the same block is too large, which leads to tedious follow-up verification and affects efficiency, the storage information of the second target archival image and the feature information of the second target archival image in the main chain block cannot be recorded without limitation, so before the main chain block is newly added, it is necessary to first determine whether the first quantity or the second quantity exceeds a second preset quantity threshold, if the second preset quantity threshold is exceeded, it is stated that the information to be recorded is too much, at this time, only a part of the information can be selected for recording, and the rest of the information is recorded in the sub-chain of the newly added main chain block. Therefore, the size of the main chain block can be ensured to be proper, and the processing speed of the subsequent block chain data in the using process is improved.
In some embodiments, if the determination of the eligibility includes clustering, obtaining first target archival image feature information of the first target archival image, and storing the first target archival image, obtaining first target archival image storage information of the first target archival image, the first target archival image storage information including a storage address and an access method of the first target archival image, and if the first number is greater than a second preset number threshold, newly adding the chain information further includes selecting the first target archival image storage information and the first target archival image feature information of a second preset number threshold number of first target archival images from each of the first target archival images.
The data selection rule for selecting the first target archival image storage information and the first target archival image characteristic information of the second preset number threshold number of first target archival images from the first target archival images may be in a manner known to those skilled in the art. For example, if the second preset number threshold is 4 and the number of the current first target archival images is 5, then 4 first target archival images are randomly selected from the 5 first target archival images, and the first target archival image storage information and the first target archival image feature information corresponding to the 4 first target archival images are added into the new main chain information to construct a new main chain block.
In some embodiments, if the determination of the qualification includes a comparison process, obtaining second target archival image feature information of the second target archival image, storing the second target archival image, and obtaining second target archival image storage information of the second target archival image, the second target archival image storage information including a storage address and an access method of the second target archival image, and if the second number is greater than a second preset number threshold, newly adding the chain information further includes selecting the second target archival image storage information and the second target archival image feature information of a second preset number threshold number of second target archival images from each second target archival image.
The second target archival image storage information and the second target archival image characteristic information of the second target archival image of the second preset number threshold number selected from the second target archival images may be in a manner known to those skilled in the art. The selection here is similar to the selection for the first target archival image described above and will not be described here again.
In some embodiments, if the determination of the qualification includes clustering, a new added child link block is registered in the new added main link block according to the new added child link information, where the new added child link information includes block feature information, child link identification information, and first target archival image storage information and first target archival image feature information of the first target archival image not included in the new added main link information.
In some embodiments, if the determination of the qualification includes a comparison process, the new added child chain block is registered in the new added main chain block according to the new added child chain information, where the new added child chain information includes block feature information, child chain identification information, and second target archival image storage information and second target archival image feature information of the second target archival image not included in the new added main chain information.
For example, if the second preset number threshold is 4 and the number of the current second target archival images is 5, then 4 second target archival images are randomly selected from the 5 second target archival images, and the second target archival image storage information and the second target archival image feature information corresponding to the 4 second target archival images are added into the new main chain information to construct a new main chain block. And adding second target archival image storage information and second target archival image characteristic information corresponding to the remaining 1 second target archival images into the newly added sub-chain information to construct a new added sub-chain block, wherein the new added sub-chain block is a sub-chain of the newly added main chain block, and the block characteristic information in the newly added sub-chain information comprises the hash and the data hash of the previous block. The sub-chain identification information is used to identify the newly added sub-chain block as a block on the sub-chain. For example, for a first sub-chain block directly extending from the main chain block, the block characteristic information in the first sub-chain block is the hash and data hash of the main chain block, and for a second sub-chain block extending from the first sub-chain block, the block characteristic information is the hash and data hash of the first sub-chain block.
In some embodiments, if there is a first similarity higher than a first preset similarity threshold, determining a target main chain block, and extending a new added sub chain block in the target main chain block according to the added sub chain information, where the new added main chain information includes sub chain identification information, to-be-stored image feature information, to-be-stored image storage information, and block feature information, and the target main chain block includes a main chain block corresponding to the similarity higher than the preset similarity threshold.
For example, a first similarity between the image feature information to be stored currently and the main chain block image feature information of the main chain block M is higher than a first preset similarity threshold, at this time, the main chain block M is a target main chain block, if the target main chain block does not have a sub-chain currently, a newly added sub-chain block is obtained by directly extending the main chain block M, and if the target main chain block already has a sub-chain currently and the last sub-chain block is a sub-chain block G, a newly added sub-chain block is obtained by directly extending the sub-chain block G.
In some embodiments, the image to be stored is an image to be archived in the image set to be archived, and before the extended sub-link block is registered in the target main-link block according to the new incremental sub-link information, any one of the following is further included:
clustering to-be-archived images in an image set to be archived to obtain a plurality of image groups, acquiring first target archived image characteristic information of a first target archived image, storing the first target archived image, acquiring first target archived image storage information of the first target archived image, adding sub-chain information, storing information of the first target archived image and the first target archived image characteristic information, wherein the first target archived image storage information comprises a storage address and an access method of the first target archived image, and the first target archived image comprises the to-be-archived image in the image group where the to-be-stored image is located;
the method comprises the steps of obtaining characteristic information of images to be archived of other images to be archived except images to be stored, determining second similarity between the characteristic information of the images to be archived and the characteristic information of the images to be stored, obtaining second target archived image characteristic information of a second target archived image, storing the second target archived image, obtaining second target archived image storage information of the second target archived image, wherein the new sub-chain information further comprises the second target archived image storage information and the second target archived image characteristic information, the second target archived image storage information comprises a storage address and an access method of the second target archived image, and the second target archived image comprises the images to be archived of which the second similarity is higher than a second preset similarity threshold value.
Optionally, the amounts of the image feature information and the image storage information recorded in the sub-chain may not be limited, in other words, the to-be-archived images having the same image identity information in each batch of to-be-archived images are stored in the same newly added sub-chain block.
In some embodiments, the image identity information includes image identity information hash, the image identity information is stored in a hash mode, so that the information security can be improved, and by utilizing the one-way property of hash operation, the image identity information hash of the block chain can be matched only after the image identity information hash is calculated, so that the archive information of the image identity owner can be obtained, and the image identity information cannot be directly obtained from the block chain.
In some embodiments, the image feature information to be stored includes image feature values and image feature recognition model information. That is, while the image feature information to be stored is acquired, information of an algorithm or a model used for extracting the image feature information to be stored is also recorded into the image feature information together with the image feature value.
Since there may be multiple ways for extracting feature values of an image, and there may be a certain difference between feature values obtained in each way, synchronously storing the image feature value Z1 and the image feature recognition model information in the block chain may be helpful for comparing, processing, and improving the comparison accuracy between the image feature value Z2 and the image feature value Z1 obtained by using different image feature recognition models.
Similarly, the first target archival image feature information and the second target archival image feature information include image feature values and image feature recognition model information.
In some embodiments, the main chain of the block chain includes a plurality of main chain blocks, a plurality of sub-chain blocks extend from a main chain block, the image storage information to be stored and the image feature information to be stored are stored in a main chain block or a sub-chain block, and the plurality of main chain blocks form a double-layer block chain structure.
Optionally, a main chain block in the block chain is sequentially extended with a plurality of sub-chain blocks, that is, the main chain block has only one sub-chain as shown in fig. 2. Other main chain blocks in the chain of blocks may also be extended with respective subchains.
Optionally, at least one main chain block in the block chain simultaneously includes two or more sub-chains, each sub-chain includes the same feature information, where the feature information includes, but is not limited to, shooting year, shooting angle, job information, and the like, for example, the block chain stores face image information, the main chain block stores a plurality of image information that is first stored by a certain person X, the person X has a plurality of face images in dimensions of several years or several angles, and the like, then a sub-chain extends from the main chain block every year, and the sub-chain stores the face images of the person X in the year, so that separate sub-chain storage of image data in different years for the same person can be realized, and subsequent data query and data verification are facilitated.
Optionally, the blockchain in this embodiment adopts a dual-layer blockchain structure, and referring to fig. 2, fig. 2 provides a schematic diagram of a dual-layer blockchain structure, where the dual-layer blockchain has 2 types of main chains and sub-chains, and the sub-chains are created by branching on the main chain blocks. The block structures of the main chain and the daughter chain are similar, both having 1 block head and 1 block body. Referring to fig. 3, fig. 3 is a schematic diagram of a main chain architecture, and as shown in fig. 3, the main chain block header includes 4 data structures, which are the previous block hash, the data hash, the main chain identification information, and the image identification information. Wherein the image identity information may be a hash of the person ID. Note that, for the created block, the hash in the block header is 0, and the image identification information is also 0. The previous block hash is key data for forming a block chain, and is the hash of the whole previous block, which is used for performing data check on the block chain subsequently. The data hash is a whole hash for the block body, and is used for ensuring the data security of the block body and preventing the block body from being tampered. The main chain identification information is used to identify whether the block is a main chain or a child chain. The image identity information is used to match with the image identity. When the image is a face image, the one-way query can be realized by using the hash of the person ID. The personnel id hash of the block chain can be matched only after the personnel id hash is calculated, the archive information of the personnel can be obtained, and the personnel id information cannot be directly obtained from the block chain. Referring to fig. 4, fig. 4 is a schematic diagram of a sub-chain architecture, as shown in fig. 4, a chunk header of a sub-chain includes 3 structures, a previous chunk hash, a data hash, and sub-chain identification information. The previous block hash and data hash have the same meaning as the main chain block, and the sub-chain identification information is used for marking that the block is a sub-chain block. Here the data content of the "previous chunk header hash" of the first child chunk and its associated successor to the main chunk is identical, so we need an identification to distinguish whether the chunk is a main or child. With continued reference to fig. 3 and 4, the bank structure is similar for the main chain blocks and the sub-chain blocks, the bank structure being the main structure for data storage in the block chain. In the dual-layer blockchain provided by the present embodiment, the blocky bodies of the main chain and the sub chain are consistent in the data structure. The < algorithm id, picture url, eigenvalue > triplet is used as a storage structure. The algorithm id is identification information (image feature recognition model information) of the image recognition algorithm used, the picture url is a url address (image storage information to be stored) for accessing the picture, and the feature value is feature data (image feature information to be stored) extracted from the picture by the image recognition algorithm.
The following describes an archive storage method in this embodiment by way of an embodiment, and referring to fig. 5, taking an image to be stored as a face picture, a face personal archive is created in the form of a main chain block structure plus a chain. The picture of each main chain block structure and the branched sub-chains is required to be the picture of the same person, so that the face personal file is constructed. When the main chain block structure is generated, it is the first creation of a face personal profile, where a sufficient number of face pictures are needed to ensure the accuracy of face identification information, so we can require that the number of triples in the main chain block structure needs to be multiple, such as 5. That is, only five groups of triples of at most 5 face pictures are recorded in the main chain block. For a sub-chain, the number of block triplet groups may be any number, depending on the number of face pictures that need to be punched into the sub-chain of block chains.
The characteristic comparison is executed by each block chain link point to obtain characteristic values of a plurality of face pictures, the characteristic values are respectively compared with all characteristic values of the main chain block, and when the face pictures meeting the following conditions are found, the data are linked and stored:
the method comprises the steps of finding that the first similarity of more than one face picture and the characteristic value of each triple of a certain block of a main chain is larger than a first preset similarity threshold. A daughter strand is newly created on the main chain block or extended from the main chain block.
Or, if the second similarity between more than 5 (including 5) face pictures is higher than a second preset similarity threshold, a newly added main chain block is obtained by extending the block behind the main chain, because the specified main chain block can only store 5 pieces of face picture data, if the number of the face pictures is larger than 5, the redundant face picture data is stored by newly creating a sub-chain block on the newly added main chain block.
Optionally, the main chain of the blockchain is extended, and a corresponding service scene is that more than 5 face pictures of the same person are found. At this time we add 1 main chain block after the last block of the main chain. The 'previous block hash' of the newly added main chain block is the hash value of the previous block, the data hash is the integral hash value of the block body of the newly added block, the main chain identification information is the main chain, and the person id number hash value is filled in after the person id hash value of the person. Specifically, if the number of face pictures found is greater than 5, the feature values of other pictures and the picture url are used as the sub-chain data of the main chain block.
Optionally, the block chain sub-chain is extended, and a corresponding service scenario is that a found face picture already has a created face personal file (similarity between a feature value stored in a certain block of the main chain and a feature value of the face image is higher than a first preset similarity threshold), so that the face personal file is enriched. For the main chain block of the face personal file with only the main chain and without the sub-chain, the sub-chain is directly created in the main chain block. For the face profile where the child chain already exists, the extension is performed at the end of the child chain. The data structure is similar to the main chain block and is not described in detail.
Optionally, since the block chain is not suitable for storing content with a large data size, the face image in the scene used in the embodiment has a large data size and is not suitable for being directly stored in the block chain. The picture storage can be performed by using a centralized storage, and only the picture url is stored in the block chain, so that the block chain can be operated quickly.
Through the block chain technology, the files are stored in the block chain, and the following advantages are achieved:
1. decentralized archive storage scheme. In this embodiment, through the decentralized feature of the block chain, each node can access the global information, calculate and process the node information by itself, and match the information chaining, thereby solving the problem.
2. And (4) data security. The block chain technology has excellent tamper-resistant property, and blocks are linked through Hash, so that files are prevented from being deleted and modified.
3. Data privacy. For private data, data that cannot be freely leaked may not be freely decrypted even if the data is leaked. The archive storage method provided by this embodiment stores the image to be stored in an independent storage server, and only stores the image storage information to be stored, such as the picture url, in the block chain, and even if the picture url is acquired, the image to be stored cannot be accessed. For the image identity information, the block chain is also used for hash value storage, and by utilizing the unidirectional property of hash operation, the file information can be obtained only by matching the hash value of the image identity information of the block chain after hash calculation of the image identity information, but the image identity information cannot be directly obtained from the block chain.
The embodiment provides a method for storing archives, which can realize multi-center distributed archive storage without building a new data center. Meanwhile, based on the irreparable modification and safety of the block chain technology, better data safety can be realized for sensitive data.
Taking a face picture as an example, an exemplary face picture archive is constructed, and the archive is applied to some branches, and each branch needs to store and call the archive, see fig. 6, where fig. 6 is an example of a data storage manner in the related art, and in the related art, a face archive data center is needed to store and calculate data. Each branch office stores the data stored by itself into the central storage server through the face archive data center.
Referring to fig. 7, fig. 7 is a schematic diagram of a data storage method for storing an archive according to this embodiment, when the archive storage method provided in this embodiment is applied, a plurality of branches use existing servers to form a double-layer block chain, and storage of a personal face archive can be implemented only by adding a central image storage server, which may be composed of a plurality of servers.
For the traditional scheme, each branch mechanism cannot access the picture characteristic data of other branch mechanisms, cannot perform characteristic calculation, and only can upload the picture characteristic data to a superior central platform, and then the superior uniformly performs characteristic comparison operation on the data to construct a personal file.
After the framework based on the double-layer block chain, each branch mechanism can access all the feature data through the block chain, so that each branch mechanism can perform feature comparison calculation by itself, and then the existing face files are added and linked up, or the new face file information is added and linked up.
The business process taking branch office a as an example is as follows,
if people are compared in the backbone:
the branch organization A acquires one or more pictures from a snapshot library thereof and calculates the characteristic value of the pictures;
the branch mechanism A uses the image characteristic value to compare with the image characteristic values of all blocks in the main chain in the block chain, and if the similarity of the image characteristic values and the blocks x in the main chain reaches a first preset similarity threshold (the first preset similarity threshold can be configured by self), the picture of the branch mechanism A and the picture of the blocks x belong to the same person;
storing the picture of the branch mechanism A to a central picture storage server to obtain a picture url address;
and extending blocks on the subchains on the block x, and filling newly-added subchain information, wherein the newly-added subchain information comprises the hash of the previous block, the hash of data, subchain identification information, image characteristic value algorithm identification information, an image url and an image characteristic value.
No comparison to people in the backbone:
the branch organization A acquires a plurality of pictures from a snapshot library of the branch organization A and calculates the characteristic values of the pictures;
the branch mechanism A uses the image characteristic value to compare with the image characteristic values of all blocks in the main chain in the block chain, and after the image characteristic values of all main blocks in the main chain are compared, the first similarity does not reach a first preset similarity threshold;
and if the mutual similarity of more than 5 pictures (the picture set C) in the plurality of pictures in the snapshot library reaches a second preset similarity threshold value, the pictures are considered to newly form a personal file of one person.
And 5 pictures in the picture set C of the branch A are stored in a central picture storage server, and a picture url address is obtained.
And extending the block on the main chain of the block x, and filling the newly added main chain information, wherein the newly added main chain information comprises the hash of the previous block, the hash of data, main chain identification information, a personnel ID hash value, image characteristic value algorithm identification information, a picture url and an image characteristic value.
And if the number of the picture sets C is more than 5, adding a sub-chain block on the extended block, and adding the picture url and the image characteristic value of the other picture sets C except the data of the pictures included in the added main chain information into the added sub-chain block as the added sub-chain information.
The embodiment provides an archive storage method, which includes the steps of obtaining an image to be stored and image feature information to be stored of the image to be stored, storing the image to be stored, obtaining image storage information to be stored of the image to be stored, obtaining image feature information of each main chain block in a block chain, and storing the image storage information to be stored and the image feature information to be stored in the main chain or the sub chain according to the image feature information of each main chain block and the image feature information to be stored, so that archive storage of the image to be stored is realized, unified integration of image data and image identification data based on individual dimensionality is provided, searching and calling of subsequent data are facilitated, a multi-center distributed storage archive is realized, and a data center does not need to be newly built. Meanwhile, based on the irreparable modification and safety of the block chain technology, better data safety can be realized for sensitive data.
The embodiment also provides a method for querying the archive, which comprises the following steps:
acquiring an image to be queried, and determining the characteristic information of the image to be queried;
acquiring main chain block image feature information in a block chain, wherein main chain block image storage information and main chain block image feature information are stored in each main chain block of the block chain, and sub-chain block image storage information and sub-chain block image feature information are stored in each sub-chain block of the block chain;
respectively determining a third similarity between the image feature information to be inquired and the image feature information of each main chain block;
if a third similarity is larger than a third preset similarity threshold, determining a target main chain block corresponding to the third similarity and a target sub-chain block on the target main chain block;
and acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block so as to realize archive inquiry of the image related to the image to be inquired and stored in the block chain.
The embodiment also provides another archive inquiry method, which comprises the following steps:
acquiring information to be inquired of a person to be inquired;
performing hash calculation on the information to be queried to obtain hash to be queried;
acquiring image identity information of each main chain block in a block chain, wherein the image identity information comprises image identity hash, main chain block image storage information and the image identity hash are stored in each main chain block of the block chain, and sub chain block image storage information is stored in each sub chain block of the block chain;
if one hash to be inquired is matched with the image identity hash, determining a target main chain block and a target sub-chain block corresponding to the matched image identity hash;
and acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block so as to realize archive inquiry of the image which is stored in the block chain and is related to the image to be inquired.
Optionally, the file query method provided in this embodiment is applied to a file stored by using any one of the file storage methods, and the block chain in any one of the embodiments is queried by using the file query method provided in this embodiment, so that the required information can be conveniently and quickly queried, and the information is real.
In the first embodiment, the human face personal profile constructed by the method shown in fig. 5 is taken as an example to exemplarily describe the profile query method provided by this embodiment.
Flow of inquiry by person id (information to be inquired): and inputting a person id, performing hash calculation, and comparing with the hash values of the person ids in all the main chain blocks. If no person id hash value in the main chain block matches with a person id, then the person without the identity id forms the face profile information. If the hash value of the person id in the main chain block is matched with the person id, the face identity file information of the person with the identity id exists. And extracting the picture url stored in the matched target main chain block and the picture url stored in the target sub chain block subsequent to the target main chain block, and returning and displaying the pictures.
The process of inquiring through the face picture comprises the following steps:
uploading a face picture, analyzing the link points of the blocks to obtain a feature value of the face picture, matching the feature value of the face picture with face features in all main chain blocks for face similarity, if the face similarity X is larger than a preset face similarity threshold value, displaying a target main chain block corresponding to the face similarity X and a picture url stored in a target sub-chain block on the target main chain block, returning the picture and displaying.
Example two
Referring to fig. 8, the present embodiment provides an archive storage system 800 including:
a to-be-stored image obtaining module 801, configured to obtain an image to be stored and feature information of the to-be-stored image;
the image storage module 802 is configured to store an image to be stored, and acquire image storage information to be stored of the image to be stored, where the image storage information to be stored includes a storage address and an access method of the image to be stored;
and the block chain 803 is used for acquiring each main chain block image feature information in the block chain, the block chain comprises a main chain and a sub chain, and the image storage information to be stored and the image feature information to be stored are stored in the main chain or the sub chain according to each main chain block image feature information and the image feature information to be stored, so that the archive storage of the image to be stored is realized.
Referring to fig. 9, the present embodiment further provides another archive query system 900, which includes an image query module 901 or an identity information query module 902, where:
the image query module is used for acquiring an image to be queried, determining the characteristic information of the image to be queried, acquiring the characteristic information of each main chain block image in a block chain, wherein each main chain block of the block chain stores main chain block image storage information and main chain block image characteristic information, each sub-chain block of the block chain stores sub-chain block image storage information and sub-chain block image characteristic information, respectively determining a third similarity between the characteristic information of the image to be queried and each main chain block image characteristic information, and if one third similarity is larger than a third preset similarity threshold, determining a target main chain block corresponding to the third similarity and a target sub-chain block on the target main chain block, and acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block so as to realize file query of images stored in the block chain and related to the image to be queried;
the identity information query module is used for acquiring information to be queried of a person to be queried, performing hash calculation on the information to be queried to obtain hashes to be queried, and acquiring image identity information of each main chain block in a block chain, wherein the image identity information comprises image identity hashes, each main chain block of the block chain stores main chain block image storage information and the image identity hashes, each sub-chain block of the block chain stores sub-chain block image storage information, if one hash to be queried is matched with the image identity hashes, a target main chain block and a target sub-chain block corresponding to the matched image identity hashes are determined, and main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block are acquired, so that file query of images related to the images to be queried and stored in the block chain is achieved.
In this embodiment, the system executes the method described in any of the above embodiments, and specific functions and technical effects are described with reference to the above embodiments, which are not described herein again.
Referring to fig. 10, an embodiment of the present application further provides an electronic device 1600, where the electronic device 1600 includes a processor 1601, a memory 1602 and a communication bus 1603;
the communication bus 1603 is used to connect the processor 1601 and the memory 1602;
the processor 1601 is configured to execute a computer program stored in the memory 1602 to implement the method according to any of the above embodiments.
Embodiments of the present application also provide a non-transitory readable storage medium, where one or more modules (programs) are stored in the storage medium, and when the one or more modules are applied to a device, the device may execute instructions (instructions) included in an embodiment of the present application.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, the computer program is used for causing the computer to execute the method according to the embodiment.
The foregoing embodiments are merely illustrative of the principles of the present invention and its efficacy, and are not to be construed as limiting the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.
In the corresponding figures of the above embodiments, the connecting lines may represent the connection relationship between the various components to indicate that more constituent signal paths (consistent _ signal paths) and/or one or more ends of some lines have arrows to indicate the main information flow direction, the connecting lines being used as a kind of identification, not a limitation on the scheme itself, but rather to facilitate easier connection of circuits or logic units using these lines in conjunction with one or more example embodiments, and any represented signal (determined by design requirements or preferences) may actually comprise one or more signals that may be transmitted in any one direction and may be implemented in any suitable type of signal scheme.
In the above embodiments, unless otherwise specified, the description of common objects by using "first", "second", etc. ordinal numbers only indicate that they refer to different instances of the same object, rather than indicating that the objects being described must be in a given sequence, whether temporally, spatially, in ranking, or in any other manner.
In the above-described embodiments, reference in the specification to "the embodiment," "an embodiment," "another embodiment," or "other embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiments is included in at least some embodiments, but not necessarily all embodiments. The various appearances of the phrase "the present embodiment," "one embodiment," or "another embodiment" are not necessarily all referring to the same embodiment. If the specification states a component, feature, structure, or characteristic "may", "might", or "could" be included, that particular component, feature, structure, or characteristic is not necessarily included. If the specification or claim refers to "a" or "an" element, that does not mean there is only one of the element. If the specification or claim refers to "a further" element, that does not preclude there being more than one of the further element.
In the embodiments described above, although the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory structures (e.g., dynamic ram (dram)) may use the discussed embodiments. The embodiments of the invention are intended to embrace all such alternatives, modifications and variances that fall within the broad scope of the appended claims.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The invention is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.

Claims (16)

1. An archive storage method, characterized in that the method comprises:
acquiring an image to be stored and the characteristic information of the image to be stored;
storing the image to be stored, and acquiring image storage information to be stored of the image to be stored, wherein the image storage information to be stored comprises a storage address and an access method of the image to be stored;
acquiring characteristic information of each main chain block image in a block chain, wherein the block chain comprises a main chain and a sub chain;
and storing the image storage information to be stored and the image feature information to be stored in the main chain or the sub chain according to the image feature information of each main chain block and the image feature information to be stored, so as to realize the archival storage of the image to be stored.
2. The method of claim 1, wherein the main chain of the block chain comprises a plurality of main chain blocks, a plurality of sub-chain blocks extend from a main chain block, the image storage information to be stored and the image feature information to be stored are stored in the main chain block or the sub-chain blocks, and a plurality of main chain blocks form a double-layer block chain structure.
3. The archive storage method of claim 1, wherein the storing the image storage information to be stored and the image feature information to be stored in the main chain or the sub-chain according to each of the main chain block image feature information and the image feature information to be stored comprises:
respectively determining first similarity between the image feature information to be stored and the image feature information of each main chain block;
if the first similarity is not higher than the first preset similarity threshold, extending a newly added main chain block on the main chain according to newly added main chain information, wherein the newly added main chain information comprises block characteristic information, main chain identification information, image identity information, the image characteristic information to be stored and the image storage information to be stored.
4. The method of claim 3, wherein the image to be stored is an image to be archived in the image collection to be archived, and the determining the qualification of the image to be stored before the new main chain block is extended on the main chain according to the new main chain information further comprises clustering or comparing;
clustering each image to be archived in the image set to be archived to obtain a plurality of image groups, acquiring a first number of first target archived images, and determining qualification information according to the number, wherein the first target archived images comprise the images to be archived in the image groups in which the images to be stored are located;
the comparison processing comprises the steps of obtaining the characteristic information of the images to be archived of other images to be archived except the images to be stored, determining the second similarity between the characteristic information of the images to be archived and the characteristic information of the images to be stored, obtaining the second quantity of second target archived images, and determining qualification information according to the quantity, wherein the second target archived images comprise the images to be archived of which the second similarity is higher than a second preset similarity threshold.
5. The archive storage method of claim 4 wherein determining said qualification based on said quantity comprises qualifying if said first quantity is greater than a first predetermined quantity threshold, said qualification comprising qualifying if said second quantity is greater than a first predetermined quantity threshold;
if the qualification includes qualification, extending the new main chain block on the main chain according to the new main chain information.
6. The archive storage method of claim 4, wherein the method further comprises:
if the qualification determining mode comprises clustering, acquiring first target archival image characteristic information of the first target archival image, storing the first target archival image, and acquiring first target archival image storage information of the first target archival image, wherein the first target archival image storage information comprises a storage address and an access method of the first target archival image, and the newly added main chain information further comprises the first target archival image storage information and the first target archival image characteristic information;
if the qualification determining mode comprises comparison processing, second target archival image feature information of the second target archival image is obtained, the second target archival image is stored, second target archival image storage information of the second target archival image is obtained, the second target archival image storage information comprises a storage address and an access method of the second target archival image, and the newly added main chain information further comprises the second target archival image storage information and the second target archival image feature information.
7. The archive storage method of claim 4, wherein the method further comprises:
if the qualification determination mode comprises clustering, acquiring first target archival image feature information of the first target archival image, storing the first target archival image, and acquiring first target archival image storage information of the first target archival image, wherein the first target archival image storage information comprises a storage address and an access method of the first target archival image, and if the first number is more than a second preset number threshold, the newly added chain information further comprises the first target archival image storage information and the first target archival image feature information, which are obtained by selecting the second preset number threshold number of the first target archival images from each first target archival image;
if the qualification determination mode includes comparison processing, second target archival image feature information of the second target archival image is obtained, the second target archival image is stored, and second target archival image storage information of the second target archival image is obtained, the second target archival image storage information includes a storage address and an access method of the second target archival image, and if the second number is greater than a second preset number threshold, the newly added chain information further includes the second target archival image storage information and the second target archival image feature information, which are selected from each second target archival image, of the second target archival image by the second preset number threshold.
8. The archive storage method of claim 7, wherein the method further comprises:
if the qualification determining mode comprises clustering processing, registering a new added sub-chain block in the new added main chain block according to new added sub-chain information, wherein the new added sub-chain information comprises block characteristic information, sub-chain identification information, and first target archival image storage information and first target archival image characteristic information of the first target archival image, which are not included in the new added main chain information;
if the qualification determining mode comprises comparison processing, registering a new added sub-chain block in the new added main chain block according to new added sub-chain information, wherein the new added sub-chain information comprises block characteristic information, sub-chain identification information, and second target archival image storage information and second target archival image characteristic information of the second target archival image, which are not included in the new added main chain information.
9. The archive storage method according to any of claims 3-8, wherein if there is one of the first similarities higher than a first preset similarity threshold, determining a target main chain block, and extending a new added sub chain block in the target main chain block according to the new added sub chain information, wherein the new added main chain information includes sub chain identification information, the image feature information to be stored, the image storage information to be stored, and block feature information of the target main chain block, and the target main chain block includes the main chain block corresponding to the similarity higher than the preset similarity threshold.
10. The archive storage method according to claim 9, wherein the image to be stored is an image to be archived in an image collection to be archived, and before extending the new incremental chain block in the target main chain block according to the new incremental chain information, the method further comprises any one of:
clustering each image to be archived in the image set to be archived to obtain a plurality of image groups, acquiring first target archival image characteristic information of the first target archival image, storing the first target archival image, and acquiring first target archival image storage information of the first target archival image, wherein the new additive chain information further comprises the first target archival image storage information and the first target archival image characteristic information, the first target archival image storage information comprises a storage address and an access method of the first target archival image, and the first target archival image comprises the image to be archived in the image group where the image to be stored is located;
the method comprises the steps of obtaining characteristic information of images to be archived of other images to be archived except images to be stored, determining second similarity between the characteristic information of the images to be archived and the characteristic information of the images to be stored, obtaining second target archived image characteristic information of a second target archived image, storing the second target archived image, obtaining second target archived image storage information of the second target archived image, wherein the new additive chain information further comprises the second target archived image storage information and the second target archived image characteristic information, the second target archived image storage information comprises a storage address and an access method of the second target archived image, and the second target archived image comprises the images to be archived with the second similarity higher than a second preset similarity threshold.
11. The archive storage method of any of claims 3-8, wherein the image identity information comprises an image identity information hash;
and/or the presence of a gas in the gas,
the image feature information to be stored comprises image feature values and image feature identification model information.
12. A method for querying a profile, the method comprising any one of:
acquiring an image to be inquired, determining characteristic information of the image to be inquired, acquiring characteristic information of each main chain block image in a block chain, wherein each main chain block of the block chain stores main chain block image storage information and main chain block image characteristic information, each sub-chain block of the block chain stores sub-chain block image storage information and sub-chain block image characteristic information,
respectively determining third similarity between the image feature information to be queried and each main chain block image feature information, if one third similarity is larger than a third preset similarity threshold, determining a target main chain block corresponding to the third similarity and a target sub-chain block on the target main chain block, and acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block so as to query an archive of an image stored in the block chain and related to the image to be queried; acquiring information to be inquired of a person to be inquired, performing hash calculation on the information to be inquired to obtain hash to be inquired, acquiring image identity information of each main chain block in a block chain, the image identity information comprises an image identity hash, each main chain block of the block chain stores main chain block image storage information and the image identity hash, each sub-chain block of the block chain stores sub-chain block image storage information, if one hash to be inquired is matched with the image identity hash, determining a target main chain block and a target sub-chain block corresponding to the matched image identity hash, acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block, and the image to be inquired stored in the block chain is inquired by the user.
13. An archival storage system, the system comprising:
the device comprises a to-be-stored image acquisition module, a storage module and a storage module, wherein the to-be-stored image acquisition module is used for acquiring an image to be stored and the to-be-stored image characteristic information of the image to be stored;
the image storage module is used for storing the image to be stored and acquiring the image storage information of the image to be stored, wherein the image storage information comprises a storage address and an access method of the image to be stored;
and the block chain is used for acquiring the characteristic information of each main chain block image in the block chain, comprises a main chain and a sub chain, and stores the image storage information to be stored and the image characteristic information to be stored in the main chain or the sub chain according to the characteristic information of each main chain block image and the characteristic information of the image to be stored, so that the archive storage of the image to be stored is realized.
14. An archive inquiry system, comprising an image inquiry module or an identity information inquiry module, wherein:
the image query module is used for acquiring an image to be queried, determining characteristic information of the image to be queried, acquiring characteristic information of each main chain block image in a block chain, wherein each main chain block of the block chain stores main chain block image storage information and main chain block image characteristic information, each sub-chain block of the block chain stores sub-chain block image storage information and sub-chain block image characteristic information, respectively determining a third similarity between the characteristic information of the image to be queried and each main chain block image characteristic information, and if one third similarity is larger than a third preset similarity threshold value, determining a target main chain block corresponding to the third similarity and a target sub-chain block on the target main chain block, and acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block, so as to realize the archive inquiry of the image which is stored in the block chain and is related to the image to be inquired;
the identity information query module is used for acquiring the information to be queried of the person to be queried, carrying out Hash calculation on the information to be queried to obtain the Hash to be queried, acquiring the image identity information of each main chain block in the block chain, the image identity information comprises an image identity hash, each main chain block of the block chain stores main chain block image storage information and the image identity hash, each sub-chain block of the block chain stores sub-chain block image storage information, if one hash to be inquired is matched with the image identity hash, determining a target main chain block and a target sub-chain block corresponding to the matched image identity hash, acquiring main chain block image storage information of the target main chain block and sub-chain block image storage information of the target sub-chain block, and the image to be inquired stored in the block chain is inquired by the user.
15. An electronic device comprising a processor, a memory, and a communication bus;
the communication bus is used for connecting the processor and the memory;
the processor is configured to execute a computer program stored in the memory to implement the method of any one of claims 1-12.
16. A computer-readable storage medium, having stored thereon a computer program for causing a computer to perform the method of any one of claims 1-12.
CN202110694366.3A 2021-06-22 2021-06-22 File storage and query method, system, electronic equipment and medium Active CN113420169B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110694366.3A CN113420169B (en) 2021-06-22 2021-06-22 File storage and query method, system, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110694366.3A CN113420169B (en) 2021-06-22 2021-06-22 File storage and query method, system, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN113420169A true CN113420169A (en) 2021-09-21
CN113420169B CN113420169B (en) 2023-03-21

Family

ID=77716100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110694366.3A Active CN113420169B (en) 2021-06-22 2021-06-22 File storage and query method, system, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN113420169B (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844976A (en) * 2017-10-25 2018-03-27 武汉天喻信息产业股份有限公司 A kind of card of depositing based on block chain applies transaction system and method
CN109117097A (en) * 2018-09-05 2019-01-01 深圳正品创想科技有限公司 A kind of date storage method and system based on block chain
CN109471744A (en) * 2018-11-21 2019-03-15 北京蓝石环球区块链科技有限公司 The more subchain system architectures of main chain adduction row based on block chain
CN109740384A (en) * 2019-01-11 2019-05-10 众安信息技术服务有限公司 Data based on block chain deposit card method and apparatus
CN109922131A (en) * 2019-01-17 2019-06-21 平安城市建设科技(深圳)有限公司 Date storage method, device, equipment and storage medium based on block chain
CN110059552A (en) * 2019-03-12 2019-07-26 上海大学 A kind of identity identifying method of block chain in conjunction with biological characteristic
CN110070339A (en) * 2019-04-19 2019-07-30 广东中安合创科技有限公司 A kind of civil air defense constructions and installations data management system, method based on block chain
CN110109929A (en) * 2019-04-30 2019-08-09 翟红鹰 Date storage method, device and computer readable storage medium
CN110647649A (en) * 2019-09-29 2020-01-03 腾讯云计算(北京)有限责任公司 Feature retrieval method, device and storage medium
US20200118068A1 (en) * 2018-10-10 2020-04-16 QuestaWeb, Inc. Hierarchical Blockchain Architecture for Global Trade Management
CN111859456A (en) * 2020-07-30 2020-10-30 重庆倍来电新能源有限公司 Fully trusted data system solution
CN112104665A (en) * 2020-11-02 2020-12-18 腾讯科技(深圳)有限公司 Block chain-based identity authentication method and device, computer and storage medium
WO2020253467A1 (en) * 2019-06-20 2020-12-24 深圳前海微众银行股份有限公司 Blockchain system-based data processing method, system and device
CN112307233A (en) * 2020-10-30 2021-02-02 圆通速递有限公司 Repeated image deleting method and system in cloud storage based on block chain
CN112364209A (en) * 2020-12-09 2021-02-12 杭州复杂美科技有限公司 Distributed data storage method, data query method, device and storage medium
US20210149885A1 (en) * 2019-09-29 2021-05-20 Tencent Technology (Shenzhen) Company Limited Blockchain-based content processing method and apparatus, device, and storage medium

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844976A (en) * 2017-10-25 2018-03-27 武汉天喻信息产业股份有限公司 A kind of card of depositing based on block chain applies transaction system and method
CN109117097A (en) * 2018-09-05 2019-01-01 深圳正品创想科技有限公司 A kind of date storage method and system based on block chain
US20200118068A1 (en) * 2018-10-10 2020-04-16 QuestaWeb, Inc. Hierarchical Blockchain Architecture for Global Trade Management
CN109471744A (en) * 2018-11-21 2019-03-15 北京蓝石环球区块链科技有限公司 The more subchain system architectures of main chain adduction row based on block chain
CN109740384A (en) * 2019-01-11 2019-05-10 众安信息技术服务有限公司 Data based on block chain deposit card method and apparatus
CN109922131A (en) * 2019-01-17 2019-06-21 平安城市建设科技(深圳)有限公司 Date storage method, device, equipment and storage medium based on block chain
CN110059552A (en) * 2019-03-12 2019-07-26 上海大学 A kind of identity identifying method of block chain in conjunction with biological characteristic
CN110070339A (en) * 2019-04-19 2019-07-30 广东中安合创科技有限公司 A kind of civil air defense constructions and installations data management system, method based on block chain
CN110109929A (en) * 2019-04-30 2019-08-09 翟红鹰 Date storage method, device and computer readable storage medium
WO2020253467A1 (en) * 2019-06-20 2020-12-24 深圳前海微众银行股份有限公司 Blockchain system-based data processing method, system and device
CN110647649A (en) * 2019-09-29 2020-01-03 腾讯云计算(北京)有限责任公司 Feature retrieval method, device and storage medium
US20210149885A1 (en) * 2019-09-29 2021-05-20 Tencent Technology (Shenzhen) Company Limited Blockchain-based content processing method and apparatus, device, and storage medium
CN111859456A (en) * 2020-07-30 2020-10-30 重庆倍来电新能源有限公司 Fully trusted data system solution
CN112307233A (en) * 2020-10-30 2021-02-02 圆通速递有限公司 Repeated image deleting method and system in cloud storage based on block chain
CN112104665A (en) * 2020-11-02 2020-12-18 腾讯科技(深圳)有限公司 Block chain-based identity authentication method and device, computer and storage medium
CN112364209A (en) * 2020-12-09 2021-02-12 杭州复杂美科技有限公司 Distributed data storage method, data query method, device and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
MEHMET AYDAR 等: "Private key encryption and recovery in blockchain", 《ARXIV:1907.04156V2》 *
RANDHIR KUMAR 等: "A secured distributed detection system based on IPFS and blockchain for industrial image and video data security", 《JOURNAL OF PARALLEL AND DISTRIBUTED COMPUTING》 *
王尚阳: "基于区块链的安全高效数据共享方案", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Also Published As

Publication number Publication date
CN113420169B (en) 2023-03-21

Similar Documents

Publication Publication Date Title
US10354348B2 (en) Digital evidence management
US10438000B1 (en) Using recognized backup images for recovery after a ransomware attack
US8411953B2 (en) Tagging images by determining a set of similar pre-tagged images and extracting prominent tags from that set
US10078781B2 (en) Automatically organizing images
CN105447046A (en) Distributed system data consistency processing method, device and system
US9665773B2 (en) Searching for events by attendants
CN113836131B (en) Big data cleaning method and device, computer equipment and storage medium
CN104519316A (en) Monitoring system, monitoring method, monitoring program, and recording medium
CN112306687B (en) Knowledge graph-based resource allocation method and device, computer equipment and medium
CN111708794B (en) Data comparison method and device based on big data platform and computer equipment
CN109784220B (en) Method and device for determining passerby track
CN113570635B (en) Target motion trail restoration method and device, electronic equipment and storage medium
CN110569380B (en) Image tag obtaining method and device, storage medium and server
CN110689323A (en) Picture auditing method and device, computer equipment and storage medium
CN114139015A (en) Video storage method, device, equipment and medium based on key event identification
CN111651631B (en) High concurrency video data processing method, electronic equipment, storage medium and system
CN110737719A (en) Data synchronization method, device, equipment and computer readable storage medium
CN109947759A (en) A kind of data directory method for building up, indexed search method and device
CN113420169B (en) File storage and query method, system, electronic equipment and medium
US20160063010A1 (en) System and method of tracking evidence to establish a chain of custody and prevent loss
CN113360571A (en) Characteristic mark-based power grid monitoring system memory database relation database synchronization method
Wood Policing through platform
Nguyen et al. An efficient similar image search framework for large-scale data on cloud
CN111061916A (en) Video sharing system based on multi-target library image recognition
CN115511645A (en) Method, device and equipment for detecting claim settlement picture and storage medium

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