Text processing method and device

By model matching of the description text in the log data of the cloud service system, the problem of difficulty in a timely acquisition of abnormal information in the cloud service system is solved, and the number of times of obtaining abnormal information is achieved is achieved, and online problems are solved in a timely manner.

CN119292873BActive Publication Date: 2025-04-08BEIJING HAIYUDONGXIANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411814300.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-08
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

It is difficult to analyze and process massive log data in the cloud service system to obtain abnormal information in a timely manner, resulting in delays in solving online problems.

Method used

By extracting description text from the log data of a specific service module of the cloud service system and matching it with the models in the preset model library, the model on each description text match and its number of matches are determined.

Benefits of technology

It realizes the number of times of rapid acquisition of abnormal information, helping R&D/Operation and Maintenance personnel solve problems that arise online in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292873B_ABST
    Figure CN119292873B_ABST
Patent Text Reader

Abstract

The present application provides a text processing method and device, the method comprising: obtaining log data of a specific service module of a cloud service system, extracting at least one descriptive text from the log data, and for each extracted descriptive text, matching the descriptive text with a model in a preset model library, wherein the model library contains multiple models, each model includes at least one text, and at least one model among the multiple models includes at least one placeholder parameter; determining the model matched by the at least one descriptive text and the number of times the corresponding model is matched based on the matching result, so that R&D / operation and maintenance personnel can obtain abnormal information in a timely manner through this method, and then solve the problems that occur online in a timely manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud applications, and in particular to a text processing method and device. Background Art

[0002] Cloud applications (such as cloud games, cloud phones, etc.) are an emerging online application model. It places the application running, rendering and processing processes on a remote cloud server and transmits the application screen to the user's device, allowing users to enjoy high-quality application experience on various devices without the need for high-performance hardware support.

[0003] Cloud application service providers have built a cloud service system to provide customers with stable and reliable cloud application services. The system has a large number of service modules, which can generate massive amounts of various log data every day. How to analyze and process these massive log data so that R&D / operation and maintenance personnel can obtain abnormal information in a timely manner and then solve online problems in a timely manner has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of the technical problems existing in the prior art, the embodiments of the present application provide a text processing method and device.

[0005] In a first aspect, an embodiment of the present application provides a text processing method, comprising:

[0006] Obtaining log data of a specific service module of the cloud service system, extracting at least one description text from the log data, and matching each extracted description text with a model in a preset model library, wherein the model library contains a plurality of models, each model includes at least one text, and at least one model among the plurality of models includes at least one placeholder parameter;

[0007] Determine, according to the matching result, the model matched by the at least one description text and the number of times the corresponding model is matched;

[0008] The step of matching the description text with a model in a preset model library includes:

[0009] At least one segmentation is obtained by segmenting the description text;

[0010] Each time a model is taken out from the model library, whether the description text matches the model is determined by judging whether the at least one word segmentation matches the text included in the model, until a model matching the description text is found or no model matching the description text is found after traversing all models.

[0011] In a second aspect, an embodiment of the present application further provides a text processing device, including:

[0012] A matching unit, configured to obtain log data of a specific service module of the cloud service system, extract at least one description text from the log data, and for each extracted description text, match the description text with a model in a preset model library, wherein the model library contains a plurality of models, each model includes at least one text, and at least one model among the plurality of models includes at least one placeholder parameter;

[0013] A determination unit, configured to determine the model matched by the at least one description text and the number of times the corresponding model is matched according to the matching result;

[0014] The step of matching the description text with a model in a preset model library includes:

[0015] At least one segmentation is obtained by segmenting the description text;

[0016] Each time a model is taken out from the model library, whether the description text matches the model is determined by judging whether the at least one word segmentation matches the text included in the model, until a model matching the description text is found or no model matching the description text is found after traversing all models.

[0017] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the text processing method described in the first aspect are executed.

[0018] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the text processing method described in the first aspect.

[0019] In summary, the text processing method and device, electronic device and storage medium provided in the embodiments of the present application perform model matching on the descriptive text extracted from the log data of a specific service module of the cloud service system, so as to determine the number of times each model is matched. R&D / operation and maintenance personnel can obtain abnormal information in a timely manner through this number, and then solve the problems that arise online in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A flowchart of an embodiment of a text processing method provided in an embodiment of the present application;

[0021] Figure 2A structural diagram of an embodiment of a text processing device provided in an embodiment of the present application;

[0022] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0024] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0025] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0026] Reference Figure 1 As shown, an embodiment of the present application provides a flowchart of a text processing method, the method comprising:

