CN111339125B - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN111339125B
CN111339125B CN202010112008.2A CN202010112008A CN111339125B CN 111339125 B CN111339125 B CN 111339125B CN 202010112008 A CN202010112008 A CN 202010112008A CN 111339125 B CN111339125 B CN 111339125B
Authority
CN
China
Prior art keywords
component
condition
screening component
condition screening
target
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
CN202010112008.2A
Other languages
Chinese (zh)
Other versions
CN111339125A (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.)
Inspur Software Technology Co Ltd
Original Assignee
Inspur Software 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 Inspur Software Technology Co Ltd filed Critical Inspur Software Technology Co Ltd
Priority to CN202010112008.2A priority Critical patent/CN111339125B/en
Publication of CN111339125A publication Critical patent/CN111339125A/en
Application granted granted Critical
Publication of CN111339125B publication Critical patent/CN111339125B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/242Query formulation
    • G06F16/2433Query languages
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a data query method and a data query device, comprising the following steps: presetting a JavaScript component, and determining at least one data query condition; calling a JavaScript component, and executing: determining a key value pair corresponding to each data query condition; determining a condition screening component for each of the key value pairs to match; setting the determined condition screening component in a target web page; when a client requests the target web page, the condition screening component is displayed in the target web page; when query information from the client is obtained by at least one of the condition screening components, the query information is stored. The scheme can reduce the development difficulty of new query service.

Description

Data query method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data query method and apparatus.
Background
Currently, most of the query related functional services contacted by us need a certain search condition. For example, if the tax payment record is queried, the corresponding query conditions such as date, tax payer, tax payment place and the like are required to be input. And the search conditions required when applications of the same service type search information are substantially the same.
However, when a developer develops a new query service, the developer needs to re-write a corresponding code for the query condition related to the service type, thereby increasing the development difficulty of the new query service.
Disclosure of Invention
The embodiment of the invention provides a data query method and a data query device, which can reduce the development difficulty of new query services.
In a first aspect, an embodiment of the present invention provides a data query method, where a JavaScript component is preset, including:
determining at least one data query condition;
calling a JavaScript component, and executing:
determining a key value pair corresponding to each data query condition;
determining a condition screening component for each of the key value pairs to match;
setting the determined condition screening component in a target web page;
when a client requests the target web page, the condition screening component is displayed in the target web page;
when query information from the client is obtained by at least one of the condition screening components, the query information is stored.
Preferably, the method comprises the steps of,
after the determining at least one data query condition, before determining the key value pair corresponding to each data query condition, the method further comprises:
Transmitting the at least one data query condition into the JavaScript component;
the determining the key value pair corresponding to each data query condition comprises the following steps:
performing array traversal on the at least one data query condition, and extracting key value pairs in each data query condition.
Preferably, the method comprises the steps of,
before said determining that each of said key-value pairs matches a conditional screening component, further comprising:
setting at least one functional component, wherein each functional component corresponds to a service function;
the condition filtering component for determining that each key value pair is matched comprises:
and determining a condition screening component matched with each key value pair from the at least one functional component by traversing each key value pair.
Preferably, the method comprises the steps of,
when query information from the client is obtained by at least one of the condition screening components, further comprising, prior to the storing the query information:
splicing the acquired query information into JSON format data;
the storing the query information includes:
and storing the spliced data.
Preferably, the method comprises the steps of,
the setting the determined condition filtering component in the target web page comprises the following steps:
Determining a display area of the condition screening component in the target web page of at least one client type and a first pixel value, wherein the first pixel value characterizes a width of the condition screening component;
inserting the determined first pixel values of the condition screening component, the display area and each condition screening component into html tags of the target web page in the form of document nodes;
the presenting the condition filtering component in the target web page comprises:
determining the current type of the client;
determining a target display area and a target first pixel value of the condition screening component in the target web page of the current type from the html tag;
and displaying the condition screening component in the target web page according to the target display area and the target first pixel value.
Preferably, the method comprises the steps of,
the displaying the condition filtering component in the target web page according to the target displaying area and the target first pixel value comprises the following steps:
d1: determining the arrangement sequence of each condition screening component in the html tag;
d2: determining a second pixel value of the target display area in the client, wherein the second pixel value characterizes the width of the target display area;
D3: setting a first condition screening component in the arrangement sequence in the target display area;
d4: adding the target first pixel value of the first condition screening component and the target first pixel value of the next condition screening component of the first condition screening component in the arrangement sequence to obtain a component width value;
d5: determining whether a difference between the component width value and the second pixel value is greater than the target first pixel value, if so, executing D6, otherwise, executing D7;
d6: setting a next condition screening component of the first condition screening component in the arrangement sequence at a position which is positioned in the same row as the first condition screening component in the target display area, and executing D8;
d7: setting a next condition screening component of the first condition screening component in the arrangement sequence in a next row of the first condition screening component of the target display area, and executing D8;
d8: determining whether the next condition screening component of the first condition screening component is the last condition screening component in the arrangement sequence, if so, executing D9, otherwise, executing D10;
D9: executing the query information when the query information from the client is acquired through at least one condition screening component;
d10: taking the component width value as a target first pixel value of a next condition screening component of the first condition screening component;
d11: and taking the next condition screening component of the first condition screening component as the first condition screening component, and returning to D4.
In a second aspect, the present invention provides a data query apparatus comprising:
the assembly setting module is used for presetting a JavaScript assembly;
the condition determining module is used for determining at least one data query condition;
the component screening module is used for calling the JavaScript component set by the component setting module and executing: determining a key value pair corresponding to each data query condition determined by the condition determining module; determining a condition screening component for each of the key value pairs to match;
the component control module is used for setting the condition screening component determined by the component screening module in the target web page; when a client requests the target web page, the condition screening component is displayed in the target web page;
And the data processing module is used for storing the query information when the query information from the client is acquired through at least one condition screening component set by the component control module.
Preferably, the method comprises the steps of,
the component screening module is further configured to transmit the at least one data query condition to the JavaScript component; and performing array traversal on the at least one data query condition, and extracting key value pairs in each data query condition.
Preferably, the method comprises the steps of,
the component setting module is further used for setting at least one functional component, wherein each functional component corresponds to one service function;
the component screening module is used for determining a condition screening component matched with each key value pair from the at least one functional component by traversing each key value pair.
Preferably, the method comprises the steps of,
the data processing module is further used for splicing the acquired query information into data in a JSON format; and storing the spliced data.
Preferably, the method comprises the steps of,
the component control module is used for determining a display area and a first pixel value of the condition screening component in the target web page of at least one client type, wherein the first pixel value characterizes the width of the condition screening component; inserting the determined first pixel values of the condition screening component, the display area and each condition screening component into html tags of the target web page in the form of document nodes; determining the current type of the client; determining a target display area and a target first pixel value of the condition screening component in the target web page of the current type from the html tag; and displaying the condition screening component in the target web page according to the target display area and the target first pixel value.
Preferably, the method comprises the steps of,
the component control module is used for executing:
d1: determining the arrangement sequence of each condition screening component in the html tag;
d2: determining a second pixel value of the target display area in the client, wherein the second pixel value characterizes the width of the target display area;
d3: setting a first condition screening component in the arrangement sequence in the target display area;
d4: adding the target first pixel value of the first condition screening component and the target first pixel value of the next condition screening component of the first condition screening component in the arrangement sequence to obtain a component width value;
d5: determining whether a difference between the component width value and the second pixel value is greater than the target first pixel value, if so, executing D6, otherwise, executing D7;
d6: setting a next condition screening component of the first condition screening component in the arrangement sequence at a position which is positioned in the same row as the first condition screening component in the target display area, and executing D8;
d7: setting a next condition screening component of the first condition screening component in the arrangement sequence in a next row of the first condition screening component of the target display area, and executing D8;
D8: determining whether the next condition screening component of the first condition screening component is the last condition screening component in the arrangement sequence, if so, executing D9, otherwise, executing D10;
d9: executing the query information when the query information from the client is acquired through at least one condition screening component;
d10: taking the component width value as a target first pixel value of a next condition screening component of the first condition screening component;
d11: and taking the next condition screening component of the first condition screening component as the first condition screening component, and returning to D4.
In a third aspect, the present invention also provides a storage medium comprising: at least one memory and at least one processor;
the at least one memory for storing a machine readable program;
the at least one processor is configured to invoke the machine-readable program to perform the data query method of any of the first aspects.
In a fourth aspect, a computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform the data query method of any of the first aspects.
The invention provides a data query method and a data query device, wherein JavaScript is an transliteration script language, is a dynamic type, weak type, prototype-based language and built-in support type. The simplest organization form of the data storage is a key value pair, so that based on the JavaScript language customization component, according to the data query condition for determining the necessary information required by the condition screening component, the matched condition screening component can be assembled, the condition screening component is controlled in the target web page, the corresponding query information is obtained, and finally the obtained query information is stored. In summary, if a new query service needs to be added, the requirement of the user on the new query service can be completed only by determining the data query condition required by the new service type, and development of the new query service does not need to be completed by a developer through writing a large number of codes, so that development difficulty of the new development service can be reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a data query method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a data query method according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data query device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present invention are within the scope of protection of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a data query method, including:
step 101: presetting a JavaScript component;
step 102: determining at least one data query condition;
step 103: calling a JavaScript component, and executing: determining a key value pair corresponding to each data query condition;
step 104: determining a condition screening component for each of the key value pairs to match;
Step 105: setting the determined condition screening component in a target web page;
step 106: when a client requests the target web page, the condition screening component is displayed in the target web page;
step 107: when query information from the client is obtained by at least one of the condition screening components, the query information is stored.
In the embodiment of the invention, javaScript is an transliteration script language, is a dynamic type, weak type and prototype-based language, and is internally provided with a support type. The simplest organization form of the data storage is a key value pair, so that based on the JavaScript language customization component, according to the data query condition for determining the necessary information required by the condition screening component, the matched condition screening component can be assembled, the condition screening component is controlled in the target web page, the corresponding query information is obtained, and finally the obtained query information is stored. In summary, if a new query service needs to be added, the requirement of the user on the new query service can be completed only by determining the data query condition required by the new service type, and development of the new query service does not need to be completed by a developer through writing a large number of codes, so that development difficulty of the new development service can be reduced.
In an embodiment of the present invention, after the determining at least one data query condition, before the determining a key value pair corresponding to each data query condition, the method further includes:
transmitting the at least one data query condition into the JavaScript component;
the determining the key value pair corresponding to each data query condition comprises the following steps:
performing array traversal on the at least one data query condition, and extracting key value pairs in each data query condition.
In the embodiment of the present invention, since the data query conditions generally include: the key value pair and the key value pair are matched parameters, so that the data query conditions can be used as initialization parameters to be transmitted into the JavaScript component, each data query condition is treated as a single object by the JavaScript component, and the key value pair of each data query condition object is extracted by performing array traversal on the transmitted data query conditions so as to search and assemble the condition screening component based on the extracted key value pair.
In one embodiment of the present invention, before the determining the condition filtering component that each of the key-value pairs matches, the method further includes:
Setting at least one functional component, wherein each functional component corresponds to a service function;
the condition filtering component for determining that each key value pair is matched comprises:
and determining a condition screening component matched with each key value pair from the at least one functional component by traversing each key value pair.
In the embodiment of the invention, as the different key value pairs have different attributes, the different attributes can be traversed, the matched condition screening components are searched in the at least one set functional component, and the searched condition screening components are assembled so as to display the condition screening components in the target web page.
In one embodiment of the present invention, when query information from the client is obtained by at least one of the condition filtering components, before the storing the query information, the method further includes:
splicing the acquired query information into JSON format data;
the storing the query information includes:
and storing the spliced data.
In the embodiment of the invention, because the JSON is in an ultra-lightweight data exchange format, the JSON has the advantages of no end tag, relatively shorter, faster reading and writing speed, capability of using a built-in JavaScript eval () method for analysis, use of an array, no use of reserved characters and the like, so that the obtained query information can be spliced together according to a specified format for data transmission, and converted into data in the JSON format for storage.
Specifically, the data splicing mode may be that the sequence of the data query conditions is determined in advance, the sequence of key pair values corresponding to the data query conditions is determined based on the sequence, the sequence of the condition screening components is further determined, and query information corresponding to the condition screening components is arranged according to the sequence and spliced together.
The data splicing mode can also be used for arranging the query information corresponding to the condition screening component according to the arrangement sequence of numbers and letters in the first character and the tail character of the condition screening component.
In one embodiment of the present invention, the setting the determined condition filtering component in the target web page includes:
determining a display area of the condition screening component in the target web page of at least one client type and a first pixel value, wherein the first pixel value characterizes a width of the condition screening component;
inserting the determined first pixel values of the condition screening component, the display area and each condition screening component into html tags of the target web page in the form of document nodes;
the presenting the condition filtering component in the target web page comprises:
Determining the current type of the client;
determining a target display area and a target first pixel value of the condition screening component in the target web page of the current type from the html tag;
and displaying the condition screening component in the target web page according to the target display area and the target first pixel value.
In the embodiment of the invention, in order to reduce the display effect difference of each condition screening component on different clients of the same type, the display area and the first pixel value (i.e. the size of the component) of the condition screening component on the web page of each type of client can be determined, for example, the first pixel value of the condition screening component on the web page of a desktop computer or a notebook computer is a, the first pixel value of the condition screening component on the web page of a mobile terminal (e.g. a mobile phone) is b, and the first pixel value of the condition screening component on the web page of a tablet computer is c, so as to meet the display requirements of different clients. Since the HTML tag may define the web page as an HTML document, the HTML tag defines a start point and an end point of the document, and a header and a body of the document therebetween, the condition filtering component display area, and the first pixel value may be inserted into the HTML tag of the target web page in the form of a document node. To implement a presentation condition screening component at a specified location of a web page of a client, it is first determined to which type of device the client belongs, e.g., desktop, notebook, tablet, smartphone, etc. The first pixel value of the condition filtering component in the web page is determined based on the type to which the client belongs to improve the use experience at the user.
In an embodiment of the present invention, the displaying the condition filtering component in the target web page according to the target displaying area and the target first pixel value includes:
d1: determining the arrangement sequence of each condition screening component in the html tag;
d2: determining a second pixel value of the target display area in the client, wherein the second pixel value characterizes the width of the target display area;
d3: setting a first condition screening component in the arrangement sequence in the target display area;
d4: adding the target first pixel value of the first condition screening component and the target first pixel value of the next condition screening component of the first condition screening component in the arrangement sequence to obtain a component width value;
d5: determining whether a difference between the component width value and the second pixel value is greater than the target first pixel value, if so, executing D6, otherwise, executing D7;
d6: setting a next condition screening component of the first condition screening component in the arrangement sequence at a position which is positioned in the same row as the first condition screening component in the target display area, and executing D8;
D7: setting a next condition screening component of the first condition screening component in the arrangement sequence in a next row of the first condition screening component of the target display area, and executing D8;
d8: determining whether the next condition screening component of the first condition screening component is the last condition screening component in the arrangement sequence, if so, executing D9, otherwise, executing D10;
d9: executing the query information when the query information from the client is acquired through at least one condition screening component;
d10: taking the component width value as a target first pixel value of a next condition screening component of the first condition screening component;
d11: and taking the next condition screening component of the first condition screening component as the first condition screening component, and returning to D4.
In the embodiment of the invention, because the widths of the clients of different types are different, the sizes of the target web pages in the clients are also different, and the target display area is determined based on the type of the clients, so that the condition screening component can be arranged in the target display area in the form of a waterfall flow. That is, based on the width of the target display area in the client, determining the number of condition screening components which can be set at most in the same row of the target display area, when the condition screening components in the same row of the target area reach the maximum value, setting the condition screening components in the next row of the row in sequence until all the condition screening components in the html tag are set in the target display area.
As shown in fig. 2, in order to more clearly illustrate the technical solution and advantages of the present invention, the following details of the data query method provided in the embodiment of the present invention may specifically include the following steps:
step 201: the method comprises the steps of presetting a JavaScript component and at least one functional component, wherein each functional component corresponds to a business function.
Specifically, in order to meet the requirements of different services, functional components with different service functions and JavaScript components for screening and splicing condition screening components from the functional components can be set.
For example, a function component a for inquiring about the tax payer identification number and a function component b for inquiring about the tax payer registration date are provided.
Step 202: at least one data query condition is determined.
Specifically, taking tax payment in tax service as an example, the data query condition is "ID: tax payer identification number "and" DATE: the date of registration.
Step 203: at least one data query condition is passed into the JavaScript component.
Step 204: calling a JavaScript component, and executing: performing array traversal on at least one data query condition, and extracting key value pairs in each data query condition.
Specifically, each filter term has a corresponding key pair value to characterize the attributes of the data query term.
For example, from the data query condition "ID: extracting a corresponding key pair value ' ID ' from the tax payer identification number ' and inquiring the condition ' DATE ' from the data: the corresponding key pair value "DATE" is extracted from the registration DATE ".
Step 205: and determining a matched condition screening component of each key value pair from at least one functional component by traversing each key value pair.
Specifically, the functional component a that can be found to be matched based on the attribute of the key pair value "ID" is the corresponding condition screening component a, and the functional component b that can be found to be matched based on the attribute of the key pair "DATE" is the corresponding condition screening component b.
Step 206: a presentation area of the condition screening component in the target web page of the at least one client type and a first pixel value are determined, wherein the first pixel value characterizes a width of the condition screening component.
Specifically, in order to ensure the display effect of the condition screening component, the sizes of the condition screening components on the same type of clients are the same, and the sizes of the different types of clients are different.
For example, the first pixel value of the condition filtering component is 600×300 when the condition filtering component is on a desktop computer or a notebook computer, the first pixel value of the condition filtering component is 150×75 when the condition filtering component is on a smart phone, and the first pixel value of the condition filtering component is 300×150 when the condition filtering component is on a tablet computer.
Step 207: and inserting the determined condition screening components, the display areas and the first pixel value of each condition screening component into the html tag of the target web page in the form of document nodes.
Specifically, since the web page is defined by the html tag, the condition filtering component, the display area of the condition filtering component, and the first pixel value of different client types can be inserted into the html tag of the target web page in the form of document nodes, so that the condition filtering component is controlled according to the content in the html tag.
Step 208: when a client requests a target web page, the current type of the client is determined.
Step 209: a target presentation area and a target first pixel value of a condition filtering component in a target web page of a current type are determined from an html tag.
Specifically, when a user requests a target web page through a client, the client type of the client is determined first, so that a target display area and a target first pixel value which can be set by a condition screening component in the target web page are determined based on the current type of the client.
For example, if the current type of the client is a smart phone, the condition filtering component corresponds to a target first pixel value of 150 in the smart phone, and the target display area is "the second line of the target web page starts".
Step 210: and determining the arrangement sequence of each condition screening component in the html tag and a second pixel value of the target display area in the client, and setting the first condition screening component in the arrangement sequence in the target display area, wherein the second pixel value represents the width of the target display area.
Specifically, the order of arrangement of the condition screening component a and the condition screening component b is 1 and 2 in order.
The second pixel value of the target presentation area in the target web page of the client is 250.
Step 211: and adding the target first pixel value of the first condition screening component and the target first pixel value of the next condition screening component of the first condition screening component in the arrangement sequence to obtain a component width value.
Specifically, by calculating the sum of target first pixel values of at least two condition filtering components in the same row, judging whether all condition filtering components for performing width summation can be set in the target display area, if all condition filtering components for performing width summation cannot be set in the width of the target display area, setting the condition filtering component for performing width summation with the last sorting in the next row until all condition filtering components to be set in the target web page are set.
Step 212: determining whether the difference between the component width value and the second pixel value is greater than the target first pixel value, if so, executing step 213, otherwise, executing step 214.
Step 213: the next conditional screening element of the first conditional screening element in the arrangement order is disposed in the target display area at the same row as the first conditional screening element, and step 215 is performed.
Step 214: the next conditional screening component of the first conditional screening component in the arrangement order is placed in the next row of the first conditional screening component in the target display area, step 215 is performed.
Step 215: it is determined whether the next conditional screening component of the first conditional screening component is the last conditional screening component in the ranking order, if so, step 218 is performed, otherwise, step 216 is performed.
Step 216: step 217 is performed using the component width value as the target first pixel value for the next conditional screening component of the first conditional screening component.
Step 217: the next condition screening component of the first condition screening component is taken as the first condition screening component, and the process returns to step 211.
Specifically, the type of the client is a smart phone, so that the first pixel value of the target corresponding to the condition screening component is 150, the second pixel value of the target display area on the target web page is 250, and two condition screening components cannot be set in the same row of the target display area, so that the condition screening component a is set in the first row of the target display area, and the condition screening component b is set in the second row of the target display area, namely below the condition screening component.
Step 218: when query information from a client is acquired through at least one condition screening component, the acquired query information is spliced into data in a JSON format, and the spliced data is stored.
Specifically, when information is acquired through the condition screening component, only a part of the condition screening component on the target web page may be used, and there may be a case that the condition screening component does not acquire the corresponding query information.
In order to facilitate data transmission, after corresponding query information is acquired through a condition screening component, the query information is stored in a JSON format.
It will be appreciated that each data inquiry criteria has a corresponding common default value, such as a common default value for data inquiry criteria for inquiring about the taxpayer identification number, for example, a character string. If the common default value of the data query condition needs to be changed, the changed common default value, for example, "number" is transmitted to the JavaScript component, so as to classify the data query condition based on the common default value.
As shown in fig. 3, an embodiment of the present invention provides a data query device, including:
the component setting module 301 is configured to preset a JavaScript component;
A condition determining module 302 for determining at least one data query condition;
the component screening module 303 is configured to call the JavaScript component set by the component setting module 301, and perform: determining a key value pair corresponding to each data query condition determined by the condition determining module 302; determining a condition screening component for each of the key value pairs to match;
a component control module 304, configured to set the condition screening component determined by the component screening module 303 in a target web page; when a client requests the target web page, the condition screening component is displayed in the target web page;
a data processing module 305, configured to store query information from the client when the query information is acquired by at least one of the condition filtering components set by the component control module 304.
In the embodiment of the invention, javaScript is an transliteration script language, is a dynamic type, weak type and prototype-based language, and is internally provided with a support type. The simplest organization form of the data storage is a key value pair, so the component setting module is based on the JavaScript language customizing component, then the component screening module can assemble the matched condition screening component according to the data query condition for determining the necessary information required by the condition screening component determined by the condition determining module, the component control module controls the condition screening component in the target web page, the data processing module can acquire the corresponding query information, and finally the acquired query information is stored. In summary, if a new query service needs to be added, the requirement of the user on the new query service can be completed only by determining the data query condition required by the new service type, and development of the new query service does not need to be completed by a developer through writing a large number of codes, so that development difficulty of the new development service can be reduced.
In an embodiment of the present invention, the component screening module is further configured to transmit the at least one data query condition to the JavaScript component; and performing array traversal on the at least one data query condition, and extracting key value pairs in each data query condition.
In an embodiment of the present invention, the component setting module is further configured to set at least one functional component, where each functional component corresponds to a service function;
the component screening module is used for determining a condition screening component matched with each key value pair from the at least one functional component by traversing each key value pair.
In an embodiment of the present invention, the data processing module is further configured to splice the acquired query information into JSON format data; and storing the spliced data.
In an embodiment of the present invention, the component control module is configured to determine a display area of the condition screening component in the target web page of at least one client type and a first pixel value, where the first pixel value characterizes a width of the condition screening component; inserting the determined first pixel values of the condition screening component, the display area and each condition screening component into html tags of the target web page in the form of document nodes; determining the current type of the client; determining a target display area and a target first pixel value of the condition screening component in the target web page of the current type from the html tag; and displaying the condition screening component in the target web page according to the target display area and the target first pixel value.
In one embodiment of the present invention, the component control module is configured to perform:
d1: determining the arrangement sequence of each condition screening component in the html tag;
d2: determining a second pixel value of the target display area in the client, wherein the second pixel value characterizes the width of the target display area;
d3: setting a first condition screening component in the arrangement sequence in the target display area;
d4: adding the target first pixel value of the first condition screening component and the target first pixel value of the next condition screening component of the first condition screening component in the arrangement sequence to obtain a component width value;
d5: determining whether a difference between the component width value and the second pixel value is greater than the target first pixel value, if so, executing D6, otherwise, executing D7;
d6: setting a next condition screening component of the first condition screening component in the arrangement sequence at a position which is positioned in the same row as the first condition screening component in the target display area, and executing D8;
d7: setting a next condition screening component of the first condition screening component in the arrangement sequence in a next row of the first condition screening component of the target display area, and executing D8;
D8: determining whether the next condition screening component of the first condition screening component is the last condition screening component in the arrangement sequence, if so, executing D9, otherwise, executing D10;
d9: executing the query information when the query information from the client is acquired through at least one condition screening component;
d10: taking the component width value as a target first pixel value of a next condition screening component of the first condition screening component;
d11: and taking the next condition screening component of the first condition screening component as the first condition screening component, and returning to D4.
It will be appreciated that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the data interrogation apparatus. In other embodiments of the invention, the data querying device may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The content of information interaction and execution process between the units in the device is based on the same conception as the embodiment of the method of the present invention, and specific content can be referred to the description in the embodiment of the method of the present invention, which is not repeated here.
The embodiment of the invention also provides a storage medium, which comprises: at least one memory and at least one processor;
the at least one memory for storing a machine readable program;
the at least one processor is configured to invoke the machine-readable program to perform the data query method described in any of the embodiments of the present invention.
Embodiments of the present invention also provide a computer readable medium having stored thereon computer instructions that, when executed by a processor, cause the processor to perform a data query method as described in any of the embodiments of the present invention.
Specifically, a system or apparatus provided with a storage medium on which a software program code realizing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus may be caused to read out and execute the program code stored in the storage medium.
In this case, the program code itself read from the storage medium may realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code form part of the present invention.
Examples of the storage medium for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer by a communication network.
Further, it should be apparent that the functions of any of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform part or all of the actual operations based on the instructions of the program code.
Further, it is understood that the program code read out by the storage medium is written into a memory provided in an expansion board inserted into a computer or into a memory provided in an expansion unit connected to the computer, and then a CPU or the like mounted on the expansion board or the expansion unit is caused to perform part and all of actual operations based on instructions of the program code, thereby realizing the functions of any of the above embodiments.
It should be noted that not all the steps and modules in the above flowcharts and the system configuration diagrams are necessary, and some steps or modules may be omitted according to actual needs. The execution sequence of the steps is not fixed and can be adjusted as required. The system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or may be implemented jointly by some components in multiple independent devices.
In the above embodiments, the hardware unit may be mechanically or electrically implemented. For example, a hardware unit may include permanently dedicated circuitry or logic (e.g., a dedicated processor, FPGA, or ASIC) to perform the corresponding operations. The hardware unit may also include programmable logic or circuitry (e.g., a general-purpose processor or other programmable processor) that may be temporarily configured by software to perform the corresponding operations. The particular implementation (mechanical, or dedicated permanent, or temporarily set) may be determined based on cost and time considerations.
While the invention has been illustrated and described in detail in the drawings and in the preferred embodiments, the invention is not limited to the disclosed embodiments, and it will be appreciated by those skilled in the art that the code audits of the various embodiments described above may be combined to produce further embodiments of the invention, which are also within the scope of the invention.

