CN111984678B - SQL using method based on Elasticissearch - Google Patents

SQL using method based on Elasticissearch Download PDF

Info

Publication number
CN111984678B
CN111984678B CN202010857481.3A CN202010857481A CN111984678B CN 111984678 B CN111984678 B CN 111984678B CN 202010857481 A CN202010857481 A CN 202010857481A CN 111984678 B CN111984678 B CN 111984678B
Authority
CN
China
Prior art keywords
user
client
preset
value
sql
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.)
Active
Application number
CN202010857481.3A
Other languages
Chinese (zh)
Other versions
CN111984678A (en
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.)
Anhui Xinhuabo Information Technology Co ltd
Original Assignee
Anhui Xinhuabo 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 Anhui Xinhuabo Information Technology Co ltd filed Critical Anhui Xinhuabo Information Technology Co ltd
Priority to CN202010857481.3A priority Critical patent/CN111984678B/en
Publication of CN111984678A publication Critical patent/CN111984678A/en
Application granted granted Critical
Publication of CN111984678B publication Critical patent/CN111984678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/24Querying
    • G06F16/245Query processing
    • G06F16/2452Query translation
    • G06F16/24526Internal representations for 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • G06F3/013Eye tracking input arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/18Eye characteristics, e.g. of the iris
    • G06V40/193Preprocessing; Feature extraction

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Ophthalmology & Optometry (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an SQL (structured query language) using method based on an Elasticissearch, which is used for solving the problems of complicated grammar, difficult semantic understanding, long structure and inconvenient query operation of the conventional Elasticissearch query, and comprises the following steps of: deploying an SQL engine, and receiving SQL sentences for transmitting queries by a client through a Rest service; obtaining a query result from a cache; analyzing the SQL sentence through a syntax tree, and constructing an Elasticissearch native query syntax after the syntax is enhanced; the universal SQL standard is adopted, the query availability of the Elasticissearch is improved, the usage is convenient, the learning cost is low, and the error rate is reduced; and (3) grammar enhancement: the range can be extracted from the search conditions, so that the search result is accurate, synonym conversion is increased, and the search data result is more comprehensive.

Description

SQL using method based on Elasticissearch
Technical Field
The invention relates to the technical field of SQL query, in particular to an SQL using method based on an elastic search.
Background
The Elasticissearch is a search engine Apacheluce built in full textTMThe basic search engine is a real-time distributed search and analysis engine.
The Elasticsearch is also written in Java, which internally uses Lucene for indexing and searching, but its purpose is to simplify full-text retrieval by hiding the Lucene complexity.
There are many ways of communicating Elasticsearch, one is to communicate through restful web interface, and the other is to communicate through java api to query relevant data.
The requirement on a technology stack is high by operating the elastic search through the javaAPI, and the learning cost is increased. The function of the query needs a large amount of written code to be completed. When the version is changed, the code also needs to be reconstructed, and the reusability is not high.
The technical stack is not required by performing communication operation Elasticissearch through a RESTful web interface, but the query grammar is based on a JSON data structure, the grammar is complicated, semantically difficult to understand, the structure is long, and the troubleshooting is difficult after errors occur.
Due to the limitation of the communication mode of the Elasticsearch. The operations related to the Elasticsearch query in the well-known-lineage SQL approach are introduced.
Disclosure of Invention
The invention aims to provide an SQL using method based on the Elasticissearch in order to solve the problems of complicated grammar, difficult semantic understanding, long structure and inconvenient query operation of the conventional Elasticissearch query; the syntax tree is a tree representation form of an abstract syntax structure of the SQL, each node on the tree represents one structure in the SQL, the universal SQL standard is adopted, the query availability of the elastic search is improved, the use is convenient, the learning cost is low, and the error rate is reduced; and (3) grammar enhancement: the range can be extracted from the search conditions, so that the search result is accurate, synonym conversion is increased, and the search data result is more comprehensive;
the purpose of the invention can be realized by the following technical scheme: an SQL using method based on an Elasticisearch comprises the following steps:
the method comprises the following steps: deploying an SQL engine, and receiving SQL sentences for transmitting queries by a client through a Rest service;
step two: obtaining a query result from a cache; wherein the cache is realized based on Ehcache;
step three: analyzing the SQL sentence through a syntax tree, and constructing an Elasticissearch native query syntax after the syntax is enhanced;
step four: acquiring an Elasticissearch query result, and performing data enhancement on the query result, wherein the data is added by adding metadata information on the basis of returning, so that the attribute of the data is clearer; and sending the query result after the data enhancement to the client.
Preferably, the syntax tree is an abstract syntax structure tree of SQL, and the syntax tree includes a plurality of nodes, each node representing a structure in SQL.
Preferably, the grammar enhancement is the extraction of range and the addition of synonym transformations in the search criteria.
Preferably, a registration login unit, a data storage unit, a data acquisition unit and a data analysis unit are installed in the client; the registration unit is used for the user to submit registration information for registration and send the registration information which is successfully registered to the data storage unit for storage; the registration information comprises the name, the age, the time of job entry, the preset eye contour and the preset distance of the client corresponding to the eyes of the user;
the data acquisition unit is used for acquiring the eye contour of a user when the user accesses the client and sending the eye contour to the data analysis unit, the data analysis unit is used for analyzing the registration information of the user and the eye contour of the user when the user accesses the client, and the specific analysis steps are as follows:
s1: amplifying the eye contour by a plurality of times when the client is accessed to obtain an eye pixel contour, and amplifying the preset eye contour of the user by the same plurality of times to obtain a preset eye pixel contour;
s2: selecting the center points of the eye pixel outline and the preset outline of the eye pixel, and coinciding the center points of the eye pixel outline and the preset outline of the eye pixel; counting the number of pixel grids of the eye pixel outline and the number of pixel grids of the preset eye pixel outline, and marking the difference value of the eye pixel outline and the preset eye pixel outline as Y1 when the number of pixel grids of the eye pixel outline is greater than the number of pixel grids of the preset eye pixel outline; when the pixel grid number of the eye pixel outline is smaller than the pixel grid number of the preset eye pixel outline, marking the difference value of the two as Y2; when the pixel grid number of the eye pixel outline is equal to the pixel grid number of the preset eye pixel outline, marking the difference value of the two as Y3; wherein the value of Y3 is equal to zero;
s3: setting the age of the user as N1, calculating the time difference between the working time of the user and the current time to obtain the working duration of the user, and marking the working duration as N2;
s4: the age and the working duration of the user are subjected to dequantization processing and numerical values are taken, and a display adjustment value NZ of the user is obtained by using a formula NZ (N1 × b1+ N2 × b 2); when the display adjustment value is greater than the set threshold, executing step S5; if not, the query result is directly displayed on the client according to the preset font size;
s5: when the difference value between the two is Y1, obtaining a display size value H by using a formula H (H1 × b4-Y1 × b 3); b3 and b4 are preset proportionality coefficients, and H1 is a preset distance of the client corresponding to the eyes;
when the difference between the two is Y2, obtaining a display size value H by using a formula H of H1 × b4+ Y1 × b 5; wherein b5 is a preset proportionality coefficient;
when the difference value between the two is Y3, obtaining a display size value H by using the formula H-H1 × b 4;
s6: setting the word size to Fk, k is 1, 2, … …, n; and F1<……<Fn; the sizes of the word sizes all correspond to a matching range (f)k-1,fk],f0Is zero; matching the display size value H of the user with the matching range of the size of the font size, and when H belongs to (f)k-1,fk]And adjusting the font corresponding to the query result to be the same as the font size Fk by the data analysis unit, and then displaying the font on the client.
Preferably, the client further includes a management unit, the management unit is configured to collect a time when the user logs in the client and a time when the user logs out of the client, and manage registration information of the user, and the specific management step includes:
SS 1: setting the time when the user logs in the client as D1j, and marking the offline time immediately after the time when the user logs in the client as D2 j; j is 1, 2, … …, n;
SS 2: counting the logging-in time length after the user is off-line, summing all the logging-in time lengths, averaging to obtain a logging-in interval time length average value, and marking the logging-in interval time length average value as QD;
SS 3: acquiring the enrollment duration N2 of the user; the mean value of the time length of the job entry and the time length of the login interval is subjected to quantization processing and is taken as a numerical value, and a formula is utilized
Figure BDA0002646884760000041
Acquiring a management value WP of a user; wherein b6, b7 and b8 are all preset proportionality coefficients; mu is a correction factor, and the value is 0.8632; SS 4: and deleting the registration information of the user when the management value is larger than the set threshold value.
Preferably, the client further comprises a remote processing unit; the remote processing unit is used for managing the plug-in of SQL query, and comprises the following specific steps:
SSS 1: marking the plug-in for SQL query corresponding to the client version as a primary selection plug-in; counting the downloading times and the unloading times of the initially selected plug-in, and respectively marking as P1 and P2;
SSS 2: carrying out dequantization processing on the downloading times and the unloading times and taking the numerical values of the downloading times and the unloading times;
SSS 3: obtaining a mounting value P of the initially selected plug-in by using a formula P ═ λ × (P1 × b9-P2 × b10) + 5.3984; marking the initially selected plug-in with the maximum installation value as a selected plug-in, wherein b9 and b10 are both preset proportionality coefficients;
SSS 4: and installing the selected plug-in the client.
Compared with the prior art, the invention has the beneficial effects that:
1. the syntax tree is a tree representation form of an abstract syntax structure of the SQL, each node on the tree represents one structure in the SQL, the universal SQL standard is adopted, the query availability of the elastic search is improved, the use is convenient, the learning cost is low, and the error rate is reduced; and (3) grammar enhancement: the range can be extracted from the search conditions, so that the search result is accurate, synonym conversion is increased, and the search data result is more comprehensive;
2. the data analysis unit is used for analyzing the registration information of the user and the eye contour when the user accesses the client, amplifying the eye contour when the user accesses the client by a plurality of times to obtain an eye pixel contour, and amplifying the preset eye contour of the user by the same plurality of times to obtain an eye pixel preset wheelProfile; selecting the center points of the eye pixel outline and the preset outline of the eye pixel, and coinciding the center points of the eye pixel outline and the preset outline of the eye pixel; counting the number of pixel grids of the eye pixel outline and the number of pixel grids of the preset eye pixel outline, and marking the difference value of the eye pixel outline and the preset eye pixel outline as Y1 when the number of pixel grids of the eye pixel outline is greater than the number of pixel grids of the preset eye pixel outline; when the pixel grid number of the eye pixel outline is smaller than the pixel grid number of the preset eye pixel outline, marking the difference value of the two as Y2; when the pixel grid number of the eye pixel outline is equal to the pixel grid number of the preset eye pixel outline, marking the difference value of the two as Y3; the value of Y3 is equal to zero, and the display adjustment value NZ of the user is obtained by using a formula NZ ═ N1 × b1+ N2 × b 2; when the display adjustment value is greater than the set threshold, executing step S5; when the difference between the two is Y1, obtaining a display size value H by using a formula H-H1 × b4-Y1 × b 3; when H is epsilon (f)k-1,fk]Then, the data analysis unit adjusts the font corresponding to the query result to be the same as the font size Fk, and then displays the font on the client; the corresponding font size is obtained by identifying the eye contour of the user and analyzing the display adjustment value and the display size value of the user, the font corresponding to the query result is adjusted to be the same as the font size Fk, the query result is adjusted to be the corresponding font size according to the query distance of the user, the user can conveniently check the font size, and the problem that the existing client cannot adjust the font size according to the distance between the eyes of the user and the client is avoided.
Drawings
In order to facilitate understanding for those skilled in the art, the present invention will be further described with reference to the accompanying drawings.
FIG. 1 is a functional block diagram of the present invention;
FIG. 2 is a diagram illustrating a syntax structure according to the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood 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.
Referring to fig. 1-2, a method for using SQL based on an Elasticsearch includes the following steps:
the method comprises the following steps: deploying an SQL engine, and receiving SQL sentences for transmitting queries by a client through a Rest service;
step two: obtaining a query result from a cache; wherein the cache is realized based on Ehcache;
step three: analyzing the SQL sentence through a syntax tree, and constructing an Elasticissearch native query syntax after the syntax is enhanced;
step four: acquiring an Elasticissearch query result, and performing data enhancement on the query result, wherein the data is added by adding metadata information on the basis of returning, so that the attribute of the data is clearer; and sending the query result after the data enhancement to the client.
The syntax tree is an abstract syntax structure tree of the SQL, the syntax tree comprises a plurality of nodes, and each node represents one structure in the SQL.
The grammar enhancement is to extract the scope and add synonym transformations in the search criteria.
A registration login unit, a data storage unit, a data acquisition unit and a data analysis unit are installed in the client; the registration unit is used for the user to submit registration information for registration and send the registration information which is successfully registered to the data storage unit for storage; the registration information comprises the name, the age, the time of job entry, the preset eye contour and the preset distance of the client corresponding to the eyes of the user;
the data acquisition unit is used for acquiring the eye contour of a user when the user accesses the client and sending the eye contour to the data analysis unit, the data analysis unit is used for analyzing the registration information of the user and the eye contour of the user when the user accesses the client, and the specific analysis steps are as follows:
s1: amplifying the eye contour by a plurality of times when the client is accessed to obtain an eye pixel contour, and amplifying the preset eye contour of the user by the same plurality of times to obtain a preset eye pixel contour;
s2: selecting the center points of the eye pixel outline and the preset outline of the eye pixel, and coinciding the center points of the eye pixel outline and the preset outline of the eye pixel; counting the number of pixel grids of the eye pixel outline and the number of pixel grids of the preset eye pixel outline, and when the number of the pixel grids of the eye pixel outline is larger than the number of the pixel grids of the preset eye pixel outline, marking the difference value of the two as Y1; when the number of pixel grids of the eye pixel outline is smaller than that of the preset outline of the eye pixel, marking the difference value of the two as Y2; when the pixel grid number of the eye pixel outline is equal to the pixel grid number of the preset eye pixel outline, marking the difference value of the two as Y3; wherein the value of Y3 is equal to zero;
s3: setting the age of the user as N1, calculating the time difference between the working time of the user and the current time to obtain the working duration of the user, and marking the working duration as N2;
s4: the age and the working duration of the user are subjected to dequantization processing and numerical values are taken, and a display adjustment value NZ of the user is obtained by using a formula NZ (N1 × b1+ N2 × b 2); when the display adjustment value is greater than the set threshold, executing step S5; if not, the query result is directly displayed on the client according to the preset font size;
s5: when the difference value between the two is Y1, obtaining a display size value H by using a formula H (H1 × b4-Y1 × b 3); b3 and b4 are preset proportionality coefficients, and H1 is a preset distance of the client corresponding to the eyes;
when the difference between the two is Y2, obtaining a display size value H by using a formula H of H1 × b4+ Y1 × b 5; wherein b5 is a preset proportionality coefficient;
when the difference value between the two is Y3, obtaining a display size value H by using the formula H-H1 × b 4;
s6: setting the word size to Fk, k is 1, 2, … …, n; and F1<……<Fn; the sizes of the word sizes all correspond to a matching range (f)k-1,fk],f0Is zero; matching the display size value H of the user with the matching range of the size of the font size, and when H belongs to (f)k-1,fk]And adjusting the font corresponding to the query result to be the same as the font size Fk by the data analysis unit, and then displaying the font on the client.
The client also comprises a management unit, the management unit is used for collecting the time when the user logs in the client and the time when the user logs off the client and managing the registration information of the user, and the specific management steps are as follows:
SS 1: setting the time when the user logs in the client as D1j, and marking the off-line time immediately after the time when the user logs in the client as D2 j; j is 1, 2, … …, n;
SS 2: counting the logging-in time length after the user is off-line, summing all the logging-in time lengths, averaging to obtain a logging-in interval time length average value, and marking the logging-in interval time length average value as QD;
SS 3: acquiring the enrollment duration N2 of the user; the mean value of the time length of the job entry and the time length of the login interval is subjected to quantization processing and is taken as a numerical value, and a formula is utilized
Figure BDA0002646884760000081
Acquiring a management value WP of a user; wherein b6, b7 and b8 are all preset proportionality coefficients; mu is a correction factor, and the value is 0.8632; SS 4: and deleting the registration information of the user when the management value is larger than the set threshold value.
The client further comprises a remote processing unit; the remote processing unit is used for managing the plug-in of SQL query, and comprises the following specific steps:
SSS 1: marking the plug-in for SQL query corresponding to the client version as a primary selection plug-in; counting the downloading times and the unloading times of the initially selected plug-in, and respectively marking as P1 and P2;
SSS 2: carrying out dequantization processing on the downloading times and the unloading times and taking the numerical values of the downloading times and the unloading times;
SSS 3: obtaining a mounting value P of the initially selected plug-in by using a formula P ═ λ × (P1 × b9-P2 × b10) + 5.3984; marking the initially selected plug-in with the maximum installation value as a selected plug-in, wherein b9 and b10 are both preset proportionality coefficients;
SSS 4: and installing the selected plug-in the client.
The Rest service: REST, or representational state transfer, is typically based on existing widely popular protocols and standards using HTTP, URI, and XML (a subset under the standard universal markup language) and HTML (an application under the standard universal markup language);
caching: the cache is realized based on Ehcache, and the Ehcache is a pure Java in-process cache framework, has the characteristics of high speed, high precision and the like, and is a widely used open source Java distributed cache. Mainly oriented to general caches, Java EE and lightweight containers. The system comprises a memory, a disk storage, a cache loader, a cache expansion and a cache exception handling program;
parsing the syntax tree: a syntax tree is a representation of the tree of SQL abstract syntax structures, where each node in the tree represents a structure in SQL and the syntax here does not represent every detail that appears in the real syntax. For example, nested brackets are implicit in the structure of the tree and are not presented in the form of nodes, whereas conditional jump statements like if-condition-then are represented using nodes with two branches;
in the parsing stage of the syntax tree, the used context-free syntax often performs equivalent transformation on the syntax (eliminating left recursion, backtracking, ambiguity, and the like) in the parsing process, so that some redundant components are introduced into the syntax, adverse effects are caused to subsequent stages, even the syntax of each stage becomes chaotic, and the SQL syntax tree is often constructed independently. Establishing a certain relation between the front and the back;
and (3) grammar enhancement: the range can be extracted from the search conditions, so that the search result is accurate, synonym conversion is increased, and the search data result is more comprehensive;
acquiring Elasticisarch data through a Java API;
acquiring data in the cluster through an Elasticissearch internal protocol;
data enhancement;
based on the self-defined metadata, the result returned by the elastic search is processed for two times, and metadata information is added on the basis of the return, so that the attribute of the data is clearer.
By customizing the SQL service, the API of the Elasticisearch is secondarily packaged, so that the maintenance is easy and the expansibility is strong.
The universal SQL standard improves the query availability of the Elasticissearch, is convenient to use and low in learning cost, and reduces the error rate;
integration is performed in a service mode without any invasiveness;
a uniform query entry is provided, the Elasticissearch is upgraded, the service system is not influenced, and the coupling degree of the service system is reduced;
when the method is used, the syntax tree is a representation form of an abstract syntax structure tree of the SQL, each node on the tree represents one structure in the SQL, the universal SQL standard is adopted, the query availability of the elastic search is improved, the method is convenient to use, the learning cost is low, and the error rate is reduced; and (3) grammar enhancement: the range can be extracted from the search conditions, so that the search result is accurate, synonym conversion is increased, and the search data result is more comprehensive; the data analysis unit is used for analyzing the registration information of the user and the eye contour when the client is accessed, amplifying the eye contour by a plurality of times when the client is accessed to obtain an eye pixel contour, and amplifying the preset eye contour of the user by a plurality of times to obtain a preset eye pixel contour; selecting the center points of the eye pixel outline and the preset outline of the eye pixel, and coinciding the center points of the eye pixel outline and the preset outline of the eye pixel; counting the number of pixel grids of the eye pixel outline and the number of pixel grids of the preset eye pixel outline, and marking the difference value of the eye pixel outline and the preset eye pixel outline as Y1 when the number of pixel grids of the eye pixel outline is greater than the number of pixel grids of the preset eye pixel outline; when the pixel grid number of the eye pixel outline is smaller than the pixel grid number of the preset eye pixel outline, marking the difference value of the two as Y2; when the pixel grid number of the eye pixel outline is equal to the pixel grid number of the preset eye pixel outline, marking the difference value of the two as Y3; the value of Y3 is equal to zero, and the display adjustment value NZ of the user is obtained by using a formula NZ ═ N1 × b1+ N2 × b 2; when the display adjustment value is greater than the set threshold, executing step S5; when the difference value between the two is Y1, obtaining a display size value H by using a formula H (H1 × b4-Y1 × b 3); when H is epsilon (f)k-1,fk]Then, the data analysis unit adjusts the font corresponding to the query result to be the same as the font size Fk, and then displays the font on the client; by identifying the eye contour of the user in combination with the display adjustment of the userAnalyzing the value and the display size value to obtain the corresponding font size, adjusting the font corresponding to the query result to be the same as the font size Fk, adjusting the query result to the corresponding font size according to the query distance of the user, facilitating the check of the user, and avoiding the problem that the existing client cannot adjust the font size according to the distance between the eyes of the user and the client.
The preferred embodiments of the invention disclosed above are intended to be illustrative only. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims (3)

