CN113068045A - Data storage method and device, electronic equipment and computer readable storage medium - Google Patents

Data storage method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN113068045A
CN113068045A CN202110287439.7A CN202110287439A CN113068045A CN 113068045 A CN113068045 A CN 113068045A CN 202110287439 A CN202110287439 A CN 202110287439A CN 113068045 A CN113068045 A CN 113068045A
Authority
CN
China
Prior art keywords
data
image
label
value
stored
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.)
Pending
Application number
CN202110287439.7A
Other languages
Chinese (zh)
Inventor
杨明宝
陈必成
林顺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Yaji Software Co Ltd
Original Assignee
Xiamen Yaji Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Yaji Software Co Ltd filed Critical Xiamen Yaji Software Co Ltd
Priority to CN202110287439.7A priority Critical patent/CN113068045A/en
Publication of CN113068045A publication Critical patent/CN113068045A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
    • H04N19/426Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements using memory downsizing methods
    • 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/53Querying
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel

Landscapes

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

Abstract

The embodiment of the application provides a data storage method, a data storage device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: acquiring a mapping table corresponding to data to be stored, wherein the mapping table is used for indicating a data label of the data to be stored and a corresponding relation between label values; acquiring a label value sequence corresponding to each data label based on a mapping table; and storing the label value sequence corresponding to each data label into a column of pixel points in the image matrix to obtain at least one data image corresponding to the data to be stored. According to the scheme, the mapping table of the data to be stored is obtained, the label value sequence of each data label is obtained according to the mapping table, and then each label value sequence is stored in a column of pixel points of the image matrix to obtain the data image.

Description

