CN115017877A - Storage method of layout file and local reconstruction method of sample database - Google Patents

Storage method of layout file and local reconstruction method of sample database Download PDF

Info

Publication number
CN115017877A
CN115017877A CN202210953200.3A CN202210953200A CN115017877A CN 115017877 A CN115017877 A CN 115017877A CN 202210953200 A CN202210953200 A CN 202210953200A CN 115017877 A CN115017877 A CN 115017877A
Authority
CN
China
Prior art keywords
block
target
tile
sample
image block
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
CN202210953200.3A
Other languages
Chinese (zh)
Other versions
CN115017877B (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.)
Jiaying Technology Co ltd
Original Assignee
Jiaying 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 Jiaying Technology Co ltd filed Critical Jiaying Technology Co ltd
Priority to CN202210953200.3A priority Critical patent/CN115017877B/en
Publication of CN115017877A publication Critical patent/CN115017877A/en
Application granted granted Critical
Publication of CN115017877B publication Critical patent/CN115017877B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • 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
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a storage method of a format file and a local reconstruction method of a sample database, which relate to the field of data processing, and the storage method of the format file comprises the following steps: importing a target layout file; averagely splitting the target layout file into N image blocks and giving sequential coding to each image block, wherein N is a preset positive integer; sequentially extracting each image block as a target image block, and executing storage operation on the target image block; determining a storage name of the target layout file based on the set of sequential codes of the N tiles, wherein the storage name can derive the sequential codes of the N tiles based on a preset program, and generating a readable file. The method ensures the data stability of the format files by using a dual tamper-proof means of generating relevance among different format files and storing related necessary data in a block chain, and improves the tamper-proof performance of the data of the format files.

Description

