CN114510605A - Data storage method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN114510605A
CN114510605A CN202011279996.6A CN202011279996A CN114510605A CN 114510605 A CN114510605 A CN 114510605A CN 202011279996 A CN202011279996 A CN 202011279996A CN 114510605 A CN114510605 A CN 114510605A
Authority
CN
China
Prior art keywords
storage
original data
field
data information
value
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
CN202011279996.6A
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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN202011279996.6A priority Critical patent/CN114510605A/en
Publication of CN114510605A publication Critical patent/CN114510605A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; 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/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing

Landscapes

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

Abstract

The embodiment of the invention discloses a data storage method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring scene information and/or field attributes in original data information; wherein the original data information comprises at least two fields; determining a storage strategy according to scene information of the original data information and/or field attributes of the original data information; determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component. By adopting the technical means, the purposes of improving the development efficiency and simplifying the data storage process so as to improve the data storage efficiency can be achieved.

Description

Data storage method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a data storage method and device, electronic equipment and a storage medium.
Background
Today's society has transitioned from the it (information technology) era to the dt (data technology) era, where data is a vital wealth for individuals or businesses. Nowadays, more and more enterprises are aware of the importance of data and want to manage and utilize the data they own, thereby increasing the value of the data.
Currently, big data provides some non-relational databases and other big data related components for storage and query of semi-structured and unstructured data.
However, when the existing big data is stored, multi-component storage is usually adopted, different warehousing rules need to be defined for different components, and the different warehousing rules need different codes, so that the development period is long, and the labor investment is large.
Therefore, a data storage method is needed to improve the development efficiency and simplify the data storage process, so as to improve the data storage efficiency.
Disclosure of Invention
The embodiment of the invention provides a data storage method, a data storage device, electronic equipment and a storage medium, and aims to improve development efficiency and simplify a data storage process so as to improve data storage efficiency.
In a first aspect, an embodiment of the present invention provides a data storage method, including:
acquiring scene information and/or field attributes in original data information; wherein the original data information comprises at least two fields;
determining a storage strategy according to scene information of the original data information and/or field attributes of the original data information;
determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component.
In a second aspect, an embodiment of the present invention further provides a data storage device, including:
the original data information acquisition module is used for acquiring scene information and/or field attributes in the original data information; wherein the original data information comprises at least two fields;
the storage strategy determining module is used for determining a storage strategy according to the scene information of the original data information and/or the field attribute of the original data information;
the storage position determining module is used for determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the data storage method according to any one of the embodiments of the present invention.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data storage method according to any one of the embodiments of the present invention.
The method comprises the steps of obtaining scene information and/or field attributes in original data information; wherein the original data information comprises at least two fields; determining a storage strategy according to scene information of the original data information and/or field attributes of the original data information; determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component. By adopting the technical means, the purposes of improving the development efficiency and simplifying the data storage process so as to improve the data storage efficiency are achieved.
Drawings
Fig. 1 is a schematic flow chart of a data storage method according to a first embodiment of the present invention;
fig. 2 is a schematic flowchart of a data storage method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data storage device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, subprograms, and the like.
Example one
Fig. 1 is a schematic flow chart of a data storage method according to an embodiment of the present invention, where the embodiment is applicable to a case where large data is stored in multiple storage components, and the method may be executed by a data storage device. The device can be realized in a software and/or hardware mode, can be integrated in electronic equipment, and specifically comprises the following steps:
s110, acquiring scene information and/or field attributes in original data information; wherein the original data information comprises at least two fields.
In this embodiment, the original data information is unstructured data and semi-structured data to be stored. The context information may include an application context of the data, and may be divided into a search query class and a comparison analysis class according to the context information. The field attribute may include a query frequency of the field, and it is more efficient to store the field in the process of storing the original data information. Therefore, it is necessary to acquire the field attribute in the original data information.
S120, determining a storage strategy according to the scene information of the original data information and/or the field attribute of the original data information.
In this embodiment, the storage policy may be determined according to scene information in the original data information; or determining a storage strategy according to the field attribute in the original data information; the storage policy may also be determined according to the scene information and the field attribute in the original data information.
In this embodiment, optionally, the determining a storage policy according to the scene information of the original data information and/or the field attribute of the original data information includes:
determining a scene numerical value according to the scene information of the original data information; and/or determining the attribute value of each field according to the field attribute of the original data information;
and determining the storage strategy of each field according to a preset storage component value and the scene value, or according to a preset storage component value and the attribute value, or according to a preset storage component value, the scene value and the attribute value.
In this embodiment, the scene numerical value is a numerical value corresponding to different pieces of scene information, and the assignment of the scene numerical value may be set by a user, so that the assignment of different pieces of scene information in the scene information is in different intervals. Illustratively, the assignment interval of the scene information may be 1-10, and the scene value of the search query class may be set to 10, and the scene value of the comparison analysis class may be set to 1; it is also possible that the scene number of the search query class is 1 and the scene number of the comparison analysis class is 10.
In this embodiment, the attribute value of each field is a value corresponding to a field attribute, that is, a value corresponding to a field query frequency, where the attribute value is in an interval range, and may be 1 to 10, or 1 to 100, and this embodiment is not limited. Specifically, the higher the query frequency of the field is, the higher the value of the attribute value of the corresponding field in the interval range is. For example, if the query frequency of a field is very frequent, the value of the attribute of the field may be set to 10; if the field is not possible for a query, such as a URL (Uniform Resource Locator) or feature information in a picture, the attribute value of the field is set to 0.
In this embodiment, the storage component value is set according to different components, wherein the specific assignment of the storage component value can be set by a user. For example, if the assignment interval of the storage component values is 1-10, the storage component value of the component with the emphasis on data query performance but with a larger storage space may be set to 10, and the component may be an exemplary elastic search component. The ElasticSearch component can be used for distributed full-text retrieval, the ElasticSearch component is high in query performance, most of data stored inside is text data needing quick retrieval, and the ElasticSearch component is usually used for quick retrieval and query. While the storage component value of a component that emphasizes data storage dominance but has poor query performance is 1, this component may be, for example, an HBase component. Among other things, the HBase component is a distributed, column-oriented open database. The compression ratio of the HBase component is high, most of internally stored data is column-type data, and the HBase component is usually used for rapid statistical analysis. And the storage component value centered on both data storage occupancy and query performance may be 5. The method has the advantages that the original data information can be stored according to the self-defined data storage rule, and the data storage efficiency under the multi-component mode can be improved.
In this embodiment, optionally, the determining a storage policy of each field according to a preset storage component value and the scene value, or according to a preset storage component value and the attribute value, or according to a preset storage component value, the scene value, and the attribute value includes:
comparing the scene numerical value with the storage component numerical value, and determining the storage strategy of each field;
or the like, or, alternatively,
comparing the attribute numerical value with the storage component numerical value, and determining the storage strategy of each field;
or the like, or, alternatively,
taking the product of the scene numerical value and the attribute numerical value as a result value;
performing evolution calculation on the result value to obtain a stored numerical value;
and comparing the storage value with the storage component value to determine the storage strategy of each field.
If the field has the scene numerical value of 10 and the attribute numerical value of 10, the result value is 100, after the result value is subjected to evolution calculation, the storage numerical value is 10, and the storage strategy of the field is stored into the component with the storage component numerical value of 10. If the field has both a scene value of 1 and an attribute value of 2, the result value is
Figure BDA0002780447450000061
The storage policy for this field is to store to the component storing the component value of 1.
In this embodiment, optionally, in a specific case, if the attribute value of the field is 0 and the preset storage component values are 10, 1 and 5, respectively, since the attribute value of the field is closest to 1 in the preset storage component values, the storage policy of the field is stored in the component with the storage component value of 1.
In this embodiment, optionally, under a specific condition, if the scene value of the field is 10, and the preset storage component values are 10, 1, and 5, respectively, since the scene value of the field is closest to 10, according to a preset data storage rule, the storage component may be determined according to the scene value alone, and the storage policy of the field is stored into the component with the storage component value of 10.
S130, determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component.
In this embodiment, if the storage policy is stored in the component with the storage component value of 10, the storage policy may be stored in the ElasticSearch component; if the storage policy is stored in the component with the storage component value of 1, the storage policy may be in the HBase component.
In this embodiment, optionally, before determining the storage policy according to the scene information of the original data information and/or the field attribute of the original data information, the method further includes:
judging whether the original data information meets a preset field rule or not; wherein the field rule includes a field name, a field type, a field length, and a range of field values;
if not, the original data information is removed;
and if so, continuing to store the original data information.
In this embodiment, by determining the field name, the field type, the field length, and the range of the field value in the original data information, it can be determined whether the original data information satisfies the storage condition, and if not, the original data information is removed. The method has the advantages that the content of the original data information stored in the storage assembly is complete, dirty data are effectively filtered, and the data storage efficiency and the utilization value of the stored data are improved.
The embodiment of the invention obtains the original data information; the original data information comprises scene information and/or field attributes; the original data information comprises at least two fields; determining a storage strategy according to scene information of the original data information and/or field attributes of the original data information; determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component. By adopting the technical means, the purposes of improving the development efficiency and simplifying the data storage process so as to improve the data storage efficiency can be achieved.
Example two
Fig. 2 is a schematic flow chart of a data storage method according to a second embodiment of the present invention, where this embodiment is applicable to a case where large data is stored in multiple storage components, and this embodiment is a further refinement on the basis of the first embodiment, and this method may be executed by a data storage device. The device can be realized in a software and/or hardware mode, can be integrated in electronic equipment, and specifically comprises the following steps:
s210, acquiring original data information; the original data information comprises scene information and/or field attributes; the raw data information includes at least two fields.
S220, determining a storage strategy according to the scene information of the original data information and/or the field attribute of the original data information.
S230, determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component.
In this embodiment, optionally, the determining, according to the storage policy, a storage location of each field in the original data information, where the storage location includes at least one storage component, includes:
and if the failure times of fields existing in all the fields in the original data information in the storage process of the at least one storage component exceed the preset times, stopping storing.
In this embodiment, the fields in the original data information are to be stored in a specific storage component, and if the fields in the original data information fail in the storage process, the fields continue to try to be stored in the corresponding storage component and do not try to be stored in other components. Further, when the storage times of the field stored in the corresponding storage component exceed the preset times, the storage is abandoned.
S240, determining the primary key information of the original data information according to the content of each field in the original data information; and storing the primary key information to the storage position of each field in the original data information.
In this embodiment, the primary key information is a unique identifier of the original data information, for example, an identity card number, a mobile phone number, a name, and a gender of a user exist in the original data information, the primary key information may be the identity card number of the user, and the primary key information and each field in the original data information are stored in at least one storage component together. In this embodiment, the setting of the primary key information may be in a Schema, where the Schema originally refers to an XML Schema, and is a recommendation standard issued by W3C in 5 months 2001, and indicates how to formally describe an element of an XML document. The Schema can be generally regarded as an abstract set of metadata, and in this patent, the Schema will be regarded as an abstract set of a data table, and record some key information of the table. In this embodiment, after defining Schema information of a table, when creating the table, the Schema information recorded in the JSON format is read and spliced into an SQL statement, so as to store and query original data information.
S250, determining primary key information in one storage component according to the content of the field in the query condition; and inquiring fields of the original data information from other storage components according to the primary key information.
In this embodiment, according to the field content in the query condition, the content of the field is determined in the storage component, the primary key information bound to the field is determined by the field, and each field bound to the primary key information is queried from other storage components according to the primary key information.
In this embodiment, exemplarily, the primary key information of the original data information is set as ID, so if the query condition is correct, the API of the ES is called to construct a corresponding query statement, and after a field meeting the condition is found in the ES, the complete data is obtained by removing HBase according to the primary key information ID. For complex query, because ES is not perfect enough for complex query at present, in this embodiment, the complex query queries the GP database, queries the corresponding field from the GP, and returns the field to the caller.
According to the embodiment of the invention, the main key information is determined, and each field in the storage component is inquired through the main key information, so that the aim of improving the inquiry efficiency can be achieved by adopting the technical means.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a data storage device according to a third embodiment of the present invention. The data storage device provided by the embodiment of the invention can execute the data storage method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. As shown in fig. 3, the apparatus includes:
an original data information obtaining module 310, configured to obtain scene information and/or field attributes in original data information; wherein the original data information comprises at least two fields.
And a storage policy determining module 320, configured to determine a storage policy according to the scene information of the raw data information and/or the field attribute of the raw data information.
A storage location determining module 330, configured to determine, according to the storage policy, a storage location of each field in the original data information; wherein the storage location comprises at least one storage component.
Optionally, the storage policy determining module 320 is configured to determine a scene value according to scene information of the original data information; and/or determining the attribute value of each field according to the field attribute of the original data information;
and determining the storage strategy of each field according to a preset storage component value and the scene value, or according to a preset storage component value and the attribute value, or according to a preset storage component value, the scene value and the attribute value.
Optionally, the storage policy determining module 320 is configured to compare the scene value with the storage component value, and determine a storage policy of each field;
or the like, or, alternatively,
comparing the attribute numerical value with the storage component numerical value, and determining the storage strategy of each field;
or the like, or a combination thereof,
taking the product of the scene numerical value and the attribute numerical value as a result value;
performing evolution calculation on the result value to obtain a stored numerical value;
and comparing the storage value with the storage component value to determine the storage strategy of each field.
The device further comprises:
the original data information judging module is used for judging whether the original data information meets a preset field rule or not; wherein the field rule includes a field name, a field type, a field length, and a range of field values;
if not, the original data information is removed;
and if so, continuing to store the original data information.
A storage location determining module 330, configured to stop storing if the number of times that fields in the original data information fail in the storage process of the at least one storage component exceeds a preset number of times.
The device, still include:
the primary key information determining module is used for determining the primary key information of the original data information according to the content of each field in the original data information;
and storing the primary key information to the storage position of each field in the original data information.
The device, still include:
each field query module is used for determining the primary key information in one storage component according to the content of the field in the query condition;
and inquiring each field of the original data information from other storage components according to the primary key information.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working process of the above-described device may refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention, and fig. 4 is a schematic structural diagram of an exemplary device suitable for implementing the embodiment of the present invention. The device 12 shown in fig. 4 is only an example and should not bring any limitation to the function and scope of use of the embodiments of the present invention.
As shown in FIG. 4, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of embodiments described herein.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown in FIG. 4, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, to implement a data storage method provided by an embodiment of the present invention, including:
acquiring scene information and/or field attributes in original data information; wherein the original data information comprises at least two fields;
determining a storage strategy according to scene information of the original data information and/or field attributes of the original data information;
determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program (or referred to as a computer-executable instruction) is stored, where the computer program, when executed by a processor, can implement a data storage method according to any of the embodiments described above, where the computer program includes:
acquiring scene information and/or field attributes in original data information; wherein the original data information comprises at least two fields;
determining a storage strategy according to scene information of the original data information and/or field attributes of the original data information;
determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of storing data, comprising:
acquiring scene information and/or field attributes in original data information; wherein the original data information comprises at least two fields;
determining a storage strategy according to scene information of the original data information and/or field attributes of the original data information;
determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component.
2. The method according to claim 1, wherein determining a storage policy according to the scene information of the original data information and/or the field attribute of the original data information comprises:
determining a scene numerical value according to the scene information of the original data information; and/or determining the attribute value of each field according to the field attribute of the original data information;
and determining the storage strategy of each field according to a preset storage component value and the scene value, or according to a preset storage component value and the attribute value, or according to a preset storage component value, the scene value and the attribute value.
3. The method according to claim 2, wherein the determining the storage policy of each field according to the preset storage component value and the scene value, or according to the preset storage component value and the attribute value, or according to the preset storage component value, the scene value, and the attribute value comprises:
comparing the scene numerical value with the storage component numerical value, and determining the storage strategy of each field;
or the like, or, alternatively,
comparing the attribute numerical value with the storage component numerical value, and determining the storage strategy of each field;
or the like, or, alternatively,
taking the product of the scene numerical value and the attribute numerical value as a result value;
performing evolution calculation on the result value to obtain a stored numerical value;
and comparing the storage value with the storage component value to determine the storage strategy of each field.
4. The method according to claim 1, before determining the storage policy according to the scene information of the original data information and/or the field attribute of the original data information, further comprising:
judging whether the original data information meets a preset field rule or not; the preset field rule comprises a field name, a field type, a field length and a field value range;
if not, the original data information is removed;
and if so, continuing to store the original data information.
5. The method of claim 1, wherein determining storage locations for fields in the raw data information according to the storage policy, wherein the storage locations comprise at least one storage component, comprises:
and if the failure times of fields existing in all fields in the original data information in the storage process of the at least one storage component exceed the preset times, stopping storing.
6. The method according to any one of claims 1 to 5, wherein after determining the storage location of each field in the original data information according to the storage policy, the method further comprises:
determining the primary key information of the original data information according to the content of each field in the original data information;
and storing the primary key information to the storage position of each field in the original data information.
7. The method according to claim 6, wherein after storing the primary key information to the storage location of each field in the original data information, further comprising:
determining primary key information in one of the storage components according to the contents of the fields in the query condition;
and inquiring fields of the original data information from other storage components according to the primary key information.
8. A data storage device, comprising:
the original data information acquisition module is used for acquiring scene information and/or field attributes in the original data information; wherein the original data information comprises at least two fields;
the storage strategy determining module is used for determining a storage strategy according to the scene information of the original data information and/or the field attribute of the original data information;
the storage position determining module is used for determining the storage position of each field in the original data information according to the storage strategy; wherein the storage location comprises at least one storage component.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the data storage method according to any of claims 1-7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the data storage method of any one of claims 1 to 7.
CN202011279996.6A 2020-11-16 2020-11-16 Data storage method and device, electronic equipment and storage medium Pending CN114510605A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011279996.6A CN114510605A (en) 2020-11-16 2020-11-16 Data storage method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011279996.6A CN114510605A (en) 2020-11-16 2020-11-16 Data storage method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114510605A true CN114510605A (en) 2022-05-17

Family

ID=81547143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011279996.6A Pending CN114510605A (en) 2020-11-16 2020-11-16 Data storage method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114510605A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024082518A1 (en) * 2022-10-19 2024-04-25 中冶南方工程技术有限公司 Data storage method and apparatus for digital steel coil system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024082518A1 (en) * 2022-10-19 2024-04-25 中冶南方工程技术有限公司 Data storage method and apparatus for digital steel coil system

Similar Documents

Publication Publication Date Title
CN107480198B (en) Distributed NewSQL database system and full-text retrieval method
CN107506451B (en) Abnormal information monitoring method and device for data interaction
CN109471863B (en) Information query method and device based on distributed database and electronic equipment
CN103608809B (en) Recommending data is enriched with
US20150142762A1 (en) Changing the Compression Level of Query Plans
CN110688544A (en) Method, device and storage medium for querying database
US8812489B2 (en) Swapping expected and candidate affinities in a query plan cache
CN112395303A (en) Query execution method and device, electronic equipment and computer readable medium
CN110704476A (en) Data processing method, device, equipment and storage medium
CN113051268A (en) Data query method, data query device, electronic equipment and storage medium
CN111694866A (en) Data searching and storing method, data searching system, data searching device, data searching equipment and data searching medium
CN109241100B (en) Query method, device, equipment and storage medium
CN110990406B (en) Fuzzy query method, device, equipment and medium
CN109815241B (en) Data query method, device, equipment and storage medium
CN114925101A (en) Data processing method and device, storage medium and electronic equipment
CN114969441A (en) Knowledge mining engine system based on graph database
CN114168616A (en) Data acquisition method and device, electronic equipment and storage medium
CN114510605A (en) Data storage method and device, electronic equipment and storage medium
CN109542912B (en) Interval data storage method, device, server and storage medium
CN112286964A (en) SQL statement optimization method, device, equipment and storage medium
US20230153455A1 (en) Query-based database redaction
WO2024001029A1 (en) Method and apparatus for maintaining blockchain data, electronic device, and storage medium
CN111198917A (en) Data processing method, device, equipment and storage medium
CN107463618B (en) Index creating method and device
CN114064729A (en) Data retrieval method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination