CN113779028A - Storage method, query method, electronic device and storage medium fusing primary key index genes - Google Patents

Storage method, query method, electronic device and storage medium fusing primary key index genes Download PDF

Info

Publication number
CN113779028A
CN113779028A CN202111013215.3A CN202111013215A CN113779028A CN 113779028 A CN113779028 A CN 113779028A CN 202111013215 A CN202111013215 A CN 202111013215A CN 113779028 A CN113779028 A CN 113779028A
Authority
CN
China
Prior art keywords
gene
primary key
query
value
server
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
CN202111013215.3A
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.)
Zhuhai Xindehui Information Technology Co ltd
Original Assignee
Zhuhai Xindehui Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Xindehui Information Technology Co ltd filed Critical Zhuhai Xindehui Information Technology Co ltd
Priority to CN202111013215.3A priority Critical patent/CN113779028A/en
Publication of CN113779028A publication Critical patent/CN113779028A/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/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/24Querying
    • G06F16/242Query formulation
    • 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
    • G06F16/24534Query rewriting; Transformation

Landscapes

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

Abstract

The invention discloses a storage method, an inquiry method, electronic equipment and a storage medium for fusing a primary key index gene, wherein the storage method comprises the following steps: acquiring gene field content, extracting genes to obtain genes, generating a primary key, fusing and generating a new primary key according to the obtained results of the genes and the primary key, and determining a server or a sub-library where a data dimension table is located according to the generated result of the new primary key and warehousing the server or the sub-library. In the application field of the sub-database and sub-table, according to the service application scene, the invention also discloses a query method of the fusion main key index gene, the gene of the query field is extracted and fused with the main key, after the gene fusion index is used for query, the positioning query is directly carried out through the algorithm, the number of intermediate query times is reduced, the service response speed is improved, the database table or the server to which the data belongs can be rapidly positioned, and the rapid query of the relevant data in the database or the server is realized.

Description