1. An SQL using method based on an Elasticissearch is characterized by comprising the following steps:
the method comprises the following steps: deploying an SQL engine, and receiving SQL sentences for transmitting queries by a client through a Rest service;
step two: obtaining a query result from a cache; wherein the cache is realized based on Ehcache;
step three: analyzing the SQL sentence through a syntax tree, and constructing an Elasticissearch native query syntax after the syntax is enhanced;
step four: acquiring an Elasticissearch query result, and performing data enhancement on the query result, wherein the data is added by adding metadata information on the basis of returning, so that the attribute of the data is clearer; sending the query result after data enhancement to the client;
a registration login unit, a data storage unit, a data acquisition unit and a data analysis unit are installed in the client; the registration login unit is used for submitting registration information for registration by a user and sending the registration information which is successfully registered to the data storage unit for storage; the registration information comprises the name, age and enrollment time of the user, a preset eye contour and a preset distance of the client corresponding to the eyes;
the data acquisition unit is used for acquiring the eye contour of a user when the user accesses the client and sending the eye contour to the data analysis unit, the data analysis unit is used for analyzing the registration information of the user and the eye contour of the user when the user accesses the client, and the specific analysis steps are as follows:
s1: amplifying the eye contour by a plurality of times when the client is accessed to obtain an eye pixel contour, and amplifying the preset eye contour of the user by the same plurality of times to obtain a preset eye pixel contour;
s2: selecting the center points of the eye pixel outline and the preset outline of the eye pixel, and coinciding the center points of the eye pixel outline and the preset outline of the eye pixel; counting the number of pixel grids of the eye pixel outline and the number of pixel grids of the preset eye pixel outline, and marking the difference value of the eye pixel outline and the preset eye pixel outline as Y1 when the number of pixel grids of the eye pixel outline is greater than the number of pixel grids of the preset eye pixel outline; when the pixel grid number of the eye pixel outline is smaller than the pixel grid number of the preset eye pixel outline, marking the difference value of the two as Y2; when the number of pixel grids of the eye pixel outline is equal to the number of pixel grids of the preset outline of the eye pixel, marking the difference value of the two as Y3; wherein the value of Y3 is equal to zero;
s3: setting the age of the user as N1, calculating the time difference between the working time of the user and the current time to obtain the working duration of the user, and marking the working duration as N2;
s4: the age and the working duration of the user are subjected to dequantization processing and numerical values are taken, and a display adjustment value NZ of the user is obtained by using a formula NZ (N1 × b1+ N2 × b 2); when the display adjustment value is greater than the set threshold, executing step S5; if not, the query result is directly displayed on the client according to the preset font size;
s5: when the difference between the two is Y1, obtaining a display size value H by using a formula H-H1 × b4-Y1 × b 3; b3 and b4 are preset proportionality coefficients, and H1 is a preset distance of the client corresponding to the eyes;
when the difference between the two is Y2, obtaining a display size value H by using a formula H of H1 × b4+ Y2 × b 5; wherein b5 is a preset proportionality coefficient;
when the difference value between the two is Y3, obtaining a display size value H by using the formula H-H1 × b 4;
s6: setting the word size to Fk, k is 1, 2, … …, n; and F1<……<Fn; the sizes of the word sizes all correspond to a matching range (f)k-1,fk],f0Is zero; matching the display size value H of the user with the matching range of the size of the font size, and when H belongs to (f)k-1,fk]Then, the data analysis unit adjusts the font corresponding to the query result to be the same as the font size Fk, and then displays the font on the client;
the client also comprises a management unit, the management unit is used for collecting the time when the user logs in the client and the time when the user logs off the client and managing the registration information of the user, and the specific management steps are as follows:
SS 1: setting the time when the user logs in the client as D1j, and marking the offline time immediately after the time when the user logs in the client as D2 j; j is 1, 2, … …, n;
SS 2: counting the login duration again after the user is offline, summing all login durations again, taking the average to obtain a login interval duration average, and marking the average as QD;
SS 3: acquiring the enrollment duration N2 of the user; the mean value of the time length of the job entry and the time length of the login interval is subjected to quantization processing and is taken as a numerical value, and a formula is utilized
Figure FDA0003595593740000031
Acquiring a management value WP of a user; wherein b6, b7 and b8 are all preset proportionality coefficients; mu is a correction factor, and the value is 0.8632;
SS 4: when the management value is larger than the set threshold value, deleting the registration information of the user;
the client further comprises a remote processing unit; the remote processing unit is used for managing the plug-in of SQL query, and comprises the following specific steps:
SSS 1: marking the plug-in for SQL query corresponding to the client version as a primary selection plug-in; counting the downloading times and the unloading times of the initially selected plug-in, and respectively marking as P1 and P2;
SSS 2: carrying out dequantization processing on the downloading times and the unloading times and taking the numerical values of the downloading times and the unloading times;
SSS 3: obtaining a mounting value P of the initially selected plug-in unit by using a formula P ═ λ × (P1 × b9-P2 × b10) + 5.3984; marking the initially selected plug-in with the maximum installation value as a selected plug-in, wherein b9 and b10 are both preset proportionality coefficients;
SSS 4: and installing the selected plug-in the client.
2. The method of claim 1, wherein the syntax tree is an abstract syntax structure tree of SQL, and the syntax tree includes a plurality of nodes, each node representing a structure in SQL.
3. The method for using SQL based on Elasticisearch according to claim 1, characterized in that the syntax enhancement is to extract the scope and add the synonym transformation in the search condition.
CN202010857481.3A 2020-08-24 2020-08-24 SQL using method based on Elasticissearch Active CN111984678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010857481.3A CN111984678B (en) 2020-08-24 2020-08-24 SQL using method based on Elasticissearch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010857481.3A CN111984678B (en) 2020-08-24 2020-08-24 SQL using method based on Elasticissearch