Storage method of layout file and local reconstruction method of sample database
Technical Field
The invention relates to the field of data processing, in particular to a format file storage method and a sample database local reconstruction method.
Background
The format file is generally used for referring to a non-editable file with a fixed style, the format file can avoid difference of display of the file on different devices, and common format file formats include a PDF format and the like.
At present, the direction of improvement of format files in the market is mainly focused on the size reduction direction of the files, namely how to compress the format files to a greater extent is mainly considered, and in fact, for most application scenes, the size of the format files cannot influence the storage and the use of the format files.
With the development of computer technology, the security problem of the format file should be taken into consideration of technical improvement, and with the popularization and use of the format file with the conventional format, the problem of tampering with the format file with the conventional format is more serious, so that it is necessary to improve the tamper resistance of the format file.
Disclosure of Invention
The embodiment of the invention provides a storage method of a format file and a local reconstruction method of a sample database, which cover the storage and reading of the format file, ensure the data stability of the format file by using a dual tamper-proof means of generating relevance among different format files and storing related necessary data in a block chain, improve the tamper-proof performance of the data of the format file and have good practical significance.
Correspondingly, the invention provides a storage method of a layout file, which comprises the following steps:
importing a target layout file;
averagely splitting the target layout file into N image blocks and giving sequential coding to each image block, wherein N is a preset positive integer;
sequentially extracting each image block as a target image block, and executing storage operation on the target image block;
determining a storage name of the target layout file based on the set of sequential codes of the N tiles, wherein the storage name is capable of deriving the sequential codes of the N tiles based on a preset program, and generating a readable file;
executing a save job on the target tile comprises:
taking the target image block as a reference, and searching a sample image block which is most similar to the target image block in a sample database to serve as a comparison image block;
comparing the target tile to the difference of the reference tiles, and forming a transform code based on the difference, the transform code being used to transform the reference tiles into the target tile;
storing the target pattern block as a sample pattern block in the sample database;
and storing the transformation code, the sequence coding of the target image block and the sequence coding of the comparison image block to a block chain.
In an alternative embodiment, storing the transform code, the sequential encoding of the target tile, and the sequential encoding of the reference tile into a tile chain includes:
packing the transform code, the sequential encoding of the target tile and the sequential encoding of the reference tile into a block and adding the block to the end of a block chain;
the blocks are encoded in the order of the target tile as identifying feature values.
In an optional embodiment, averagely splitting the target layout file into N tiles and assigning a sequential code to each tile, where N is a preset positive integer includes:
sequentially assigning sequential codes a to the N image blocks according to a preset spatial sequence 1 ,a 2 ,……,a N-1 , a N And the sequence coding difference value between two adjacent image blocks is a preset value, and the sequence coding of the image block in the later sequence is greater than that of the image block in the earlier sequence.
In an alternative embodiment, determining the storage name of the target layout file based on the sequentially encoded set of N tiles and generating a readable file includes:
extraction of a 1 As the first feature value, a is extracted N As a second characteristic value;
determining a storage name of the target layout file based on the first characteristic value and the second characteristic value.
In an optional embodiment, storing the target tile as a sample tile in the sample database comprises:
if there is a sample tile in the sample database that is the same as the target tile, then additional and the same sequential encoding as that of the target tile is added on the sample tile.
In an alternative embodiment, the block chain comprises a number of blocks;
the storage method of the layout file further comprises the following steps:
when the block length on the block chain meets a preset condition, deriving an original verification block based on the real-time block length of the block chain;
importing a verification picture block;
and taking the original verification image block as a target image block, and executing the saving operation on the target image block.
In an optional embodiment, when the target tile is a verification tile, before a sample tile most similar to the target tile is retrieved from the sample database as a comparison tile, the sample tile with the verification tile content and the sample tile with the initial tile content in the sample database are rejected.
Correspondingly, the invention provides a sample database local reconstruction method of a layout file, which comprises the following steps:
initializing a sample database with empty contents;
importing a plurality of initial image blocks as sample image blocks in the sample database with empty content;
the method comprises the steps that a local participation block chain is maintained, and the local synchronization block chain is arranged in the local synchronization block chain, wherein the block chain comprises a plurality of blocks which are arranged in sequence, and each block comprises a transformation code, a sequential code of a target block and a sequential code of a comparison block;
according to the sequence of the blocks in the block chain, sequentially extracting one block from the block chain as a target block and reconstructing the target block;
performing reconstruction operations on the target block comprises:
extracting a transformation code, a sequential code of a target image block and a sequential code of a comparison image block in the target block;
searching in the sample database in real time according to the sequence coding of the comparison image blocks to obtain corresponding sample image blocks as the comparison image blocks;
processing the comparison image block according to the transformation code to obtain a target image block;
and after the sequential coding of the target image block is given to the target image block, importing the target image block into the sample database as a sample image block.
In an alternative embodiment, the blocks in the blockchain have identifying characteristic values that are encoded in the same order as the target block.
Optionally, the method further includes a step of verifying the sample database;
the step of verifying the sample database comprises the following steps:
taking a sample picture block obtained by carrying out reconstruction operation on a block at a preset position as a reconstruction verification picture block;
deriving an original verification pattern block based on the sorting of the blocks corresponding to the reconstruction verification pattern block on the block chain;
the reconstructed verification tile and the original verification tile are compared.
The embodiment of the invention provides a storage method of a format file and a local reconstruction method of a sample database, which cover the storage and reading of the format file, and in the aspect of data storage, the data stability of the format file is ensured by using a double tamper-proof means which generates relevance among different format files and stores relevant necessary data in a block chain, the tamper-proof performance of the data of the format file is improved, and the method has good practical significance; in the aspect of use of a user, the sample database is locally reconstructed, so that the user can quickly read the layout file, and the method has good use convenience.
Drawings
Fig. 1 is a flowchart of a method for storing a layout file according to an embodiment of the present invention.
FIG. 2 is a flowchart illustrating a target tile saving operation according to an embodiment of the present invention.
Fig. 3 is a flowchart of a sample database local reconstruction method for a layout file according to an embodiment of the present invention. .
FIG. 4 is a flowchart illustrating a target block reconstruction operation according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention particularly provides a storage method of a format file and a sample database local reconstruction method of the format file, and particularly relates to two aspects of file storage and file reading of a format when the format file is used; in the embodiment of the invention, file reading of the format file depends on sample blocks in the sample database and on record data of a block chain, and the record data of the block chain is actually shared in a cloud end, so that the use of the format file substantially depends on the sample database, and the block chain is mainly used for restoring the data of the sample database and ensuring the accuracy of the sample data; therefore, the embodiment of the invention mainly explains the storage of the format file and the local reconstruction direction of the sample database, and the combined implementation of the storage and the local reconstruction direction can meet the application requirement of the format file.
Fig. 1 shows a flowchart of a storing method of a layout file according to an embodiment of the present invention.
Specifically, the embodiment of the invention provides a storage method of a layout file, which comprises the following steps:
s101: importing a target layout file;
the storage and reading of the layout files are realized by modern electronic equipment, a visual man-machine conversation interface is generally used for storing and reading the layout files, the storage and reading of the layout files are realized by a program substantially, and the storage and reading of the layout files by different software are not necessarily the same, so that the problem of importing the layout files in the software is involved in the embodiment of the invention, so that the layout files can be stored in a set storage form and can be read in a reversible mode.
Specifically, for a target layout file to be stored, the target layout file needs to be imported first, and in the embodiment of the present invention, the target layout file is imported into software, and is stored on a specific information carrier in a specific data form after being processed by the software.
S102: averagely splitting the target layout file into N image blocks and giving sequential coding to each image block, wherein N is a preset positive integer;
specifically, the sequential coding needs to keep uniqueness within the service life of the program because the subsequent data related to the tiles are stored in the block chain, and in order to make the sequential coding unique, when the tiles are endowed with the sequential coding, the last used sequential coding needs to be found in the block chain firstly, and then the sequential coding is endowed to the tiles of the target layout file on the basis, so as to ensure the uniqueness of the sequential coding.
Specifically, regarding the naming of sequential encoding, sequential encoding is generally performed in an incremental manner, for example, splitting the target layout file into N tiles on average and assigning sequential encoding to each tile includes:
sequentially assigning sequential codes a to the N image blocks according to a preset spatial sequence 1 ,a 2 ,……,a N-1 , a N And the sequence coding difference value between two adjacent image blocks is a preset value, and the sequence coding of the image block in the later sequence is greater than that of the image block in the earlier sequence.
In addition, a used in order-assigned coding according to the embodiment of the present invention 1 When a target layout file is split into N graphic blocks, the total number of codes used by the N graphic blocks is N, the subscript symbol represents the sorting sequence of the graphic blocks in the sequence, and a 1 And the N image blocks of the equal symbols which do not represent different target layout files adopt the same identification. In particular, a 1 The value of (a) needs to be associated with the last used sequential coding in the block chain 1 Is greater than the last used sequential coding in the block chain.
S103: sequentially extracting each image block as a target image block, and executing storage operation on the target image block;
specifically, after the target layout file is divided into N tiles, the tiles are stored as a storage base unit, and specifically, the storage of the N tiles can be divided into storage of each tile in sequence, so that one tile is extracted according to the sequence of the tiles as a target tile, and a storage operation is performed on the target tile.
The specific operation contents of the save job will be described later.
S104: determining a storage name of the target layout file based on the set of sequential encoding of the N tiles, wherein the storage name is capable of deriving the sequential encoding of the N tiles based on a preset program, and generating a readable file.
After the N image blocks are saved, the content of the target layout file is substantially stored, and accordingly, in order to be read and used by a user, a file entry needs to be constructed for the user to select. Specifically, in the embodiment of the present invention, after the N tiles of the target layout file are all stored, a readable file needs to be generated.
Specifically, in the embodiment of the present invention, since the target format file is stored in the form of a tile, and accordingly, a correlation is required between the target format file and the corresponding bump, in the embodiment of the present invention, a storage name of the target format file needs to have a correlation with N tiles corresponding to the target format file, therefore, in the embodiment of the present invention, the storage name of the target format file needs to be confirmed by a set of sequential codes of the N tiles, and the storage name of the target format file can derive the sequential codes of the N tiles based on a preset program.
In the embodiment of the present invention, the sequential coding of N tiles has the characteristic of equivalent incremental property, and theoretically, all the sequential coding of N tiles can be known only by knowing the sequential coding of the first tile in the N tiles and the number of tiles (or the sequential coding of the last tile).
Therefore, in the embodiment of the present invention, determining the storage name of the target layout file based on the sequentially encoded set of N tiles and generating a readable file includes:
extraction of a 1 As the first feature value, a is extracted N As a second characteristic value;
determining a storage name of the target layout file based on the first characteristic value and the second characteristic value.
Specifically, there are many ways of determining the storage name of the target layout file with respect to the first characteristic value and the second characteristic value, which are simple, and the first characteristic value and the second characteristic value are combined in a plaintext manner to obtain the storage name; the first characteristic value and the second characteristic value can be processed in an encryption mode and then combined to obtain a storage name, which mainly relates to the problem of reciprocal operation between two groups of data and one group of data and can be realized according to the prior art.
FIG. 2 illustrates a target tile saving job flow diagram according to an embodiment of the present invention.
Specifically, executing the save job on the target tile includes:
s201: taking the target image block as a reference, and searching a sample image block which is most similar to the target image block in a sample database to serve as a comparison image block;
specifically, a sample database is introduced in this step. The sample database comprises a plurality of sample tiles, the generation logic of the sample tiles imports all the tiles used by the software as the sample tiles, and the sample tile capacity of the sample database is increased along with the increase of the use time of the software. Specifically, the contents of the sample database will be further described in the following.
Specifically, a sample image block most similar to the target image block is searched in a sample database to serve as a comparison image block; for similar accurate concepts, the determination can be made based on the selected similarity comparison direction.
Specifically, in the embodiment of the present invention, the image block may be understood as an image composed of pixels, and for the similarity comparison of the images, according to the generation logic of the sample image blocks in the sample database, the sample image blocks and the target image block are of equal size, and the number and the distribution structure of the pixels are consistent; most fundamentally, a pixel point-to-point comparison mode can be adopted for comparison, and if the number of pixels with the same pixel point-to-point is more, the similarity is higher; furthermore, for the comparison of the similarity of the images, a cosine comparison method, a histogram comparison method, and other image similarity comparison methods in the prior art can be used for comparison.
It should be noted that, the selection of the comparison block also involves the generation of the subsequent transform code, and according to the current computer logic, generally, the simpler the similarity comparison algorithm adopted in the selection stage of the comparison block (the easier the calculation, the lower the calculation force requirement, and the shorter the time requirement), the larger the scale of the transform code obtained in the subsequent transform code generation stage (the larger the storage capacity requirement); the more complex the similarity comparison algorithm adopted in the selection stage of the comparison image block (the harder the calculation, the higher the calculation power requirement and the longer the time requirement), the smaller the scale of the transformation code obtained in the subsequent transformation code generation stage; therefore, when the similarity algorithm is actually selected, the overall consideration needs to be performed by combining the scale of the transform code, so that a good balance is achieved in terms of the data storage scale and the computational investment scale.
S202: comparing the target tile to the difference of the reference tiles, and forming a transform code based on the difference, the transform code being used to transform the reference tiles into the target tile;
specifically, the function of the transform code is to enable the comparison image block to be transformed into the target image block, and in essence, the actual function of the transform code is to retain data of the same pixel in the comparison image block and the target image block and transform pixels which are not the same, so that the target image block can be derived from the comparison image block.
S203: storing the target pattern block as a sample pattern block in the sample database;
after use, the target tile is stored as a sample tile in the sample database. It should be noted that, in order to save capacity, storing the target tile as a sample tile into the sample database includes:
if the sample pattern block same as the target pattern block exists in the sample database, adding additional sequence codes which are the same as the sequence codes of the target pattern block on the sample pattern block, storing two sample pattern blocks which are substantially the same as the sequence codes of the target pattern block as one sample pattern block, and obtaining a corresponding sample pattern block structure when the sample pattern blocks are required to be obtained according to the sequence codes; if the sample pattern block is needed to be used as the comparison pattern block, the larger or smaller sequence code can be selected for use, so that the stability of the data content is ensured.
S204: and storing the transformation code, the sequential coding of the target image block and the sequential coding of the comparison image block to a block chain.
Specifically, the block chain structure is introduced in this step, specifically, compared with the substantive data of the block, the block chain is mainly used for storing the transform code, the sequential coding of the target block, and the sequential coding of the comparison block, and the block chain mainly serves to derive the sample database and ensure the non-tamper-proof property of the data of the sample block, and in essence, the stored data on the block chain already can fully represent the sample database, but in actual use, the sample block in the sample database is directly used, and although the stored data on the block chain can derive the sample database, the stored data cannot be directly used well; however, since the size of the tile data is large and is not suitable for being directly stored in the tile chain, the data sufficient for reconstructing the sample database, that is, the transform code, the sequential encoding of the target tile, and the sequential encoding of the comparison tile, are stored in the tile chain according to the embodiment of the present invention.
Specifically, the data in the blockchain is generally packed in the block, and therefore, storing the transform code, the sequential encoding of the target tile, and the sequential encoding of the reference tile into the blockchain includes:
packing the transform code, the sequential encoding of the target tile and the sequential encoding of the reference tile into a block and adding the block to the end of a block chain; the blocks are encoded in the order of the target tile as identifying feature values.
According to the setting mode, one block is corresponding to the reconstruction information of one target image block, and correspondingly, when the target block is to be reconstructed, only the corresponding block needs to be found, so that the identification feature code of the block and the sequence coding of the target image block are equivalent and consistent with each other in the embodiment of the invention.
In combination with the foregoing description, in the embodiment of the present invention, the storage manner for the layout file can be summarized as follows: firstly, equally dividing a format file into a plurality of image blocks and respectively storing each image block; the final representation form of the storage is that the image blocks are stored in the sample database as sample image blocks; before the image blocks are stored in a sample database as sample image blocks, the most similar sample image blocks in the sample database are used as a reference, transformation codes are generated through comparison, and the corresponding image blocks can be derived through the combination of the transformation codes and the sample image blocks; accordingly, the transform code involved therein, the information of the sample tile (sequential coding), and the information of the target tile (sequential coding) are packed into blocks and stored in the block chain.
The substantive functions of the storage application of the layout file are as follows: the block chains have a sequential characteristic, each block is arranged in sequence, data in the blocks are related data of the blocks for generating the layout file, and the data of the related data of the blocks can be ensured not to be tampered by the block chains; for the use of the layout file, all the image blocks related to the program are stored in the sample database, the image blocks obtained by splitting the layout file are also stored in the sample database, and are directly read from the sample database when in use and are displayed according to corresponding rules, so that the layout file is more convenient to use; according to the target block storage logic of the embodiment of the invention, the storage of the target blocks depends on the sample blocks, and the target blocks can be finally changed into the sample blocks, namely, the storage of different sample blocks is sequential, chain-type correlation similar to the block chain can be formed among the sample blocks, and the sample blocks are gradually added into the sample database according to the sequence of the blocks in the reconstruction process of the sample database, so that the sequence of the block chain can be fully applied, the logic generated by the blocks can also be applied, and the combination of the two can ensure that the sample blocks in the sample database have good data accuracy and reliability.
It should be further noted that, in order to perform manual intervention data checking on the blockchain and the sample database, alternative embodiments,
the block chain comprises a plurality of blocks;
the storage method of the layout file further comprises the following steps:
when the block length on the block chain meets a preset condition, deriving an original verification block based on the real-time block length of the block chain, wherein the verification block is related to the length of the block chain and has a known property;
importing a verification picture block;
and taking the original verification image block as a target image block, and executing the saving operation on the target image block.
Specifically, the verification image blocks are artificially constructed image blocks which are not actually used by the format file, the verification image blocks are imported after a certain number of blocks are arranged on the block chain at intervals, and the accuracy of the sample database can be checked in the subsequent reconstruction process of the sample database. For example, by importing the verification pattern block, the related data of the verification pattern block can also be written into the block chain, and when the sample database is reconstructed, the verification pattern block can be correspondingly generated according to the block chain data; because each sample image block in the sample database is generated by depending on another sample image block, whether the sample image block generated before the verification image block is accurate can be judged by directly comparing the verification image block during storage with the regenerated verification image block.
Further, in order to prevent the verification pattern block from using only the earlier verification pattern block or the initial pattern block as the comparison object, and thus the verification effect cannot be exerted, when the target pattern block is the verification pattern block, a sample pattern block most similar to the target pattern block is searched in the sample database to be used as the comparison pattern block, and the sample pattern block with the content as the verification pattern block and the sample pattern block with the content as the initial pattern block in the sample database are removed.
Specifically, the initial block will be described later.
Fig. 3 shows a flowchart of a method for locally reconstructing a sample database of a layout file according to an embodiment of the present invention.
The embodiment of the invention provides a sample database local reconstruction method of a layout file, which comprises the following steps:
s301: initializing a sample database with empty contents;
the empty sample database is mainly used for defining a basic data form of the sample database, and subsequent data can be conveniently imported.
S302: importing a plurality of initial image blocks as sample image blocks in the sample database with empty content;
specifically, since the layout file of the embodiment of the present invention is stored depending on the existing samples in the sample database (the data on the blockchain is also closely associated with the existing samples), it is necessary to actively add the sample tiles in the empty sample database.
It should be noted that the basic role of the initial tile is to ensure the availability of information in the tile chain and prevent program interruption; furthermore, the initial image block substantially controls the generation of all the subsequent sample image blocks, so that a plurality of initial image blocks can also be used as an initialization password; because the initial image block does not correspond to the layout file, the representation display is not carried out, and when the initial image block is used as an initialization password, the security is good.
In fact, for convenience, if no additional function is required, the initial tile may be preset to be a tile with all white pixels or black pixels.
S303: the local participation block chain is maintained and is synchronized in the local block chain;
specifically, in combination with the foregoing description, the block chain includes a plurality of blocks arranged in sequence, and each of the blocks includes a transform code, a sequential encoding of a target block, and a sequential encoding of a comparison block;
the block chain can be understood as a database commonly maintained by a plurality of users/a plurality of user devices, when the block chain needs to be synchronized, the user devices need to participate in the maintenance of the block chain, and by means of the implementation mode, when the user needs to read the related format file, the user passively participates in the maintenance of the block chain, and the continuity of the block chain can be guaranteed.
S304: according to the sequence of the blocks in the block chain, sequentially extracting one block from the block chain as a target block and reconstructing the target block;
the reconstruction of the sample database is sequential, on one hand, the block chain is sequential, and on the other hand, the data storage form of the blocks in the embodiment of the invention depends on the sequence.
Fig. 4 is a flowchart illustrating a target block reconstruction operation according to an embodiment of the present invention.
Correspondingly, the reconstructing operation of the target block includes:
s401: extracting a transformation code, a sequential code of a target image block and a sequential code of a comparison image block in the target block;
s402: searching in the sample database in real time according to the sequence coding of the comparison image blocks to obtain corresponding sample image blocks as the comparison image blocks;
the data contained in the block comprises a transformation code, a sequential code of a target block and a sequential code of a comparison block, wherein the existing sample blocks are searched in the sample database by utilizing the sequential codes of the comparison blocks, and the corresponding sample blocks are used as the comparison blocks.
S403: processing the comparison image block according to the transformation code to obtain a target image block;
and then processing the comparison image block by using a corresponding transformation code to obtain a target image block.
S404: and after the sequential coding of the target image block is given to the target image block, importing the target image block into the sample database as a sample image block.
And after the sequence codes corresponding to the target image blocks are given to the target image blocks, the target image blocks are stored in a sample database as sample image blocks.
According to the block arrangement sequence on the block chain, the steps S401 to S404 are repeatedly executed, and the local reconstruction of the sample database can be completed.
Correspondingly, in addition to sequentially selecting blocks according to the block sequence of the block chain to perform the reconstruction operation, the reconstruction operation may also be sequentially selected according to the identification characteristic value of the blocks, specifically, the blocks on the block chain have the identification characteristic value, the identification characteristic value is the same as the sequence code of the target block, and the identification characteristic value substantially represents the sequence code.
Further, if the sample database needs to be actively checked, the target block is rebuilt, and the method further comprises a step of checking the sample database.
Specifically, in the reconstruction process of the sample database, the comparison data therein are substantially equivalent, so that, in combination with the aforementioned import logic of the verification tile block, the verification tile block can be confirmed at the position of the block in the block chain (the length of the block chain in the corresponding block), and the reconstructed verification tile block is compared with the original verification tile block to confirm the reconstruction accuracy of the sample database.
Specifically, the step of verifying the sample database includes:
taking a sample picture block obtained by carrying out reconstruction operation on a block at a preset position as a reconstruction verification picture block;
deriving an original verification pattern block based on the sorting of the blocks corresponding to the reconstruction verification pattern block on the block chain;
the reconstructed verification tile and the original verification tile are compared.
When the reconstructed verification pattern block is inconsistent with the original verification pattern block, the reconstructed sample pattern block before the reconstructed verification pattern block is reconstructed in error and needs to be reconstructed again.
After the local reconstruction of the sample database is completed, correspondingly, the readable file with the storage name generated during the storage of the format file can be selected and used by a user, after the user selects one readable file, the user searches for a related block in the sample database according to the storage name of the readable file, and performs sequencing combination according to a preset program (consistent with the program logic when the format file is unpacked into N blocks), so as to obtain a visual format file.
To sum up, the embodiment of the invention provides a storage method of a format file and a local reconstruction method of a sample database, which cover the storage and reading of the format file, and in the aspect of data storage, the data stability of the format file is ensured by using a dual tamper-proof means of generating relevance among different format files and storing related necessary data in a block chain, so that the tamper-proof performance of the data of the format file is improved, and the method has good practical significance; in the aspect of use of a user, the sample database is locally reconstructed, so that the user can quickly read the layout file, and the method has good use convenience.
The storage method of the format file and the local reconstruction method of the sample database provided by the embodiment of the invention are described in detail, a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for storing a layout file is characterized by comprising the following steps:
importing a target layout file;
averagely splitting the target layout file into N image blocks and giving sequential coding to each image block, wherein N is a preset positive integer;
sequentially extracting each image block as a target image block, and executing storage operation on the target image block;
determining a storage name of the target layout file based on the set of sequential codes of the N tiles, wherein the storage name can derive the sequential codes of the N tiles based on a preset program, and generating a readable file;
executing a save job on the target tile comprises:
taking the target image block as a reference, and searching a sample image block which is most similar to the target image block in a sample database to serve as a comparison image block;
comparing the target tile to the difference of the reference tiles, and forming a transform code based on the difference, the transform code being used to transform the reference tiles into the target tile;
storing the target pattern block as a sample pattern block in the sample database;
and storing the transformation code, the sequence coding of the target image block and the sequence coding of the comparison image block to a block chain.
2. The method of claim 1, wherein storing the transform code, the sequential encoding of the target tile, and the sequential encoding of the reference tile onto a tile chain comprises:
packing the transform code, the sequential encoding of the target tile and the sequential encoding of the reference tile into a block and adding the block to the end of a block chain;
the blocks are encoded in the order of the target tile as identifying feature values.
3. The method for storing the layout file according to claim 1, wherein the splitting the target layout file into N tiles on average and assigning a sequential code to each tile, where N is a preset positive integer includes:
sequentially assigning sequential codes a to the N image blocks according to a preset spatial sequence 1 ,a 2 ,……,a N-1 , a N And the sequence coding difference value between two adjacent image blocks is a preset value, and the sequence coding of the image block in the later sequence is greater than that of the image block in the earlier sequence.
4. The method of claim 3, wherein determining a storage name of the target layout file based on the sequentially encoded set of N tiles and generating a readable file comprises:
extraction of a 1 As the first feature value, a is extracted N As a second eigenvalue;
determining a storage name of the target layout file based on the first characteristic value and the second characteristic value.
5. The method of claim 1, wherein storing the target tile as a sample tile in the sample database comprises:
if there is a sample tile in the sample database that is the same as the target tile, then additional and the same sequential encoding as that of the target tile is added on the sample tile.
6. The method for storing the layout file according to claim 1, wherein the block chain comprises a plurality of blocks;
the storage method of the layout file further comprises the following steps:
when the block length on the block chain meets a preset condition, deriving an original verification block based on the real-time block length of the block chain;
importing a verification picture block;
and taking the original verification image block as a target image block, and executing the saving operation on the target image block.
7. The method for storing the layout file as claimed in claim 6, wherein when the target tile is the verification tile, the sample tile with the content of the verification tile and the sample tile with the content of the initial tile in the sample database are rejected before a sample tile most similar to the target tile is retrieved from the sample database as the comparison tile.
8. A local reconstruction method for a sample database of a layout file is characterized by comprising the following steps:
initializing a sample database with empty contents;
importing a plurality of initial image blocks as sample image blocks in the sample database with empty content;
the method comprises the steps of maintaining a local participation block chain and synchronizing the block chain locally, wherein the block chain comprises a plurality of blocks which are arranged in sequence, and each block comprises a transformation code, a sequence code of a target block and a sequence code of a comparison block;
according to the sequence of the blocks in the block chain, sequentially extracting one block from the block chain as a target block and reconstructing the target block;
performing reconstruction operations on the target block comprises:
extracting a transformation code, a sequential code of a target image block and a sequential code of a comparison image block in the target block;
searching in the sample database in real time according to the sequence coding of the comparison image blocks to obtain corresponding sample image blocks as the comparison image blocks;
processing the comparison image block according to the transformation code to obtain a target image block;
and after the sequential coding of the target image block is given to the target image block, importing the target image block into the sample database as a sample image block.
9. The method of claim 8, wherein a tile on the chain of tiles has an identifying eigenvalue that is the same as the sequential encoding of the target tile.
10. The method for locally reconstructing a sample database of layout files according to claim 8, further comprising a step of verifying the sample database;
the step of verifying the sample database comprises the following steps:
taking a sample picture block obtained by carrying out reconstruction operation on a block at a preset position as a reconstruction verification picture block;
deriving an original verification pattern block based on the sorting of the blocks corresponding to the reconstruction verification pattern block on the block chain;
the reconstructed verification tile and the original verification tile are compared.
CN202210953200.3A 2022-08-10 2022-08-10 Storage method of layout file and local reconstruction method of sample database Active CN115017877B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210953200.3A CN115017877B (en) 2022-08-10 2022-08-10 Storage method of layout file and local reconstruction method of sample database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210953200.3A CN115017877B (en) 2022-08-10 2022-08-10 Storage method of layout file and local reconstruction method of sample database

