CN111897818A - 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
CN111897818A
CN111897818A CN202010760663.9A CN202010760663A CN111897818A CN 111897818 A CN111897818 A CN 111897818A CN 202010760663 A CN202010760663 A CN 202010760663A CN 111897818 A CN111897818 A CN 111897818A
Authority
CN
China
Prior art keywords
data
target
field
query
data storage
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
CN202010760663.9A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202010760663.9A priority Critical patent/CN111897818A/en
Publication of CN111897818A publication Critical patent/CN111897818A/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

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

Abstract

The application relates to big data technology field, can be applied to in the scene that needs a large amount of data storage such as wisdom commodity circulation, wisdom medical treatment to promote the construction in wisdom city. The invention provides a data storage method, which comprises the following steps: acquiring target wind control data, wherein the target wind control data is composed of a plurality of fields; determining a field with a non-empty value as a target field to be stored from the plurality of fields; storing the target field into a preset target data set in a document form, recording write-in information of the target field and generating a target record; creating a mapping relation between each target field and a corresponding target record; and storing the mapping relation into a preset target data table. The invention also provides a data storage device, an electronic device and a storage medium. The invention can reduce the calculation resources occupied by the database.

Description

Data storage method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a data storage method and apparatus, an electronic device, and a storage medium.
Background
At present, data related to wind control can be stored in a database and queried at any time to perform wind control analysis, but in practice, it is found that a large number of fields of one piece of wind control data are provided, and as the number of fields of a table is increased, when operations such as updating and data inserting are performed, too many bound variables are provided, so that the database occupies too many operation resources, the system performance is reduced, and as the requirement of a big data technology is met, the requirement on the database is further improved by the storage of a large amount of data.
Therefore, how to reduce the computational resources occupied by the database is an urgent technical problem to be solved.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a data storage method, an apparatus, an electronic device and a storage medium, which can reduce the computation resources occupied by the database.
A first aspect of the present invention provides a data storage method, including:
acquiring target wind control data, wherein the target wind control data is composed of a plurality of fields;
determining a field with a non-empty value as a target field to be stored from the plurality of fields;
storing the target field into a preset target data set in a document form, recording write-in information of the target field and generating a target record;
creating a mapping relation between each target field and a corresponding target record;
and storing the mapping relation into a preset target data table.
In a possible implementation manner, after the storing the mapping relationship into a preset target data table, the data storage method further includes:
when a data updating instruction is received, inquiring in the target data set according to a first identifier carried by the data updating instruction to obtain data to be updated;
and updating the data to be updated according to the updating field carried by the data updating instruction.
In a possible implementation manner, after the storing the mapping relationship into a preset target data table, the data storage method further includes:
when a field query instruction is received, determining first query data from the target data set according to a second identifier carried by the field query instruction;
judging whether the first query data has a query field indicated by the field query instruction;
and if the first query data has the query field indicated by the field query instruction, outputting data corresponding to the query field from the first query data.
In a possible implementation manner, after determining whether the query field indicated by the field query instruction exists in the first query data, the data storage method further includes:
if the query field indicated by the field query instruction does not exist in the first query data, determining that the value of the query field is a null value;
and outputting the null value.
In a possible implementation manner, after the storing the mapping relationship into a preset target data table, the data storage method further includes:
when a data query instruction is received, determining second query data from the target data set according to a third identifier carried by the data query instruction;
determining a mapping record of a mapping relation corresponding to the second query data from the target data table;
determining a target field with an empty value according to the mapping record;
outputting the second query data and the target field.
In a possible implementation manner, after the storing the mapping relationship into a preset target data table, the data storage method further includes:
acquiring a unique identifier of the target wind control data;
and establishing a query index of the target record in the target data set according to the unique identifier.
In one possible implementation, the target damper data is stored in the target data set in a document form, and one record of the target data table maps one document of the target data set.
A second aspect of the present invention provides a data storage apparatus comprising:
the system comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring target wind control data, and the target wind control data consists of a plurality of fields;
the determining module is used for determining a field with a non-empty value as a target field to be stored from the plurality of fields;
the storage module is used for storing the target field into a preset target data set in a document form, recording the writing information of the target field and generating a target record;
the creating module is used for creating a mapping relation between each target field and the corresponding target record;
the storage module is further configured to store the mapping relationship into a preset target data table.
A third aspect of the invention provides an electronic device comprising a processor and a memory, the processor being configured to implement the data storage method when executing a computer program stored in the memory.
A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the data storage method.
Based on the technical scheme, the fields with values in the wind control data can be stored in the data set, the fields without the values do not need to be stored, a plurality of column elements do not need to be bound because the fields are not stored in a data table form, and the table does not need to be expanded when the fields are newly added, so that the storage space is saved. In addition, the database stores the mapping relation between the wind control data and the field, so that the field with an empty value can be quickly determined, and the system performance is improved.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of a data storage method disclosed in the present invention.
FIG. 2 is a functional block diagram of a preferred embodiment of a data storage device according to the present disclosure.
FIG. 3 is a schematic structural diagram of an electronic device implementing a data storage method according to a preferred embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
The data storage method of the embodiment of the invention is applied to the electronic equipment, and can also be applied to a hardware environment formed by the electronic equipment and a server connected with the electronic equipment through a network, and the server and the electronic equipment are jointly executed. Networks include, but are not limited to: a wide area network, a metropolitan area network, or a local area network.
A server may refer to a computer system that provides services to other devices (e.g., electronic devices) in a network. A personal computer may also be called a server if it can externally provide a File Transfer Protocol (FTP) service. In a narrow sense, a server refers to a high-performance computer, which can provide services to the outside through a network, and compared with a common personal computer, the server has higher requirements on stability, security, performance and the like, and therefore, hardware such as a CPU, a chipset, a memory, a disk system, a network and the like is different from that of the common personal computer.
The electronic device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware thereof includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like. The electronic device may also include a network device and/or a user device. The network device includes, but is not limited to, a single network device, a server group consisting of a plurality of network devices, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of hosts or network devices, wherein the Cloud Computing is one of distributed Computing, and is a super virtual computer consisting of a group of loosely coupled computers. The user device includes, but is not limited to, any electronic product that can interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device, for example, a personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), or the like.
Referring to fig. 1, fig. 1 is a flowchart illustrating a data storage method according to a preferred embodiment of the present invention. The order of the steps in the flowchart may be changed, and some steps may be omitted. Wherein, the execution subject of the data storage method may be an electronic device.
And S11, acquiring target wind control data, wherein the target wind control data is composed of a plurality of fields.
In the embodiment of the present invention, a piece of pneumatic control data may be composed of a plurality of fields, such as name, telephone, overdue number of payment, and the like, for example, { name: zhang III; telephone: 33501; overdue number of repayment: 3}.
And S12, determining the field with the value not being null as the target field to be stored from the plurality of fields.
In the embodiment of the present invention, the target wind control data is composed of a plurality of fields, but there may be some fields with null values, such as { name: plum four; telephone: NULL; overdue number of repayment: 3, the field 'telephone' is null, from the plurality of fields, the field whose value is not null is determined as the target field to be stored, and the fields whose values are not null, i.e., "name", "number of payment overdue", can be determined as the target field.
And S13, storing the target field into a preset target data set in a document form, recording the written information of the target field and generating a target record.
In the embodiment of the invention, the target data set only needs to store the field with the value, and the other empty fields are not stored, so that the storage space can be saved.
Wherein the target wind control data is stored in the target data set in a document form, and one record of the target data table maps one document of the target data set.
Wherein the target data set may be a stored document in mongodb (a database based on distributed file storage). The fields are stored in a document format, such as the JSON format, in mongodb, which facilitates the transmission and use of data.
And S14, creating a mapping relation between each target field and the corresponding target record.
In the embodiment of the present invention, the mapping relationship between each field and the target record may be configured in mongodb.
The target data table can be a configuration table in a database, and occupies a small storage space.
And S15, storing the mapping relation into a preset target data table.
In the embodiment of the present invention, the mapping relationship may be stored in a preset target data table, that is, all fields corresponding to the target record may be queried and determined in the target data table through the mapping relationship.
As an optional implementation manner, after storing the mapping relationship in a preset target data table, the method further includes:
acquiring a unique identifier of the target wind control data;
and establishing a query index of the target record in the target data set according to the unique identifier.
Wherein the index is a storage structure for speeding up the query of data.
In this optional embodiment, a unique identifier of the target wind control data may be obtained, a query index of the target record in the target data set is established according to the unique identifier, and the target record may be quickly queried in the target data set by using the query index.
As an optional implementation manner, after storing the mapping relationship in a preset target data table, the method further includes:
when a data updating instruction is received, inquiring in the target data set according to a first identifier carried by the data updating instruction to obtain data to be updated;
and updating the data to be updated according to the updating field carried by the data updating instruction.
In this optional embodiment, a plurality of corresponding fields (i.e., the data to be updated) may be quickly queried in the target data set through the target identifier, and then the value of the corresponding field is updated according to the update field carried by the data update instruction, so as to complete updating of the data to be updated.
As an optional implementation manner, after storing the mapping relationship in a preset target data table, the method further includes:
when a field query instruction is received, determining first query data from the target data set according to a second identifier carried by the field query instruction;
judging whether the first query data has a query field indicated by the field query instruction;
and if the first query data has the query field indicated by the field query instruction, outputting data corresponding to the query field from the first query data.
The field query instruction may be an instruction for querying a specified field in a certain piece of wind control data.
In this optional embodiment, when a field query instruction is received, first query data is determined from the target data set according to the wind control identifier carried by the field query instruction, where the first query data may be values of all fields corresponding to the wind control identifier. And if the first query data has the query field indicated by the field query instruction, outputting data corresponding to the query field from the first query data.
As an optional implementation manner, after determining whether the query field indicated by the field query instruction exists in the first query data, the method further includes:
if the query field indicated by the field query instruction does not exist in the first query data, determining that the value of the query field is a null value;
and outputting the null value.
In this optional embodiment, because only the field in which the value exists is stored in the target data set, if the query field indicated by the field query instruction does not exist in the query data, it may be determined that the value of the query field is a null value, and the null value is output.
As an optional implementation manner, after storing the mapping relationship in a preset target data table, the method further includes:
when a data query instruction is received, determining second query data from the target data set according to a third identifier carried by the data query instruction;
determining a mapping record of a mapping relation corresponding to the second query data from the target data table;
determining a target field with an empty value according to the mapping record;
outputting the second query data and the target field.
The data query instruction may be a query instruction for a certain piece of wind control data, and the corresponding query result may be values of all fields of the wind control data.
In this optional embodiment, when a data query instruction is received, second query data (i.e., a field having a value) is determined from the target data set according to a third identifier carried by the data query instruction; determining, from the target data table, a mapping record corresponding to the second query data (the mapping record records all fields of the wind control data corresponding to the third identifier); a null value for the target field may be determined based on the mapping record.
In the method flow described in fig. 1, fields with values in the wind control data may be stored in the data set, and fields without values do not need to be stored. In addition, the database stores the mapping relation between the wind control data and the field, so that the field with an empty value can be quickly determined, and the system performance is improved.
FIG. 2 is a functional block diagram of a preferred embodiment of a data storage device according to the present disclosure.
Referring to fig. 2, the data storage device 20 may be operated in an electronic apparatus. The data storage device 20 may comprise a plurality of functional modules comprised of program code segments. Program code for various program segments in the data storage device 20 may be stored in the memory and executed by the at least one processor to perform some or all of the steps of the data storage method described in fig. 1.
In this embodiment, the data storage device 20 may be divided into a plurality of functional modules according to the functions performed by the data storage device. The functional module may include: an acquisition module 201, a determination module 202, a storage module 203, and a creation module 204. The module referred to herein is a series of computer program segments capable of being executed by at least one processor and capable of performing a fixed function and is stored in memory.
The obtaining module 201 is configured to obtain target wind control data, where the target wind control data is composed of a plurality of fields.
In the embodiment of the present invention, a piece of pneumatic control data may be composed of a plurality of fields, such as name, telephone, overdue number of payment, and the like, for example, { name: zhang III; telephone: 33501; overdue number of repayment: 3}.
A determining module 202, configured to determine, from the plurality of fields, a field whose value is not null as a target field to be stored.
In the embodiment of the present invention, the target wind control data is composed of a plurality of fields, but there may be some fields with null values, such as { name: plum four; telephone: NULL; overdue number of repayment: 3, the field 'telephone' is null, from the plurality of fields, the field whose value is not null is determined as the target field to be stored, and the fields whose values are not null, i.e., "name", "number of payment overdue", can be determined as the target field.
The storage module 203 is configured to store the target field in a preset target data set in a document form, record writing information of the target field, and generate a target record.
In the embodiment of the invention, the target data set only needs to store the field with the value, and the other empty fields are not stored, so that the storage space can be saved.
Wherein the target wind control data is stored in the target data set in a document form, and one record of the target data table maps one document of the target data set.
Wherein the target data set may be a stored document in mongodb (a database based on distributed file storage). The fields are stored in a document format, such as the JSON format, in mongodb, which facilitates the transmission and use of data.
A creating module 204, configured to create a mapping relationship between each of the target fields and the corresponding target record.
In the embodiment of the present invention, the mapping relationship between each field and the target record may be configured in mongodb.
The target data table can be a configuration table in a database, and occupies a small storage space.
The storage module 203 is further configured to store the mapping relationship into a preset target data table.
In the embodiment of the present invention, the mapping relationship may be stored in a preset target data table, that is, all fields corresponding to the target record may be queried and determined in the target data table through the mapping relationship.
As an optional implementation, the data storage device 20 further includes:
the query module is configured to, after the storage module 203 stores the mapping relationship into a preset target data table, query in the target data set according to a first identifier carried by a data update instruction when the data update instruction is received, and obtain data to be updated;
and the updating module is used for updating the data to be updated according to the updating field carried by the data updating instruction.
In this optional embodiment, a plurality of corresponding fields (i.e., the data to be updated) may be quickly queried in the target data set through the target identifier, and then the value of the corresponding field is updated according to the update field carried by the data update instruction, so as to complete updating of the data to be updated.
As an optional implementation manner, the determining module 202 is further configured to, after the storing module 203 stores the mapping relationship into a preset target data table, when a field query instruction is received, determine first query data from the target data set according to a second identifier carried by the field query instruction;
the data storage device 20 further comprises:
the judging module is used for judging whether the first query data has the query field indicated by the field query instruction;
and the first output module is used for outputting data corresponding to the query field from the first query data if the query field indicated by the field query instruction exists in the first query data.
The field query instruction may be an instruction for querying a specified field in a certain piece of wind control data.
In this optional embodiment, when a field query instruction is received, first query data is determined from the target data set according to the wind control identifier carried by the field query instruction, where the first query data may be values of all fields corresponding to the wind control identifier. And if the first query data has the query field indicated by the field query instruction, outputting data corresponding to the query field from the first query data.
As an optional implementation manner, the determining module 202 is further configured to determine, after the determining module determines whether the query field indicated by the field query instruction exists in the first query data, if the query field indicated by the field query instruction does not exist in the first query data, that a value of the query field is a null value;
the first output module is further configured to output the null value.
In this optional embodiment, because only the field in which the value exists is stored in the target data set, if the query field indicated by the field query instruction does not exist in the query data, it may be determined that the value of the query field is a null value, and the null value is output.
As an optional implementation manner, the determining module 202 is further configured to, after the mapping relationship is stored in a preset target data table, determine, when a data query instruction is received, second query data from the target data set according to a third identifier carried by the data query instruction;
the determining module 202 is further configured to determine, from the target data table, a mapping record of a mapping relationship corresponding to the second query data;
the determining module 202 is further configured to determine, according to the mapping record, a target field whose value is null;
the data storage device 20 further comprises:
and the second output module is used for outputting the second query data and the target field.
The data query instruction may be a query instruction for a certain piece of wind control data, and the corresponding query result may be values of all fields of the wind control data.
In this optional embodiment, when a data query instruction is received, second query data (i.e., a field having a value) is determined from the target data set according to a third identifier carried by the data query instruction; determining, from the target data table, a mapping record corresponding to the second query data (the mapping record records all fields of the wind control data corresponding to the third identifier); a null value for the target field may be determined based on the mapping record.
As an optional implementation manner, the obtaining module 201 is further configured to obtain a unique identifier of the target wind control data after the storage module 203 stores the mapping relationship into a preset target data table;
the data storage device 20 further comprises:
and the establishing module is used for establishing the query index of the target record in the target data set according to the unique identifier.
Wherein the index is a storage structure for speeding up the query of data.
In this optional embodiment, a unique identifier of the target wind control data may be obtained, a query index of the target record in the target data set is established according to the unique identifier, and the target record may be quickly queried in the target data set by using the query index.
In the data storage device described in fig. 2, fields with values in the wind control data may be stored in the data set, and fields without values do not need to be stored, and since the fields are not stored in a data table, a plurality of column elements do not need to be bound, and a table does not need to be expanded when a field is newly added, thereby saving storage space. In addition, the database stores the mapping relation between the wind control data and the field, so that the field with an empty value can be quickly determined, and the system performance is improved.
As shown in fig. 3, fig. 3 is a schematic structural diagram of an electronic device implementing a data storage method according to a preferred embodiment of the invention. The electronic device 3 comprises a memory 31, at least one processor 32, a computer program 33 stored in the memory 31 and executable on the at least one processor 32, and at least one communication bus 34.
Those skilled in the art will appreciate that the schematic diagram shown in fig. 3 is merely an example of the electronic device 3, and does not constitute a limitation of the electronic device 3, and may include more or less components than those shown, or combine some components, or different components, for example, the electronic device 3 may further include an input/output device, a network access device, and the like.
The electronic device 3 may also include, but is not limited to, any electronic product that can interact with a user through a keyboard, a mouse, a remote controller, a touch panel, or a voice control device, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an Internet Protocol Television (IPTV), an intelligent wearable device, and the like. The Network where the electronic device 3 is located includes, but is not limited to, the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
The at least one Processor 32 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a transistor logic device, a discrete hardware component, etc. The processor 32 may be a microprocessor or the processor 32 may be any conventional processor or the like, and the processor 32 is a control center of the electronic device 3 and connects various parts of the whole electronic device 3 by various interfaces and lines.
The memory 31 may be used to store the computer program 33 and/or the module/unit, and the processor 32 may implement various functions of the electronic device 3 by running or executing the computer program and/or the module/unit stored in the memory 31 and calling data stored in the memory 31. The memory 31 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the electronic device 3, and the like. In addition, the memory 31 may include volatile and non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one disk storage device, a Flash memory device, and so forth.
In conjunction with fig. 1, the memory 31 in the electronic device 3 stores a plurality of instructions to implement a data storage method, and the processor 32 executes the plurality of instructions to implement:
acquiring target wind control data, wherein the target wind control data is composed of a plurality of fields;
determining a field with a non-empty value as a target field to be stored from the plurality of fields;
determining a target data set and a target data table;
storing the target field into a preset target data set in a document form, recording write-in information of the target field and generating a target record;
creating a mapping relation between each target field and a corresponding target record;
and storing the mapping relation into a preset target data table.
Specifically, the processor 32 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the instruction, which is not described herein again.
In the electronic device 3 described in fig. 3, fields with values in the wind control data may be stored in the data set, and fields without values do not need to be stored, and since the fields are not stored in a data table, a plurality of column elements do not need to be bound, and a table does not need to be expanded when a field is newly added, thereby saving storage space. In addition, the database stores the mapping relation between the wind control data and the field, so that the field with an empty value can be quickly determined, and the system performance is improved.
The integrated modules/units of the electronic device 3 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program code may be in source code form, object code form, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), etc.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A data storage method, characterized in that the data storage method comprises:
acquiring target wind control data, wherein the target wind control data is composed of a plurality of fields;
determining a field with a non-empty value as a target field to be stored from the plurality of fields;
storing the target field into a preset target data set in a document form, recording write-in information of the target field and generating a target record;
creating a mapping relation between each target field and a corresponding target record;
and storing the mapping relation into a preset target data table.
2. The data storage method according to claim 1, wherein after storing the mapping relationship into a preset target data table, the data storage method further comprises:
when a data updating instruction is received, inquiring in the target data set according to a first identifier carried by the data updating instruction to obtain data to be updated;
and updating the data to be updated according to the updating field carried by the data updating instruction.
3. The data storage method according to claim 1, wherein after storing the mapping relationship into a preset target data table, the data storage method further comprises:
when a field query instruction is received, determining first query data from the target data set according to a second identifier carried by the field query instruction;
judging whether the first query data has a query field indicated by the field query instruction;
and if the first query data has the query field indicated by the field query instruction, outputting data corresponding to the query field from the first query data.
4. The data storage method according to claim 3, wherein after determining whether the query field indicated by the field query instruction exists in the first query data, the data storage method further comprises:
if the query field indicated by the field query instruction does not exist in the first query data, determining that the value of the query field is a null value;
and outputting the null value.
5. The data storage method according to claim 1, wherein after storing the mapping relationship into a preset target data table, the data storage method further comprises:
when a data query instruction is received, determining second query data from the target data set according to a third identifier carried by the data query instruction;
determining a mapping record of a mapping relation corresponding to the second query data from the target data table;
determining empty fields with empty values according to the mapping records;
outputting the second query data and the null field.
6. The data storage method according to any one of claims 1 to 5, wherein after storing the mapping relationship into a preset target data table, the data storage method further comprises:
acquiring a unique identifier of the target wind control data;
and establishing a query index of the target record in the target data set according to the unique identifier.
7. A data storage method according to any one of claims 1 to 5, wherein the target damper data is stored in the target data set in the form of a document, and one record of the target data table maps one document of the target data set.
8. A data storage device, characterized in that the data storage device comprises:
the system comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring target wind control data, and the target wind control data consists of a plurality of fields;
the determining module is used for determining a field with a non-empty value as a target field to be stored from the plurality of fields;
the storage module is used for storing the target field into a preset target data set in a document form, recording the writing information of the target field and generating a target record;
the creating module is used for creating a mapping relation between each target field and the corresponding target record;
the storage module is further configured to store the mapping relationship into a preset target data table.
9. An electronic device, characterized in that the electronic device comprises a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the data storage method of any one of claims 1 to 7.
10. A computer-readable storage medium storing at least one instruction which, when executed by a processor, implements a data storage method as claimed in any one of claims 1 to 7.
CN202010760663.9A 2020-07-31 2020-07-31 Data storage method and device, electronic equipment and storage medium Pending CN111897818A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010760663.9A CN111897818A (en) 2020-07-31 2020-07-31 Data storage method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010760663.9A CN111897818A (en) 2020-07-31 2020-07-31 Data storage method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111897818A true CN111897818A (en) 2020-11-06

Family

ID=73182984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010760663.9A Pending CN111897818A (en) 2020-07-31 2020-07-31 Data storage method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111897818A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112364041A (en) * 2020-12-01 2021-02-12 苏宁金融科技(南京)有限公司 Data processing method and device, computer equipment and storage medium
CN112597175A (en) * 2020-12-15 2021-04-02 京东方科技集团股份有限公司 Data docking method, system, device and storage medium
CN113077336A (en) * 2021-04-15 2021-07-06 北京同邦卓益科技有限公司 Wind control information configuration method and device, electronic equipment and computer readable medium
CN113378202A (en) * 2021-06-29 2021-09-10 湖南盈聚信息技术有限公司 Multi-dimensional data security storage system based on big data
CN113779349A (en) * 2021-08-11 2021-12-10 中央广播电视总台 Data retrieval system, apparatus, electronic device, and readable storage medium
CN114650222A (en) * 2022-03-14 2022-06-21 北京百度网讯科技有限公司 Parameter configuration method and device, electronic equipment and storage medium
CN115686939A (en) * 2022-10-27 2023-02-03 湖南长银五八消费金融股份有限公司 Data backup method and device, computer equipment and storage medium
CN116401303A (en) * 2023-04-12 2023-07-07 岱特智能科技(上海)有限公司 Hospital multi-database data management method and related device for kidney disease treatment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06282309A (en) * 1993-03-30 1994-10-07 Keyence Corp Collecting device for production management data
US20060242104A1 (en) * 2005-04-21 2006-10-26 Microsoft Corporation Systems and methods for manipulating data in a data storage system
CN106815267A (en) * 2015-12-01 2017-06-09 中兴通讯股份有限公司 Date storage method and device
CN107145493A (en) * 2016-03-01 2017-09-08 阿里巴巴集团控股有限公司 Information processing method and device
CN110489433A (en) * 2019-07-11 2019-11-22 中国平安人寿保险股份有限公司 A kind of message treatment method and device, electronic equipment based on MongoDB
CN110609954A (en) * 2019-08-30 2019-12-24 深圳壹账通智能科技有限公司 Data acquisition method and device, computer equipment and storage medium
CN110765128A (en) * 2019-09-17 2020-02-07 江苏海平面数据科技有限公司 Optimized storage method based on large-scale GPS data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06282309A (en) * 1993-03-30 1994-10-07 Keyence Corp Collecting device for production management data
US20060242104A1 (en) * 2005-04-21 2006-10-26 Microsoft Corporation Systems and methods for manipulating data in a data storage system
CN106815267A (en) * 2015-12-01 2017-06-09 中兴通讯股份有限公司 Date storage method and device
CN107145493A (en) * 2016-03-01 2017-09-08 阿里巴巴集团控股有限公司 Information processing method and device
CN110489433A (en) * 2019-07-11 2019-11-22 中国平安人寿保险股份有限公司 A kind of message treatment method and device, electronic equipment based on MongoDB
CN110609954A (en) * 2019-08-30 2019-12-24 深圳壹账通智能科技有限公司 Data acquisition method and device, computer equipment and storage medium
CN110765128A (en) * 2019-09-17 2020-02-07 江苏海平面数据科技有限公司 Optimized storage method based on large-scale GPS data

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112364041A (en) * 2020-12-01 2021-02-12 苏宁金融科技(南京)有限公司 Data processing method and device, computer equipment and storage medium
CN112597175A (en) * 2020-12-15 2021-04-02 京东方科技集团股份有限公司 Data docking method, system, device and storage medium
CN113077336A (en) * 2021-04-15 2021-07-06 北京同邦卓益科技有限公司 Wind control information configuration method and device, electronic equipment and computer readable medium
CN113077336B (en) * 2021-04-15 2024-05-24 北京同邦卓益科技有限公司 Wind control information configuration method, device, electronic equipment and computer readable medium
CN113378202A (en) * 2021-06-29 2021-09-10 湖南盈聚信息技术有限公司 Multi-dimensional data security storage system based on big data
CN113378202B (en) * 2021-06-29 2022-05-03 湖南盈聚信息技术有限公司 Multi-dimensional data security storage system based on big data
CN113779349A (en) * 2021-08-11 2021-12-10 中央广播电视总台 Data retrieval system, apparatus, electronic device, and readable storage medium
CN114650222A (en) * 2022-03-14 2022-06-21 北京百度网讯科技有限公司 Parameter configuration method and device, electronic equipment and storage medium
CN114650222B (en) * 2022-03-14 2024-03-01 北京百度网讯科技有限公司 Parameter configuration method, device, electronic equipment and storage medium
CN115686939A (en) * 2022-10-27 2023-02-03 湖南长银五八消费金融股份有限公司 Data backup method and device, computer equipment and storage medium
CN116401303A (en) * 2023-04-12 2023-07-07 岱特智能科技(上海)有限公司 Hospital multi-database data management method and related device for kidney disease treatment
CN116401303B (en) * 2023-04-12 2023-11-10 岱特智能科技(上海)有限公司 Hospital multi-database data management method and related device for kidney disease treatment

Similar Documents

Publication Publication Date Title
CN111897818A (en) Data storage method and device, electronic equipment and storage medium
CN109144647B (en) Form design method and device, terminal equipment and storage medium
WO2021217863A1 (en) Order identifier generation method and apparatus, server, and storage medium
CN111949666B (en) Identification generation method and device, electronic equipment and storage medium
CN111986194A (en) Medical annotation image detection method and device, electronic equipment and storage medium
CN112541786A (en) Site selection method and device for network points, electronic equipment and storage medium
WO2021174836A1 (en) Differential package generation method and apparatus, computer device, and storage medium
CN112001159A (en) Document generation method and device, electronic equipment and storage medium
CN111858891A (en) Question-answer library construction method and device, electronic equipment and storage medium
CN117195185A (en) User authority management method for graph database, electronic equipment and medium
CN109697083B (en) Fixed-point acceleration method and device for data, electronic equipment and storage medium
CN114372060A (en) Data storage method, device, equipment and storage medium
CN109542398B (en) Business system generation method and device and computer readable storage medium
CN111562953A (en) Interface calling method and device, computer device and readable storage medium
CN114116108A (en) Dynamic rendering method, device, equipment and storage medium
WO2021237414A1 (en) Information pushing method and apparatus, electronic device, and storage medium
CN110535724B (en) Application program network read-write limiting method and device, electronic equipment and storage medium
CN115544214B (en) Event processing method, device and computer readable storage medium
CN116089535A (en) Data synchronization method, device, equipment and storage medium
CN113407537B (en) Data processing method and device and electronic equipment
CN111897612A (en) Page updating method and device, electronic equipment and storage medium
CN112667721A (en) Data analysis method, device, equipment and storage medium
CN110428453B (en) Data processing method, data processing device, data processing equipment and storage medium
CN110032445B (en) Big data aggregation calculation method and device
CN109542986B (en) Element normalization method, device, equipment and storage medium of network data

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