CN112527843B - Data query method, device, terminal equipment and storage medium - Google Patents

Data query method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN112527843B
CN112527843B CN202011506379.5A CN202011506379A CN112527843B CN 112527843 B CN112527843 B CN 112527843B CN 202011506379 A CN202011506379 A CN 202011506379A CN 112527843 B CN112527843 B CN 112527843B
Authority
CN
China
Prior art keywords
data
instruction
query
queried
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
CN202011506379.5A
Other languages
Chinese (zh)
Other versions
CN112527843A (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.)
China Industrial Control Systems Cyber Emergency Response Team
Original Assignee
China Industrial Control Systems Cyber Emergency Response Team
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 China Industrial Control Systems Cyber Emergency Response Team filed Critical China Industrial Control Systems Cyber Emergency Response Team
Priority to CN202011506379.5A priority Critical patent/CN112527843B/en
Publication of CN112527843A publication Critical patent/CN112527843A/en
Application granted granted Critical
Publication of CN112527843B publication Critical patent/CN112527843B/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/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification
    • G06F16/287Visualization; Browsing
    • 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 application is applicable to the technical field of information, and provides a data query method, a data query device, terminal equipment and a storage medium. The data query method comprises the following steps: acquiring a command to be queried; searching target data information corresponding to the instruction to be inquired according to a pre-constructed instruction index table; and acquiring corresponding target cache data from the least recently used LRU cache of the specified server according to the target data information, and displaying the target cache data in a specified data query result interface. According to the method and the device, the instruction index table for recording the corresponding relation between each data query instruction with the query frequency larger than the set threshold and the data to be queried is firstly established, after the query instruction is obtained, the target data information can be determined according to the instruction index table, then the target cache data are obtained from the LRU cache according to the target data information so as to quickly feed back the query result, and the data query efficiency can be improved.

Description

Data query method, device, terminal equipment and storage medium
Technical Field
The application belongs to the technical field of information processing, and particularly relates to a data query method, a data query device, terminal equipment and a storage medium.
Background
At present, each service in a distributed system architecture is functionally split, when data needs to be queried, the data is queried in a corresponding server through a representational state transition interface, a server providing a query function can also search in a database of the server, and under the condition that query requests are highly concurrent, the I/O of a network and the disk I/O of the server are excessively consumed, so that the data query efficiency is greatly reduced.
Disclosure of Invention
In view of this, embodiments of the present application provide a data query method, an apparatus, a terminal device, and a storage medium, which can improve efficiency of data query.
In a first aspect, an embodiment of the present application provides a data query method, including:
acquiring a command to be queried;
searching target data information corresponding to the to-be-inquired instruction according to a pre-constructed instruction index table, wherein the instruction index table records the corresponding relation between each data inquiry instruction with the inquiry frequency larger than a set threshold value and the data information of the to-be-inquired data;
and acquiring corresponding target cache data from the least recently used LRU cache of the specified server according to the target data information, and displaying the target cache data in a specified data query result interface.
According to the embodiment of the application, the instruction index table for recording the corresponding relation between each data query instruction with the query frequency larger than the set threshold and the data to be queried is constructed, then after the query instruction is obtained, the target data information is determined according to the instruction index table, and then the target cache data is obtained from the LRU cache according to the target data information so as to feed back the query result quickly, so that the data query efficiency can be improved.
Further, the instruction index table is constructed by the following steps:
acquiring historical data of data query;
searching out each data query instruction with the query frequency larger than a set threshold value according to the historical data;
and constructing the instruction index table according to the corresponding relation between each data query instruction and the data information of the data to be queried.
By screening the historical data of the data query, each data query instruction with the query frequency larger than a set threshold value can be accurately found, and then an instruction index table can be constructed through the corresponding relation between the data query instructions and the data information of the data to be queried.
Further, after the instruction index table is constructed according to the corresponding relationship between each data query instruction and the data information of the data to be queried, the method further includes:
and acquiring corresponding data to be queried according to the data information recorded by the instruction index table, and caching the acquired data to be queried to the LRU cache of the designated server.
The data reading efficiency in the cache is far higher than that in the memory, so that after the instruction index table is constructed, each to-be-queried data corresponding to each data information in the instruction index table can be cached in the LRU cache of the designated server, and the data querying efficiency is further improved.
Further, acquiring a pre-constructed queue to be queried;
and determining the data query instruction with the highest query priority level in the queue to be queried as the instruction to be queried, and acquiring the instruction to be queried.
The method is different from concurrent data query requests, and only single data query operation can be executed each time, so that the problem of excessive occupation of network I/O and disk I/O is avoided, the conflict between data queries can be avoided, and the reliability of the data query is improved.
Further, after searching for the target data information corresponding to the instruction to be queried according to a pre-constructed instruction index table, the method further includes:
and if the target data information corresponding to the instruction to be inquired is not found according to the instruction index table, traversing the database of the designated server according to the instruction to be inquired to obtain corresponding target storage data, and displaying the target storage data in the data inquiry result interface.
The instruction to be queried may also be a data query instruction with low query frequency, and for such an instruction to be queried, the corresponding target data information cannot be found according to the instruction index table. In this case, whether corresponding target storage data exists in the database of the designated server can be searched according to the instruction to be queried, and although the query takes a relatively long time in the process, the reliability of the data query can be improved.
Further, the data in the database is collected by the following steps:
collecting log data of devices flowing through a network access and a network access by using a flow mirroring method and log attribute information corresponding to the log data, and storing the log data and the log attribute information into the database.
The data stored in the database is collected by a flow mirroring method, and the comprehensiveness of data collection can be ensured by deploying at a network input port, wherein the collected data comprises log data and log attribute information of the flow-through equipment.
Further, displaying the target cache data in a specified data query result interface includes:
converting the target cache data into a chart with a specified style, and displaying the chart in the data query result interface
After the target cache data is obtained, the target cache data is converted into the chart of the target display style, and then the chart is displayed in the interface of the data query result, so that the visualization of the data query result can be improved.
In a second aspect, an embodiment of the present application provides a data query apparatus, including:
the query instruction acquisition module is used for acquiring a to-be-queried instruction;
the target data information searching module is used for searching target data information corresponding to the to-be-inquired instruction according to a pre-constructed instruction index table, and the instruction index table records the corresponding relation between each data inquiry instruction with the inquiry frequency larger than a set threshold value and the data information of the to-be-inquired data;
and the query result first feedback module is used for acquiring corresponding target cache data from the least recently used LRU cache of the specified server according to the target data information and displaying the target cache data in a specified data query result interface.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program that is stored in the memory and is executable on the processor, and when the processor executes the computer program, the data query method as set forth in the first aspect of the embodiment of the present application is implemented.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the data query method as set forth in the first aspect of the embodiment of the present application.
Compared with the prior art, the embodiment of the application has the advantages that: the query result can be fed back quickly, and the efficiency of data query is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings may be obtained according to these drawings without inventive labor.
Fig. 1 is a flowchart of a data query method provided in an embodiment of the present application;
fig. 2 is a structural diagram of a data query device according to an embodiment of the present application;
fig. 3 is a schematic diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular device structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the embodiments of the present application, "one or more" means one, two, or more than two; "and/or" describes the association relationship of the associated object, and indicates that three relationships can exist; for example, a and/or B, may represent: a alone, both A and B, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The data query method provided by the embodiment of the application can be applied to terminal devices or servers such as a mobile phone, a tablet computer, a medical device, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and the like, and the embodiment of the application does not limit the specific types of the terminal devices and the servers.
Under the big data era, the retrieval efficiency of data is crucial, for equipment which runs for a long time and collects data in real time for analysis, the query efficiency of log data is emphasized, at present, each service in a distributed system architecture is functionally split, when data query is needed, a RESTful interface is needed to be taken to a corresponding server for query, the server providing the query function can also retrieve in a database of the server, and the network I/O and disk I/O are excessively consumed under the high concurrency condition, so that the data query efficiency is greatly reduced. In order to solve the problem, the data query method is provided, and the data query efficiency can be improved.
Referring to fig. 1, fig. 1 shows a flowchart of a data query method provided in the present application, including:
101. acquiring a command to be queried;
firstly, a to-be-queried instruction is obtained, wherein the to-be-queried instruction refers to a data query instruction for performing query operation immediately after obtaining, and the data query is an instruction for converting relevant query information input by a user through a query interface into data.
In one embodiment, the instruction to be queried may be determined by:
acquiring a pre-constructed queue to be queried;
and determining the data query instruction with the highest query priority level in the queue to be queried as the instruction to be queried.
The data query method is characterized by adopting a queue type query, namely, a queue to be queried is constructed in advance, when a data query instruction converted from related query information is received, the data query instruction is placed in the queue to be queried firstly, then a priority level corresponding to each data query instruction in the queue to be queried is given according to the sequence of receiving the data query instruction, namely, the priority level of the received data query instruction is higher than that of the received data query instruction, then the data query instruction is determined according to the priority level, and the data query instruction is obtained. Of course, when determining the priority level of each data query instruction, not only may the receiving time of the data query instruction be used as the determination criterion, but also the priority level may be divided according to the user tag carried by the data query instruction, for example, the data query instruction of the common user and the VIP user is received at the same time, and the data query instruction of the VIP user may be determined as the data query instruction with a higher priority level. By using the receiving time of the user tag and the data query instruction as the determination standard of the priority level, the experience of the VIP user can be improved, and the viscosity of the user can be enhanced.
102. Searching target data information corresponding to the to-be-inquired instruction according to a pre-constructed instruction index table, wherein the instruction index table records the corresponding relation between each data inquiry instruction with the inquiry frequency larger than a set threshold value and the data information of the to-be-inquired data;
in the pre-constructed instruction index table, the corresponding relation between each data query instruction with the query frequency larger than the set threshold value and the data to be queried is recorded, so that after the instruction to be queried is obtained, whether the target data information corresponding to the instruction to be queried is recorded or not can be searched from the instruction index table.
Specifically, in one embodiment, the instruction index table is constructed by the following steps:
acquiring historical data of data query;
searching out each data query instruction with the query frequency larger than a set threshold value according to the historical data;
and constructing the instruction index table according to the corresponding relation between each data query instruction and the data information of the data to be queried.
By analyzing historical data of data query, counting the query frequency of each data query instruction, comparing the query frequency with a set threshold value, screening out data query instructions with the query frequency larger than the set threshold value (the screened data query instructions can be regarded as high-frequency data query instructions, and the screened data query instructions can be regarded as low-frequency data query instructions), and then constructing an instruction index table according to the corresponding relation between each data query instruction and the data information of the data to be queried. Preferably, after the query frequency of each data query instruction is counted, a user image of data query can be constructed according to user information carried in the data query instruction, then the user image can be used for preferentially judging when the to-be-queried instruction is obtained, if the user image is displayed, the user can frequently query through a high-frequency data query instruction, and after the to-be-queried instruction is obtained, data query operation is carried out according to the method; however, if the user portrait is displayed, the user often queries through a low-frequency data query instruction, and after the instruction to be queried is obtained, the database of the designated server is directly traversed according to the instruction to be queried to find whether corresponding target storage data exists. The user portrait is judged in advance, whether a data query instruction input by a user is a high-frequency data query instruction or a low-frequency data query instruction can be judged accurately, and proper data query operation is selected through the data query instructions with different frequencies, so that the data query efficiency can be further improved, and the data query reliability is improved.
In order to further improve the query efficiency of the data, in an embodiment, after the instruction index table is constructed according to the corresponding relationship between each data query instruction and the data information of the data to be queried, the method further includes:
and acquiring corresponding data to be queried according to the data information recorded by the instruction index table, and caching the acquired data to be queried to the LRU cache of the designated server.
When a certain hardware needs to read data, the required data is firstly searched from the cache, if the data is found, the data is directly executed, and if the data is not found, the data is searched from the memory. Since caches run much faster than memory, the role of caches is to help hardware run faster. Therefore, after the instruction index table is constructed, each data to be queried corresponding to each data information recorded in the instruction index table can be obtained and cached in the LRU cache of the designated server, so that the data query efficiency is improved.
In the embodiment of the present application, the LRU cache is selected because the cache capacity of the computer is limited, and if the cache is full, some content is deleted to give a new content position. According to experience, the useless cache is preferably deleted, and the useful data is kept in the cache for further use after convenience. The LRU cache eviction algorithm is a commonly used discrimination strategy for "useful" data. LRU is called "Least Recently Used", i.e., data that has been Recently Used is considered to be "useful", data that has not been Used for a long time is considered to be useless, and data that has not been Used for a long time is preferably deleted when the memory is full. By adopting the cache, the instruction index table can be continuously optimized along with the query method, so that the real high-frequency data query instruction is screened out, and the data query method of the application becomes more reliable.
Because the target data information corresponding to the data query instruction with higher query frequency is recorded in the instruction index table, it is also possible that the obtained instruction to be queried is a low-frequency data query instruction. In this case, the corresponding target data query information cannot be found through the data query instruction. At this time, whether corresponding target storage data exists or not can be judged by inquiring the memory of the specified server, so that the reliability of data inquiry is improved.
In one embodiment, after looking up the target data information corresponding to the instruction to be queried according to a pre-constructed instruction index table, the method further includes:
and if the target data information corresponding to the instruction to be queried is not found according to the instruction index table, traversing the database of the designated server according to the instruction to be queried to obtain corresponding target storage data, and displaying the target storage data in the data query result interface.
When the target data information corresponding to the instruction to be queried is not found according to the instruction index table, the query instruction may be a low-frequency data query instruction, so that the memory of the designated server, namely the database, can be traversed according to the query instruction to obtain the corresponding target storage data, and after the target storage data is obtained, the target storage data is displayed in the data query result interface.
In one embodiment, the stored data in the database of the designated server may be collected by:
collecting log data of devices flowing through a network access and a network access by using a flow mirroring method and log attribute information corresponding to the log data, and storing the log data and the log attribute information into the database.
The traffic Mirroring (Mirroring/traffic-shadow), also called as shadow traffic, refers to copying real online traffic to a Mirroring service through a certain configuration, and forwarding the real online traffic through the traffic Mirroring to achieve the purpose of specifically analyzing the traffic or request content without affecting the online service. Specifically, in this example, deployment is performed at an exit and an entrance of a network, log data and log number log attribute information of devices flowing through are collected, and the collected data is stored in a database of a designated server. After the instruction index table is constructed, corresponding data can be cached to the LRU cache from the database according to the information of the data to be queried recorded in the table to be queried.
103. And acquiring corresponding target cache data from the least recently used LRU cache of the specified server according to the target data information, and displaying the target cache data in a specified data query result interface.
After the target data information is determined, corresponding target cache data can be obtained from the LRU cache of the designated server, and the target cache data is displayed in a designated data query result interface.
In order to facilitate the user to intuitively understand the query result, in one embodiment, the presenting the target cache data in a specified data query result interface includes:
and converting the target cache data into a chart with a specified style, and displaying the chart in the data query result interface.
Target cache data are converted into a chart with a specified style through conversion, and a data result is displayed in a specified data query result interface after being visualized, so that a client can know the query result more conveniently and intuitively.
According to the method and the device, an instruction index table for recording the corresponding relation between each data query instruction with the query frequency larger than a set threshold and the data to be queried is established, then after the query instruction is obtained, the target data information is determined according to the instruction index table, and then the target cache data are obtained from the LRU cache according to the target data information so as to feed back the query result quickly, so that the data query efficiency can be improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 2 shows a block diagram of a data query apparatus according to an embodiment of the present application, and only shows portions related to the embodiment of the present application for convenience of description.
Referring to fig. 2, the apparatus includes:
a query instruction obtaining module 201, configured to obtain an instruction to be queried;
a target data information searching module 202, configured to search, according to a pre-constructed instruction index table, target data information corresponding to the instruction to be queried, where the instruction index table records a correspondence between each data query instruction whose query frequency is greater than a set threshold and data information of data to be queried;
and the query result first feedback module 203 is configured to obtain corresponding target cache data from the least recently used LRU cache of the designated server according to the target data information, and display the target cache data in a designated data query result interface.
Further, the apparatus may further include:
the historical data acquisition module is used for acquiring historical data of data query;
the data query instruction searching module is used for searching each data query instruction with the query frequency larger than a set threshold value according to the historical data;
and the instruction index table building module is used for building the instruction index table according to the corresponding relation between each data query instruction and the data information of the data to be queried.
Further, the apparatus may further include:
after the instruction index table is constructed according to the corresponding relation between each data query instruction and the data information of the data to be queried, the corresponding data to be queried is obtained according to the data information recorded by the instruction index table, and the obtained data to be queried is cached to the LRU cache of the designated server.
Further, the query obtaining module 201 may include:
the query queue acquiring module is used for acquiring a pre-constructed query queue;
and the to-be-queried instruction determining module is used for determining the data query instruction with the highest query priority level in the to-be-queried queue as the to-be-queried instruction and acquiring the to-be-queried instruction.
Further, the apparatus may further include:
and the query result second feedback module is used for traversing the database of the specified server according to the instruction to be queried to acquire corresponding target storage data and displaying the target storage data in the data query result interface if the target data information corresponding to the instruction to be queried is not found according to the instruction index table after the target data information corresponding to the instruction to be queried is found according to a pre-constructed instruction index table.
Further, the query result second feedback module may include:
the storage data acquisition unit is used for acquiring log data of equipment flowing through a network access and a network gateway and log attribute information corresponding to the log data by using a flow mirroring method, and storing the log data and the log attribute information into the database.
Further, the query result first feedback module 203 may include:
and the query result first feedback unit is used for converting the target cache data into a chart with a specified style and displaying the chart in the data query result interface.
The embodiment of the present application further provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the steps of each data query method as proposed in the present application when executing the computer program.
An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the data query methods as set forth in the present application.
The embodiment of the present application further provides a computer program product, which, when running on a terminal device, enables the terminal device to execute the steps of each data query method provided by the present application.
Fig. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 3, the terminal device 3 of this embodiment includes: at least one processor 30 (only one shown in fig. 3), a memory 31, and a computer program 32 stored in the memory 31 and executable on the at least one processor 30, the processor 30 implementing the steps in any of the above-described browser-driven configuration method embodiments when executing the computer program 32.
The terminal device 3 may be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices, and a smart watch, a smart bracelet and other wearable devices. The terminal device may include, but is not limited to, a processor 30, a memory 31. Those skilled in the art will appreciate that fig. 3 is only an example of the terminal device 3, and does not constitute a limitation to the terminal device 3, and may include more or less components than those shown, or combine some components, or different components, and may further include, for example, an input/output device, a network access device, and the like.
The Processor 30 may be a Central Processing Unit (CPU), and the Processor 30 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 31 may in some embodiments be an internal storage unit of the terminal device 3, such as a hard disk or a memory of the terminal device 3. The memory 31 may also be an external storage device of the terminal device 3 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the terminal device 3. The memory 31 is used for storing an operating device, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 31 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the above-mentioned apparatus may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above may be implemented by instructing relevant hardware by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the embodiments of the methods described above may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include at least: any entity or apparatus capable of carrying computer program code to a terminal device, recording medium, computer Memory, read-Only Memory (ROM), random-Access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (9)

1. A method of querying data, comprising:
acquiring a command to be queried;
searching target data information corresponding to the to-be-inquired instruction according to a pre-constructed instruction index table, wherein the instruction index table records the corresponding relation between each data inquiry instruction with the inquiry frequency larger than a set threshold value and the data information of the to-be-inquired data;
acquiring corresponding target cache data from a least recently used LRU cache of a specified server according to the target data information, and displaying the target cache data in a specified data query result interface;
the acquiring of the instruction to be queried includes:
acquiring a pre-constructed queue to be queried;
for each queue query instruction in the query queue, determining the query priority of the queue query instruction based on a user tag carried by the queue query instruction, wherein the user tag comprises a common user and a VIP user, and the query priority of the queue query instruction with the user tag of the common user is lower than the query priority of the queue query instruction with the user tag of the VIP user;
determining the queue query instruction with the highest query priority as the instruction to be queried, and acquiring the instruction to be queried;
before the target data information corresponding to the instruction to be queried is searched according to the pre-constructed instruction index table, the method further includes:
constructing a user image corresponding to the instruction to be inquired based on the user information carried in the instruction to be inquired;
determining whether the command to be queried is a high-frequency data query command or not based on the user portrait;
if the command to be queried is a high-frequency data query command, the step of searching target data information corresponding to the command to be queried according to a pre-constructed command index table and subsequent steps are executed;
and traversing the database of the specified server based on the instruction to be queried to obtain a data query result corresponding to the instruction to be queried if the instruction to be queried is not a high-frequency data query instruction.
2. The data query method of claim 1, wherein the instruction index table is constructed by:
acquiring historical data of data query;
searching out each data query instruction with the query frequency larger than a set threshold value according to the historical data;
and constructing the instruction index table according to the corresponding relation between each data query instruction and the data information of the data to be queried.
3. The data query method according to claim 2, after constructing the instruction index table according to the correspondence between each data query instruction and the data information of the data to be queried, further comprising:
and acquiring corresponding data to be queried according to the data information recorded by the instruction index table, and caching the acquired data to be queried into the LRU cache of the designated server.
4. The data query method of claim 1, after searching for the target data information corresponding to the instruction to be queried according to a pre-constructed instruction index table, further comprising:
and if the target data information corresponding to the instruction to be inquired is not found according to the instruction index table, traversing the database of the designated server according to the instruction to be inquired to obtain corresponding target storage data, and displaying the target storage data in the data inquiry result interface.
5. The data query method of claim 4, wherein the data in the database is collected by:
collecting log data of devices flowing through a network access and a network access by using a flow mirroring method and log attribute information corresponding to the log data, and storing the log data and the log attribute information into the database.
6. The data query method of any one of claims 1 to 5, wherein the exposing the target cached data in a specified data query results interface comprises:
and converting the target cache data into a chart with a specified style, and displaying the chart in the data query result interface.
7. A data query apparatus, comprising:
the query instruction acquisition module is used for acquiring a to-be-queried instruction;
the target data information searching module is used for searching target data information corresponding to the to-be-queried instruction according to a pre-constructed instruction index table, and the instruction index table records the corresponding relation between each data query instruction with the query frequency larger than a set threshold value and the data information of the to-be-queried data;
the first query result feedback module is used for acquiring corresponding target cache data from the least recently used LRU cache of the specified server according to the target data information and displaying the target cache data in a specified data query result interface;
wherein, the query instruction acquisition module comprises:
a queue to be queried acquiring unit, configured to acquire a queue to be queried that is pre-constructed;
the query priority determining unit is used for determining the query priority of each queue query instruction in the query queue based on a user tag carried by the queue query instruction, wherein the user tag comprises a common user and a VIP user, and the query priority of the queue query instruction with the user tag of the common user is lower than that of the queue query instruction with the user tag of the VIP user;
a query queue obtaining unit, configured to determine the queue query instruction with the highest query priority as the instruction to be queried, and obtain the instruction to be queried;
the data query device further comprises:
the user portrait construction module is used for constructing a user portrait corresponding to the instruction to be inquired based on the user information carried in the instruction to be inquired;
the high-frequency instruction determining module is used for determining whether the instruction to be inquired is a high-frequency data inquiry instruction or not based on the user portrait; if the command to be inquired is a high-frequency data inquiry command, the step of searching the target data information corresponding to the command to be inquired according to a pre-constructed command index table and the subsequent steps are executed; and traversing the database of the specified server based on the instruction to be queried to obtain a data query result corresponding to the instruction to be queried if the instruction to be queried is not a high-frequency data query instruction.
8. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the data query method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements a data query method according to any one of claims 1 to 6.
CN202011506379.5A 2020-12-18 2020-12-18 Data query method, device, terminal equipment and storage medium Active CN112527843B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011506379.5A CN112527843B (en) 2020-12-18 2020-12-18 Data query method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011506379.5A CN112527843B (en) 2020-12-18 2020-12-18 Data query method, device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112527843A CN112527843A (en) 2021-03-19
CN112527843B true CN112527843B (en) 2023-04-14