Publications (2)

Publication Number Publication Date
CN115017877A true CN115017877A (en) 2022-09-06
CN115017877B CN115017877B (en) 2022-10-11

Family

ID=83065466

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210953200.3A Active CN115017877B (en) 2022-08-10 2022-08-10 Storage method of layout file and local reconstruction method of sample database

Country Status (1)

Country Link
CN (1) CN115017877B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117271528B (en) * 2023-11-16 2024-02-06 佳瑛科技有限公司 Table key character storage method and system based on block chain technology

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101308488A (en) * 2008-06-05 2008-11-19 北大方正集团有限公司 Document stream type information processing method based on format document and device therefor
US20100119170A1 (en) * 2008-11-07 2010-05-13 Yahoo! Inc. Image compression by comparison to large database
CN113408259A (en) * 2021-06-09 2021-09-17 微易签(杭州)科技有限公司 Method, system, device and storage medium for filling in files based on block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101308488A (en) * 2008-06-05 2008-11-19 北大方正集团有限公司 Document stream type information processing method based on format document and device therefor
US20100119170A1 (en) * 2008-11-07 2010-05-13 Yahoo! Inc. Image compression by comparison to large database
CN113408259A (en) * 2021-06-09 2021-09-17 微易签(杭州)科技有限公司 Method, system, device and storage medium for filling in files based on block chain