Storage method, query method, electronic device and storage medium fusing primary key index genes
Technical Field
The invention relates to the field of big data and multi-server warehouse-dividing and table-dividing query, in particular to a warehouse-in method, a query method, electronic equipment and a storage medium fusing a primary key index gene.
Background
The query method of big data and multi-server sub-database and sub-table in the current market mainly adopts a technical scheme of querying by a main key, but the scheme has the following defects when in use: if the common fields except the main key are required to be inquired, the scanning needs to be carried out by the base, and the resources are consumed.
In order to avoid scanning from one database to another, some query methods for big data and multiple servers in different databases establish a data dimension table, or put the data dimension table into a cache to record which database the data is stored in, but the scheme needs query conversion to determine the data route of the server, and has a great influence on the application rate under the application conditions of high load and high concurrent query. This solution also takes a long time to find the data route because it requires many requests to find the data route when querying the data dimension table.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art.
Therefore, according to one aspect of the invention, a method for importing a fusion primary key index gene is disclosed, which comprises the following detailed steps: acquiring gene field content; extracting the gene to obtain the gene; generating a primary key; fusing to generate a new main bond according to the obtained results of the gene and the main bond; and according to the result of the generated new primary key, determining a server or a sub-library where the data dimension table is located and warehousing.
Preferably, the method for importing the fusion major bond index gene specifically comprises the following steps: converting the gene field content into a byte stream; calculating a value A of the byte stream by using a CRC32 algorithm; according to the total amount of the library or the table, calculating the remainder of the value A of the byte stream; the remainder is converted to a 16-ary number of four bits, resulting in a value B, which is defined as a gene.
Preferably, the primary key is generated by using a 64-bit UUID, and the uniqueness of the data is ensured.
According to one aspect of the invention, the invention discloses a query method for fusing major key index genes, which is characterized in that: forming a query field according to the query condition; extracting the gene to obtain the gene; inquiring through map parameters; and acquiring data, connecting a server or a sub-library where the data dimension table is located, and acquiring the data.
Preferably, the method for searching the fusion major bond index gene specifically comprises the following steps of: converting the gene field content into a byte stream; calculating a value A of the byte stream by using a CRC32 algorithm; according to the total amount of the library or the table, calculating the remainder of the value A of the byte stream; the remainder is converted to a 16-ary number of four bits, resulting in a value B, which is defined as a gene.
Preferably, the server or the sub-library where the data dimension table is located is queried through map parameter query.
According to one aspect of the invention, an electronic device is disclosed, comprising a processor and a memory, wherein the memory is used for storing a computer program, the computer program comprises program instructions, and the processor is used for calling the program instructions and executing the storage method of the fusion primary key index gene or the query method of the fusion primary key index gene.
According to an aspect of the present invention, a computer storage medium is disclosed, which stores a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the primary key index gene fused binning method or the primary key index gene fused query method of the present invention.
The invention discloses a storage method, an inquiry method, electronic equipment and a storage medium fusing a main key index gene.
Drawings
In order to more clearly illustrate the embodiments of the present invention, the drawings that are required to be used in the description of the embodiments or the related art will be briefly described below.
FIG. 1 is a schematic diagram of a warehousing procedure for fusion of primary key index genes;
FIG. 2 is a hexadecimal representation of decimal conversion to four bits;
FIG. 3 is a schematic view of a query process for fusion of primary key index genes.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
The invention discloses a storage method of fusion major key index genes, which mainly relates to five steps as shown in figure 1: acquiring gene field content; extracting the gene to obtain the gene; generating a primary key; fusing to generate a new main key according to the obtained results of the gene and the main key; and according to the result of the generated new primary key, determining a server or a sub-library where the data dimension table is located and warehousing.
As shown in FIG. 1-2, the gene field content is obtained, such as picture path:/xxx/pic/x1. png. The process of extracting gene mainly includes four steps: converting the gene field content into a byte stream; calculating a value a of the byte stream by using a CRC32 algorithm, wherein CRC32.ieee (stream) ═ 12254; remainder is calculated for the value a of the byte stream according to the total amount of the library or table, mod (12254,4096) is 4062; converting the remainder into a 16-ary number of four bits, resulting in a value B of 0FDE, and defining the value B as a gene, preferably, a 16-ary number of four bits, with a maximum value of FFFF, the disclosed algorithm can support up to 65535 banks or tables.
As shown in FIG. 1, the primary key uses a 64-bit UUID to generate xxxx-xxxx-xxxx … xxxx, ensuring the uniqueness of the data. According to the obtained results of the genes and the major bonds, new major bonds are generated by fusion, and the value of the new major bonds is xxxx-xxxx-xxxx … xxxx _0 fde. And according to the value of the new primary key, determining a server or a sub-library where the data dimension table is located and warehousing.
The invention discloses a query method for fusing a major key index gene, which mainly relates to four steps as shown in figure 3: forming a query field according to a query condition, such as picture path:/xxx/pic/x1. png; extracting the gene, wherein the path _ gene (path) is 12254, such as 4096 servers, to obtain gene 0 FDE; and querying a server where the positioning data dimension table is located by map parameter query, wherein the server is 0FDE- - > 192.168.40.62. The connection server obtains data 192.168.40.62/xxx/pic/x1. png.
The invention discloses electronic equipment which comprises a processor and a memory, wherein the memory is used for storing a computer program, the computer program comprises a program instruction, and the processor is used for calling the program instruction and executing the storage method of the fusion primary key index gene or the query method of the fusion primary key index gene.
The present invention discloses a computer storage medium storing a computer program, the computer program comprising program instructions that, when executed by a processor, cause the processor to execute the method of entering a library of a fused primary key index gene or the method of querying a fused primary key index gene of the present invention.
The invention provides a storage method, an inquiry method, electronic equipment and a storage medium fusing a main key index gene, wherein in the application field of sub-library and sub-list, the gene of an inquiry field is extracted through an algorithm according to a service application scene, and is fused with a main key, after the gene fusion index is used for inquiry, the positioning inquiry is directly carried out through the algorithm, so that the number of intermediate inquiry times is reduced, the service response speed is improved, a database table or a server to which the data belongs can be quickly positioned, and the quick inquiry of related data in the library or the server is realized.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explaining the principles of the invention and are not to be construed as limiting the invention. Therefore, any modification, equivalent replacement, improvement and the like made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. Further, it is intended that the appended claims cover all such variations and modifications as fall within the scope and boundaries of the appended claims or the equivalents of such scope and boundaries.

Claims (8)

