CN116303988A - Query request processing method, device, electronic equipment, medium and program product - Google Patents
Query request processing method, device, electronic equipment, medium and program product Download PDFInfo
- Publication number
- CN116303988A CN116303988A CN202310183887.1A CN202310183887A CN116303988A CN 116303988 A CN116303988 A CN 116303988A CN 202310183887 A CN202310183887 A CN 202310183887A CN 116303988 A CN116303988 A CN 116303988A
- Authority
- CN
- China
- Prior art keywords
- query
- log
- log data
- compressed
- data block
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 24
- 238000000034 method Methods 0.000 claims abstract description 29
- 230000004044 response Effects 0.000 claims abstract description 27
- 238000001914 filtration Methods 0.000 claims abstract description 14
- 238000004590 computer program Methods 0.000 claims description 17
- 238000010586 diagram Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 9
- 239000002699 waste material Substances 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 238000005457 optimization Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000011045 prefiltration Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/335—Filtering based on additional data, e.g. user or group profiles
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1805—Append-only file systems, e.g. using logs or journals to store data
- G06F16/1815—Journaling file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/3332—Query translation
- G06F16/3334—Selection or weighting of terms from queries, including natural language queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/38—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Library & Information Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the disclosure discloses a query request processing method, a query request processing device, an electronic device, a medium and a program product. One embodiment of the method comprises the following steps: determining whether the received log query request contains a query key; responding to the fact that the log query request contains query keywords, and acquiring a compressed log data block set corresponding to target query conditions; in response to determining that there are prestored non-result compressed log data blocks corresponding to the query keywords, filtering the set of compressed log data blocks according to the prestored non-result compressed log data blocks corresponding to the query keywords; selecting each compressed log data block meeting the keyword query conditions from the filtered compressed log data block set as a log query result according to the keyword query conditions; and sending the obtained log query result to the terminal equipment corresponding to the log query request. The log inquiry of the embodiment is related, the log inquiry efficiency is improved, and the storage space and the calculation resources are saved.
Description
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method, an apparatus, an electronic device, a medium, and a program product for processing a query request.
Background
The log data is data that records operations performed on the client. Currently, when log data is stored, the following methods are generally adopted: a log aggregation system (e.g., loki) is employed as a storage and query component, or an inverted index is built for the original text of the log for optimization based on building a pre-indexed.
However, the inventors found that when log data is stored in the above manner, there are often the following technical problems: when the log data volume is large, the query efficiency is low, a mode of establishing reverse indexes for optimization is required to establish a large number of front indexes, so that the final stored data is increased compared with the original content, the waste of storage space is caused, and no matter whether the log data is searched in the future or not, a large amount of computing resources are occupied due to index operation during writing, so that the waste of computing resources is caused.
The above information disclosed in this background section is only for enhancement of understanding of the background of the inventive concept and, therefore, may contain information that does not form the prior art that is already known to those of ordinary skill in the art in this country.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose query request processing methods, apparatuses, electronic devices, media, and program products to address one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a query request processing method, the method including: determining whether the received log query request contains a query key; responding to the fact that the log query request contains query keywords, and acquiring a compressed log data block set corresponding to target query conditions according to the target query conditions corresponding to the log query request; in response to determining that there are prestored non-result compressed log data blocks corresponding to the query key, filtering the set of compressed log data blocks according to the prestored non-result compressed log data blocks corresponding to the query key; according to the keyword query conditions corresponding to the query keywords, selecting each compressed log data block meeting the keyword query conditions from the filtered compressed log data block set as a log query result; and sending the obtained log query result to terminal equipment corresponding to the log query request.
Optionally, the method further comprises: generating a non-result compressed log data block set corresponding to the query keywords according to the log query results; and storing the set of the non-result compressed log data blocks.
Optionally, before the obtained log query result is sent to the terminal device corresponding to the log query request, the method further includes: and responding to the fact that the log query request does not contain query keywords, and acquiring a compressed log data block set corresponding to the query conditions as a log query result according to the query conditions corresponding to the log query request.
Optionally, the obtaining the compressed log data block set corresponding to the target query condition according to the target query condition corresponding to the log query request includes: determining a target query condition according to the log query request, wherein the log query request further comprises at least one of the following: application conditions, log path conditions, log time conditions and query quantity conditions, wherein the target query conditions comprise at least one of the following: the application condition, the log path condition, the log time condition, and the query number condition; and acquiring a compressed log data block set corresponding to the target query condition according to the determined target query condition.
Optionally, the generating a set of non-result compressed log data blocks corresponding to the query keyword according to the log query result includes: and performing intersection inversion processing on the log query result and the obtained compressed log data block set to obtain each compressed log data block as a non-result compressed log data block set corresponding to the query key word.
Optionally, the storing the set of the resultless compressed log data blocks includes: and correspondingly adding the query key words and the non-result compressed log data block set to a cache.
In a second aspect, some embodiments of the present disclosure provide a query request processing apparatus, the apparatus including: a determining unit configured to determine whether the received log query request contains a query key; an obtaining unit configured to obtain a compressed log data block set corresponding to a target query condition corresponding to the log query request according to the target query condition corresponding to the log query request in response to determining that the log query request includes a query keyword; a filtering unit configured to filter the compressed log data block set according to a prestored non-result compressed log data block corresponding to the query key in response to determining that there is a prestored non-result compressed log data block corresponding to the query key; a selection unit configured to select, from the filtered compressed log data block set, each compressed log data block satisfying the keyword query condition as a log query result according to the keyword query condition corresponding to the query keyword; and the sending unit is configured to send the obtained log query result to the terminal equipment corresponding to the log query request.
Optionally, the query request processing device further includes: a generating unit and a storing unit. The generation unit is configured to generate a no-result compressed log data block set corresponding to the query keyword according to the log query result. The storage unit is configured to store the above-described set of resultless compressed log data blocks.
Optionally, before the sending unit, the query request processing device further includes: and the compressed log data block set acquisition unit is configured to acquire a compressed log data block set corresponding to the query condition as a log query result according to the query condition corresponding to the log query request in response to determining that the log query request does not contain the query keyword.
Optionally, the acquisition unit is further configured to: determining a target query condition according to the log query request, wherein the log query request further comprises at least one of the following: application conditions, log path conditions, log time conditions and query quantity conditions, wherein the target query conditions comprise at least one of the following: the application condition, the log path condition, the log time condition, and the query number condition; and acquiring a compressed log data block set corresponding to the target query condition according to the determined target query condition.
Optionally, the generating unit is further configured to: and performing intersection inversion processing on the log query result and the obtained compressed log data block set to obtain each compressed log data block as a non-result compressed log data block set corresponding to the query key word.
Optionally, the storage unit is further configured to: and correspondingly adding the query key words and the non-result compressed log data block set to a cache.
In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors causes the one or more processors to implement the method described in any of the implementations of the first aspect above.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
In a fifth aspect, some embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
The above embodiments of the present disclosure have the following advantageous effects: by the query request processing method of some embodiments of the present disclosure, log query efficiency is improved, and storage space and computing resources are saved. Specifically, the reasons for the low efficiency of log query and the waste of storage space and computing resources are: when the log data volume is large, the query efficiency is low, a mode of establishing reverse indexes for optimization is required to establish a large number of front indexes, so that the final stored data is increased compared with the original content, the waste of storage space is caused, and no matter whether the log data is searched in the future or not, a large amount of computing resources are occupied due to index operation during writing, so that the waste of computing resources is caused. Based on this, the query request processing method of some embodiments of the present disclosure first determines whether the received log query request contains a query key. Then, in response to determining that the log query request contains a query keyword, a compressed log data block set corresponding to a target query condition corresponding to the log query request is obtained according to the target query condition. Thus, when the log query request contains a query key, the compressed log data block set can be screened out in advance. And then, in response to determining that the prestored non-result compressed log data block corresponding to the query keyword exists, filtering the compressed log data block set according to the prestored non-result compressed log data block corresponding to the query keyword. Thus, the pre-screened compressed log data block set can be filtered through pre-stored non-result compressed log data blocks with no query result according to the query key, so as to filter out the compressed log data blocks which are the same as the non-result compressed log data blocks of the query key in the compressed log data block set. And secondly, according to the keyword query conditions corresponding to the query keywords, selecting each compressed log data block meeting the keyword query conditions from the filtered compressed log data block set as a log query result. Thus, each compressed log data block meeting the keyword query condition can be screened from the filtered compressed log data block set to serve as a log query result. And finally, sending the obtained log query result to the terminal equipment corresponding to the log query request. Thus, the queried log query result can be returned to the request end. And when each compressed log data block meeting the keyword query condition is screened, the compressed log data block set is filtered in advance through the stored non-result compressed log data blocks corresponding to the query keywords, so that the query scanning time is shortened, and the query efficiency is improved. And the query is not performed in a reverse index mode, so that a large number of front indexes are not required to be established, and the storage space and the computing resource are saved. Therefore, the log query efficiency is improved, and the storage space and the computing resources are saved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is an architecture diagram of an exemplary system in which some embodiments of the present disclosure may be applied;
FIG. 2 is a schematic diagram of one application scenario of a query request processing method according to some embodiments of the present disclosure;
FIG. 3 is a flow chart of some embodiments of a query request processing method according to the present disclosure;
FIG. 4 is a flow chart of other embodiments of a query request processing method according to the present disclosure;
FIG. 5 is a schematic diagram of the architecture of some embodiments of a query request processing apparatus according to the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Operations such as collection, storage, use, etc. of personal information (e.g., log data) of a user involved in the present disclosure, and prior to performing the corresponding operations, the relevant organization or individual is up to the end to include carrying out personal information security impact assessment, fulfilling informed obligations to the personal information body, obtaining authorized consent of the personal information body in advance, etc.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 illustrates an exemplary system architecture 100 to which query request processing methods or query request processing apparatus of some embodiments of the present disclosure may be applied.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, an item information presentation class application, a search class application, an instant messaging tool, a mailbox client, social platform software, and the like, may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting information display, including but not limited to smartphones, tablet computers, electronic book readers, laptop and desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices. It may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server providing support for information displayed on the terminal devices 101, 102, 103. The background server may analyze and process the received data such as the query request, and feed back the processing result (for example, the log query result) to the terminal device.
It should be noted that, the query request processing method provided by the embodiments of the present disclosure may be executed by the server 105. Accordingly, the query request processing means may be provided in the server 105. The present invention is not particularly limited herein.
The server may be hardware or software. When the server is hardware, the server may be implemented as a distributed server cluster formed by a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 is a schematic diagram of one application scenario of a query request processing method of some embodiments of the present disclosure.
In the application scenario of fig. 2, first, the computing device 201 may determine whether the received log query request 202 contains a query key. Then, in response to determining that the log query request 202 includes a query key, the computing device 201 may obtain, according to a target query condition 203 corresponding to the log query request 202, a compressed set of log data blocks 204 corresponding to the target query condition 203. Thereafter, the computing device 201 may filter the set 204 of compressed log data blocks based on the pre-stored non-result compressed log data blocks 205 corresponding to the query key in response to determining that there are pre-stored non-result compressed log data blocks corresponding to the query key. Next, the computing device 201 may select, according to the keyword query condition 206 corresponding to the query keyword, each compressed log data block satisfying the keyword query condition 206 from the filtered compressed log data block set 207 as the log query result 208. Finally, the computing device 201 may send the obtained log query result 208 to the terminal device 209 corresponding to the log query request 202 described above.
The computing device 201 may be hardware or software. When the computing device is hardware, the computing device may be implemented as a distributed cluster formed by a plurality of servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices listed above. It may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
It should be understood that the number of computing devices in fig. 2 is merely illustrative. There may be any number of computing devices, as desired for an implementation.
With continued reference to fig. 3, a flow 300 of some embodiments of a query request processing method according to the present disclosure is shown. The query request processing method comprises the following steps:
step 301 determines whether the received log query request contains a query key.
In some embodiments, an executing body of the query request processing method (e.g., a server as shown in fig. 1) may determine whether a received log query request contains a query key. The log query request may be a request sent by a user for querying log data. The log query request may include, but is not limited to, at least one of the following: query key, log size. The log query request may be sent by the user through a terminal device in a wired connection manner or a wireless connection manner. The above-mentioned query keyword may be a keyword for query log data. The log size described above may be used to define the size of the log data of the query. It should be noted that the wireless connection may include, but is not limited to, 3G/4G connections, wiFi connections, bluetooth connections, wiMAX connections, zigbee connections, UWB (ultra wideband) connections, and other now known or later developed wireless connection means. In practice, the executing entity may determine, in response to receiving a log query request, whether the log query request contains a query key.
In some embodiments, the executing entity may obtain, in response to determining that the log query request includes a query key, a compressed set of log data blocks corresponding to a target query condition corresponding to the log query request. The target query condition may be a query constraint that does not include a keyword query condition corresponding to the query keyword. For example, the target query condition may be a log-size query condition. For example, the log size query condition may be that the size of the compressed log data block is equal to or smaller than a preset size. The setting of the preset size is not limited. For example, the preset size may be 1M. The compressed log data block may be a compressed log data block. A log data block may be data in which log data itself is compressed and stored in the form of a block. The log data blocks may be stored in an object store or in a local file system. For example, the log data block may be Chunk in Loki. In practice, the execution body may acquire, from the stored compressed log data blocks, compressed log data blocks satisfying the target query condition as a compressed log data block set.
In some optional implementations of some embodiments, the executing entity may obtain the compressed log data block set corresponding to the target query condition according to the target query condition corresponding to the log query request by:
and step one, determining target query conditions according to the log query request. Wherein, the log query request may further include at least one of the following: application conditions, log path conditions, log time conditions, and query number conditions. The application condition may be that an application identifier corresponding to the compressed log data block is a query application identifier. The application identification described above may be used to represent an application. For example, the application identification may be an application name. The query application identification may be an application identification for querying log data included in the log query request. The log path condition may be that a path corresponding to the compressed log data block is a query log path. The query log path may be a retrieval path of log data included in the above-described log query request for querying the log data. The time query condition may be that a storage time corresponding to the compressed log data block is within a query log storage time period. The time inquiry condition may be that the record time corresponding to the compressed log data block is within the inquiry log record time period. The query log storage time period may include a time period for querying log data according to the storage time for the above-described log query request. The query log recording period may be a period for querying log data according to a recording time included in the above-described log query request. The above-mentioned query number condition may be that the number of the queried compressed log data blocks is the query number. The number of queries may be the number of log data that need to be queried. The target query condition includes at least one of the following: the application condition, the log path condition, the log time condition, and the query number condition. In practice, the execution body may combine the application condition, the log path condition, the log time condition, and the query number condition as target query conditions in response to determining that the log query request includes an application identification, a log path, log time information, and query number information.
It will be appreciated that the sub-conditions included in the determined target query condition may be determined based on conditions included in the log query request other than the keyword query condition. Each sub-condition included in the determined target query condition corresponds to each condition except the keyword query condition included in the log query request one by one.
And secondly, acquiring a compressed log data block set corresponding to the target query condition according to the determined target query condition. Thus, the conditions other than the conditions corresponding to the query keyword can be combined as the target query condition.
In some embodiments, the execution body may filter the compressed log data block set according to the prestored non-result compressed log data block corresponding to the query key in response to determining that there is a prestored non-result compressed log data block corresponding to the query key. The non-result compressed log data block corresponding to the query keyword may be a compressed log data block that cannot be queried according to the query keyword. Here, the number of the non-result compressed log data blocks corresponding to the query key may be one or a plurality, and may be determined by the number of the non-result compressed log data blocks corresponding to the query key stored in advance. In practice, the execution body may determine a prestored resultless compressed log data block corresponding to the query key as a resultless compressed log data block set. Then, each compressed log data block that is identical to each of the non-result compressed log data blocks in the set of non-result compressed log data blocks may be deleted from the set of compressed log data blocks to filter the set of compressed log data blocks.
And step 304, selecting each compressed log data block meeting the keyword query conditions from the filtered compressed log data block set as a log query result according to the keyword query conditions corresponding to the query keywords.
In some embodiments, the execution body may select, according to a keyword query condition corresponding to the query keyword, each compressed log data block that satisfies the keyword query condition from the filtered compressed log data block set as a log query result. The keyword query condition may be a condition that the log data is queried by the query keyword. For example, the keyword query condition may be that the keyword corresponding to the compressed log data block includes the query keyword. In practice, the execution body may select each compressed log data block whose corresponding keyword includes the query keyword from the filtered compressed log data block set. The selected individual compressed log data blocks may then be determined as log query results.
Optionally, the executing body may further obtain, as the log query result, a compressed log data block set corresponding to the query condition according to the query condition corresponding to the log query request in response to determining that the log query request does not include the query keyword. The query condition may be a condition that the log data to be queried is required to be satisfied by the log query request. In practice, the execution body may acquire, from the stored compressed log data blocks, the compressed log data blocks satisfying the query condition as the compressed log data block set. The resulting set of compressed log data blocks may then be determined as log query results. Therefore, when the log query request does not contain the query keyword, the log query result can be directly obtained according to the query condition corresponding to the log query request.
And step 305, sending the obtained log query result to the terminal equipment corresponding to the log query request.
In some embodiments, the execution body may send the obtained log query result to a terminal device corresponding to the log query request. The terminal device may be a device that sends the log query request. In practice, the execution body may send the log query result to the terminal device through a wired connection manner or a wireless connection manner.
The above embodiments of the present disclosure have the following advantageous effects: by the query request processing method of some embodiments of the present disclosure, log query efficiency is improved, and storage space and computing resources are saved. Specifically, the reasons for the low efficiency of log query and the waste of storage space and computing resources are: when the log data volume is large, the query efficiency is low, a mode of establishing reverse indexes for optimization is required to establish a large number of front indexes, so that the final stored data is increased compared with the original content, the waste of storage space is caused, and no matter whether the log data is searched in the future or not, a large amount of computing resources are occupied due to index operation during writing, so that the waste of computing resources is caused. Based on this, the query request processing method of some embodiments of the present disclosure first determines whether the received log query request contains a query key. Then, in response to determining that the log query request contains a query keyword, a compressed log data block set corresponding to a target query condition corresponding to the log query request is obtained according to the target query condition. Thus, when the log query request contains a query key, the compressed log data block set can be screened out in advance. And then, in response to determining that the prestored non-result compressed log data block corresponding to the query keyword exists, filtering the compressed log data block set according to the prestored non-result compressed log data block corresponding to the query keyword. Thus, the pre-screened compressed log data block set can be filtered through pre-stored non-result compressed log data blocks with no query result according to the query key, so as to filter out the compressed log data blocks which are the same as the non-result compressed log data blocks of the query key in the compressed log data block set. And secondly, according to the keyword query conditions corresponding to the query keywords, selecting each compressed log data block meeting the keyword query conditions from the filtered compressed log data block set as a log query result. Thus, each compressed log data block meeting the keyword query condition can be screened from the filtered compressed log data block set to serve as a log query result. And finally, sending the obtained log query result to the terminal equipment corresponding to the log query request. Thus, the queried log query result can be returned to the request end. And when each compressed log data block meeting the keyword query condition is screened, the compressed log data block set is filtered in advance through the stored non-result compressed log data blocks corresponding to the query keywords, so that the query scanning time is shortened, and the query efficiency is improved. And the query is not performed in a reverse index mode, so that a large number of front indexes are not required to be established, and the storage space and the computing resource are saved. Therefore, the log query efficiency is improved, and the storage space and the computing resources are saved.
With further reference to FIG. 4, a flow 400 of further embodiments of a query request processing method is shown. The flow 400 of the query request processing method includes the following steps:
And step 404, selecting each compressed log data block meeting the keyword query conditions from the filtered compressed log data block set as a log query result according to the keyword query conditions corresponding to the query keywords.
And step 405, sending the obtained log query result to the terminal equipment corresponding to the log query request.
In some embodiments, the specific implementation of steps 401-405 and the technical effects thereof may refer to steps 301-305 in those embodiments corresponding to fig. 3, which are not described herein.
And step 406, generating a non-result compressed log data block set corresponding to the query keywords according to the log query results.
In some embodiments, the execution body of the query request processing method (such as the server shown in fig. 1) may generate a set of resultless compressed log data blocks corresponding to the query key according to the log query result. In practice, the execution body may perform intersection inversion processing on the log query result and the filtered compressed log data block set, to obtain each compressed log data block as a non-result compressed log data block set corresponding to the query keyword.
In some optional implementations of some embodiments, the execution body may perform intersection inverse processing on the log query result and the obtained compressed log data block set, to obtain each compressed log data block as a non-result compressed log data block set corresponding to the query key. Thus, the resulting set of resultless compressed log data blocks may be used to pre-filter the compressed log data blocks the next time log data is queried according to the query key.
In some embodiments, the execution body may store the set of resultless compressed log data blocks. In practice, the execution body may add each of the above-mentioned sets of the above-mentioned non-result compressed log data blocks to the stored set of the non-result compressed log data blocks corresponding to the above-mentioned query key, so as to update the stored set of the non-result compressed log data blocks corresponding to the above-mentioned query key.
In some optional implementations of some embodiments, the execution body may add the query key and the set of resultless compressed log data blocks to a cache, respectively. In practice, the execution body may add each of the above-mentioned sets of non-result compressed log data blocks to the cached set of non-result compressed log data blocks corresponding to the above-mentioned query key to update the cached set of non-result compressed log data blocks corresponding to the above-mentioned query key. Thus, each of the unobtrusive compressed log data blocks corresponding to the query key may be stored in a cached manner.
As can be seen in FIG. 4, flow 400 of the query request processing method in some embodiments corresponding to FIG. 4 embodies the steps of storing an expanded set of resultless compressed log data blocks corresponding to a query key, as compared to the description of some embodiments corresponding to FIG. 3. Thus, the embodiments describe schemes that enable pre-filtering compressed log data blocks through a set of resultless compressed log data blocks corresponding to a query key the next time log data is queried according to the query key.
With further reference to fig. 5, as an implementation of the method shown in the foregoing figures, the present disclosure provides some embodiments of a query request processing apparatus, which correspond to those method embodiments shown in fig. 3, and which are particularly applicable to various electronic devices.
As shown in fig. 5, the query request processing apparatus 500 of some embodiments includes: a determining unit 501, an acquiring unit 502, a filtering unit 503, a selecting unit 504, and a transmitting unit 505. Wherein the determining unit 501 is configured to determine whether the received log query request contains a query key; the obtaining unit 502 is configured to obtain, in response to determining that the log query request includes a query keyword, a compressed log data block set corresponding to a target query condition corresponding to the log query request according to the target query condition; the filtering unit 503 is configured to filter the set of compressed log data blocks according to the prestored non-result compressed log data blocks corresponding to the query key in response to determining that there is a prestored non-result compressed log data block corresponding to the query key; the selecting unit 504 is configured to select, according to a keyword query condition corresponding to the query keyword, each compressed log data block satisfying the keyword query condition from the filtered compressed log data block set as a log query result; the transmitting unit 505 is configured to transmit the obtained log query result to the terminal device corresponding to the above log query request.
Optionally, the query request processing apparatus 500 may further include: a generation unit and a storage unit (not shown in the figure). The generation unit is configured to generate a no-result compressed log data block set corresponding to the query keyword according to the log query result. The storage unit is configured to store the above-described set of resultless compressed log data blocks.
Optionally, before the sending unit 505, the query request processing apparatus 500 may further include: a compressed log data block set obtaining unit (not shown in the figure) configured to obtain, as a log query result, a compressed log data block set corresponding to a query condition corresponding to the log query request according to the query condition corresponding to the log query request, in response to determining that the log query request does not contain a query keyword.
Optionally, the acquisition unit 502 may be further configured to: determining a target query condition according to the log query request, wherein the log query request further comprises at least one of the following: application conditions, log path conditions, log time conditions and query quantity conditions, wherein the target query conditions comprise at least one of the following: the application condition, the log path condition, the log time condition, and the query number condition; and acquiring a compressed log data block set corresponding to the target query condition according to the determined target query condition.
Optionally, the generating unit may be further configured to: and performing intersection inversion processing on the log query result and the obtained compressed log data block set to obtain each compressed log data block as a non-result compressed log data block set corresponding to the query key word.
Optionally, the storage unit may be further configured to: and correspondingly adding the query key words and the non-result compressed log data block set to a cache.
It will be appreciated that the elements described in the apparatus 500 correspond to the various steps in the method described with reference to fig. 3. Thus, the operations, features and resulting benefits described above with respect to the method are equally applicable to the apparatus 500 and the units contained therein, and are not described in detail herein.
Referring now to fig. 6, a schematic diagram of an electronic device 600 (e.g., a server in fig. 1) suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means 601 (e.g., a central processor, a graphics processor, etc.) that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 6 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communications device 609, or from storage device 608, or from ROM 602. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that, the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining whether the received log query request contains a query key; responding to the fact that the log query request contains query keywords, and acquiring a compressed log data block set corresponding to target query conditions according to the target query conditions corresponding to the log query request; in response to determining that there are prestored non-result compressed log data blocks corresponding to the query key, filtering the set of compressed log data blocks according to the prestored non-result compressed log data blocks corresponding to the query key; according to the keyword query conditions corresponding to the query keywords, selecting each compressed log data block meeting the keyword query conditions from the filtered compressed log data block set as a log query result; and sending the obtained log query result to terminal equipment corresponding to the log query request.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes a determining unit, an acquiring unit, a filtering unit, a selecting unit, and a transmitting unit. Where the names of the units do not constitute a limitation on the unit itself in some cases, for example, the determining unit may also be described as "unit that determines whether the received log query request contains a query key".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
Some embodiments of the present disclosure also provide a computer program product comprising a computer program which, when executed by a processor, implements any of the above-described query request processing methods.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.
Claims (10)
1. A query request processing method, comprising:
determining whether the received log query request contains a query key;
responding to the fact that the log query request contains query keywords, and acquiring a compressed log data block set corresponding to target query conditions according to the target query conditions corresponding to the log query request;
in response to determining that there are prestored non-result compressed log data blocks corresponding to the query key, filtering the set of compressed log data blocks according to the prestored non-result compressed log data blocks corresponding to the query key;
According to the keyword query conditions corresponding to the query keywords, selecting each compressed log data block meeting the keyword query conditions from the filtered compressed log data block set as a log query result;
and sending the obtained log query result to terminal equipment corresponding to the log query request.
2. The method of claim 1, wherein the method further comprises:
generating a non-result compressed log data block set corresponding to the query keyword according to the log query result;
and storing the non-result compressed log data block set.
3. The method of claim 1, wherein prior to said sending the resulting log query result to the terminal device corresponding to the log query request, the method further comprises:
and responding to the fact that the log query request does not contain query keywords, and acquiring a compressed log data block set corresponding to the query conditions as a log query result according to the query conditions corresponding to the log query request.
4. The method of claim 1, wherein the obtaining, according to the target query condition corresponding to the log query request, the compressed log data block set corresponding to the target query condition includes:
Determining a target query condition according to the log query request, wherein the log query request further comprises at least one of the following: application conditions, log path conditions, log time conditions, query number conditions, the target query conditions including at least one of: the application condition, the log path condition, the log time condition, the query number condition;
and acquiring a compressed log data block set corresponding to the target query condition according to the determined target query condition.
5. The method of claim 2, wherein the generating a set of resultless compressed log data blocks corresponding to the query key from the log query results comprises:
and performing intersection inversion processing on the log query result and the obtained compressed log data block set to obtain each compressed log data block as a non-result compressed log data block set corresponding to the query keyword.
6. The method of claim 2, wherein the storing the set of resultless compressed log data blocks comprises:
and correspondingly adding the query keyword and the non-result compressed log data block set to a cache.
7. A query request processing apparatus comprising:
a determining unit configured to determine whether the received log query request contains a query key;
an obtaining unit, configured to obtain a compressed log data block set corresponding to a target query condition corresponding to the log query request according to the target query condition corresponding to the log query request in response to determining that the log query request contains a query keyword;
a filtering unit configured to filter the compressed log data block set according to a prestored non-result compressed log data block corresponding to the query key in response to determining that there is a prestored non-result compressed log data block corresponding to the query key;
a selection unit configured to select, according to a keyword query condition corresponding to the query keyword, each compressed log data block satisfying the keyword query condition from the filtered compressed log data block set as a log query result;
and the sending unit is configured to send the obtained log query result to the terminal equipment corresponding to the log query request.
8. An electronic device, comprising:
one or more processors;
A storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
9. A computer readable medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the method of any of claims 1-6.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310183887.1A CN116303988A (en) | 2023-02-20 | 2023-02-20 | Query request processing method, device, electronic equipment, medium and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310183887.1A CN116303988A (en) | 2023-02-20 | 2023-02-20 | Query request processing method, device, electronic equipment, medium and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116303988A true CN116303988A (en) | 2023-06-23 |
Family
ID=86833531
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310183887.1A Pending CN116303988A (en) | 2023-02-20 | 2023-02-20 | Query request processing method, device, electronic equipment, medium and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116303988A (en) |
-
2023
- 2023-02-20 CN CN202310183887.1A patent/CN116303988A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111679990B (en) | Test data generation method and device, readable medium and electronic equipment | |
JP2021103506A (en) | Method and device for generating information | |
CN110781373B (en) | List updating method and device, readable medium and electronic equipment | |
CN110909521A (en) | Synchronous processing method and device for online document information and electronic equipment | |
CN111125107A (en) | Data processing method, device, electronic equipment and medium | |
CN111400625B (en) | Page processing method and device, electronic equipment and computer readable storage medium | |
CN115757400B (en) | Data table processing method, device, electronic equipment and computer readable medium | |
CN111241137A (en) | Data processing method and device, electronic equipment and storage medium | |
CN113918659A (en) | Data operation method and device, storage medium and electronic equipment | |
CN113515576A (en) | Data processing method and device, electronic equipment and computer readable medium | |
CN112131181A (en) | Storage path display method and device and electronic equipment | |
CN112507676B (en) | Method and device for generating energy report, electronic equipment and computer readable medium | |
CN111460020B (en) | Method, device, electronic equipment and medium for resolving message | |
CN115269645A (en) | Information query method and device, electronic equipment and computer readable medium | |
CN116303988A (en) | Query request processing method, device, electronic equipment, medium and program product | |
CN114490718A (en) | Data output method, data output device, electronic equipment and computer readable medium | |
CN110113416B (en) | Method and device for displaying information | |
CN110941683B (en) | Method, device, medium and electronic equipment for acquiring object attribute information in space | |
CN111460273B (en) | Information pushing method and device | |
CN113722315A (en) | Data generation method and device, electronic equipment and computer readable medium | |
CN115080521A (en) | Information display method and device, electronic equipment and storage medium | |
CN111581246A (en) | Method, device, electronic equipment and computer readable medium for generating data | |
CN111787043A (en) | Data request method and device | |
CN117692672B (en) | Snapshot-based video information sending method and device, electronic equipment and medium | |
CN116820354B (en) | Data storage method, data storage device and data storage system |
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 |