Log data query method and device, computer equipment and storage medium
By performing word segmentation processing on event description information and target log data, extracting and matching keywords, combining preset fields and language conversion, the existing log query methods are complicated and poor language adaptability are solved, and efficient and accurate log query is achieved , improving user experience and storage efficiency.
Patent Information
- Application Number
- CN202411489453.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-10-24
AI Technical Summary
In a multi-language environment, the existing log query methods are cumbersome, require multiple steps and cannot perform fuzzy matching query, poor user experience, and difficult to adapt to the needs of different languages.
By performing word segmentation processing on event description information and target log data, the target keywords are extracted to match the data fragments, the historical log data is parsed using preset fields, and the mapping relationship between keywords and data fragments is constructed, and language conversion and fuzzy matching query is supported. Improve query efficiency and accuracy.
It simplifies user query operations, improves query efficiency and accuracy, adapts to the needs of different languages, enhances user experience, and saves storage space.
Smart Images

Figure CN119201853A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of log processing, and in particular to a method, device, computer equipment and storage medium for querying log data. Background Art
[0002] In a multilingual environment, logs need to support multiple language displays. Generally, logs are divided into variable parts and immutable parts. The operations within the group are immutable, such as "xxx joins the group", "xxx leaves the group", etc. The other part is the variable part, that is, the specific group user nicknames that join and the group user nicknames that leave the group. Then, the immutable group operations are traversed and enumerated, and the texts of various languages of the log operations related to the group operations are stored on the server. For the variable part: the nickname of the group user, there is no need to internationalize it and it can be directly stored. When querying, you only need to obtain the language text corresponding to the corresponding immutable operation according to the language selected by the client, and then replace the placeholder. In this way, you can get the complete group log information in the specified language.
[0003] However, when searching, the query requires a combination of multiple query conditions. The user needs to select the corresponding group operation, and then enter the nickname of the operator or the person being queried, and perform a logical AND combination of the two to filter and query the group logs that meet the conditions. This operation is cumbersome for users, requiring multiple steps to query data, and fuzzy matching queries cannot be performed. Summary of the invention
[0004] In view of this, the present invention provides a log data query method, apparatus, computer equipment and storage medium, which can effectively improve query efficiency and user experience, and can also adapt to the needs of different languages.
[0005] In a first aspect, the present invention provides a method for querying log data, which is applied to a server and includes: obtaining a log query request sent by a client to a target group, wherein the log query request includes event description information; performing word segmentation processing on the event description information to obtain multiple target keywords, and performing word segmentation processing on target log data corresponding to the target group to obtain multiple data segments, wherein the target log data is screened from historical log data of the target group; matching the target keywords with the data segments to obtain the target data segments hit by the target keywords; and querying the corresponding group log data from the target data segments using the target keywords. The log data query method provided by the embodiment of the present invention performs word segmentation processing on the event description information input by the user and the target log data corresponding to the target group when querying the log data required by the user. After the word segmentation processing of the event description information, multiple target keywords are obtained. After the word segmentation processing of the target log data, multiple data fragments are obtained, so that the target keywords and each data fragment can be matched to obtain the group log number required by the user. When executing the log data query of this embodiment, since the server will perform word segmentation processing on the event description information after receiving the event description information, the user can only enter the event description information containing multiple keywords in one input box, the user can flexibly enter the query information, and does not need to enter the query information in a specific format, and the user's query operation is simpler.
[0006] In an optional implementation, the event description information is segmented to obtain multiple target keywords, including: detecting a keyword set carried in the event description information, and filtering out target keywords that match preset fields from the keyword set, wherein the preset fields are determined based on context information of the group chat operation event, and the preset fields include at least: an operation object, an operation code, a user identifier, and an operation content. The query method for log data provided by the embodiment of the present invention detects a keyword set carried in event description information, and filters out target keywords that match preset fields from the keyword set. Through keyword extraction and screening, key information related to group chat operation events can be accurately extracted from the event description information, thereby avoiding omission or misjudgment of information and improving processing efficiency. The setting of preset fields can be flexibly adjusted according to actual needs and context information of group chat operation events, thereby improving the flexibility of the system.
[0007] In an optional implementation, it includes: obtaining historical log data of a target group, parsing the historical log data according to preset fields, obtaining keywords corresponding to the preset fields, extracting data segments matching the keywords from the historical log data, constructing a mapping relationship between the keywords and the data segments, and storing the mapping relationship.
[0008] The log data query method provided by the embodiment of the present invention obtains the historical log data of the target group, parses the historical log data according to preset fields, obtains the keywords corresponding to the preset fields, extracts the data segments matching the keywords from the historical log data, constructs the mapping relationship between the keywords and the data segments, and stores the mapping relationship. By parsing the historical log data by preset fields, the log entries containing key information can be quickly located, the efficiency of data retrieval is improved, and by extracting keywords and data segments, the storage of redundant information is avoided, and the storage space is effectively saved.
[0009] In an optional embodiment, before performing word segmentation processing on the target log data corresponding to the target group to obtain multiple data segments, it includes: obtaining business requirements from the log query request, and obtaining a preset number of original log data before the current time from the historical log data, obtaining the original language corresponding to the original log data, if the original language is inconsistent with the target language corresponding to the business requirement, then converting the original log data according to the target language, and using the converted original log data as the target log data, or, if the original language is consistent with the target language corresponding to the business requirement, then using the original log data as the target log data. The log data query method provided in the embodiment of the present invention can convert the original log data into the target language specified by the business needs through language conversion, thereby meeting the data analysis requirements in different languages, and can ensure that there is no language misunderstanding or ambiguity in the log data during the understanding and analysis process, thereby improving the accuracy of the data.
[0010] In an optional embodiment, the target keyword is matched with the data segment to obtain the target data segment hit by the target keyword, including: obtaining the candidate data segment corresponding to the target keyword from the data segment based on the mapping relationship, querying whether the log query request carries the specified log source, if the log query request carries the specified log source, then obtaining the target data segment belonging to the log source from the candidate data segment; or, if the log query request does not carry the specified log source, then using the candidate data segment as the target data segment.
[0011] The log data query method provided by the embodiment of the present invention directly locates the candidate data segments related to the target keyword through mapping relationships, reduces the interference of irrelevant data, and improves the accuracy of data retrieval. When the log query request carries a specified log source, the data belonging to the source is further screened from the candidate data segments, ensuring the source consistency of the data and further improving the accuracy of data retrieval.
[0012] In an optional embodiment, after querying the corresponding group log data from the target data segment using the target keyword, it includes: obtaining a preset indicator for measuring relevance, calculating the indicator score of each log data in the group log data in the preset indicator, calculating the comprehensive score of the corresponding log data based on the indicator score of each log data in the preset indicator, sorting each log data in the group log data in order from high to low according to the comprehensive score, and sending the sorted group log data to the client.
[0013] The log data query method provided by the embodiment of the present invention calculates the comprehensive score of each log data through preset indicators, and sorts the log data according to the scores, so that the most relevant and valuable log data can be displayed to the user first, thereby improving the efficiency and accuracy of information retrieval. In an optional implementation, after sending the sorted group log data to the client, it includes: receiving evaluation information fed back by the client based on the sorted group log data, and adjusting the weights of preset indicators for measuring relevance based on the evaluation information, wherein the weights of the preset indicators are used to calculate the comprehensive score. The log data query method provided in the embodiment of the present invention adjusts the weights of preset indicators for measuring relevance based on the evaluation information fed back by the client based on the sorted group log data, thereby providing users with customized log data sorting results, enabling users to find required information more quickly and optimizing the user experience. In a second aspect, the present invention provides a log data query device, comprising: an acquisition module, a processing module, a matching module and a query module, the acquisition module being used to acquire a log query request sent by a client to a target group, wherein the log query request includes event description information, the processing module being used to perform word segmentation processing on the event description information to obtain multiple target keywords, and to perform word segmentation processing on target log data corresponding to the target group to obtain multiple data segments, wherein the target log data is screened from the historical log data of the target group, the matching module being used to match the data segments using the target keywords to obtain the target data segments hit by the target keywords, and the query module being used to query the corresponding group log data from the target data segments using the target keywords.
[0014] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the upgrade method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0015] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the log data query method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 is a flow chart of a method for querying log data according to an embodiment of the present invention; Figure 2 is a flow chart of another log data query method according to an embodiment of the present invention; Figure 3 is a flow chart of another method for querying log data according to an embodiment of the present invention; Figure 4 is a structural block diagram of a log data query device according to an embodiment of the present invention; Figure 5 It is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0019] The query method for log data provided by the embodiment of the present invention can be applied to enterprise IT system monitoring and management, cloud computing and big data platform, network security and auditing, software development and testing and other fields or scenarios with the increasing development of computer systems and software applications. Different fields or scenarios require querying and analyzing log data, which is conducive to better understanding user needs. After receiving the log query request, the server performs word segmentation processing on the event description information and breaks the event description information into multiple keywords. At the same time, the server selects the target log data from the historical log data of the target group and performs word segmentation processing, cutting it into multiple data segments, matching the target keywords with the data segments, finding the data segments containing the target keywords, and querying and extracting the corresponding group log data from the target data segments using the target keywords. After the query is completed, the queried group log data is returned to the client for the user to view and use, which can improve the query efficiency and user experience, and can also adapt to the needs of different languages.
[0020] Currently, the query method for log data requires a combination of multiple query conditions. Users need to select the corresponding group operation, and then enter the nickname of the operator or the person being queried, and perform a logical AND combination of the two to filter and query the group logs that meet the conditions. This operation is cumbersome for users, requiring multiple steps to query data, and fuzzy matching queries cannot be performed.
[0021] The present invention provides a method for querying log data. By performing word segmentation processing on event description information and target log data, target keywords are used to match data fragments, and corresponding group log data is queried and extracted. This method can improve query efficiency and user experience, and can also adapt to the needs of different languages. According to an embodiment of the present invention, an embodiment of a method for querying log data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0022] In this embodiment, a method for querying log data is provided, which can be used for the above-mentioned server. Figure 1 is a flow chart of a method for querying log data according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps: Step S101: obtaining a log query request sent by a client to a target group, wherein the log query request includes event description information.
[0023] In an optional embodiment, the event description information can indicate the specific event or operation that the client wishes to query, and can determine the range of log data that needs to be retrieved and returned. By providing the event description information, the client can help the server or log management system locate relevant log records more quickly.
[0024] In an optional embodiment, after the user operates the target group, log data will be generated. The log data includes but is not limited to information such as the operator information, the operated person information, and the operation action. The above information can be arbitrarily combined to form the log data. For example, the log data can be "user A joins the group". In this log data, the operator information is "user A" and the operation action is "join the group". After the target group is operated multiple times, a large amount of log data will be generated. The user needs to send the event description information to the server through the client, and the server will query the log data required by the user from multiple log data according to the event description information.
[0025] Step S102 , segmenting the event description information to obtain a plurality of target keywords, and segmenting the target log data corresponding to the target group to obtain a plurality of data segments, wherein the target log data is screened from the historical log data of the target group.
[0026] In an optional embodiment, word segmentation processing cuts the continuous text in the event description information into independent, meaningful words or phrases. These words or phrases (i.e., target keywords) can accurately reflect the key information of the event. Through the target keywords, the log data related to the target group can be more accurately located.
[0027] In an optional embodiment, historical log data of the target group is segmented and cut into multiple data segments. These data segments contain key information in the group chat log data. By matching with target keywords, log data segments related to event description information can be quickly found.
[0028] Step S103, matching the target keyword with the data segment to obtain the target data segment hit by the target keyword.
[0029] In an optional embodiment, the target keywords obtained after word segmentation processing are the core components of the event description information. By matching these keywords with data fragments in the group chat log data, the log content related to the query event can be accurately located, thereby improving the accuracy and efficiency of the query. User query needs are diverse, and through keyword matching, it is possible to flexibly filter and sort according to user needs to meet diverse query needs.
[0030] Step S104: Query corresponding group log data from the target data segment using the target keyword.
[0031] The log data query method provided by the embodiment of the present invention performs word segmentation processing on the event description information input by the user and the target log data corresponding to the target group when querying the log data required by the user. After the word segmentation processing of the event description information, multiple target keywords are obtained. After the word segmentation processing of the target log data, multiple data fragments are obtained, so that the target keywords and each data fragment can be matched to obtain the group log number required by the user. When executing the log data query of this embodiment, since the server will perform word segmentation processing on the event description information after receiving the event description information, the user can only enter the event description information containing multiple keywords in one input box, the user can flexibly enter the query information, and does not need to enter the query information in a specific format, and the user's query operation is simpler.
[0032] In this embodiment, a method for querying log data is provided, which can be used for the above-mentioned server. Figure 2FIG. 1 is a flowchart of another method for querying log data according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps: Step S201: Obtain a log query request sent by a client to a target group, wherein the log query request includes event description information. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0033] Step S202: According to the business requirements in the log query request, a preset amount of original log data is obtained from the historical log data, and the original log data is converted into a target language as required to obtain target log data.
[0034] Specifically, the above step S202 includes: Step S2021, obtaining business requirements from the log query request, and obtaining a preset amount of original log data before the current time from the historical log data.
[0035] In an optional embodiment, when the group chat is established for a long time, the amount of log data corresponding to the target group is large. If the event description information in the log query request is compared with each log in turn each time a log query request is executed, the amount of calculation is large. Moreover, when users usually perform log queries, the query demand for logs that are far away from the current time is relatively small. Therefore, a preset number of original log data before the current time can be obtained from the historical log data, and the log corresponding to the event description information can be queried from the original log data, which reduces the amount of calculation and can basically meet user needs.
[0036] In an optional embodiment, if the user needs to query the required information from all logs since the target group was established, the target identifier can be added to the log query request. After the server receives the log query request, if it determines that the log query request contains the target identifier, there is no need to obtain a preset number of original log data before the current time from the historical log data, but all historical log data will be used as original log data.
[0037] In an optional embodiment, the preset number can be set according to actual needs. For example, 10,000 logs before the current time can be selected as the original log data, which is not specifically limited in the embodiment of the present invention.
[0038] Step S2022, obtaining the original language corresponding to the original log data.
[0039] The language corresponding to the original log data refers to the language type used when the log data is stored. Exemplarily, the original language may be Chinese, English, Japanese, etc.
[0040] Step S2023, determining whether the original language is consistent with the target language corresponding to the business requirement.
[0041] In an optional embodiment, the language corresponding to the business requirement may be the language used when the client sends event description information to the server.
[0042] If the original language is inconsistent with the target language corresponding to the business requirement, the original log data is converted according to the target language, and the converted original log data is used as the target log data; If the original language is consistent with the target language corresponding to the business requirement, the original log data is used as the target log data.
[0043] In an optional embodiment, the language of the data is ensured to be consistent with the business requirements to avoid misunderstandings or errors caused by language barriers. The data is ensured to be consistent with the user's requirements through language conversion. For data that does not need to be converted, it is directly used as the target data to reduce unnecessary processing steps.
[0044] For example, if the language used by the client to send event description information to the server is Chinese, and the original language used when the original log data is stored is also Chinese, there is no need to translate the original log data, and the original log data can be used as the target log data; If the language used by the client to send event description information to the server is Chinese, and the original language used when the original log data is stored is English, then in order to facilitate query, the original log data needs to be translated into Chinese, and the translated original log data is used as the target log data.
[0045] In an optional embodiment, through language conversion, the original log data can be converted into the target language specified by the business needs, thereby meeting the data analysis requirements in different languages, ensuring that there is no language misunderstanding or ambiguity in the log data during the understanding and analysis process, thereby improving the accuracy of the data.
[0046] Step S203, performing word segmentation processing on the event description information to obtain multiple target keywords, and performing word segmentation processing on the target log data corresponding to the target group to obtain multiple data segments, wherein the target log data is screened from the historical log data of the target group. Specifically, the above step S203 includes: Step S2031, obtaining historical log data of the target group.
[0047] In an optional embodiment, log data analysis is performed on a specific group chat to obtain more targeted results.
[0048] Step S2032: parsing the historical log data according to the preset fields to obtain keywords corresponding to the preset fields, and extracting data segments matching the keywords from the historical log data.
[0049] In an optional embodiment, preset fields are extracted from log data to quickly locate key information in the log data. The log data is parsed based on the preset fields. Log data is usually stored in text form, and each log may contain information from multiple fields. The log data is further filtered based on keywords, and data fragments matching the keywords are extracted from the parsed log data.
[0050] Step S2033: construct a mapping relationship between keywords and data segments, and store the mapping relationship. In an optional embodiment, by parsing historical log data through preset fields, log entries containing key information can be quickly located, improving the efficiency of data retrieval, and by extracting keywords and data fragments, the storage of redundant information is avoided, effectively saving storage space. Step S204: Match the target keyword with the data segment to obtain the target data segment hit by the target keyword.
[0051] Specifically, the above step S204 includes: Step S2041: acquiring candidate data segments corresponding to the target keyword from the data segments based on the mapping relationship.
[0052] In an optional embodiment, the mapping relationship is used to quickly locate data segments related to the target keyword, namely, candidate data segments, thereby improving query efficiency and reducing unnecessary operations.
[0053] Step S2042, query whether the log query request carries a specified log source.
[0054] If the log query request carries a specified log source, then the target data segment belonging to the log source is obtained from the candidate data segments; If the log query request does not carry a specified log source, the candidate data segment is used as the target data segment. In an optional embodiment, when processing a user's log query request, it is first checked whether a specific log source is clearly stated in the request. If the user specifies the log source in the query request, data segments that match the log source are further filtered out from the previously filtered candidate data segments. The data segments that have undergone secondary filtering are target data segments, which accurately meet the user's query requirements. If the user does not specify the log source in the query request, it is assumed that the user wishes to obtain all relevant data segments, and the previously filtered candidate data segments are directly regarded as target data segments, and no additional filtering operations are performed.
[0055] Step S205: Use the target keyword to search for corresponding group log data from the target data segment. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0056] In this embodiment, a method for querying log data is provided, which can be used for the above-mentioned server. Figure 3 is a flowchart of another method for querying log data according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps: Step S301: Obtain a log query request sent by a client to a target group, wherein the log query request includes event description information. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0057] Step S302 , segmenting the event description information to obtain a plurality of target keywords, and segmenting the target log data corresponding to the target group to obtain a plurality of data segments, wherein the target log data is screened from the historical log data of the target group.
[0058] Specifically, the above step S302 includes: Step S3021, detecting a keyword set carried in the event description information.
[0059] In an optional embodiment, the event description information usually includes a large amount of text, which contains key information related to the group chat operation event. In order to extract useful information, it is necessary to first perform keyword detection to identify words and phrases related to the event. By detecting the keyword set, the words related to the event can be preliminarily screened out. Therefore, it is necessary to detect the keyword set carried in the event description information.
[0060] Step S3022, filter out target keywords that match preset fields from the keyword set, wherein the preset fields are determined based on the context information of the group chat operation event, and the preset fields include at least: operation object, operation code, user identifier, and operation content.
[0061] In an optional embodiment, target keywords that match preset fields are screened out from the keyword set. Through keyword extraction and screening, key information related to the group chat operation event can be accurately extracted from the event description information, thereby avoiding omission or misjudgment of information and improving processing efficiency. The setting of preset fields can be flexibly adjusted according to actual needs and context information of the group chat operation event, thereby improving the flexibility of the system. Step S303, use the target keyword to match the data segment to obtain the target data segment hit by the target keyword. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0062] Step S304: Query corresponding group log data from the target data segment using the target keyword.
[0063] For details, please see Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0064] Step S305, after measuring the correlation, calculate the score of the group log data under the preset index, comprehensively score and sort, and finally send the sorted log data to the client.
[0065] Specifically, the above step S305 includes: Step S3051, obtaining a preset indicator for measuring relevance.
[0066] In an optional embodiment, the preset indicators for measuring correlation include time, operator, and operated person. According to the importance of the preset indicators for measuring correlation, respective weights are set for different indicators. For example, the preset indicators for measuring correlation are time, operator, and operated person, and the importance indicator values can be set to 0.3, 0.4, and 0.3, respectively.
[0067] Step S3052, calculating the index score of each log data in the group log data in the preset index.
[0068] In an optional embodiment, the time score is calculated according to the set rules based on the distance between the log time and the current time. For example, the closer the set time is to the current time, the higher the score is, and 10 points can be added for every hour closer.
[0069] In an optional embodiment, for the operator score, check whether the operator in the log is consistent with the operator specified in the query. If they are consistent, the operator score is assigned. For example, if the operator in the check log is consistent with the operator specified in the query, 30 points can be set to be added.
[0070] In an optional embodiment, for the score of the operated person, it is checked whether the operated person in the log matches the query requirements. If they match, the operated person is assigned a score. For example, if the operated person in the check log matches the query requirements, 20 points can be set.
[0071] Step S3053, calculating the comprehensive score of the corresponding log data based on the index score of each log data in the preset index.
[0072] In an optional embodiment, respective weights are set for different indicators, and weighted calculation is performed on the values of each indicator to obtain a comprehensive score of the log data for each piece of log data.
[0073] The specific calculation formula is: v = s1×w1+s2×w2+s3×w3, where s1 represents the time score, s2 represents the operator score, s3 represents the operated person score, w1 represents the time weight, w2 represents the operator weight, and w3 represents the operated person weight.
[0074] Step S3054: sort each piece of log data in the group log data in descending order of comprehensive scores, and send the sorted group log data to the client.
[0075] Step S3055: receiving evaluation information fed back by the client based on the sorted group log data.
[0076] Step S3056, adjusting the weight of the preset indicator used to measure the relevance based on the evaluation information, wherein the weight of the preset indicator is used to calculate the comprehensive score.
[0077] In an optional embodiment, the preset indicators for measuring correlation include time, operator, and operated person. According to the importance of the preset indicators for measuring correlation, respective weights are set for different indicators. For example, the preset indicators for measuring correlation are time, operator, and operated person, and the importance indicator values can be set to 0.5, 0.25, and 0.25, respectively.
[0078] In an optional embodiment, according to the evaluation information fed back by the client based on the sorted group log data, the weights of preset indicators for measuring relevance are adjusted based on the evaluation information, and customized log data sorting results are provided to users, allowing users to find required information more quickly, thereby optimizing the user experience.
[0079] In this embodiment, a device for querying log data is provided. Figure 4 is a structural block diagram of a log data query device according to an embodiment of the present invention. Figure 4 As shown, the system includes an acquisition module 401 , a processing module 402 , a matching module 403 , and a query module 404 .
[0080] The acquisition module 401 is used to acquire a log query request sent by a client to a target group, wherein the log query request includes event description information; The processing module 402 is used to perform word segmentation processing on the event description information to obtain multiple target keywords, and to perform word segmentation processing on the target log data corresponding to the target group to obtain multiple data segments, wherein the target log data is obtained by screening the historical log data of the target group; A matching module 403 is used to match the target keyword with the data segment to obtain the target data segment hit by the target keyword; The query module 404 is used to query corresponding group log data from the target data segment using the target keyword.
[0081] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0082] Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0083] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0084] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0085] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0086] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0087] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0088] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0089] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0090] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for querying log data, characterized in that: The method is applied to a server, and the method comprises: Obtaining a log query request sent by a client to a target group, wherein the log query request includes event description information; Performing word segmentation processing on the event description information to obtain a plurality of target keywords, and performing word segmentation processing on the target log data corresponding to the target group to obtain a plurality of data segments, wherein the target log data is obtained by screening the historical log data of the target group; Matching the target keyword with the data segment to obtain the target data segment hit by the target keyword; The target keyword is used to query corresponding group log data from the target data segment.
2. The method according to claim 1, characterized in that The word segmentation process of the event description information to obtain a plurality of target keywords includes: Detecting a set of keywords carried in the event description information; Filter out target keywords that match the preset field from the keyword set, wherein the preset field is determined according to context information of the group chat operation event, and the preset field includes at least: an operation object, an operation code, a user identifier, and an operation content.
3. The method according to claim 2, characterized in that The method further comprises: Obtaining historical log data of the target group; Parsing the historical log data according to the preset fields to obtain keywords corresponding to the preset fields, and extracting data segments matching the keywords from the historical log data; A mapping relationship between the keywords and the data segments is constructed, and the mapping relationship is stored.
4. The method according to claim 2, characterized in that: Before performing word segmentation processing on the target log data corresponding to the target group to obtain a plurality of data segments, the process includes: Obtaining business requirements from the log query request, and obtaining a preset amount of original log data before the current time from the historical log data; Obtaining the original language corresponding to the original log data; If the original language is inconsistent with the target language corresponding to the business requirement, the original log data is converted according to the target language, and the converted original log data is used as the target log data; or, if the original language is consistent with the target language corresponding to the business requirement, the original log data is used as the target log data.
5. The method according to claim 3, characterized in that: The step of matching the target keyword with the data segment to obtain the target data segment hit by the target keyword includes: Acquire a candidate data segment corresponding to the target keyword from the data segment based on the mapping relationship; Query whether the log query request carries a specified log source; If the log query request carries a specified log source, the target data segment belonging to the log source is obtained from the candidate data segment; or, if the log query request does not carry a specified log source, the candidate data segment is used as the target data segment.
6. The method according to claim 1, characterized in that After using the target keyword to query the corresponding group log data from the target data segment, the method further includes: Get preset metrics for measuring relevance; Calculate the index score of each log data in the group log data in the preset index; Calculate the comprehensive score of the corresponding log data based on the index score of each log data in the preset index; Each piece of log data in the group log data is sorted in descending order of the comprehensive score, and the sorted group log data is sent to the client.
7. The method according to claim 6, characterized in that After sending the sorted group log data to the client, the method further includes: Receiving evaluation information fed back by the client based on the sorted group log data; The weight of a preset indicator for measuring relevance is adjusted based on the evaluation information, wherein the weight of the preset indicator is used to calculate a comprehensive score.
8. A log data query device, characterized in that: The device comprises: An acquisition module, used to acquire a log query request sent by a client to a target group, wherein the log query request includes event description information; a processing module, configured to perform word segmentation processing on the event description information to obtain a plurality of target keywords, and perform word segmentation processing on the target log data corresponding to the target group to obtain a plurality of data segments, wherein the target log data is obtained by screening the historical log data of the target group; A matching module, used to match the target keyword with the data segment to obtain the target data segment hit by the target keyword; The query module is used to query the corresponding group log data from the target data segment using the target keyword.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Scientific researcher recommendation method and system
CN108171401A
Log data processing method, device, equipment and storage medium
CN110532347A
Index construction method and device and query method and device for time series data
CN113656397A
Ordering data sets based on data attributes
CN114647627A
Information recommendation method and device, equipment and storage medium
CN117009617A
Cited By
Log processing method, device, equipment, system and chip
CN120371794A