[0027] S10, obtaining log data of a specific service module of the cloud service system, extracting at least one description text from the log data, and matching each extracted description text with a model in a preset model library, wherein the model library contains a plurality of models, each model includes at least one text, and at least one model among the plurality of models includes at least one placeholder parameter;

[0028] In this embodiment, it should be noted that the structure of the model in the model library is a text (for example, [{"text":"text0"}], where text represents text and text0 is the specific text content), or a structure consisting of at least one text and at least one placeholder parameter (the placeholder parameter can match empty space and any text at the position of the placeholder parameter), in which the texts have a sequence, two adjacent placeholder parameters are separated by a text, and two adjacent texts are separated by a placeholder parameter (for example, [{"text":"text0"}, {"param":"0"}, {"text":"text1"}, {"param":"1"}, {"text":"text2"}]).

[0029] S11, determining the model matched by the at least one description text and the number of times the corresponding model is matched according to the matching result;

[0030] The step of matching the description text with a model in a preset model library includes:

[0031] At least one segmentation is obtained by segmenting the description text;

[0032] Each time a model is taken out from the model library, whether the description text matches the model is determined by judging whether the at least one word segmentation matches the text included in the model, until a model matching the description text is found or no model matching the description text is found after traversing all models.

[0033] In this embodiment, it should be noted that if the at least one word segmentation matches the text included in the model, it means that the description text matches the model; if the at least one word segmentation does not match the text included in the model, it means that the description text does not match the model.

[0034] The text processing method provided in the embodiment of the present application performs model matching on the descriptive text extracted from the log data of a specific service module of the cloud service system, so as to determine the number of times each model is matched. R&D / operation and maintenance personnel can obtain abnormal information in a timely manner through this number, and then solve the problems that arise online in a timely manner.

[0035] Based on the foregoing method embodiment, determining whether the description text matches the model by judging whether the at least one word segmentation matches the text included in the model may include:

[0036] Determining whether the at least one word segmentation satisfies a preset condition;

[0037] If the at least one word segmentation satisfies the preset condition, it is determined that the at least one word segmentation matches the text included in the model; otherwise, it is determined that the at least one word segmentation does not match the text included in the model, wherein the preset condition includes: the at least one word segmentation has the text structure of the model.

[0038] In this embodiment, it should be noted that if each text included in the model can be obtained by combining one participle of the at least one participle or at least two consecutive participles, and the participles used in the combination process of each text of the model that can be obtained by combining participles are taken from all the participles after the most recent participle that can be combined into the text of the model or all the participles before the most recent participle that can be combined into the text of the model, then it is determined that the at least one participle has the text structure of the model.

[0039] For example, assuming that model P is [{"text":"abc"}, {"param":"0"}, {"text":"de"}, {"param":"1"}, {"text":"fgh"}], text represents text, abc, de and fgh are the first text, the second text and the third text of model P respectively, and param represents a placeholder parameter. The at least one word segment is abcmndefgh, and a, b, c, m, n, d, e, f, g and h are all one word segment. Since the first text abc of model P can be obtained by combining the three consecutive word segments a, b and c in abcmndefgh, and the second text de of model P can be obtained by combining the two consecutive word segments d and e after the word segments a, b and c in abcmndefgh, and the third text fgh of model P can be obtained by combining the three consecutive word segments f, g and h after the word segments d and e in abcmndefgh, abcmndefgh has the text structure of model P. It can be understood that the processing process in this example is performed from left to right. In addition to processing from left to right, it can also be processed from right to left. Specifically: because the third text fgh of model P can be obtained by combining the three consecutive participles f, g and h in abcmndefgh, and the second text de of model P can be obtained by combining the two consecutive participles d and e before the participles f, g and h in abcmndefgh, and the first text abc of model P can be obtained by combining the three consecutive participles a, b and c before the participles d and e in abcmndefgh, then abcmndefgh has the text structure of model P.

[0040] In addition, it should be noted that if a certain text included in the model can obtain at least two participles by combining the participles during the processing, one of the at least two participles can be used as the target result, and the participles used in the subsequent text processing of the model are taken from all the participles after the target result or all the participles before the target result. For example, assuming that the model P is [{"text":"abc"}, {"param":"0"}, {"text":"de"}, {"param":"1"}, {"text":"fgh"}], the at least one participle is abcmndeabcfgh, a, b, c, m, n, d, e, f, g and h are all participles, then the first text text of the model P can be obtained by combining the three consecutive participles a, b and c in abcmndeabcfgh, and there are two of these three consecutive participles a, b and c in abcmndeabcfgh. Then the first three consecutive participles a, b and c can be used as the target continuous participles (i.e., the target result) that can be combined to obtain the first text abc of the model P, and the participles used in the subsequent processing process are all participles after the first three consecutive participles a, b and c.

