[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN115114297A - Data lightweight storage and search method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN115114297A
CN115114297A CN202210822505.0A CN202210822505A CN115114297A CN 115114297 A CN115114297 A CN 115114297A CN 202210822505 A CN202210822505 A CN 202210822505A CN 115114297 A CN115114297 A CN 115114297A
Authority
CN
China
Prior art keywords
data
linked list
data set
index
nodes
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
CN202210822505.0A
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.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202210822505.0A priority Critical patent/CN115114297A/en
Publication of CN115114297A publication Critical patent/CN115114297A/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • 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/2453Query optimisation
    • 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/2455Query execution
    • G06F16/24553Query execution of query operations

Landscapes

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

Abstract

The invention relates to an artificial intelligence technology, and discloses a data lightweight storage and search method, which comprises the following steps: the method comprises the steps of obtaining an original data set from a source database, carrying out format conversion on data in the original data set, carrying out data cleaning on the data after format conversion is finished to obtain a standard data set, carrying out linked list structure conversion on the data in the standard data set to obtain a linked list data set, constructing an index based on the linked list data set, storing the index into a preset database, obtaining a data search instruction, carrying out linked list directional deletion query on the data in the database based on the data search instruction, and obtaining searched target data. Furthermore, the invention relates to a blockchain technique, the original data set being obtainable from a node of the blockchain. The invention also provides a data lightweight storage and search device, electronic equipment and a readable storage medium. The invention can solve the problem of low data query efficiency.

Description

Data lightweight storage and search method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a method and a device for lightweight data storage and search, an electronic device and a readable storage medium.
Background
The conventional big data storage generally uses data mongodb to store corresponding data at present, and the storage generally uses Json data and applies input query and use with the data. Generally, source data is directly stored in a JSon data format, so that rapid storage and query of the data can be achieved (usually, fast Jason plug-in is used for analyzing and querying through object conversion), however, in some specific financial fields such as insurance, collection, loan and the like, due to the fact that the data volume is large, half of resources are occupied by the fast Jason plug-in during analysis, data change at the back end or the front end can affect the speed of data query, and the efficiency of data query is reduced.
Disclosure of Invention
The invention provides a method and a device for lightweight storage and search of data, electronic equipment and a readable storage medium, and mainly aims to solve the problem of low data query efficiency.
In order to achieve the above object, the present invention provides a data lightweight storage and search method, which includes:
acquiring an original data set from a source database, performing format conversion on data in the original data set, and performing data cleaning on the data subjected to format conversion to obtain a standard data set;
performing linked list structure conversion on the data in the standard data set to obtain a linked list data set;
constructing an index based on the linked list data set and storing the index into a preset database;
and acquiring a data searching instruction, and performing linked list directional deletion query on the data in the database based on the data searching instruction to obtain the searched target data.
Optionally, the obtaining an original data set from a source database, and performing format conversion on data in the original data set includes:
reading a data document in the source database, and acquiring the original data set from the data document by using a preset data export tool;
and converting the data in the original data set into data in a JSON format by using the data export tool.
Optionally, the data cleaning of the format-converted data to obtain a standard data set includes:
performing null removal and duplicate removal processing on the JSON format data to obtain a cleaning data set;
and performing field segmentation on the data in the cleaning data set according to a preset field, and performing formatted output on the segmented data to obtain the standard data set.
Optionally, the performing linked list structure conversion on the data in the standard data set to obtain a linked list data set includes:
constructing linked list nodes based on the number of data in the standard data set;
assigning the data in the standard data set to the linked list nodes according to the data sequence in the standard data set, and summarizing all linked list data after assignment to obtain the linked list data set.
Optionally, the constructing an index based on the linked list data set and storing the index into a preset database includes:
constructing an index based on the nodes of the data in the linked list data set, and recording the addresses of the nodes;
and constructing an index table according to the index of the node and the node address, and storing the index table into the database.
Optionally, the performing, based on the data search instruction, a linked list directional deletion query on the data in the database to obtain the searched target data includes:
analyzing the data searching instruction to obtain a query index;
inquiring a target index from the index table according to the inquiry index, and determining the searched linked list data based on the node address corresponding to the target index;
and directionally deleting the nodes in the linked list data by using the node addresses, and determining the data in the nodes which are not deleted as the target data.
Optionally, the directionally deleting the nodes in the linked list data by using the node addresses, and determining the data in the nodes that are not deleted as the target data, includes:
traversing from the head node of the linked list data until a node with the index consistent with the target index is found out and is used as a target node;
and directing the precursor node of the target node to a successor node of the target node, deleting the target node, and extracting data in nodes which are not deleted as the searched target data.
In order to solve the above problem, the present invention further provides a data lightweight storage and search device, including:
the data cleaning module is used for acquiring an original data set from a source database, performing format conversion on data in the original data set, and performing data cleaning on the data subjected to format conversion to obtain a standard data set;
the data conversion module is used for performing linked list structure conversion on the data in the standard data set to obtain a linked list data set;
the data storage module is used for constructing an index based on the linked list data set and storing the index into a preset database;
and the data query module is used for performing reference operation on the at least two independent sub-components to obtain a front-end item containing a reference relation.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
and the processor executes the computer program stored in the memory to realize the data lightweight storage and searching method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the data lightweight storage and lookup method described above.
According to the invention, through carrying out format conversion on the data in the original data set, carrying out data cleaning on the data subjected to format conversion and carrying out linked list structure conversion on the data in the standard data set, the data can be converted into the data with a lighter linked list structure, and the light weight storage capability of the data is improved. Meanwhile, the data query does not need to carry out object conversion and analysis, and the traditional query is changed into the directional deletion of the linked list, so that the efficiency of the data query is greatly improved. Therefore, the data lightweight storage and search method, the data lightweight storage and search device, the electronic equipment and the computer readable storage medium can solve the problem of low data query efficiency.
Drawings
Fig. 1 is a schematic flow chart of a data lightweight storage and search method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart showing a detailed implementation of one of the steps in FIG. 1;
FIG. 3 is a schematic flow chart showing another step of FIG. 1;
FIG. 4 is a schematic flow chart showing another step of FIG. 1;
FIG. 5 is a schematic flow chart showing another step in FIG. 1;
FIG. 6 is a flow chart illustrating a detailed implementation of one of the steps in FIG. 5;
FIG. 7 is a functional block diagram of a data lightweight storage and lookup apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device for implementing the data lightweight storage and search method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides a data lightweight storage and search method. The execution subject of the data lightweight storage and search method includes, but is not limited to, at least one of electronic devices such as a server and a terminal, which can be configured to execute the method provided by the embodiment of the present invention. In other words, the data lightweight storage and lookup method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, web service, cloud communication, middleware service, domain name service, security service, Content Delivery Network (CDN), and a big data and artificial intelligence platform.
Fig. 1 is a schematic flow chart of a data lightweight storage and search method according to an embodiment of the present invention. In this embodiment, the data lightweight storage and search method includes the following steps S1-S5:
s1, acquiring an original data set from a source database, performing format conversion on data in the original data set, and performing data cleaning on the data after format conversion to obtain a standard data set.
In the embodiment of the invention, the source database can be a MongoDB database, the MongoDB database is a database based on distributed file storage, is between a relational database and a non-relational database, has the most abundant functions in the non-relational database, is most similar to the relational database, supports very loose data structure and is in a json-like bson format, and therefore can store more complex data types.
The format conversion refers to converting data into a json format, and the json format data is a lightweight data exchange format, is easy to read and write by people, and is easy to analyze and generate by a machine, so that the format conversion is widely applied to data query in various scenes. For example, insurance, urging, loan, and other business fields in the financial field.
In detail, the acquiring an original data set from a source database, and performing format conversion on data in the original data set includes: reading a data document in the source database, acquiring the original data set from the data document by using a preset data export tool, and converting data in the original data set into data in a JSON format by using the data export tool.
In the embodiment of the invention, the data documents refer to a plurality of documents in the MongoDB, and as the documents are the basic unit of data in the MongoDB, a set is formed by the documents, a plurality of sets form a database, namely, one MongoDB instance can bear a plurality of databases which can be regarded as mutually independent, each database has independent authority control, and different databases are stored in different files. For example, business data of different fields such as insurance, loan, etc. are stored in different documents.
In detail, referring to fig. 2, the data cleansing of the format-converted data to obtain the standard data set includes the following steps S10-S11:
s10, performing null removal and duplicate removal processing on the JSON format data to obtain a cleaning data set;
and S11, performing field segmentation on the data in the cleaning data set according to preset fields, and performing formatted output on the segmented data to obtain the standard data set.
In an optional embodiment of the present invention, the data in the JSON format is data in an object format: { "key1": obj, "key2": obj, "key3": obj. The data cleaning processing refers to extracting objects in the JSON data through nulling (deleting missing values or filling with specified values) and deduplication (removing duplicate data), segmenting the objects by using specified fields, and outputting the objects in a format, for example, { "id": 123"," username ": zhangsan", "age":28, "addr": beijing "}, through data cleaning and formatting output: 123| zhangsan |28| beijing, wherein the specified fields are "id", "username", "age", and "addr".
S2, performing linked list structure conversion on the data in the standard data set to obtain a linked list data set.
In the embodiment of the present invention, the linked list structure conversion refers to converting data in the standard data set into data of a linked list structure. The data of the linked list structure is composed of a series of nodes (each element in the linked list is called a node), the nodes can be dynamically generated at runtime, and each node comprises two parts: one is a data field for storing data elements, and the other is a pointer field for storing the address of the next node, and the linked list can reach the complexity of O (1) when being inserted, so that the speed of data query can be improved.
Specifically, referring to fig. 3, the performing linked list structure conversion on the data in the standard data set to obtain a linked list data set includes the following steps S20 to S21:
s20, constructing linked list nodes based on the number of data in the standard data set;
and S21, assigning the data in the standard data set to the linked list nodes according to the data sequence in the standard data set, and summarizing all linked list data subjected to assignment to obtain the linked list data set.
In the embodiment of the invention, the linked list nodes are constructed based on the number of the data in the standard data set, and the data in the standard data set is assigned to the data fields of the linked list nodes, so that the data can be converted into the data with the linked list structure, and the speed of data query is improved. For example, for the data in the above example: 123| zhangsan |28| beijing, four nodes are constructed to store corresponding data.
And S3, constructing indexes based on the linked list data set and storing the indexes into a preset database.
In the embodiment of the present invention, the preset database includes a relational database, a non-relational database, and the like.
In detail, referring to fig. 4, the constructing and storing the index based on the linked list data set into the preset database includes the following steps S30-S31:
s30, constructing indexes based on the nodes of the data in the linked list data set, and recording the addresses of the nodes;
s31, an index table is constructed according to the index and the node address of the node, and the index table is stored in the database.
In an optional embodiment of the invention, index storage is to determine the node storage address by using the index number of the node, and the incidence relation between the index and the node is determined by constructing an index table, so that the retrieval speed is higher. For example, the data 123| zhangsan |28| beijing corresponds to an index of [1, 2, 3, 4 ].
S4, acquiring a data searching instruction, and performing linked list directional deletion query on the data in the database based on the data searching instruction to obtain the searched target data.
In the embodiment of the invention, the link list directional deletion query refers to determining the queried nodes in the link list data through the index table, and finding out the target data in the queried nodes by deleting the specified nodes.
Further, referring to fig. 5, the performing linked list directional deletion query on the data in the database based on the data search instruction to obtain the searched target data includes the following steps S40 to S42:
s40, analyzing the data searching instruction to obtain a query index;
s41, querying a target index from the index table according to the query index, and determining the searched linked list data based on the node address corresponding to the target index;
s42, directionally deleting the nodes in the linked list data by using the node addresses, and determining the data in the nodes which are not deleted as the target data.
In an optional embodiment of the present invention, since the data that the user needs to search is stored in a certain node of the linked list, the node specified by the user needs to be deleted through the node address, so that the node data can be accurately searched. For example, a query index [1, 3, 4] is obtained by parsing the data instruction, and a target index of 2 can be obtained by comparing with the index table.
In detail, referring to fig. 6, the performing directional deletion on the nodes in the linked list data by using the node addresses and determining the data in the nodes that are not deleted as the target data includes the following steps S420 to S421:
s420, traversing from the head node of the linked list data until a node with the index consistent with the target index is found as a target node;
s421, directing the predecessor node of the target node to the successor node of the target node, deleting the target node, and extracting the data in the nodes which are not deleted as the searched target data.
In an alternative embodiment of the present invention, there are several situations:
A. if the linked list is empty, the null value is directly returned.
B. If the head node is the target node, the head node is directly deleted without adjusting the direction between the nodes.
C. If the target node is not the head node, directly enabling the predecessor node of the target node to point to the successor node, and advancing the pointers of the predecessor node and the target node by one grid. For example, if the index of a linked list is [1, 2, 3, 4] and the target index is 2, the data corresponding to [1, 3, 4] is output as the queried target data.
According to the invention, format conversion is carried out on the data in the original data set, data cleaning is carried out on the data after format conversion is completed, and linked list structure conversion is carried out on the data in the standard data set, so that the data can be converted into the data with a lighter linked list structure, and the light weight storage capacity of the data is improved. Meanwhile, the data query does not need to carry out object conversion and analysis, and the traditional query is changed into the directional deletion of the linked list, so that the efficiency of the data query is greatly improved. Therefore, the data lightweight storage and search method provided by the invention can solve the problem of low data query efficiency.
Fig. 7 is a functional block diagram of a data lightweight storage and lookup apparatus according to an embodiment of the present invention.
The data lightweight storage and lookup apparatus 100 of the present invention can be installed in an electronic device. According to the implemented functions, the data lightweight storage and lookup apparatus 100 may include a data cleaning module 101, a data conversion module 102, a data storage module 103, and a data query module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the data cleaning module 101 is configured to acquire an original data set from a source database, perform format conversion on data in the original data set, and perform data cleaning on the data after format conversion to obtain a standard data set;
the data conversion module 102 is configured to perform linked list structure conversion on the data in the standard data set to obtain a linked list data set;
the data storage module 103 is configured to construct an index based on the linked list data set and store the index into a preset database;
the data query module 104 is configured to perform a reference operation on the at least two independent sub-components to obtain a front-end item containing a reference relationship.
In detail, the data lightweight storage and lookup apparatus 100 includes the following modules:
the method comprises the steps of firstly, obtaining an original data set from a source database, carrying out format conversion on data in the original data set, and carrying out data cleaning on the data after format conversion is finished to obtain a standard data set.
In the embodiment of the invention, the source database can be a MongoDB database, the MongoDB database is a database based on distributed file storage, is between a relational database and a non-relational database, has the most abundant functions in the non-relational database, is most similar to the relational database, supports very loose data structure and is in a json-like bson format, and therefore can store more complex data types.
The format conversion refers to converting data into a json format, and the json format data is a lightweight data exchange format, is easy to read and write by people and is easy to analyze and generate by a machine, so that the format conversion is widely applied to data query in various scenes. For example, insurance, urging, loan, and other business fields in the financial field.
In detail, the acquiring an original data set from a source database, and performing format conversion on data in the original data set includes: reading a data document in the source database, acquiring the original data set from the data document by using a preset data export tool, and converting data in the original data set into data in a JSON format by using the data export tool.
In the embodiment of the invention, the data documents refer to a plurality of documents in the MongoDB, and as the documents are the basic unit of data in the MongoDB, a set is formed by the documents, a plurality of sets form a database, namely, one MongoDB instance can bear a plurality of databases which can be regarded as mutually independent, each database has independent authority control, and different databases are stored in different files. For example, business data of different fields such as insurance, loan, etc. are stored in different documents.
In detail, the data cleansing of the format-converted data to obtain a standard data set includes:
performing null removal and duplicate removal processing on the JSON format data to obtain a cleaning data set;
and performing field segmentation on the data in the cleaning data set according to a preset field, and performing formatted output on the segmented data to obtain the standard data set.
In an optional embodiment of the present invention, the data in the JSON format is data in an object format: { "key1": obj, "key2": obj, "key3": obj. The data cleaning processing refers to extracting objects in the JSON data through nulling (deleting missing values or filling with specified values) and deduplication (removing duplicate data), segmenting the objects by using specified fields, and outputting the objects in a format, for example, { "id": 123"," username ": zhangsan", "age":28, "addr": beijing "}, through data cleaning and formatting output: 123| zhangsan |28| beijing, wherein the specified fields are "id", "username", "age", and "addr".
And secondly, performing linked list structure transformation on the data in the standard data set to obtain a linked list data set.
In the embodiment of the present invention, the linked list structure conversion refers to converting data in the standard data set into data of a linked list structure. The data of the linked list structure is composed of a series of nodes (each element in the linked list is called a node), the nodes can be dynamically generated at runtime, and each node comprises two parts: one is a data field for storing data elements, and the other is a pointer field for storing the address of the next node, and the linked list can reach the complexity of O (1) when being inserted, so that the speed of data query can be improved.
Specifically, the performing linked list structure transformation on the data in the standard data set to obtain a linked list data set includes:
constructing a linked list node based on the number of data in the standard data set;
assigning the data in the standard data set to the linked list nodes according to the data sequence in the standard data set, and summarizing all linked list data after assignment to obtain the linked list data set.
In the embodiment of the invention, the linked list nodes are constructed based on the number of the data in the standard data set, and the data in the standard data set is assigned to the data fields of the linked list nodes, so that the data can be converted into the data with the linked list structure, and the speed of data query is improved. For example, for the data in the above example: 123| zhangsan |28| beijing, four nodes are constructed to store corresponding data.
And thirdly, constructing an index based on the linked list data set and storing the index into a preset database.
In the embodiment of the present invention, the preset database includes a relational database, a non-relational database, and the like.
In detail, the constructing and storing an index based on the linked list data set into a preset database includes:
constructing an index based on the nodes of the data in the linked list data set, and recording the addresses of the nodes;
and constructing an index table according to the index of the node and the node address, and storing the index table into the database.
In an optional embodiment of the invention, index storage is to determine the node storage address by using the index number of the node, and the incidence relation between the index and the node is determined by constructing an index table, so that the retrieval speed is higher. For example, the data 123| zhangsan |28| beijing corresponds to an index of [1, 2, 3, 4 ].
And step four, acquiring a data searching instruction, and performing linked list directional deletion query on the data in the database based on the data searching instruction to obtain the searched target data.
In the embodiment of the invention, the link list directional deletion query refers to determining the queried nodes in the link list data through the index table, and finding out the target data in the queried nodes by deleting the specified nodes.
Further, the performing linked list directional deletion query on the data in the database based on the data search instruction to obtain the searched target data includes:
analyzing the data searching instruction to obtain a query index;
inquiring a target index from the index table according to the inquiry index, and determining the searched linked list data based on the node address corresponding to the target index;
and directionally deleting the nodes in the linked list data by using the node addresses, and determining the data in the nodes which are not deleted as the target data.
In an optional embodiment of the present invention, since the data that the user needs to search is stored in a certain node of the linked list, the node specified by the user needs to be deleted through the node address, so that the node data can be accurately searched. For example, a query index [1, 3, 4] is obtained by parsing the data instruction, and a target index of 2 can be obtained by comparing with the index table.
In detail, the performing directional deletion on the nodes in the linked list data by using the node addresses, and determining the data in the nodes that are not deleted as the target data includes:
traversing from the head node of the linked list data until a node with the index consistent with the target index is found as a target node;
and directing the precursor node of the target node to a successor node of the target node, deleting the target node, and extracting data in nodes which are not deleted as the searched target data.
In an alternative embodiment of the present invention, there are several situations:
A. if the linked list is empty, the null value is directly returned.
B. If the head node is the target node, the head node is directly deleted without adjusting the direction between the nodes.
C. If the target node is not the head node, the predecessor node of the target node is directly pointed to the successor node, and pointers of the predecessor node and the target node are advanced by one grid. For example, if the index of a linked list is [1, 2, 3, 4] and the target index is 2, the data corresponding to [1, 3, 4] is output as the queried target data.
According to the invention, format conversion is carried out on the data in the original data set, data cleaning is carried out on the data after format conversion is completed, and linked list structure conversion is carried out on the data in the standard data set, so that the data can be converted into the data with a lighter linked list structure, and the light weight storage capacity of the data is improved. Meanwhile, the data query does not need to carry out object conversion and analysis, and the traditional query is changed into the directional deletion of the linked list, so that the efficiency of the data query is greatly improved. Therefore, the data lightweight storage and search device provided by the invention can solve the problem of low data query efficiency.
Fig. 8 is a schematic structural diagram of an electronic device for implementing a data lightweight storage and search method according to an embodiment of the present invention.
The electronic device may include a processor 10, a memory 11, a communication interface 12, and a bus 13, and may further include a computer program, such as a data lightweight storage and lookup program, stored in the memory 11 and operable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used to store not only application software installed in the electronic device and various types of data, such as codes of a data lightweight storage and search program, but also temporarily store data that has been output or is to be output.
The processor 10 may be formed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed of a plurality of integrated circuits packaged with the same function or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules (such as data lightweight storage and search programs) stored in the memory 11 and calling data stored in the memory 11.
The communication interface 12 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 13 may be divided into an address bus, a data bus, a control bus, etc. The bus 13 is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 8 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 8 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the electronic device may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The data lightweight storage and lookup program stored in the memory 11 of the electronic device is a combination of a plurality of instructions, which when executed in the processor 10, can implement:
acquiring an original data set from a source database, performing format conversion on data in the original data set, and performing data cleaning on the data subjected to format conversion to obtain a standard data set;
performing linked list structure conversion on the data in the standard data set to obtain a linked list data set;
constructing an index based on the linked list data set and storing the index into a preset database;
and acquiring a data searching instruction, and performing linked list directional deletion query on the data in the database based on the data searching instruction to obtain the searched target data.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, a recording medium, a usb-disk, a removable hard disk, a magnetic diskette, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring an original data set from a source database, performing format conversion on data in the original data set, and performing data cleaning on the data subjected to format conversion to obtain a standard data set;
performing linked list structure conversion on the data in the standard data set to obtain a linked list data set;
constructing an index based on the linked list data set and storing the index into a preset database;
and acquiring a data searching instruction, and performing linked list directional deletion query on the data in the database based on the data searching instruction to obtain the searched target data.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. 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.
The embodiment of the invention can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence base technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
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 lightweight storage and search method is characterized by comprising the following steps:
acquiring an original data set from a source database, performing format conversion on data in the original data set, and performing data cleaning on the data subjected to format conversion to obtain a standard data set;
performing linked list structure conversion on the data in the standard data set to obtain a linked list data set;
constructing an index based on the linked list data set and storing the index into a preset database;
and acquiring a data searching instruction, and performing linked list directional deletion query on the data in the database based on the data searching instruction to obtain the searched target data.
2. The data lightweight storage and retrieval method of claim 1, wherein said obtaining a raw data set from a source database, and performing format conversion on data in said raw data set, comprises:
reading a data document in the source database, and acquiring the original data set from the data document by using a preset data export tool;
and converting the data in the original data set into data in a JSON format by using the data export tool.
3. The method for lightweight storage and retrieval of data as recited in claim 2 wherein said data cleansing of format-converted data to obtain a standard data set comprises:
performing null removal and duplicate removal processing on the JSON format data to obtain a cleaning data set;
and performing field segmentation on the data in the cleaning data set according to a preset field, and performing formatted output on the segmented data to obtain the standard data set.
4. The method for lightweight storage and lookup of data as claimed in claim 1, wherein said performing linked list structure transformation on data in said standard data set to obtain a linked list data set comprises:
constructing linked list nodes based on the number of data in the standard data set;
assigning the data in the standard data set to the linked list nodes according to the data sequence in the standard data set, and summarizing all linked list data after assignment to obtain the linked list data set.
5. The data lightweight storage and lookup method of claim 4 wherein said building an index based on said linked list data set and storing into a predetermined database comprises:
constructing an index based on the nodes of the data in the linked list data set, and recording the addresses of the nodes;
and constructing an index table according to the index of the node and the node address, and storing the index table into the database.
6. The data lightweight storage and lookup method of claim 5, wherein the performing linked list directed deletion query on the data in the database based on the data lookup instruction to obtain the looked-up target data comprises:
analyzing the data searching instruction to obtain a query index;
inquiring a target index from the index table according to the inquiry index, and determining the searched linked list data based on the node address corresponding to the target index;
and directionally deleting the nodes in the linked list data by using the node addresses, and determining the data in the nodes which are not deleted as the target data.
7. The data lightweight storage and lookup method of claim 6, wherein said directionally deleting nodes in the linked list data using the node addresses and determining data in nodes that are not deleted as the target data comprises:
traversing from the head node of the linked list data until a node with the index consistent with the target index is found as a target node;
and pointing the predecessor nodes of the target nodes to successor nodes of the target nodes, deleting the target nodes, and extracting data in nodes which are not deleted to serve as the searched target data.
8. A data lightweight storage and lookup apparatus, the apparatus comprising:
the data cleaning module is used for acquiring an original data set from a source database, performing format conversion on data in the original data set, and performing data cleaning on the data subjected to format conversion to obtain a standard data set;
the data conversion module is used for performing linked list structure conversion on the data in the standard data set to obtain a linked list data set;
the data storage module is used for constructing an index based on the linked list data set and storing the index into a preset database;
and the data query module is used for performing reference operation on the at least two independent sub-components to obtain a front-end item containing a reference relation.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the data lightweight storage and lookup method of any of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the data lightweight storage and lookup method according to any one of claims 1 to 7.
CN202210822505.0A 2022-07-12 2022-07-12 Data lightweight storage and search method and device, electronic equipment and storage medium Pending CN115114297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210822505.0A CN115114297A (en) 2022-07-12 2022-07-12 Data lightweight storage and search method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210822505.0A CN115114297A (en) 2022-07-12 2022-07-12 Data lightweight storage and search method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115114297A true CN115114297A (en) 2022-09-27

Family

ID=83331998

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210822505.0A Pending CN115114297A (en) 2022-07-12 2022-07-12 Data lightweight storage and search method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115114297A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116405188A (en) * 2023-06-07 2023-07-07 湖南元数科技有限公司 Block chain-based insurance application flow data storage method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011146452A1 (en) * 2010-05-18 2011-11-24 Google Inc. Data storage and processing service
CN104809135A (en) * 2014-01-27 2015-07-29 腾讯科技(深圳)有限公司 Method and device for accessing data
CN106874424A (en) * 2017-01-25 2017-06-20 杭州淘淘搜科技有限公司 A kind of collecting webpage data processing method and system based on MongoDB and Redis
CN112506931A (en) * 2020-12-15 2021-03-16 平安银行股份有限公司 Data query method and device, electronic equipment and storage medium
WO2021051531A1 (en) * 2019-09-19 2021-03-25 平安科技(深圳)有限公司 Method and apparatus for processing multi-cluster job record, and device and storage medium
CN113868249A (en) * 2021-09-23 2021-12-31 广东电网有限责任公司 Data storage method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011146452A1 (en) * 2010-05-18 2011-11-24 Google Inc. Data storage and processing service
CN104809135A (en) * 2014-01-27 2015-07-29 腾讯科技(深圳)有限公司 Method and device for accessing data
CN106874424A (en) * 2017-01-25 2017-06-20 杭州淘淘搜科技有限公司 A kind of collecting webpage data processing method and system based on MongoDB and Redis
WO2021051531A1 (en) * 2019-09-19 2021-03-25 平安科技(深圳)有限公司 Method and apparatus for processing multi-cluster job record, and device and storage medium
CN112506931A (en) * 2020-12-15 2021-03-16 平安银行股份有限公司 Data query method and device, electronic equipment and storage medium
CN113868249A (en) * 2021-09-23 2021-12-31 广东电网有限责任公司 Data storage method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116405188A (en) * 2023-06-07 2023-07-07 湖南元数科技有限公司 Block chain-based insurance application flow data storage method and system
CN116405188B (en) * 2023-06-07 2023-08-22 湖南元数科技有限公司 Block chain-based insurance application flow data storage method and system

Similar Documents

Publication Publication Date Title
CN111709527A (en) Operation and maintenance knowledge map library establishing method, device, equipment and storage medium
US10002142B2 (en) Method and apparatus for generating schema of non-relational database
WO2022100032A1 (en) System analysis visualization method and apparatus, electronic device, and computer readable storage medium
CN111651453A (en) User historical behavior query method and device, electronic equipment and storage medium
CN114979120A (en) Data uploading method, device, equipment and storage medium
CN112506486A (en) Search system establishing method and device, electronic equipment and readable storage medium
CN112231417A (en) Data classification method and device, electronic equipment and storage medium
CN116089535A (en) Data synchronization method, device, equipment and storage medium
CN114185895A (en) Data import and export method and device, electronic equipment and storage medium
CN114398194A (en) Data collection method and device, electronic equipment and readable storage medium
CN112506931B (en) Data query method, device, electronic equipment and storage medium
CN111984745A (en) Dynamic expansion method, device, equipment and storage medium for database field
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN115129753A (en) Data blood relationship analysis method and device, electronic equipment and storage medium
CN115114297A (en) Data lightweight storage and search method and device, electronic equipment and storage medium
CN114398346A (en) Data migration method, device, equipment and storage medium
CN113254446A (en) Data fusion method and device, electronic equipment and medium
CN112328656A (en) Service query method, device, equipment and storage medium based on middle platform architecture
CN114756564B (en) Data processing method, device, equipment and medium for stream computing
US20220300513A1 (en) Asynchronous query optimization using spare hosts
CN115481145A (en) Data query method, device, equipment and medium based on search engine
CN110647518B (en) Data source fusion calculation method, component and device
CN115062023A (en) Wide table optimization method and device, electronic equipment and computer readable storage medium
CN113407657A (en) Data query method, device, equipment and storage medium based on single-level database
CN112686759A (en) Account checking monitoring method, device, equipment and 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