A method, device, computer device, and storage medium for querying log data

By performing word segmentation processing on event description information and target log data, extracting and matching target keywords and data fragments, the problems of low log query efficiency and poor user experience in the prior art are solved, and efficient and flexible log data query and multi-language support are achieved.

CN119201853BActive Publication Date: 2025-06-03HANGZHOU AKEY ME CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411489453.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-06-03
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

In multi-language environments, it is difficult for the prior art to achieve efficient and user-friendly log queries, especially when multiple query conditions are required and fuzzy matching queries cannot be performed.

Method used

By performing word segmentation processing on event description information and target log data, target keywords and data fragments are extracted, and these keywords are used to match the data fragments, and corresponding group log data are queried and extracted.

Benefits of technology

It improves the efficiency and user experience of log data query, allowing users to flexibly enter query information without the need to follow a specific format and adapt to the needs of different languages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201853B_ABST
    Figure CN119201853B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of log processing, and discloses a method, device, computer device and storage medium for querying log data. The present invention includes the following steps: obtaining a log query request sent by a client for a target group, where 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 target log data corresponding to the target group to obtain a plurality of data segments, where the target log data is screened from the historical log data of the target group; using the target keywords to match with the data segments to obtain the target data segments hit by the target keywords; using the target keywords to query corresponding group log data from the target data segments. By implementing the present invention, the query of log data can be realized efficiently and flexibly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of log processing, and in particular, to a method, device, computer device 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 a variable part and an immutable part. Among them, the operation part within the group is immutable, such as "xxx joined the group", "xxx exited the group", etc. Another part is the variable part, that is, the specific group user nickname that joined or exited the group. Then, the immutable group operations are traversed and enumerated, and the log operation copywriting in various languages related to the group operations is stored on the server. For the variable part: the group user nickname, no internationalization is required, and it can be directly stored. When querying, only according to the language selected by the client, obtain the corresponding language copywriting of the immutable operation, and then perform placeholder replacement, so that the complete group log information in the specified language can be obtained.

[0003] However, during retrieval, multiple query conditions need to be combined for querying. The user needs to select the corresponding group operation, and then enter the nickname of the operator or the operated person to be queried, and perform a logical AND combination of the two to filter and query the group logs that meet the conditions. This operation is relatively cumbersome for users, and multiple steps are required to perform data query, and fuzzy matching query cannot be performed. Summary of the Invention

[0004] In view of this, the present invention provides a method, device, computer device and storage medium for querying log data, which can effectively improve the query efficiency and user experience, and can also meet the requirements 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 for a target group, where 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, where the target log data is filtered from the historical log data of the target group; using the target keywords to match with the data segments to obtain the target data segments hit by the target keywords; using the target keywords to query the corresponding group log data from the target data segments.

[0006] The log data query method provided by the embodiments of the present invention performs word segmentation on both 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 word segmentation of the event description information, a plurality of target keywords are obtained. After word segmentation of the target log data, a plurality of data segments are obtained. Therefore, by matching the target keywords with each data segment, the group log data required by the user can be obtained. When executing the log data query of this embodiment, since the server will perform word segmentation on the event description information after receiving it, the user can input the event description information containing multiple keywords in only one input box. The user can flexibly input query information without having to input the query information in a specific format, making the user's query operation simpler.

[0007] In an alternative embodiment, performing word segmentation on the event description information to obtain a plurality of target keywords includes: detecting a keyword set carried in the event description information, and screening out target keywords that match a preset field from the keyword set, where the preset field is determined according to the context information of the group chat operation event, and the preset field at least includes: operation object, operation code, user identifier, and operation content.

[0008] The log data query method provided by the embodiments of the present invention detects a keyword set carried in the event description information, and screens out target keywords that match a preset field from the keyword set. Through keyword extraction and screening, the key information related to the group chat operation event can be accurately extracted from the event description information, avoiding information omission or misjudgment, improving the processing efficiency, and the setting of the preset field can be flexibly adjusted according to actual needs and the context information of the group chat operation event, improving the flexibility of the system.

[0009] In an alternative embodiment, it includes: obtaining the historical log data of the target group, parsing the historical log data according to the preset field to obtain the keywords corresponding to the preset field, extracting data segments that match the keywords from the historical log data, constructing a mapping relationship between the keywords and the data segments, and storing the mapping relationship.