[0041] Based on the aforementioned method embodiment, the preset conditions may also include: the similarity between the first text and the second text is greater than a first threshold, the first text is a text composed of texts included in the model, and the second text is a text composed of the at least one word segmentation.

[0042] Based on the foregoing method embodiment, the process of calculating whether the similarity between the first text and the second text is greater than the first threshold may include:

[0043] Calculating hash values ​​of all texts included in the model and the hash value of the at least one word segmentation, and calculating a hash value of the first text according to the hash values ​​of all texts included in the model, and calculating a hash value of the second text according to the hash value of the at least one word segmentation;

[0044] The Hamming distance between the first text and the second text is calculated according to the hash value of the first text and the hash value of the second text, and when the Hamming distance is less than the second threshold, it is determined that the similarity is greater than the first threshold.

[0045] In this embodiment, it should be noted that the hash value of the first text may be the minimum value among the hash values ​​of all the texts included in the model, and the hash value of the second text may be the minimum value among the hash values ​​of the at least one word segment. The hash value referred to herein may be the minimum hash value (i.e., minhash).

[0046] Based on the foregoing method embodiment, the step of obtaining at least one segmented word by segmenting the description text may include:

[0047] Determine whether there are Chinese characters in the description text;

[0048] If there are Chinese characters in the description text, the description text is segmented into Chinese words, or if there are no Chinese characters in the description text, the description text is segmented into English words;

[0049] According to the word segmentation result, at least one word segmentation is obtained.

[0050] In this embodiment, it should be noted that both Chinese word segmentation and English word segmentation can use existing technologies. If there are punctuation marks / spaces / special symbols in the description text, each punctuation mark / space / special symbol will be segmented into a word segmentation.

[0051] Based on the above method embodiment, before matching the description text with the model in the preset model library, the following may also be included:

[0052] Obtaining log data of a specific service module of the cloud service system, extracting a plurality of description texts from the log data, and clustering the plurality of description texts to obtain at least one description text class;

[0053] For each description text class, determine whether the number of description texts in the description text class is greater than 1 or equal to 1, if the number of description texts in the description text class is equal to 1, then put the description texts in the description text class into one group, or if the number of description texts in the description text class is greater than 1, then calculate the longest common subsequence of each description text in the description text class except the benchmark and the benchmark, and determine whether there is a target description text in the description text class according to the longest common subsequence, if there is no target description text, then put the benchmark into one group, or if there is a target description text, then put the target description text and the benchmark into one group;

[0054] At least one model is determined according to the obtained grouping, and a model library is constructed according to the at least one model.

[0055] In this embodiment, it should be noted that after extracting multiple description texts from the log data, the multiple description texts may be deduplicated and sorted, and then the sorted description texts may be clustered.

[0056] The following is an explanation using a specific example. Assuming that there is only description text w in the description text class L1, description text w can be put into a group. Assuming that there are description texts x, y, z, s and t in the description text class L2, description text x can be used as a benchmark to calculate the longest common subsequence between description text y, z, s and t and description text x (the existing function ListUtils.longestCommonSubsequence can be used to calculate the longest common subsequence LCS). According to the longest common subsequence between description text y and description text x, the longest common subsequence between description text z and description text x, the longest common subsequence between description text s and description text x, and the longest common subsequence between description text t and description text x, it is determined whether there is a target description text in description text y, description text z, description text s and description text t. If there is no target description text, description text x is put into a group. Alternatively, if there is a target description text (assuming it is description text z), description text z and description text x are put into a group. Assuming that the target description text is description text z, and description text z and description text x have been put into a group, then description text x and description text z in description text class L2 can be removed. At this time, description text y, description text s and description text t exist in description text class L2. Then, taking description text y as a benchmark, respectively calculate the longest common subsequence of description text s and description text t with description text y, and judge whether there is a target description text in description text s and description text t according to the longest common subsequence of description text s and description text y and the longest common subsequence of description text t and description text y. If the target description text is description text s, description text s and description text y can be put into a group, and description text t can be put into a group; or if the target description text is description text t, description text t and description text y can be put into a group, and description text s can be put into a group; or if there is no target description text, description text y can be put into a group, description text s can be put into a group, and description text t can be put into a group.