Also Published As

Publication number Publication date
CN115017877B (en) 2022-10-11

Similar Documents

Publication Publication Date Title
CN102236693B (en) Method and device for determining similarity between documents
US8265407B2 (en) Method for coding and decoding 3D data implemented as a mesh model
CN110362542B (en) Nuclear power station file encoding method and device, computer equipment and storage medium
CN110457873A (en) A kind of watermark embedding and detection method and device
CN108985066A (en) Intelligent contract security vulnerability detection method, device, terminal and storage medium
CN115017877B (en) Storage method of layout file and local reconstruction method of sample database
CN110189384B (en) Image compression method, device, computer equipment and storage medium based on Unity3D
CN112231516A (en) Training method of video abstract generation model, video abstract generation method and device
CN111475785A (en) Information acquisition method and device, computer equipment and storage medium
CN111666114A (en) Plug-in type well logging data conversion method
CN111222611A (en) Stacking type three-dimensional code encoding method, encoding device, decoding method, decoding device and storage medium based on colors
CN116226681B (en) Text similarity judging method and device, computer equipment and storage medium
CN110730277B (en) Information coding and method and device for acquiring coded information
CN115544979A (en) Method, device and equipment for extracting administrative address and storage medium
CN112528674B (en) Text processing method, training device, training equipment and training equipment for model and storage medium
CN111737090B (en) Log simulation method and device, computer equipment and storage medium
CN114222181A (en) Image processing method, device, equipment and medium
CN111143619B (en) Video fingerprint generation method, search method, electronic device and medium
CN116702218B (en) Rendering method, device, terminal and storage medium of three-dimensional model in applet
CN113537484B (en) Network training, encoding and decoding method, device and medium for digital watermarking
CN117544822B (en) Video editing automation method and system
CN115982358B (en) Document splitting method, device, terminal equipment and computer readable storage medium
CN113766311B (en) Method and device for determining video segment number in video
CN113961905B (en) Storage method of on-line agreement signing data
CN117786626A (en) Method for generating data watermark and tracing watermark information

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