[0010] The log data query method provided by the embodiments of the present invention obtains the historical log data of the target group, parses the historical log data according to the preset field to obtain the keywords corresponding to the preset field, extracts data segments that match the keywords from the historical log data, constructs a mapping relationship between the keywords and the data segments, and stores the mapping relationship. By parsing the historical log data according to the preset field, the log entries containing key information can be quickly located, improving the data retrieval efficiency. By extracting keywords and data segments, redundant information storage is avoided, effectively saving storage space.

[0011] In an alternative embodiment, before tokenizing the target log data corresponding to the target group to obtain multiple data segments, it includes: obtaining the 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 requirements, then performing language conversion on 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 requirements, then using the original log data as the target log data.

[0012] The log data query method provided by the embodiments of the present invention can convert the original log data into the target language specified by the business requirements through language conversion, so as to meet the data analysis requirements of different languages, and can ensure that there are no language misunderstandings or ambiguities in the process of understanding and analyzing the log data, thereby improving the accuracy of the data.

[0013] In an alternative embodiment, using the target keyword to match with the data segment to obtain the target data segment hit by the target keyword includes: 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.

[0014] The log data query method provided by the embodiments of the present invention directly locates the candidate data segment related to the target keyword through the mapping relationship, reduces the interference of irrelevant data, and improves the accuracy of data retrieval. When the log query request carries the specified log source, further screening the data belonging to this source from the candidate data segments ensures the consistency of the data source and further improves the accuracy of data retrieval.

[0015] In an alternative embodiment, after querying the corresponding group log data from the target data segment using the target keyword, it includes: obtaining a preset metric for measuring relevance, calculating the metric score of each log data in the group log data for the preset metric, calculating the comprehensive score of the corresponding log data based on the metric score of each log data for the preset metric, sorting each log data in the group log data in descending order according to the comprehensive score, and sending the sorted group log data to the client.

[0016] The query method for log data provided by the embodiments of the present invention calculates the comprehensive score of each log data through preset metrics and sorts them according to the score level, so that the most relevant and valuable log data can be preferentially displayed to users, thereby improving the efficiency and accuracy of information retrieval.

[0017] In an alternative embodiment, after sending the sorted group log data to the client, it includes: receiving the evaluation information fed back by the client based on the sorted group log data, and adjusting the weight of the preset metric for measuring relevance based on the evaluation information, where the weight of the preset metric is used to calculate the comprehensive score.

[0018] The query method for log data provided by the embodiments of the present invention adjusts the weight of the preset metric for measuring relevance based on the evaluation information fed back by the client based on the sorted group log data, provides customized log data sorting results for users, enables users to find the required information more quickly, and optimizes the user experience.

[0019] In a second aspect, the present invention provides a query device for log data, including: an acquisition module, a processing module, a matching module, and a query module. The acquisition module is used to acquire a log query request sent by the client for a target group, where the log query request includes event description information. The processing module is used to perform word segmentation processing on the event description information to obtain multiple target keywords, and perform word segmentation processing on the target log data corresponding to the target group to obtain multiple data segments, where the target log data is filtered from the historical log data of the target group. The matching module is used to match the target keywords with the data segments to obtain the target data segments hit by the target keywords. The query module is used to query the corresponding group log data from the target data segments using the target keywords.

[0020] In a third aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the upgrade method in the first aspect or any corresponding embodiment thereof.

[0021] In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored. The computer instructions are used to cause a computer to execute the query method for log data in the first aspect or any corresponding embodiment thereof. Description of the Drawings

[0022] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0023] Figure 1 is a schematic flowchart of a method for querying log data according to an embodiment of the present invention;

[0024] Figure 2 is a schematic flowchart of another method for querying log data according to an embodiment of the present invention;

[0025] Figure 3 is a schematic flowchart of yet another method for querying log data according to an embodiment of the present invention;

[0026] Figure 4 is a structural block diagram of a device for querying log data according to an embodiment of the present invention;

[0027] Figure 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention. Specific Embodiments

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0029] The log data query method provided by the embodiments of the present invention can be applied to enterprise IT system monitoring and management, cloud computing and big data platforms, network security and auditing, software development and testing, etc. with the increasing development of computer systems and software applications. Different fields or scenarios need to query and analyze log data, which is conducive to better understanding user needs. After receiving a log query request, the server performs word segmentation on the event description information, disassembling the event description information into multiple keywords. At the same time, the server filters out target log data from the historical log data of the target group and performs word segmentation on it, cutting it into multiple data segments, matching the target keywords with the data segments, finding the data segments containing the target keywords, querying and extracting the corresponding group log data from the target data segments. 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 meet the needs of different languages.

[0030] Currently, the log data query method requires a combination of multiple query conditions. The user needs to select the corresponding group operation, then enter the nickname of the operator or the person being operated on to be queried, and perform a logical AND combination of the two to filter and query the group logs that meet the conditions. This operation is rather cumbersome for the user, requiring multiple steps to perform data query, and fuzzy matching query cannot be performed.

[0031] The present invention provides a log data query method. By performing word segmentation on the event description information and the target log data, and matching the target keywords with the data segments, the corresponding group log data is queried and extracted, which can improve the query efficiency and user experience and can also meet the needs of different languages.

[0032] According to the embodiments of the present invention, an embodiment of a log data query method 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 the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0033] In this embodiment, a log data query method is provided, which can be used for the above-mentioned server. Figure 1 It is a flowchart of the log data query method according to the embodiments of the present invention, as Figure 1 shown. The process includes the following steps:

[0034] Step S101, obtain a log query request sent by the client for the target group, where the log query request includes event description information.

[0035] In an alternative 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 the log management system locate the relevant log records more quickly.

[0036] In an alternative embodiment, after the user operates on the target group, log data will be generated. The log data includes but is not limited to information such as the operator information, the information of the person being operated on, and the operation action. The above information can be combined arbitrarily to form log data. Exemplarily, the log data can be "User A joins the group". Then, in this log data, the operator information is "User A", and the operation action is "joins the group". After the target group is operated on 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.

[0037] Step S102: Perform word segmentation processing on the event description information to obtain multiple target keywords, and perform word segmentation processing on the target log data corresponding to the target group to obtain multiple data segments, where the target log data is filtered from the historical log data of the target group.

[0038] In an alternative embodiment, word segmentation processing cuts the continuous text in the event description information into independent and 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 located more precisely.

[0039] In an alternative embodiment, performing word segmentation processing on the historical log data of the target group can cut it into multiple data segments. These data segments contain the key information in the group chat log data. By matching with the target keywords, the log data segments related to the event description information can be quickly found.

[0040] Step S103: Use the target keywords to match with the data segments to obtain the target data segments hit by the target keywords.

[0041] In an alternative embodiment, the target keywords obtained after word segmentation processing are the core components of the event description information. By matching these keywords with the data segments in the group chat log data, the log content related to the query event can be accurately located, improving the accuracy and efficiency of the query. The needs of users for queries are diverse. Through keyword matching, filtering and sorting can be flexibly performed according to the user's needs to meet diverse query requirements.

[0042] Step S104: Use the target keywords to query the corresponding group log data from the target data segments.

[0043] The log data query method provided by the embodiment of the present invention performs word segmentation on both 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 word segmentation of the event description information, a plurality of target keywords are obtained. After word segmentation of the target log data, a plurality of data segments are obtained. Therefore, by matching the target keywords with each data segment, the group log data required by the user can be obtained. When executing the log data query of this embodiment, since the server will perform word segmentation on the event description information after receiving it, the user can input event description information containing multiple keywords in only one input box. The user can flexibly input query information without having to input query information in a specific format, making the user's query operation simpler.

[0044] In this embodiment, a log data query method is provided, which can be used for the above-mentioned server. Figure 2 It is a flowchart of another log data query method according to the embodiment of the present invention, as Figure 2 shown. The process includes the following steps:

[0045] Step S201, obtain a log query request sent by the client for the target group, where the log query request includes event description information. For details, please refer to Figure 1 step S101 of the embodiment shown here, which will not be elaborated here.

[0046] Step S202, according to the service requirements in the log query request, obtain a preset number of original log data from the historical log data, and convert it into the target language as needed to obtain the target log data.

[0047] Specifically, the above step S202 includes:

[0048] Step S2021, obtain the service requirements from the log query request, and obtain a preset number of original log data before the current time from the historical log data.

[0049] In an optional embodiment, when the group chat has been 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 one by one every time a log query request is executed, the calculation amount is large. Moreover, usually when a user queries logs, the query demand for logs that are far from the current time is small. Therefore, a preset number of original log data before the current time can be obtained from the historical log data, and the logs corresponding to the event description information can be queried from the original log data, reducing the calculation amount and basically meeting the user's needs.

[0050] In an optional embodiment, if the user needs to query the required information from all the logs since the target group was established, the target identifier can be added to the log query request. After receiving the log query request, if the server determines that the log query request contains the target identifier, instead of obtaining a preset number of original log data before the current time from the historical log data, all the historical log data is used as the original log data.

[0051] In an optional embodiment, the preset number can be set according to actual needs. Exemplarily, 10,000 logs before the current time can be selected as the original log data, and no specific limitation is made in the embodiments of the present invention.

[0052] Step S2022, obtain the original language corresponding to the original log data.

[0053] The language corresponding to the original log data refers to the language type used when the log data is stored. Exemplarily, the original language can be Chinese, English, Japanese, etc.

[0054] Step S2023, determine whether the original language is the same as the target language corresponding to the business requirement.

[0055] In an optional embodiment, the language corresponding to the business requirement can be the language used when the client sends event description information to the server.

[0056] If the original language is not the same as the target language corresponding to the business requirement, the original log data is converted into the target language, and the converted original log data is used as the target log data;

[0057] If the original language is the same as the target language corresponding to the business requirement, the original log data is used as the target log data.

[0058] In an optional embodiment, ensuring that the language of the data is the same as the business requirement can avoid misunderstandings or errors caused by language barriers. Through language conversion, it is ensured that the data is consistent with the user's requirements. For data that does not need to be converted, it is directly used as the target data, reducing unnecessary processing steps.

[0059] Exemplarily, if the language used when the client sends 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;

[0060] If the language used when the client sends event description information to the server is Chinese, and the original language used when the original log data is stored is English, for the convenience of query, the original log data needs to be translated into Chinese, and the translated original log data is used as the target log data.

[0061] In an optional embodiment, through language conversion, the original log data can be converted into the target language specified by the business requirements, so as to meet the data analysis requirements in different languages, ensure that there are no language misunderstandings or ambiguities in the process of understanding and analyzing the log data, and thus improve the accuracy of the data.

[0062] Step S203: Perform word segmentation on the event description information to obtain multiple target keywords, and perform word segmentation on the target log data corresponding to the target group to obtain multiple data segments, where the target log data is screened from the historical log data of the target group.

[0063] Specifically, the above step S203 includes:

[0064] Step S2031: Obtain the historical log data of the target group.

[0065] In an optional embodiment, log data analysis is performed on a specific group chat to obtain more targeted results.

[0066] Step S2032: Parse the historical log data according to the preset fields to obtain the keywords corresponding to the preset fields, and extract the data segments matching the keywords from the historical log data.

[0067] In an optional embodiment, by extracting the preset fields from the log data, the key information in the log data can be quickly located. By parsing the log data according to the preset fields, the log data is usually stored in text form, and each log may contain information of multiple fields. According to the keywords, the log data is further screened, and the data segments matching the keywords are extracted from the parsed log data.

[0068] Step S2033: Construct a mapping relationship between the keywords and the data segments, and store the mapping relationship.

[0069] In an optional embodiment, by parsing the historical log data according to the preset fields, the log entries containing key information can be quickly located, improving the efficiency of data retrieval. By extracting the keywords and data segments, redundant information storage is avoided, effectively saving storage space.

[0070] Step S204: Use the target keywords to match with the data segments to obtain the target data segments hit by the target keywords.

[0071] Specifically, the above step S204 includes:

[0072] Step S2041: Obtain the candidate data segments corresponding to the target keywords from the data segments based on the mapping relationship.

[0073] In an alternative embodiment, by using the mapping relationship, the data segment related to the target keyword, that is, the candidate data segment, can be quickly located, improving the query efficiency and reducing unnecessary operations.

[0074] Step S2042: Check whether the log query request carries a specified log source.

[0075] If the log query request carries a specified log source, obtain the target data segment belonging to the log source from the candidate data segments;

[0076] If the log query request does not carry a specified log source, use the candidate data segments as the target data segments.

[0077] In an alternative embodiment, when processing the user's log query request, first check whether a specific log source is clearly indicated in the request. If the user specifies a log source in the query request, further filter out the data segments that match the log source from the previously filtered candidate data segments. The data segments after the secondary filtering are the target data segments, which precisely meet the user's query requirements. If the user does not specify a log source in the query request, it is considered that the user hopes to obtain all relevant data segments, and the previously filtered candidate data segments are directly regarded as the target data segments without additional filtering operations.

[0078] Step S205: Query the corresponding group log data from the target data segments by using the target keyword. For details, please refer to Figure 1 Step S104 of the embodiment shown, which will not be elaborated here.

[0079] In this embodiment, a method for querying log data is provided, which can be used for the above-mentioned server. Figure 3 It is a flowchart of another method for querying log data according to an embodiment of the present invention. As Figure 3 shown, this process includes the following steps:

[0080] Step S301: Obtain the log query request sent by the client for the target group, where the log query request includes event description information. For details, please refer to Figure 1 Step S101 of the embodiment shown, which will not be elaborated here.

[0081] Step S302: Perform word segmentation on the event description information to obtain multiple target keywords, and perform word segmentation on the target log data corresponding to the target group to obtain multiple data segments, where the target log data is filtered from the historical log data of the target group.

[0082] Specifically, the above step S302 includes:

[0083] Step S3021: Detect the keyword set carried in the event description information.

[0084] In an optional embodiment, the event description information usually contains a large amount of text, and the key information related to the group chat operation event is contained in this text. To extract useful information, keyword detection needs to be performed first to identify the 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.

[0085] Step S3022: Screen out the target keywords in the keyword set that match the preset fields. Among them, the preset fields are determined according to the context information of the group chat operation event, and the preset fields at least include: operation object, operation code, user identifier, and operation content.

[0086] In an optional embodiment, screen out the target keywords in the keyword set that match the preset fields. Through keyword extraction and screening, the key information related to the group chat operation event can be accurately extracted from the event description information, avoiding information omission or misjudgment, improving the processing efficiency. The setting of the preset fields can be flexibly adjusted according to the actual needs and the context information of the group chat operation event, improving the flexibility of the system.

[0087] Step S303: Use the target keywords to match with the data fragments to obtain the target data fragments hit by the target keywords. For details, please refer to Figure 1 Step S103 of the illustrated embodiment, which will not be elaborated here.

[0088] Step S304: Use the target keywords to query the corresponding group log data from the target data fragments.

[0089] For details, please refer to Figure 1 Step S104 of the illustrated embodiment, which will not be elaborated here.

[0090] Step S305: After measuring the relevance, calculate the score of the group log data under the preset metrics, comprehensively score and sort, and finally send the sorted log data to the client.

[0091] Specifically, the above-mentioned step S305 includes:

[0092] Step S3051: Obtain the preset metrics for measuring the relevance.

[0093] In an alternative embodiment, the preset metrics for measuring relevance include time, operator, and the person being operated on. According to the importance of the preset metrics for measuring relevance, respective weights are set for different metrics. Exemplarily, if the preset metrics for measuring relevance are time, operator, and the person being operated on, the importance metric values can be set to 0.3, 0.4, and 0.3 respectively.

[0094] Step S3052: Calculate the metric scores of each log data in the group log data for the preset metrics.

[0095] In an alternative embodiment, for the time score, according to the distance between the log time and the current time, the time score is calculated according to the set rules. Exemplarily, if it is set that the closer the time is to the current time, the higher the score, then it can be set to add 10 points for each hour closer.

[0096] In an alternative embodiment, for the operator score, check whether the operator in the log is the same as the operator specified in the query. If they are the same, assign the operator score. Exemplarily, if it is checked that the operator in the log is the same as the operator specified in the query, then it can be set to add 30 points.

[0097] In an alternative embodiment, for the person-being-operated-on score, check whether the person being operated on in the log matches the query requirements. If they match, assign the person-being-operated-on score. Exemplarily, if it is checked that the person being operated on in the log matches the query requirements, then it can be set to add 20 points.

[0098] Step S3053: Calculate the comprehensive score of the corresponding log data based on the metric scores of each log data for the preset metrics.

[0099] In an alternative embodiment, respective weights are set for different metrics, and the metric values are weighted and calculated to obtain the comprehensive log data score of each log data.

[0100] 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 person-being-operated-on score, w1 represents the time weight, w2 represents the operator weight, and w3 represents the person-being-operated-on weight.