Family

ID=75001903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011506379.5A Active CN112527843B (en) 2020-12-18 2020-12-18 Data query method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112527843B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076462B (en) * 2021-03-25 2024-04-30 恒安嘉新(北京)科技股份公司 Network session data query method, device, equipment and medium
CN113282587B (en) * 2021-06-01 2023-06-16 青岛海尔科技有限公司 Method and device for transmitting state data, storage medium and electronic device
CN113517047A (en) * 2021-06-08 2021-10-19 联仁健康医疗大数据科技股份有限公司 Medical data acquisition method and device, electronic equipment and storage medium
CN113836181A (en) * 2021-09-01 2021-12-24 北京来也网络科技有限公司 Data query method and device combining RPA and AI, electronic equipment and storage medium
CN115361032B (en) * 2022-08-17 2023-04-18 佛山市朗盛通讯设备有限公司 Antenna unit for 5G communication

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857369A (en) * 2012-08-07 2013-01-02 北京鼎震科技有限责任公司 Website log saving system, method and apparatus
CN109657174A (en) * 2018-12-25 2019-04-19 北京百度网讯科技有限公司 Method and apparatus for more new data
CN111104402A (en) * 2019-11-29 2020-05-05 北京文渊佳科技有限公司 Method, device, electronic equipment and medium for searching data
CN111814045A (en) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 Data query method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10990573B2 (en) * 2019-01-16 2021-04-27 Syscom Computer Engineering Co. Fast index creation system for cloud big data database

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857369A (en) * 2012-08-07 2013-01-02 北京鼎震科技有限责任公司 Website log saving system, method and apparatus
CN109657174A (en) * 2018-12-25 2019-04-19 北京百度网讯科技有限公司 Method and apparatus for more new data
CN111104402A (en) * 2019-11-29 2020-05-05 北京文渊佳科技有限公司 Method, device, electronic equipment and medium for searching data
CN111814045A (en) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 Data query method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112527843A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN112527843B (en) Data query method, device, terminal equipment and storage medium
CN110046133B (en) Metadata management method, device and system for storage file system
US7865476B2 (en) File sharing system in cooperation with a search engine
US8725762B2 (en) Preventing leakage of information over a network
CN111198976B (en) Cloud asset association analysis system, method, electronic equipment and medium
US9280551B2 (en) De-duplication deployment planning
US20140304274A1 (en) Systems and Methods for Publishing Datasets
CN111813756A (en) Log retrieval system, method and device, electronic equipment and storage medium
CN111339171A (en) Data query method, device and equipment
CN109446225A (en) Data cache method, device, computer equipment and storage medium
CN107748772B (en) Trademark identification method and device
US9870404B2 (en) Computer system, data management method, and recording medium storing program
CN110008243A (en) A kind of tables of data processing method and processing device
CN115269519A (en) Log detection method and device and electronic equipment
CN112667682A (en) Data processing method, data processing device, computer equipment and storage medium
CN111782588A (en) File reading method, device, equipment and medium
CN110678854B (en) Data query method and device
CN112434195A (en) Data analysis method and device, electronic equipment and computer readable storage medium
CN112416699A (en) Index data collection method and system
CN113312410B (en) Data map construction method, data query method and terminal equipment
CN113625967B (en) Data storage method, data query method and server
JP7180769B2 (en) Data management device, control method, and storage medium
WO2016045397A1 (en) Method and query processing server for optimizing query execution
CN109241084B (en) Data query method, terminal equipment and medium
CN109710673B (en) Work processing method, device, equipment and medium

Legal Events

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