Data storage method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data storage method and apparatus, an electronic device, and a computer-readable storage medium.
Background
The existing data storage mode comprises: the storage method can store a small number of data types, and generally can only store existing common basic data types (for example, integer, or, short integer, long integer, floating point, character string, etc.), and the stored data has a fixed bit number, for example, 16 bits, 8 bits, 4 bits, etc., so that the span of the bit number is large and discontinuous, the compression is difficult, and the data storage space is large.
Disclosure of Invention
The purpose of the present application is to solve at least one of the above technical drawbacks, and to provide the following solutions:
in a first aspect, an embodiment of the present application provides a data storage method, including:
acquiring a mapping table corresponding to data to be stored, wherein the mapping table is used for indicating a data label of the data to be stored and a corresponding relation between label values;
acquiring a label value sequence corresponding to each data label based on a mapping table;
and storing the label value sequence corresponding to each data label into a column of pixel points in the image matrix to obtain at least one data image corresponding to the data to be stored.
In an optional embodiment of the present application, the mapping table is further configured to indicate a correspondence between a data object of the data to be stored and the tag value, and the method further includes:
based on the mapping table, acquiring the serial number of the label value corresponding to each data object in the corresponding label value sequence;
and storing the corresponding relation between each data object and the serial number of the label value into a line head storage system.
In an optional embodiment of the present application, storing a tag value sequence corresponding to each data tag in a column of pixel points in an image matrix includes:
and matching each label value in each label value sequence with each pixel point in a corresponding column of pixel points in sequence, and setting the gray value of the matched pixel point based on each label value.
In an optional embodiment of the present application, the method further comprises:
the data image is compressed based on image characteristics of the data image.
In an optional embodiment of the present application, the method further comprises:
when data stored in the data image needs to be retrieved, retrieving conditions are obtained, and the retrieving conditions are used for indicating corresponding target label values;
acquiring a serial number of a target label value from a data image;
and acquiring the corresponding data object from the line head storage system based on the sequence number of the target label value.
In an optional embodiment of the present application, the retrieving condition is further configured to indicate a corresponding target data tag, and obtain a serial number of the target tag value from the data image, where the retrieving condition includes:
and acquiring the serial number of the target tag value from the data image by combining the target data tag.
In an optional embodiment of the present application, if the corresponding target tag value indicated by the search condition is stored in a different data image, acquiring a serial number of the target tag value from the data image includes:
extracting and merging each row of pixel points storing target label values in each data image to obtain a corresponding merged image;
and acquiring the serial number of the target label value from the combined image based on the retrieval condition.
In an optional embodiment of the present application, obtaining a corresponding target tag value from the merged image based on the search condition includes:
setting the gray value of a pixel point where the label value which does not meet the retrieval condition in the merged image as a preset value, and screening out a gray area corresponding to the preset value in the merged image to obtain a screened merged image;
and acquiring the serial number of the target label value based on the screened combined image.
In a second aspect, an embodiment of the present application provides a data storage device, including:
the mapping table acquisition module is used for acquiring a mapping table corresponding to the data to be stored, and the mapping table is used for indicating the data labels of the data to be stored and the corresponding relation between the label values;
the label value sequence acquisition module is used for acquiring a label value sequence corresponding to each data label based on a mapping table;
and the first data storage module is used for storing the label value sequence corresponding to each data label into a column of pixel points in the image matrix to obtain at least one data image corresponding to the data to be stored.
In an optional embodiment of the present application, the mapping table is further configured to indicate a correspondence between a data object of the data to be stored and the tag value, and the apparatus further includes a second data storage module configured to:
based on the mapping table, acquiring the serial number of the label value corresponding to each data object in the corresponding label value sequence;
and storing the corresponding relation between each data object and the serial number of the label value into a line head storage system.
In an optional embodiment of the present application, the first data storage module is specifically configured to:
and matching each label value in each label value sequence with each pixel point in a corresponding column of pixel points in sequence, and setting the gray value of the matched pixel point based on each label value.
In an optional embodiment of the present application, the apparatus may further comprise an image compression module configured to:
the data image is compressed based on image characteristics of the data image.
In an optional embodiment of the present application, the apparatus further comprises a data reading module, configured to:
when data stored in the data image needs to be retrieved, retrieving conditions are obtained, and the retrieving conditions are used for indicating corresponding target label values;
acquiring a serial number of a target label value from the data image based on the retrieval condition;
and acquiring the corresponding data object from the line head storage system based on the sequence number of the target label value.
In an optional embodiment of the present application, the retrieval condition is further configured to indicate a corresponding target data tag, and the data reading module is configured to:
and acquiring the serial number of the target tag value from the data image by combining the target data tag.
In an optional embodiment of the present application, if the corresponding target tag value indicated by the search condition is stored in a different data image, the data reading module is specifically configured to:
extracting and merging each row of pixel points storing target label values in each data image to obtain a corresponding merged image;
and acquiring the serial number of the target label value from the combined image based on the retrieval condition.
In an optional embodiment of the present application, the data reading module is further configured to:
setting the gray value of a pixel point where the label value which does not meet the retrieval condition in the merged image as a preset value, and screening out a gray area corresponding to the preset value in the merged image to obtain a screened merged image;
and acquiring the serial number of the target label value based on the screened combined image.
The beneficial effect that technical scheme that this application provided brought is:
the mapping table of the data to be stored is obtained, the label value sequence of each data label is obtained according to the mapping table, and then each label value sequence is stored in a column of pixel points of the image matrix to obtain the data image.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a data storage method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a data image in an example of an embodiment of the present application;
fig. 3 is a block diagram of a data storage device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a data storage method provided in an embodiment of the present application, and as shown in fig. 1, the method may include:
step S101, a mapping table corresponding to the data to be stored is obtained, and the mapping table is used for indicating the data labels of the data to be stored and the corresponding relation between the label values.
The data to be stored is a tag value (the tag value may be obtained by quantizing the original attribute of the data to be stored, for example, the male is quantized to 1, and the female is quantized to 2), and the tag value is classified according to the attribute to obtain a plurality of data tags, and meanwhile, the data to be stored may be derived from one or more data objects, and then, each data tag may correspond to a tag value derived from one or more data objects, and further, each data tag may correspond to one or more tag values, and each data object may correspond to one or more tag values. The mapping table corresponding to the data to be stored is used for indicating the corresponding relation between the data object and the tag value and the storage relation between the data tag and the tag value.
For example, data tags of certain data to be stored include age, gender, and frequency of logging in APP (Application), and data objects thereof include user a, user B, and user C. According to the mapping table corresponding to the data to be stored, the age of the user A, the sex of the user A, and the frequency of logging in the APP can be known.
Specifically, after the data to be stored is acquired, the data object, the data tag and the tag value are analyzed and sorted, so that a corresponding mapping table is obtained.
Step S102, based on the mapping table, obtaining a label value sequence corresponding to each data label.
Specifically, each data tag may correspond to one or more tag values, so that, for convenience of subsequent storage and reading, the tag values corresponding to each data tag may be sorted, specifically, the tag values corresponding to each data tag are respectively derived from different data objects, and therefore, sorting the tag values actually sorts the different data objects, that is, each tag value is given a sequence number, and each data object is also given a sequence number. Furthermore, the sequence numbers of the tag values corresponding to all the data tags in the mapping table may be the same, that is, the sequence numbers of the tag values under different types of data tags from the same data object may be the same.
As shown in the above example, if the ages of the users A, B, C are 25, 20, and 25, and the sexes of the users A, B, C are 1,2, and 1 (where 1 represents male, and 2 represents female), respectively, then if the serial numbers of the users A, B, C are 1, 3, and 2, respectively, the tag value sequences corresponding to the ages of the data tags are 25, and 20, and the tag value sequences corresponding to the sexes of the data tags are 1, and 2, respectively, as seen from the mapping table corresponding to the data to be stored.
Step S103, storing the label value sequence corresponding to each data label into a column of pixel points in the image matrix to obtain at least one data image corresponding to the data to be stored.
Specifically, after a tag value sequence corresponding to each data tag is obtained, each tag value sequence is stored in a column of pixel points in an image matrix, if tag value sequences corresponding to different tag values are stored in the same image matrix, a data image is obtained, and if tag value sequences corresponding to different tag values are stored in different image matrices, a plurality of data images are obtained. The tag value in the tag value sequence may be integer or floating point. The sequence of tag values may or may not be regular. For example, it may be: 1,2,3, … …, N; 1,4,5,8 … …,2N, etc.; 1.5,3.4,5.6 … ….
According to the scheme, the mapping table of the data to be stored is obtained, the label value sequence of each data label is obtained according to the mapping table, and then each label value sequence is stored in one column of pixel points of the image matrix to obtain the data image, the data image is convenient to compress, and the data storage space is small.
In an optional embodiment of the present application, the mapping table is further configured to indicate a correspondence between a data object of the data to be stored and the tag value, and the method further includes:
based on the mapping table, acquiring the serial number of the label value corresponding to each data object in the corresponding label value sequence;
and storing the corresponding relation between each data object and the serial number of the label value into a line head storage system.
As can be seen from the foregoing description, the mapping table is further used to indicate a corresponding relationship between a data object of data to be stored and a tag value, and in the process of reading the data, not only the tag value itself but also a source of the tag value, that is, the data object corresponding to the tag value, needs to be determined. Since the tag value has the same sequence number as the corresponding data object, the correspondence of the data object and the corresponding sequence number can be stored in another separate storage system, referred to as a line head storage system.
In an optional embodiment of the present application, storing a tag value sequence corresponding to each data tag in a column of pixel points in an image matrix includes:
and matching each label value in each label value sequence with each pixel point in a corresponding column of pixel points in sequence, and setting the gray value of the matched pixel point based on each label value.
Specifically, since the label values in the label value sequence are sorted to have respective serial numbers, each label value is sequentially and correspondingly stored into the corresponding pixel points, specifically, the label values can be sequentially and sequentially stored into the pixel points in a row of the pixel points from top to bottom, and then, the gray values of the pixel points are set based on the corresponding label values. Specifically, the gray value of the pixel point can be set to the corresponding label value, or the gray value of the pixel point can be set to the preset multiple of the corresponding label value, and the preset multiple can be set according to actual requirements. For example, if the label value 100 is stored in the pixel point X, the gray scale value of the pixel point X is set to 100, or the gray scale value of the pixel point X is set to 150 (i.e., the gray scale value is 1.5 times the label value). It can be understood that after the label value is stored, different areas of the data image have different gray levels, as shown in fig. 2, that is, the data image is a schematic diagram after different label values are stored, wherein each square represents a pixel point.
It should be noted that the image matrix has many pixels, each pixel is actually a number, and the number needs to be represented by a binary system with a certain bit number. For example, the number of a pixel is 255, the binary representation is 16 1, that is, 16 bits are needed to represent the binary representation, and in this case, the number of bits of the pixel is 16. Assuming that the number of bits is N, the storage condition is that 2N is greater than the number N of tag values. During storage, when a plurality of pixel points meet the storage condition, the smaller the bit number n of the pixel points for storage, the better. In the image matrix, each column has a plurality of pixel points, and the bit number is the same. And during storage, if the number of the label values under the data label is N, storing the label values into N pixel points under the column.
The above scheme is further explained by an example, where the data tag corresponding to the data to be stored is a wind level, including strong wind, medium wind, weak wind, and no wind, and the tag values corresponding to quantization are 1,2,3, and 4, respectively. The existing data are: strong wind in Guangdong, gentle wind in Henan, stroke in Guangxi, no wind in Fujian, after quantification: guangdong, 1; henan, 3; guangxi, 2; fujian, 4, make up 4 records. The corresponding mapping table is shown in table 1.
TABLE 1
Figure BDA0002981071700000071
Figure BDA0002981071700000081
According to the mapping table, the tag value sequences 1,2,3 and 4 of the data tag 'wind grade' are obtained, and the corresponding serial numbers of the data object 'Guangdong, Henan, Guangxi and Fujian' are respectively '1, 2,3 and 4', so that the tag value sequences are stored in 4 pixels in a column of pixel points, and the corresponding relation between the data object and the serial numbers is stored in a line head storage system.
In an optional embodiment of the present application, the method may further comprise:
the data image is compressed based on image characteristics of the data image.
Specifically, the essence of compression storage is that, because the image has some characteristics, data of some pixel points is representative, and the compression storage can be realized by storing the data of the part of the pixel points to store all the data. It is understood that, for a plurality of data images of the obtained data to be stored, all the data images may be compressed, or only a part of the data images may be compressed.
Two examples of compressed storage methods: (1) an image is symmetric, so long as the data in the upper or lower triangular pixel points is stored. Compressed storage of data of the regular matrix. (2) In the storage method of the sparse matrix, only a few pixel points in one picture have colors, the data of the pixel points are stored, and the data of one point are stored when other points have no colors or the same color.
In an optional embodiment of the present application, the method may further comprise:
when data stored in the data image needs to be retrieved, retrieving conditions are obtained;
acquiring a serial number of a target label value from the data image based on the retrieval condition;
and acquiring the corresponding data object from the line head storage system based on the sequence number of the target label value.
Further, the search condition is also used for indicating a corresponding target data tag, and acquiring a serial number of a target tag value from the data image, and includes:
and acquiring the serial number of the target tag value from the data image by combining the target data tag.
The retrieval condition may indicate a numerical value of the tag value to be retrieved and a data tag type. The search condition indicating the numerical value size of the tag value to be searched may be considered to indicate a target tag value, and the search condition indicating the numerical value size of the tag value to be searched and the data tag type may be considered to indicate a target tag value and a target data tag.
Specifically, for the case that the target tag value is indicated, the corresponding data tag may be obtained from the mapping tag value according to the target tag value, and then, in addition to obtaining the target tag value from the data image, the corresponding data object may also be obtained from the line head storage system according to the serial number of the target tag value, so as to obtain the complete data to be retrieved. For the case where the target tag value and the target data tag are indicated, in addition to acquiring the target tag value from the data image, the corresponding data object needs to be acquired from the line head storage system according to the serial number of the target tag value, so as to acquire the complete data to be retrieved. It will be appreciated that the key in both of the above scenarios is to obtain the sequence number of the target tag value.
In an optional embodiment of the present application, if the retrieval condition indicates that the corresponding target tag value is stored in a different data image, acquiring a serial number of the target tag value from the data image includes:
extracting and merging each row of pixel points storing target label values in each data image to obtain a corresponding merged image;
and acquiring the serial number of the target label value from the combined image based on the retrieval condition.
Specifically, for single-condition retrieval, i.e., the retrieval condition indicates a target tag value (one or more values) to which one data tag corresponds. And determining a data picture corresponding to the target tag value. And fetching the rows equal to the target tag value from the data of the compressed and stored pixel point, wherein the sequence of the rows may indicate the sequence number of the target tag value, for example, row 6 may indicate that the sequence number of the target tag value is 6. And then acquiring the corresponding data object in the line head storage system based on the sequence number of the target label value.
For example, when it is queried that the wind in which regions is breeze, the target tag value is determined to be 3 and the data tag type is the wind level through the mapping table, and then the corresponding data picture is determined. The rows equal to 3 are determined from the data of the compressed and stored pixel points of the data picture, and the row number (i.e. the sequence number) is used as an index and then the "row head storage system" is referred to, so that the corresponding region can be determined, i.e. the data object is determined.
In the case of a complex condition search, that is, the search condition indicates target tag values corresponding to multiple data tags (in this case, it is understood that the search condition includes a target tag value and a target data tag), for example, "tag a ═ aa, tag B ═ bb, and tag F ═ ff", and tag value sequences corresponding to the three data tags are stored in different data images, respectively, then pixel points of columns corresponding to the three data tags in each data image are all merged to form a new image (hereinafter referred to as a merged image), and the merged image includes "ABF", that is, includes columns corresponding to the three data tags A, B, F. Two possible ways to obtain the sequence number of the target tag value from the merged image are as follows:
(1) for the merged image, the combined search condition may be searched item by item, that is, the search is performed based on the tag a ═ aa first, so as to obtain all the data in the two columns of data "aa" and "BF" in the column a; and then, taking the label B-bb and the label F-ff as screening conditions in sequence to obtain final data, thereby determining the serial number of the target label value.
(2) And for the combined image, extracting each line of data to form a combined image, and rendering a layer of image. And (3) reserving the original color of the pixel points meeting the conditions, adjusting the gray scale to be maximum when the pixel points do not meet the conditions, for example, adjusting the gray scale to be white, cutting the whitish data to obtain the desired data, and finally determining the serial number of the target label value.
It should be noted that this process can be accelerated by a GPU (Graphics Processing Unit), because the stored data in the pixel points are quantized into numbers, which is convenient for the GPU to process.
In a word, the tag value is quantized into a numerical value and stored in the pixel point of the image matrix, and the compressed storage algorithm is used for compressed storage, so that the storage space is reduced, the access efficiency is improved, and the GPU resource is used for improving the calculation speed. Also, by quantization, the type of data stored is not limited.
Fig. 3 is a block diagram of a data storage device according to an embodiment of the present disclosure, and as shown in fig. 3, the device 300 may include: a mapping table obtaining module 301, a tag value sequence obtaining module 302, and a first data storage module 303, where:
the mapping table obtaining module 301 is configured to obtain a mapping table corresponding to data to be stored, where the mapping table is used to indicate a data tag of the data to be stored and a corresponding relationship between tag values;
the tag value sequence obtaining module 302 is configured to obtain a tag value sequence corresponding to each data tag based on the mapping table;
the first data storage module 303 is configured to store the tag value sequence corresponding to each data tag into a column of pixel points in an image matrix, so as to obtain at least one data image corresponding to the data to be stored.
According to the scheme, the mapping table of the data to be stored is obtained, the label value sequence of each data label is obtained according to the mapping table, and then each label value sequence is stored in one column of pixel points of the image matrix to obtain the data image, the data image is convenient to compress, and the data storage space is small.
In an optional embodiment of the present application, the mapping table is further configured to indicate a correspondence between a data object of the data to be stored and the tag value, and the apparatus further includes a second data storage module configured to:
based on the mapping table, acquiring the serial number of the label value corresponding to each data object in the corresponding label value sequence;
and storing the corresponding relation between each data object and the serial number of the label value into a line head storage system.
In an optional embodiment of the present application, the first data storage module is specifically configured to:
and matching each label value in each label value sequence with each pixel point in a corresponding column of pixel points in sequence, and setting the gray value of the matched pixel point based on each label value.
In an optional embodiment of the present application, the apparatus may further comprise an image compression module configured to:
the data image is compressed based on image characteristics of the data image.
In an optional embodiment of the present application, the apparatus further comprises a data reading module, configured to:
when data stored in the data image needs to be retrieved, retrieving conditions are obtained, and the retrieving conditions are used for indicating corresponding target label values;
acquiring a serial number of a target label value from a data image;
and acquiring the corresponding data object from the line head storage system based on the sequence number of the target label value.
In an optional embodiment of the present application, the retrieval condition is further configured to indicate a corresponding target data tag, and the data reading module is configured to:
and acquiring the serial number of the target tag value from the data image by combining the target data tag.
In an optional embodiment of the present application, if the corresponding target tag value indicated by the search condition is stored in a different data image, the data reading module is specifically configured to:
extracting and merging each row of pixel points storing target label values in each data image to obtain a corresponding merged image;
and acquiring the serial number of the target label value from the combined image based on the retrieval condition.
In an optional embodiment of the present application, the data reading module is further configured to:
setting the gray value of a pixel point where the label value which does not meet the retrieval condition in the merged image as a preset value, and screening out a gray area corresponding to the preset value in the merged image to obtain a screened merged image;
and acquiring the serial number of the target label value based on the screened combined image.
Based on the same principle, an embodiment of the present application further provides an electronic device, where the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method provided in any optional embodiment of the present application is implemented, and the following specific cases may be implemented:
acquiring a mapping table corresponding to data to be stored, wherein the mapping table is used for indicating a data label of the data to be stored and a corresponding relation between label values; acquiring a label value sequence corresponding to each data label based on a mapping table; and storing the label value sequence corresponding to each data label into a column of pixel points in the image matrix to obtain at least one data image corresponding to the data to be stored.
The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method shown in any embodiment of the present application.
It is understood that the medium may store a computer program corresponding to the data storage method.
Fig. 4 is a schematic structural diagram of an electronic device to which the embodiment of the present application is applied, and as shown in fig. 4, the electronic device 400 shown in fig. 4 includes: a processor 401 and a memory 403. Wherein the processor 401 is coupled to the memory 403, such as via a bus 402. Further, the electronic device 400 may further include a transceiver 404, and the electronic device 400 may interact with other electronic devices through the transceiver 404. It should be noted that the transceiver 404 is not limited to one in practical applications, and the structure of the electronic device 400 is not limited to the embodiment of the present application.
In the embodiment of the present application, the processor 401 may be used to implement the functions of the data storage device shown in fig. 3,
the processor 401 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 401 may also be a combination of computing functions, e.g., comprising one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 402 may include a path that transfers information between the above components. The bus 402 may be a PCI bus or an EISA bus, etc. The bus 402 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
The memory 403 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 403 is used for storing application program codes for executing the scheme of the application, and the execution is controlled by the processor 401. The processor 401 is configured to execute application program code stored in the memory 403 to implement the actions of the data storage device provided by the embodiment shown in fig. 3.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (11)