[0057] When determining the target description text, whether the description text is the target description text can be determined based on the length of the longest common subsequence between the description text and the benchmark, and the numerical relationship between the product of the description text and a preset numerical value. For example, when the length of the longest common subsequence between the description text and the benchmark is greater than the result of rounding down the product of the length of the description text and the preset numerical value, the description text is determined to be the target description text.

[0058] Based on the foregoing method embodiment, determining at least one model according to the obtained grouping may include:

[0059] For each group obtained, a model corresponding to the group is generated, wherein the text contained in the model corresponding to the group whose number of descriptive texts is equal to 1 is the descriptive text in the group, and the text contained in the model corresponding to the group whose number of descriptive texts is greater than 1 is generated according to the longest common subsequence of the word list corresponding to the descriptive text in the group.

[0060] In this embodiment, it should be noted that each group corresponds to a model, which is divided into two cases: the text contained in the model corresponding to the group whose number of description texts is equal to 1 is the description text in the group, and the model does not contain a placeholder parameter; the text contained in the model corresponding to the group whose number of description texts is greater than 1 is generated according to the longest common subsequence of the word list corresponding to the description text in the group, and the longest common subsequence of the word list corresponding to the description text in the group is the result of taking the intersection of the longest common subsequence calculated according to the word list corresponding to the two description texts in the group, and the two description texts in the group include all results of selecting two description texts from the group. For example, assuming that there are 4 description texts in the group: description text x, description text y, description text z and description text s, then all results of selecting two description texts from the group are description text x and description text y, description text x and description text z, description text x and description text s, description text y and description text z, description text y and description text s, and description text z and description text s.

[0061] The following example illustrates the process of generating the text contained in the model. Assume that there is a description text "The client / device has reported that the intrusion prevention rule engine is offline" in group C, then the text contained in the model corresponding to group C is "The client / device has reported that the intrusion prevention rule engine is offline.", and the model corresponding to group C is [{"text":"The client / device has reported that the intrusion prevention rule engine is offline."}]. Assume that there are two description texts "Severity: Warning" and "Severity: Critical" in group D, and the word segmentation results of the description text "Severity: Warning" are "Severity", ":", and "Warning", and the word segmentation results of the description text "Severity: Critical" are "Severity", ":", and "Critical", and the word segmentation list corresponding to "Severity", ":", and "Warning" is {"Severity", ":", "Warning"}, and the longest common subsequence of the word segmentation list corresponding to "Severity", ":", and "Critical" is {"Severity", ":", "Critical"}, then the longest common subsequence of the word segmentation list corresponding to the description text in group D is {"Severity", ":"}, and because the description There is no text between "Severity" and ":" in the text "Severity: Warning", and there is no text between "Severity" and ":" in the description text "Severity: Severe", then the word segments "Severity" and ":" are merged into one text "Severity:" as the text contained in group D. Since there is text after the text "Severity:" in the description texts "Severity: Warning" and "Severity: Severe", the condition that there is a description text in the description texts "Severity: Warning" and "Severity: Severe" and there is text after the text "Severity:" in the description text is satisfied. Then the model corresponding to group D is [{"text":"Severity:"},{"param":"0"}].

[0062] It can be understood that for each element in the longest common subsequence of the word list corresponding to the description text in a certain group, the element is a text or a part of a text in the model corresponding to the group, and an element belongs to only one text. The text in the model corresponding to the group is the element in the longest common subsequence of the word list corresponding to the description text in the group, or is composed of continuous elements in the longest common subsequence. Whether the elements need to be combined depends on whether these elements are continuous in the word list corresponding to the description text in the group (that is, not separated by other texts). If they are continuous, these elements need to be combined into one text, which is a text in the model.

[0063] After generating the models corresponding to each group, the obtained models can be deduplicated.

[0064] On the basis of the aforementioned method embodiment, for each text in the model corresponding to the group containing a number of descriptive texts greater than 1, determine whether there are placeholder parameters on the left and right sides of the text; if there are no placeholder parameters on the left and right sides of all the texts in the model, the model is generated based on all the texts in the model; or if there is a text among all the texts in the model and there is a placeholder parameter on the left or right side of the text, the model is generated based on all the texts in the model and the existing placeholder parameters.