Publications (2)

Publication Number Publication Date
CN111984678A CN111984678A (en) 2020-11-24
CN111984678B true CN111984678B (en) 2022-06-14

Family

ID=73442475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010857481.3A Active CN111984678B (en) 2020-08-24 2020-08-24 SQL using method based on Elasticissearch

Country Status (1)

Country Link
CN (1) CN111984678B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009193357A (en) * 2008-02-14 2009-08-27 Seiko Epson Corp Contour detection method, contour detection device, and contour detection program
WO2016078423A1 (en) * 2014-11-17 2016-05-26 中兴通讯股份有限公司 Transaction processing method and apparatus for distributed database system
CN109157186A (en) * 2018-10-25 2019-01-08 武汉目明乐视健康科技有限公司 Unmanned self-service vision monitoring instrument
CN111198898A (en) * 2018-11-16 2020-05-26 浙江宇视科技有限公司 Big data query method and big data query device
CN111522816A (en) * 2020-04-16 2020-08-11 云和恩墨(北京)信息技术有限公司 Data processing method, device, terminal and medium based on database engine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8161035B2 (en) * 2009-06-04 2012-04-17 Oracle International Corporation Query optimization by specifying path-based predicate evaluation in a path-based query operator

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009193357A (en) * 2008-02-14 2009-08-27 Seiko Epson Corp Contour detection method, contour detection device, and contour detection program
WO2016078423A1 (en) * 2014-11-17 2016-05-26 中兴通讯股份有限公司 Transaction processing method and apparatus for distributed database system
CN109157186A (en) * 2018-10-25 2019-01-08 武汉目明乐视健康科技有限公司 Unmanned self-service vision monitoring instrument
CN111198898A (en) * 2018-11-16 2020-05-26 浙江宇视科技有限公司 Big data query method and big data query device
CN111522816A (en) * 2020-04-16 2020-08-11 云和恩墨(北京)信息技术有限公司 Data processing method, device, terminal and medium based on database engine

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"A remote assessment system with a vision robot and wearable sensors";Tong Zhang等;《 The 26th Annual International Conference of the IEEE Engineering in Medicine and Biology Society》;20050314;第1-2页 *
"大小字号的文本对中文读者阅读知觉广度和眼动模式的影响";巫金根等;《心理科学》;20141231;第10-15页 *