1. A method of storing data, comprising:
acquiring a mapping table corresponding to data to be stored, wherein the mapping table is used for indicating a data label of the data to be stored and a corresponding relation between label values;
acquiring a label value sequence corresponding to each data label based on the mapping table;
and storing the label value sequence corresponding to each data label into a column of pixel points in an image matrix to obtain at least one data image corresponding to the data to be stored.
2. The method of claim 1, wherein the mapping table is further used for indicating a correspondence between a data object of the data to be stored and the tag value, and the method further comprises:
based on the mapping table, acquiring the serial number of the label value corresponding to each data object in the corresponding label value sequence;
and storing the corresponding relation between each data object and the serial number of the label value into a line head storage system.
3. The method of claim 1, wherein storing the sequence of tag values corresponding to each data tag in a column of pixels in the image matrix comprises:
and matching each label value in each label value sequence with each pixel point in a corresponding column of pixel points in sequence, and setting the gray value of the matched pixel point based on each label value.
4. The method of claim 1, further comprising:
compressing the data image based on image features of the data image.
5. The method of claim 2, further comprising:
when data stored in the data image needs to be retrieved, retrieving conditions are obtained, and the retrieving conditions are used for indicating corresponding target label values;
acquiring the serial number of the target label value from the data image;
and acquiring a corresponding data object from the line head storage system based on the sequence number of the target label value.
6. The method of claim 5, wherein the search condition is further configured to indicate a corresponding target data tag, and wherein obtaining the sequence number of the target tag value from the data image comprises:
and acquiring the serial number of the target label value from the data image by combining the target data label.
7. The method according to claim 5 or 6, wherein if the corresponding target tag value indicated by the search condition is stored in a different data image, the obtaining the serial number of the target tag value from the data image comprises:
extracting and merging columns of pixel points storing the target label value in each data image to obtain a corresponding merged image;
and acquiring the sequence number of the target label value from the combined image based on the retrieval condition.
8. The method of claim 7, wherein obtaining the corresponding target tag value from the merged image based on the search criteria comprises:
setting the gray value of a pixel point where the label value which does not meet the retrieval condition in the merged image as a preset value, and screening out a gray area corresponding to the preset value in the merged image to obtain a screened merged image;
and acquiring the sequence number of the target label value based on the screened combined image.
9. A data storage device, comprising:
the mapping table acquisition module is used for acquiring a mapping table corresponding to the data to be stored, and the mapping table is used for indicating the data labels of the data to be stored and the corresponding relation between the label values;
a tag value sequence obtaining module, configured to obtain, based on the mapping table, a tag value sequence corresponding to each data tag;
and the first data storage module is used for storing the label value sequence corresponding to each data label into a column of pixel points in an image matrix to obtain at least one data image corresponding to the data to be stored.
10. An electronic device comprising a memory and a processor;
the memory has stored therein a computer program;
the processor for executing the computer program to implement the method of any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method of any one of claims 1 to 8.
CN202110287439.7A 2021-03-17 2021-03-17 Data storage method and device, electronic equipment and computer readable storage medium Pending CN113068045A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110287439.7A CN113068045A (en) 2021-03-17 2021-03-17 Data storage method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110287439.7A CN113068045A (en) 2021-03-17 2021-03-17 Data storage method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113068045A true CN113068045A (en) 2021-07-02

Family

ID=76561067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110287439.7A Pending CN113068045A (en) 2021-03-17 2021-03-17 Data storage method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113068045A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001034513A (en) * 1999-07-19 2001-02-09 Hitachi Ltd Method and device for data conversion, and storage medium storing data conversion program
CN102982507A (en) * 2012-10-30 2013-03-20 广东威创视讯科技股份有限公司 Method and device of video image processing
CN107704527A (en) * 2017-09-18 2018-02-16 华为技术有限公司 Date storage method, device and storage medium
CN108416223A (en) * 2018-02-11 2018-08-17 长沙理工大学 A kind of information labels encryption method and its system based on chaology
CN109739854A (en) * 2018-12-27 2019-05-10 新华三大数据技术有限公司 A kind of date storage method and device
CN110168529A (en) * 2017-08-03 2019-08-23 华为技术有限公司 Date storage method, device and storage medium
CN110264488A (en) * 2019-06-20 2019-09-20 合肥工业大学 A kind of bianry image edge extraction device
CN110322416A (en) * 2019-07-09 2019-10-11 腾讯科技(深圳)有限公司 Image processing method, device and computer readable storage medium
WO2019242499A1 (en) * 2018-06-20 2019-12-26 腾讯科技(深圳)有限公司 Video encoding and decoding method and device, computer device and storage medium
CN111798467A (en) * 2020-06-30 2020-10-20 中国第一汽车股份有限公司 Image segmentation method, device, equipment and storage medium
CN112307232A (en) * 2020-10-29 2021-02-02 杭州宣迅电子科技有限公司 Intelligent classification storage processing method for big data content

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001034513A (en) * 1999-07-19 2001-02-09 Hitachi Ltd Method and device for data conversion, and storage medium storing data conversion program
CN102982507A (en) * 2012-10-30 2013-03-20 广东威创视讯科技股份有限公司 Method and device of video image processing
CN110168529A (en) * 2017-08-03 2019-08-23 华为技术有限公司 Date storage method, device and storage medium
CN107704527A (en) * 2017-09-18 2018-02-16 华为技术有限公司 Date storage method, device and storage medium
CN108416223A (en) * 2018-02-11 2018-08-17 长沙理工大学 A kind of information labels encryption method and its system based on chaology
WO2019242499A1 (en) * 2018-06-20 2019-12-26 腾讯科技(深圳)有限公司 Video encoding and decoding method and device, computer device and storage medium
CN109739854A (en) * 2018-12-27 2019-05-10 新华三大数据技术有限公司 A kind of date storage method and device
CN110264488A (en) * 2019-06-20 2019-09-20 合肥工业大学 A kind of bianry image edge extraction device
CN110322416A (en) * 2019-07-09 2019-10-11 腾讯科技(深圳)有限公司 Image processing method, device and computer readable storage medium
CN111798467A (en) * 2020-06-30 2020-10-20 中国第一汽车股份有限公司 Image segmentation method, device, equipment and storage medium
CN112307232A (en) * 2020-10-29 2021-02-02 杭州宣迅电子科技有限公司 Intelligent classification storage processing method for big data content