[0101] Step S3054: Sort each log data in the group log data in descending order according to the comprehensive score, and send the sorted group log data to the client.

[0102] Step S3055: Receive the evaluation information fed back by the client based on the sorted group log data.

[0103] Step S3056: Adjust the weights of preset metrics for measuring relevance based on the evaluation information, where the weights of the preset metrics are used to calculate the comprehensive score.

[0104] In an alternative embodiment, the preset metrics for measuring relevance include time, operator, and the person being operated on. According to the importance of the preset metrics for measuring relevance, respective weights are set for different metrics. Exemplarily, if the preset metrics for measuring relevance are time, operator, and the person being operated on, the importance metric values can be set to 0.5, 0.25, and 0.25 respectively.

[0105] In an alternative embodiment, based on the evaluation information fed back by the client based on the sorted group log data, adjust the weights of the preset metrics for measuring relevance to provide the user with a customized sorted result of the log data, enabling the user to find the required information more quickly and optimizing the user experience.

[0106] In this embodiment, a query device for log data is provided. Figure 4 It is a structural block diagram of the query device for log data according to an embodiment of the present invention, as Figure 4 shown. The system includes an acquisition module 401, a processing module 402, a matching module 403, and a query module 404.

[0107] The acquisition module 401 is configured to acquire a log query request sent by the client for a target group, where the log query request includes event description information.

[0108] The processing module 402 is configured to perform word segmentation on the event description information to obtain a plurality of target keywords, and perform word segmentation on the target log data corresponding to the target group to obtain a plurality of data segments, where the target log data is filtered from the historical log data of the target group.

[0109] The matching module 403 is configured to match the target keywords with the data segments to obtain the target data segments hit by the target keywords.

[0110] The query module 404 is configured to query the corresponding group log data from the target data segments using the target keywords.

[0111] The further function descriptions of the above-mentioned modules and units are the same as those in the corresponding embodiments above and will not be elaborated here.

[0112] Figure 5 It is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention, as Figure 5As 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. Each component communicates with each other using different buses and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 5 In the figure, a processor 10 is taken as an example.

[0113] The processor 10 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above hardware chip can be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above programmable logic device can be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.

[0114] Among them, the memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the methods shown in the above embodiments.

[0115] The memory 20 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device. In addition, the memory 20 can include high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 can optionally include a memory remotely set relative to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0116] The memory 20 can include volatile memory, such as random access memory; the memory can also include non-volatile memory, such as flash memory, a hard disk, or a solid-state drive; the memory 20 can also include a combination of the above types of memory.

[0117] The computer device further 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 can be connected through a bus or other means.Figure 5 Take the bus connection as an example.

[0118] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, 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 haptic feedback device (e.g., a vibration motor), etc. The above display device includes, but is not limited to, a liquid crystal display, a light emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.

[0119] The embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented by downloading through a network the original computer code stored in a remote storage medium or a non-transitory machine-readable storage medium and to be stored in a local storage medium, 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 memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, 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, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0120] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall 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; Using the target keyword to query corresponding group log data from the target data segment; 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; Filtering out target keywords matching preset fields from the keyword set, wherein the preset fields are determined according to context information of the group chat operation event, and the preset fields at least include: an operation object, an operation code, a user identifier, and an operation content; The step of matching the target keyword with the data segment to obtain the target data segment hit by the target keyword includes: 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; Constructing a mapping relationship between the keyword and the data segment, storing the mapping relationship, and acquiring a candidate data segment corresponding to the target keyword from the data segment based on the mapping relationship; 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.

2. The method according to claim 1, 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.

3. 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.

4. The method according to claim 3, 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.

5. 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; A query module, used to query corresponding group log data from the target data segment using the target keyword; 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; Filtering out target keywords matching preset fields from the keyword set, wherein the preset fields are determined according to context information of the group chat operation event, and the preset fields at least include: an operation object, an operation code, a user identifier, and an operation content; The step of matching the target keyword with the data segment to obtain the target data segment hit by the target keyword includes: 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; Constructing a mapping relationship between the keyword and the data segment, storing the mapping relationship, and acquiring a candidate data segment corresponding to the target keyword from the data segment based on the mapping relationship; 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. 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 4 by executing the computer instructions.

7. 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 4.

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

  • Log information management method and device, equipment and storage medium

    CN118409932A