Also Published As

Publication number Publication date
CN111984678A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN110032604B (en) Data storage device, translation device and database access method
JP2022120014A (en) System and method for capturing data and facilitating user access to data
EP2874077B1 (en) Stateless database cache
US20040193574A1 (en) Application server, cache program, and application server system
CN108446313B (en) Data format conversion method and device
CN110688397B (en) SQL-based distributed data unified access system and method
CN105550206B (en) The edition control method and device of structured query sentence
US11709831B2 (en) Cost-based query optimization for array fields in database systems
CN105095424A (en) Method for realizing high-concurrency retrieval of medicine in hospital HIS system
EP3433734A1 (en) Technologies for auto discover and connect to a rest interface
US20110302220A1 (en) Sql processing for data conversion
CN111984678B (en) SQL using method based on Elasticissearch
CN113220710A (en) Data query method and device, electronic equipment and storage medium
CN115905239A (en) Method and device for realizing highly-multiplexed performance index data retrieval
CN115756610A (en) Method, device, equipment and medium for processing natural language instruction information
US20140304293A1 (en) Apparatus and Method for Query Based Replication of Database
JP3465815B2 (en) Text filtering system
CN110058858B (en) JSON data processing method and device
CN113868138A (en) Method, system, equipment and storage medium for acquiring test data
US20050114162A1 (en) Dialog fragmentation for mobile devices
KR100670208B1 (en) System and method for processing continuous query language based xml query language for processing streaming data expressed xml
CN115186674B (en) Aviation failure case management method, device, equipment and storage medium
CN114547525B (en) Large-data-volume tree structure rendering system and method under Web browser
US11693869B1 (en) Processing queries and commands using a universal intelli-shell instrument
CN116610711A (en) Data query method, device, equipment and storage medium

Legal Events

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