Similar Documents

Publication Publication Date Title
CN110287942B (en) Training method of age estimation model, age estimation method and corresponding device
JP4486780B2 (en) Nonlinear quantization and similarity matching method for image information retrieval
CN101290634B (en) Method for recognizing repeated miniature, device and its uses in search engine
US20100177967A1 (en) Image retrieval system and method
US9319690B2 (en) Method and system for image analysis
CN104160409A (en) Method and system for image analysis
US9373056B2 (en) Image analysis
CN110110113A (en) Image search method, system and electronic device
CN114969417B (en) Image reordering method, related device and computer readable storage medium
CN111553471A (en) Data analysis processing method and device
CN110110120B (en) Image retrieval method and device based on deep learning
CN110662080A (en) Machine-oriented universal coding method
JP4632830B2 (en) Image search method and image search apparatus
CN103593458A (en) Mass image searching system based on color features and inverted indexes
CN113068045A (en) Data storage method and device, electronic equipment and computer readable storage medium
CN104866818A (en) Method and device for searching pictures including human faces
CN113609313A (en) Data processing method and device, electronic equipment and storage medium
KR102054211B1 (en) Method and system for video retrieval based on image queries
CN108665434B (en) Image synthesis method and device
CN112182164A (en) High-dimensional data feature processing method and system
Janet et al. Vector quantization based index cube model for image retrieval
CN112650775B (en) Data searching method and device, electronic equipment and storage medium
CN105488510A (en) Construction method and system for color histogram of static picture
CN112257749A (en) Similar picture processing method and device, terminal equipment and storage medium
Janet et al. Incremental codebook generation for vector quantization in large scale content based image retrieval

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