1. The method for storing the fusion major bond index gene is characterized by comprising the following steps:
acquiring gene field content;
extracting the gene to obtain the gene;
generating a primary key;
fusing to generate a new main bond according to the obtained results of the gene and the main bond;
and determining a server or a sub-library where the data dimension table is located according to the generated result of the new primary key, and warehousing the data dimension table.
2. The method of claim 1, wherein the extracting the gene specifically comprises the following steps:
converting the gene field content into a byte stream;
calculating a value A of the byte stream by using a CRC32 algorithm;
according to the total amount of the library or the table, calculating the remainder of the value A of the byte stream;
converting the remainder into a 16-system numerical value of four bits to obtain a value B, and defining the value B as a gene.
3. The method of claim 2, wherein the primary key is generated using a 64-bit UUID.
4. The query method for the fusion major bond index gene is characterized by comprising the following steps:
forming a query field according to the query condition;
extracting the gene to obtain the gene;
inquiring through map parameters;
and acquiring data, connecting a server or a sub-library where the data dimension table is located, and acquiring the data.
5. The method for searching for a fused primary key index gene as claimed in claim 4, wherein said extracting of the gene specifically comprises the steps of:
converting the gene field content into a byte stream;
calculating a value A of the byte stream by using a CRC32 algorithm;
according to the total amount of the library or the table, calculating the remainder of the value A of the byte stream;
converting the remainder into a 16-system numerical value of four bits to obtain a value B, and defining the value B as a gene.
6. The method for searching fused primary key index gene according to claim 5, wherein the server or sub-library where the data dimension table is located is searched through map parameter search.
7. An electronic device comprising a processor and a memory, wherein the memory is configured to store a computer program comprising program instructions, and wherein the processor is configured to invoke the program instructions to perform the method of any of claims 1-6.
8. A computer storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1-6.
CN202111013215.3A 2021-08-31 2021-08-31 Storage method, query method, electronic device and storage medium fusing primary key index genes Pending CN113779028A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111013215.3A CN113779028A (en) 2021-08-31 2021-08-31 Storage method, query method, electronic device and storage medium fusing primary key index genes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111013215.3A CN113779028A (en) 2021-08-31 2021-08-31 Storage method, query method, electronic device and storage medium fusing primary key index genes

Publications (1)

Publication Number Publication Date
CN113779028A true CN113779028A (en) 2021-12-10

Family

ID=78840406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111013215.3A Pending CN113779028A (en) 2021-08-31 2021-08-31 Storage method, query method, electronic device and storage medium fusing primary key index genes

Country Status (1)

Country Link
CN (1) CN113779028A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117309A (en) * 2010-01-06 2011-07-06 卓望数码技术(深圳)有限公司 Data caching system and data query method
CN103905503A (en) * 2012-12-27 2014-07-02 中国移动通信集团公司 Data storage method, data scheduling method, device and system
WO2018095187A1 (en) * 2016-11-22 2018-05-31 北京京东尚科信息技术有限公司 Document online preview method and device
CN109471863A (en) * 2018-11-12 2019-03-15 北京懿医云科技有限公司 Information query method and device, electronic equipment based on distributed data base
CN112988763A (en) * 2021-05-14 2021-06-18 北京顺实科技有限公司 Kv database storage and query method using partial hash Key as index

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117309A (en) * 2010-01-06 2011-07-06 卓望数码技术(深圳)有限公司 Data caching system and data query method
CN103905503A (en) * 2012-12-27 2014-07-02 中国移动通信集团公司 Data storage method, data scheduling method, device and system
WO2018095187A1 (en) * 2016-11-22 2018-05-31 北京京东尚科信息技术有限公司 Document online preview method and device
CN109471863A (en) * 2018-11-12 2019-03-15 北京懿医云科技有限公司 Information query method and device, electronic equipment based on distributed data base
CN112988763A (en) * 2021-05-14 2021-06-18 北京顺实科技有限公司 Kv database storage and query method using partial hash Key as index

Similar Documents

Publication Publication Date Title
US7496566B2 (en) Priority based LDAP service publication mechanism
CN112347377B (en) IP address field searching method, service scheduling method, device and electronic equipment
US7761570B1 (en) Extensible domain name service
EP2073505A1 (en) Query routing in distributed database system
CN103810224A (en) Information persistence and query method and device
CN103729471A (en) Method and device for database query
CN106951179B (en) Data migration method and device
US20080126311A1 (en) Automatic index creation based on unindexed search evaluation
CN105224609A (en) Index query method and device
CN113568924B (en) Data processing method and device, electronic equipment and storage medium
CN113626448B (en) HBase distributed storage-based space vector data indexing and query method
CN111930823A (en) Data query method and device, data center station and storage medium
CN110888878A (en) Service-oriented main data management method and system
US20080097971A1 (en) Peer-to-peer based secondary key search method and system for cluster database
CN107423037A (en) Application programming interfaces localization method and equipment
CN109656950A (en) Recursive query method, apparatus, server and storage medium
CN105912696A (en) DNS (Domain Name System) index creating method and query method based on logarithm merging
CN104239337A (en) TCAM (ternary content addressable memory) based table look-up processing method and device
CN107704475B (en) Multilayer distributed unstructured data storage method, query method and device
CN111400301B (en) Data query method, device and equipment
CN113779028A (en) Storage method, query method, electronic device and storage medium fusing primary key index genes
CN110020001A (en) Storage, querying method and the corresponding equipment of string data
CN109697234B (en) Multi-attribute information query method, device, server and medium for entity
CN104750749A (en) Data processing method and data processing device
CN116610694A (en) Rule verification method and system based on relation between columns and access sentences

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