Claims (2)

1. The data query method is characterized by comprising the following steps of:
determining at least one data query condition;
calling a JavaScript component, and executing:
Determining a key value pair corresponding to each data query condition;
determining a condition screening component for each of the key value pairs to match;
setting the determined condition screening component in a target web page;
when a client requests the target web page, the condition screening component is displayed in the target web page;
storing query information from the client when the query information is acquired by at least one of the condition screening components;
after the determining at least one data query condition, before determining the key value pair corresponding to each data query condition, the method further comprises:
transmitting the at least one data query condition into the JavaScript component;
the determining the key value pair corresponding to each data query condition comprises the following steps:
performing array traversal on the at least one data query condition, and extracting key value pairs in each data query condition;
and/or the number of the groups of groups,
before said determining that each of said key-value pairs matches a conditional screening component, further comprising:
setting at least one functional component, wherein each functional component corresponds to a service function;
The condition filtering component for determining that each key value pair is matched comprises:
determining a condition screening component matched with each key value pair from the at least one functional component by traversing each key value pair;
and/or the number of the groups of groups,
when query information from the client is obtained by at least one of the condition screening components, further comprising, prior to the storing the query information:
splicing the acquired query information into JSON format data;
the storing the query information includes:
storing the spliced data;
the setting the determined condition filtering component in the target web page comprises the following steps:
determining a display area of the condition screening component in the target web page of at least one client type and a first pixel value, wherein the first pixel value characterizes a width of the condition screening component;
inserting the determined first pixel values of the condition screening component, the display area and each condition screening component into html tags of the target web page in the form of document nodes;
the presenting the condition filtering component in the target web page comprises:
Determining the current type of the client;
determining a target display area and a target first pixel value of the condition screening component in the target web page of the current type from the html tag;
displaying the condition screening component in the target web page according to the target display area and the target first pixel value;
the displaying the condition filtering component in the target web page according to the target displaying area and the target first pixel value comprises the following steps:
d1: determining the arrangement sequence of each condition screening component in the html tag;
d2: determining a second pixel value of the target display area in the client, wherein the second pixel value characterizes the width of the target display area;
d3: setting a first condition screening component in the arrangement sequence in the target display area;
d4: adding the target first pixel value of the first condition screening component and the target first pixel value of the next condition screening component of the first condition screening component in the arrangement sequence to obtain a component width value;
d5: determining whether a difference between the component width value and the second pixel value is greater than the target first pixel value, if so, executing D6, otherwise, executing D7;
D6: setting a next condition screening component of the first condition screening component in the arrangement sequence at a position which is positioned in the same row as the first condition screening component in the target display area, and executing D8;
d7: setting a next condition screening component of the first condition screening component in the arrangement sequence in a next row of the first condition screening component of the target display area, and executing D8;
d8: determining whether the next condition screening component of the first condition screening component is the last condition screening component in the arrangement sequence, if so, executing D9, otherwise, executing D10;
d9: executing the query information when the query information from the client is acquired through at least one condition screening component;
d10: taking the component width value as a target first pixel value of a next condition screening component of the first condition screening component;
d11: and taking the next condition screening component of the first condition screening component as the first condition screening component, and returning to D4.
2. A data query device, comprising:
the assembly setting module is used for presetting a JavaScript assembly;
The condition determining module is used for determining at least one data query condition;
the component screening module is used for calling the JavaScript component set by the component setting module and executing: determining a key value pair corresponding to each data query condition determined by the condition determining module; determining a condition screening component for each of the key value pairs to match;
the component control module is used for setting the condition screening component determined by the component screening module in the target web page; when a client requests the target web page, the condition screening component is displayed in the target web page;
the data processing module is used for storing the query information when the query information from the client is acquired through at least one condition screening component set by the component control module;
the component screening module is further configured to transmit the at least one data query condition to the JavaScript component; performing array traversal on the at least one data query condition, and extracting key value pairs in each data query condition;
and/or the number of the groups of groups,
the component setting module is further used for setting at least one functional component, wherein each functional component corresponds to one service function;
The component screening module is used for determining a condition screening component matched with each key value pair from the at least one functional component by traversing each key value pair;
and/or the number of the groups of groups,
the data processing module is further used for splicing the acquired query information into data in a JSON format; storing the spliced data;
the component control module is used for determining a display area and a first pixel value of the condition screening component in the target web page of at least one client type, wherein the first pixel value characterizes the width of the condition screening component; inserting the determined first pixel values of the condition screening component, the display area and each condition screening component into html tags of the target web page in the form of document nodes; determining the current type of the client; determining a target display area and a target first pixel value of the condition screening component in the target web page of the current type from the html tag; displaying the condition screening component in the target web page according to the target display area and the target first pixel value;
The component control module is used for executing:
d1: determining the arrangement sequence of each condition screening component in the html tag;
d2: determining a second pixel value of the target display area in the client, wherein the second pixel value characterizes the width of the target display area;
d3: setting a first condition screening component in the arrangement sequence in the target display area;
d4: adding the target first pixel value of the first condition screening component and the target first pixel value of the next condition screening component of the first condition screening component in the arrangement sequence to obtain a component width value;
d5: determining whether a difference between the component width value and the second pixel value is greater than the target first pixel value, if so, executing D6, otherwise, executing D7;
d6: setting a next condition screening component of the first condition screening component in the arrangement sequence at a position which is positioned in the same row as the first condition screening component in the target display area, and executing D8;
d7: setting a next condition screening component of the first condition screening component in the arrangement sequence in a next row of the first condition screening component of the target display area, and executing D8;
D8: determining whether the next condition screening component of the first condition screening component is the last condition screening component in the arrangement sequence, if so, executing D9, otherwise, executing D10;
d9: executing the query information when the query information from the client is acquired through at least one condition screening component;
d10: taking the component width value as a target first pixel value of a next condition screening component of the first condition screening component;
d11: and taking the next condition screening component of the first condition screening component as the first condition screening component, and returning to D4.
CN202010112008.2A 2020-02-24 2020-02-24 Data query method and device Active CN111339125B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010112008.2A CN111339125B (en) 2020-02-24 2020-02-24 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010112008.2A CN111339125B (en) 2020-02-24 2020-02-24 Data query method and device