[0065] In this embodiment, it should be noted that, taking the left side as an example, for a text in a model corresponding to a certain group, if there is a description text in the group, and there is text on the left side of the text in the description text, then it is determined that there is a placeholder parameter on the left side of the text, otherwise, it is determined that there is no placeholder parameter on the left side of the text. Still using the above example to illustrate, for the text "Severity:" in the model corresponding to group D, there is no text on the left side of the text "Severity:" in the two description texts in group D, then it is determined that there is no placeholder parameter on the left side of the text "Severity:" in the model corresponding to group D. At the same time, since there is text on the right side of the text "Severity:" in the two description texts in group D, the condition that there is text on the right side of the text "Severity:" in one description text in group D is met, then there is a placeholder parameter on the right side of the text "Severity:" in the model corresponding to group D.

[0066] Reference Figure 2 FIG. 1 is a schematic diagram of a text processing device provided in an embodiment of the present application, the device comprising:

[0067] A matching unit 20 is used to obtain log data of a specific service module of the cloud service system, extract at least one description text from the log data, and for each extracted description text, match the description text with a model in a preset model library, wherein the model library contains a plurality of models, each model includes at least one text, and at least one model among the plurality of models includes at least one placeholder parameter;

[0068] A determination unit 21, configured to determine the model matched by the at least one description text and the number of times the corresponding model is matched according to the matching result;

[0069] The step of matching the description text with a model in a preset model library includes:

[0070] At least one segmentation is obtained by segmenting the description text;

[0071] Each time a model is taken out from the model library, whether the description text matches the model is determined by judging whether the at least one word segmentation matches the text included in the model, until a model matching the description text is found or no model matching the description text is found after traversing all models.

[0072] The text processing device provided in the embodiment of the present application performs model matching on the descriptive text extracted from the log data of a specific service module of the cloud service system, so as to determine the number of times each model is matched. R&D / operation and maintenance personnel can obtain abnormal information in a timely manner through this number, and then solve the problems that arise online in a timely manner.

[0073] The text processing device provided in the embodiment of the present application has an implementation process that is consistent with the text processing method provided in the embodiment of the present application, and the effect that can be achieved is also the same as the text processing method provided in the embodiment of the present application, which will not be repeated here.

[0074] like Figure 3 As shown, an electronic device provided by an embodiment of the present application includes: a processor 30, a memory 31 and a bus 32, wherein the memory 31 stores machine-readable instructions executable by the processor 30, and when the electronic device is running, the processor 30 communicates with the memory 31 through the bus 32, and the processor 30 executes the machine-readable instructions to perform the steps of the above-mentioned text processing method.

[0075] Specifically, the above-mentioned memory 31 and processor 30 can be general-purpose memories and processors, which are not specifically limited here. When the processor 30 runs the computer program stored in the memory 31, the above-mentioned text processing method can be executed.

[0076] Corresponding to the above-mentioned text processing method, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned text processing method are executed.

[0077] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A text processing method, characterized in that: include: Obtaining log data of a specific service module of the cloud service system, extracting at least one description text from the log data, and matching each extracted description text with a model in a preset model library, wherein the model library contains a plurality of models, each model includes at least one text, and at least one model among the plurality of models includes at least one placeholder parameter; Determine, according to the matching result, the model matched by the at least one description text and the number of times the corresponding model is matched; The step of matching the description text with a model in a preset model library includes: At least one segmentation is obtained by segmenting the description text; Each time a model is taken out from the model library, whether the description text matches the model is determined by judging whether the at least one word segmentation matches the text included in the model, until a model matching the description text is found or no model matching the description text is found after traversing all models; The determining whether the description text matches the model by judging whether the at least one word segment matches the text included in the model includes: Determining whether the at least one word segmentation satisfies a preset condition; If the at least one segmented word satisfies the preset condition, it is determined that the at least one segmented word matches the text included in the model; otherwise, it is determined that the at least one segmented word does not match the text included in the model, wherein the preset condition includes: the at least one segmented word has the text structure of the model; Before matching the description text with the model in the preset model library, the method further includes: Obtaining log data of a specific service module of the cloud service system, extracting a plurality of description texts from the log data, and clustering the plurality of description texts to obtain at least one description text class; For each description text class, determine whether the number of description texts in the description text class is greater than 1 or equal to 1, if the number of description texts in the description text class is equal to 1, then put the description texts in the description text class into one group, or if the number of description texts in the description text class is greater than 1, then calculate the longest common subsequence of each description text in the description text class except the benchmark and the benchmark, and determine whether there is a target description text in the description text class according to the longest common subsequence, if there is no target description text, then put the benchmark into one group, or if there is a target description text, then put the target description text and the benchmark into one group; At least one model is determined according to the obtained grouping, and a model library is constructed according to the at least one model.

2. The method according to claim 1, characterized in that If each text included in the model can be obtained by combining one participle of the at least one participle or at least two consecutive participles, and the participles used in each combination process of obtaining the text of the model by combining participles are taken from all the participles after the most recent participle that can be combined into the text of the model or all the participles before the most recent participle that can be combined into the text of the model, then it is determined that the at least one participle has the text structure of the model.

3. The method according to claim 1 or 2, characterized in that The preset conditions also include: the similarity between the first text and the second text is greater than a first threshold, the first text is a text composed of texts included in the model, and the second text is a text composed of the at least one segmented word.

4. The method according to claim 3, characterized in that The calculation process of whether the similarity between the first text and the second text is greater than the first threshold includes: Calculating hash values ​​of all texts included in the model and the hash value of the at least one word segmentation, and calculating a hash value of the first text according to the hash values ​​of all texts included in the model, and calculating a hash value of the second text according to the hash value of the at least one word segmentation; The Hamming distance between the first text and the second text is calculated according to the hash value of the first text and the hash value of the second text, and when the Hamming distance is less than the second threshold, it is determined that the similarity is greater than the first threshold.

5. The method according to claim 1, characterized in that The step of obtaining at least one segmented word by segmenting the description text includes: Determine whether there are Chinese characters in the description text; If there are Chinese characters in the description text, the description text is segmented into Chinese words, or if there are no Chinese characters in the description text, the description text is segmented into English words; According to the word segmentation result, at least one word segmentation is obtained.

6. The method according to claim 1, characterized in that The step of determining at least one model according to the obtained grouping includes: For each group obtained, a model corresponding to the group is generated, wherein the text contained in the model corresponding to the group whose number of descriptive texts is equal to 1 is the descriptive text in the group, and the text contained in the model corresponding to the group whose number of descriptive texts is greater than 1 is generated according to the longest common subsequence of the word list corresponding to the descriptive text in the group.

7. The method according to claim 6, characterized in that For each text in the model corresponding to the group containing more than 1 descriptive texts, determine whether there are placeholder parameters on the left and right sides of the text; if there are no placeholder parameters on the left and right sides of all the texts in the model, generate the model based on all the texts in the model; or if there is a text among all the texts in the model and there is a placeholder parameter on the left or right side of the text, generate the model based on all the texts in the model and the existing placeholder parameters.

8. A text processing device, characterized in that: include: A matching unit, configured to obtain log data of a specific service module of the cloud service system, extract at least one description text from the log data, and for each extracted description text, match the description text with a model in a preset model library, wherein the model library contains a plurality of models, each model includes at least one text, and at least one model among the plurality of models includes at least one placeholder parameter; A determination unit, configured to determine the model matched by the at least one description text and the number of times the corresponding model is matched according to the matching result; The step of matching the description text with a model in a preset model library includes: At least one segmentation is obtained by segmenting the description text; Each time a model is taken out from the model library, whether the description text matches the model is determined by judging whether the at least one word segmentation matches the text included in the model, until a model matching the description text is found or no model matching the description text is found after traversing all models; The determining whether the description text matches the model by judging whether the at least one word segment matches the text included in the model includes: Determining whether the at least one word segmentation satisfies a preset condition; If the at least one segmented word satisfies the preset condition, it is determined that the at least one segmented word matches the text included in the model; otherwise, it is determined that the at least one segmented word does not match the text included in the model, wherein the preset condition includes: the at least one segmented word has the text structure of the model; The matching unit is further used to obtain log data of a specific service module of the cloud service system before matching the description text with a model in a preset model library, extract multiple description texts from the log data, cluster the multiple description texts to obtain at least one description text class; for each description text class, determine whether the number of description texts in the description text class is greater than 1 or equal to 1, if the number of description texts in the description text class is equal to 1, put the description texts in the description text class into a group, or if the number of description texts in the description text class is greater than 1, calculate the longest common subsequence of each description text in the description text class except the benchmark and the benchmark, determine whether there is a target description text in the description text class according to the longest common subsequence, if there is no target description text, put the benchmark into a group, or if there is a target description text, put the target description text and the benchmark into a group; determine at least one model according to the obtained grouping, and build a model library according to the at least one model.

Citation Information

Patent Citations

  • Method and device for detecting text similarity, storage medium and electronic equipment

    CN116910180A

  • Log template matching method and cloud management platform

    CN118277179A