Publications (2)

Publication Number Publication Date
CN111339125A CN111339125A (en) 2020-06-26
CN111339125B true CN111339125B (en) 2023-07-25

Family

ID=71185449

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010112008.2A Active CN111339125B (en) 2020-02-24 2020-02-24 Data query method and device

Country Status (1)

Country Link
CN (1) CN111339125B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933875A (en) * 2015-12-31 2017-07-07 北京城市网邻信息技术有限公司 Data query method and device
CN108345511A (en) * 2017-01-24 2018-07-31 阿里巴巴集团控股有限公司 A kind of application data verification method, device and electronic equipment
CN108920505A (en) * 2018-05-29 2018-11-30 阿里巴巴集团控股有限公司 Exchange rate enquiring component device, server-side and method
CN109902205A (en) * 2019-02-13 2019-06-18 广东高云半导体科技股份有限公司 FPGA device information processing method, device, computer equipment and storage medium
WO2019184219A1 (en) * 2018-03-26 2019-10-03 平安科技(深圳)有限公司 Method, server, and storage medium for smart search
CN110489120A (en) * 2019-07-03 2019-11-22 平安证券股份有限公司 Page development method component-based and server
CN110825766A (en) * 2019-11-13 2020-02-21 恩亿科(北京)数据科技有限公司 Query condition generation method and device, server and readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761451B2 (en) * 2005-06-17 2010-07-20 Microsoft Corporation Efficient querying and paging in databases
US20120136858A1 (en) * 2010-11-30 2012-05-31 International Business Machines Corporation Method to Coordinate Data Collection Among Multiple System Components
CN109325201A (en) * 2018-08-15 2019-02-12 北京百度网讯科技有限公司 Generation method, device, equipment and the storage medium of entity relationship data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933875A (en) * 2015-12-31 2017-07-07 北京城市网邻信息技术有限公司 Data query method and device
CN108345511A (en) * 2017-01-24 2018-07-31 阿里巴巴集团控股有限公司 A kind of application data verification method, device and electronic equipment
WO2019184219A1 (en) * 2018-03-26 2019-10-03 平安科技(深圳)有限公司 Method, server, and storage medium for smart search
CN108920505A (en) * 2018-05-29 2018-11-30 阿里巴巴集团控股有限公司 Exchange rate enquiring component device, server-side and method
CN109902205A (en) * 2019-02-13 2019-06-18 广东高云半导体科技股份有限公司 FPGA device information processing method, device, computer equipment and storage medium
CN110489120A (en) * 2019-07-03 2019-11-22 平安证券股份有限公司 Page development method component-based and server
CN110825766A (en) * 2019-11-13 2020-02-21 恩亿科(北京)数据科技有限公司 Query condition generation method and device, server and readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
丁俊 ; .利用客户端脚本实现复合查询的新思路.电脑知识与技术.2008,(14),全文. *
王战英 ; 王占宏 ; .基于元数据的分布式通用查询系统研究与实现.微型电脑应用.2017,(08),全文. *

Also Published As

Publication number Publication date
CN111339125A (en) 2020-06-26

Similar Documents

Publication Publication Date Title
US9842172B2 (en) Method, client device and server of accessing network information through graphic code
CN102722563B (en) Method and device for displaying page
EP3273362A1 (en) Webpage access method, apparatus, device and non-volatile computer storage medium
CN108427731B (en) Page code processing method and device, terminal equipment and medium
CN108334508B (en) Webpage information extraction method and device
CN110245069B (en) Page version testing method and device and page display method and device
CN105094775B (en) Webpage generation method and device
CN105843800A (en) DOI-based language information display method and device
CN111880813B (en) Method for realizing android card UI (user interface) and storage medium
CN108304562B (en) Question searching method and device and intelligent terminal
CN108196902B (en) Method and apparatus for displaying open screen advertisements
CN115526160A (en) Rich text processing method, device and equipment and storage medium
CN111008865A (en) Coupon synchronous display method and device, server and storage medium
CN112784529B (en) Mobile terminal sorting table based on BetterScroll and construction method thereof
CN116306498B (en) Text rendering method and device
CN112612964A (en) Picture display method and device, computer equipment and storage medium
CN111339125B (en) Data query method and device
US8112070B2 (en) Electronic device and method for searching a merchandise location
CN110781375B (en) User state identification determining method and device
CN108038403B (en) Card reading method based on NFC technology and client
CN111859154B (en) Application recommendation method and device
CN109032924A (en) Identify method, apparatus, equipment and the storage medium of resource type in the page
CN105589870B (en) Method and system for filtering webpage advertisements
CN113704648A (en) Page data processing method, device, equipment and storage medium
KR101884293B1 (en) Method and apparatus for providing a template of micro web-page

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
TA01 Transfer of patent application right

Effective date of registration: 20230626

Address after: 250100 Inspur science and Technology Park, 1036 Inspur Road, hi tech Zone, Jinan City, Shandong Province

Applicant after: Inspur Software Technology Co.,Ltd.

Address before: 250100 First Floor of R&D Building 2877 Kehang Road, Sun Village Town, Jinan High-tech Zone, Shandong Province

Applicant before: SHANDONG INSPUR BUSINESS SYSTEM Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant