Intelligent network card fault positioning method and device, equipment and storage medium
By obtaining the log statements to be matched during the time period of the smart network card failure, and matching the similarity with the pre-stored log statement data set, the target log statement is determined to generate comparison results, the problem of low efficiency of the smart network card failure positioning is solved and faster fault positioning is achieved.
Patent Information
- Application Number
- CN202411784718.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-18
AI Technical Summary
Due to its complex design and low fault positioning efficiency, smart network cards need to coordinate multiple development groups to determine the problem.
By obtaining the log statement to be matched by each component during the failure period, calculating its similarity to the pre-stored log statement dataset, thereby determining the target log statement and generating comparison results to help the user locate the fault.
It improves the efficiency of fault location of smart network card, reduces the amount of calculation, simplifies the coordination process, and enables faults to be located more quickly.
Smart Images

Figure CN119645707A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for locating faults of an intelligent network card. Background Art
[0002] At present, mainstream data processors (Data Process Unit, DPU) (also known as smart network cards) mostly adopt a design architecture that combines software and hardware. The overall complexity is relatively high, and multiple components need to work together to provide normal services. As a result, when a problem occurs during testing or operation and maintenance, the problem location is relatively complex, and it is necessary to coordinate developers from different development groups to determine the problem, resulting in low efficiency in fault location for smart network cards.
[0003] Therefore, how to improve the efficiency of smart network card fault location has become an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device and storage medium for locating faults of a smart network card, which are conducive to improving the efficiency of locating faults of a smart network card.
[0005] In a first aspect, an embodiment of the present application provides a method for locating a fault of an intelligent network card, the method comprising:
[0006] In the case of a fault in the smart network card, the log statements to be matched corresponding to each component in the smart network card during the fault time period are obtained; the fault time period includes the time when the smart network card fails;
[0007] For each log statement to be matched, determine the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and determine at least one target log statement corresponding to the log statement to be matched from the log statement data set based on multiple similarities; the log statement data set is obtained based on the source code corresponding to each component in the smart network card;
[0008] Based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and corresponding similarities, a comparison result is obtained; the comparison result is used by the user to locate the fault of the smart network card.
[0009] In one of the embodiments, when a smart network card fails, log statements to be matched corresponding to each component in the smart network card during the failure time period are obtained, including: when a smart network card fails, based on a preset log function corresponding to each component in the smart network card, multiple log logs corresponding to each component are obtained; from the multiple log logs corresponding to each component, the log log corresponding to the failure time period is intercepted, and based on the log log corresponding to the failure time period, the log statement to be matched corresponding to the component is determined.
[0010] In one of the embodiments, based on multiple similarities, at least one target log statement corresponding to the log statement to be matched is determined from the log statement data set, including: selecting a preset number of log statements corresponding to the log statement to be matched from the log statement data set according to the principle of selecting similarities from high to low; and using the selected preset number of log statements as at least one target log statement corresponding to the log statement to be matched.
[0011] In one of the embodiments, the method further includes: obtaining statement information corresponding to each target log statement; the statement information includes a function name, a file name, and submission author information; and obtaining a comparison result based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched and the corresponding similarities, and the statement information corresponding to each target log statement.
[0012] In one of the embodiments, the method also includes: obtaining source code corresponding to each component in the smart network card; based on a preset log function corresponding to each component, obtaining a log log corresponding to the component from the source code corresponding to each component; based on the log log corresponding to each component, determining multiple log statements corresponding to each component; based on the multiple log statements corresponding to each component, obtaining a log statement data set, and storing the log statement data set.
[0013] In one of the embodiments, a log statement data set is obtained based on multiple log statements corresponding to each component, including: performing format symbol replacement processing on the multiple log statements corresponding to each component to obtain multiple processed log statements corresponding to each component; and obtaining a log statement data set based on the multiple processed log statements corresponding to each component.
[0014] In a second aspect, the present application provides a smart network card fault location device, the device comprising:
[0015] An acquisition module, used for acquiring, when a fault occurs on the smart network card, log statements to be matched corresponding to each component in the smart network card during a fault time period; the fault time period includes the time when the fault occurs on the smart network card;
[0016] a determination module, configured to determine, for each log statement to be matched, a similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and determine, based on multiple similarities, at least one target log statement corresponding to the log statement to be matched from the log statement data set; the log statement data set is obtained based on source code corresponding to each component in the smart network card;
[0017] The comparison result obtaining module obtains the comparison result based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and the corresponding similarity; the comparison result is used by the user to locate the fault of the smart network card.
[0018] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0019] In the case of a fault in the smart network card, the log statements to be matched corresponding to each component in the smart network card during the fault time period are obtained; the fault time period includes the time when the smart network card fails;
[0020] For each log statement to be matched, determine the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and determine at least one target log statement corresponding to the log statement to be matched from the log statement data set based on multiple similarities; the log statement data set is obtained based on the source code corresponding to each component in the smart network card;
[0021] Based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and corresponding similarities, a comparison result is obtained; the comparison result is used by the user to locate the fault of the smart network card.
[0022] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0023] In the case of a fault in the smart network card, the log statements to be matched corresponding to each component in the smart network card during the fault time period are obtained; the fault time period includes the time when the smart network card fails;
[0024] For each log statement to be matched, determine the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and determine at least one target log statement corresponding to the log statement to be matched from the log statement data set based on multiple similarities; the log statement data set is obtained based on the source code corresponding to each component in the smart network card;
[0025] Based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and corresponding similarities, a comparison result is obtained; the comparison result is used by the user to locate the fault of the smart network card.
[0026] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0027] In the case of a fault in the smart network card, the log statements to be matched corresponding to each component in the smart network card during the fault time period are obtained; the fault time period includes the time when the smart network card fails;
[0028] For each log statement to be matched, determine the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and determine at least one target log statement corresponding to the log statement to be matched from the log statement data set based on multiple similarities; the log statement data set is obtained based on the source code corresponding to each component in the smart network card;
[0029] Based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and corresponding similarities, a comparison result is obtained; the comparison result is used by the user to locate the fault of the smart network card.
[0030] According to the above-mentioned intelligent network card fault locating method, device, equipment and storage medium, the computer equipment can obtain the to-be-matched log statements corresponding to each component in the intelligent network card within the fault time period when the intelligent network card fails; the fault time period includes the moment when the intelligent network card fails; for each log statement to be matched, determine the similarity between the to-be-matched log statement and each log statement in the pre-stored log statement data set, and based on multiple similarities, determine at least one target log statement corresponding to the to-be-matched log statement from the log statement data set; the log statement data set is obtained based on the source code corresponding to each component in the intelligent network card; based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched and the corresponding similarities, obtain a comparison result; the comparison result is used by the user to locate the fault of the intelligent network card. By adopting this method, the computer device can determine the similarity between the log statements to be matched corresponding to each component in the smart network card within the fault time period and the log statements in the pre-stored log statement data set obtained based on the source code corresponding to each component in the smart network card, and based on the similarity, determine at least one target log statement corresponding to the log statement to be matched from the log statement data set, so that at least one source code corresponding to the log statement to be matched within the fault time period can be quickly determined, thereby facilitating improving the efficiency of smart network card fault locating. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 This is a schematic diagram of an application scenario of a smart network card fault locating method provided in an embodiment of the present application;
[0033] Figure 2 It is a flowchart of a method for locating a fault of an intelligent network card provided in an embodiment of the present application;
[0034] Figure 3 It is a flowchart of another intelligent network card fault locating method provided in an embodiment of the present application;
[0035] Figure 4 is a schematic diagram of comparison results displayed on a user interface provided in an embodiment of the present application;
[0036] Figure 5It is a schematic diagram of a process of obtaining and storing a log statement data set corresponding to a smart network card provided in an embodiment of the present application;
[0037] Figure 6 It is a structural schematic diagram of a smart network card fault locating device provided in an embodiment of the present application;
[0038] Figure 7 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0040] See also Figure 1 , Figure 1 Schematic diagram of an application scenario of a smart network card fault location method provided in an embodiment of the present application. Figure 1 As shown, the computer device 100 includes a smart network card 101.
[0041] When the computer device 100 detects that the smart network card 101 has a fault, it can determine the similarity between the log statements to be matched corresponding to each component in the smart network card during the fault time period and the log statements in the log statement data set obtained based on the source code corresponding to each component in the smart network card, and determine at least one target log statement corresponding to the log statement to be matched from the log statement data set based on the similarity. Afterwards, the computer device 100 can obtain a comparison result for the user to locate the fault of the smart network card based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and the corresponding similarity, so that at least one source code corresponding to the log statement to be matched during the fault time period can be quickly determined, thereby facilitating the efficiency of locating the fault of the smart network card.
[0042] Optionally, the computer device 100 may be a terminal device or a server. The terminal device mentioned here may include but is not limited to a desktop computer, a laptop computer, etc.; the server mentioned here may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers.
[0043] See also Figure 2 , Figure 2 1 is a flow chart of a method for locating faults of an intelligent network card provided in an embodiment of the present application. The method can be executed by a computer device (for example, the above-mentioned computer device 100). Figure 2As shown, the intelligent network card fault locating method may include but is not limited to the following steps:
[0044] S201. When a fault occurs on the smart network card, obtain log statements to be matched corresponding to each component in the smart network card during the fault time period.
[0045] The fault time period includes the time when the smart network card fails. For example, if the smart network card fails at 15:00 on November 29, 2024, the fault time period may be from 14:55 to 15:05 on November 29, 2024.
[0046] Optionally, the fault time period may be determined by the computer device when detecting a selection operation on a time period selection option in the user interface, or may be determined by the computer device when detecting an input operation on a time period input box in the user interface, which is not limited here. That is, the user may select the fault time period through the time period selection option in the user interface, or may input the fault time period in the time period input box in the user interface.
[0047] Among them, Smart NICs can also be called data processors, which are dedicated hardware accelerators designed to handle large-scale data processing tasks. Smart NICs usually include highly optimized processing units, storage, network interfaces, etc., mainly used to efficiently process data streams.
[0048] Among them, the components in the smart network card may include but are not limited to the Open vSwitch (OVS) component, the Storage Performance Development Kit (SPDK) component, and the Data Plane Development Kit (DPDK) component. Among them, OVS is an open source implementation of a distributed virtual multilayer switch, whose main purpose is to provide a switching stack for a hardware virtualization environment while supporting a variety of protocols and standards used in computer networks. SPDK is a user-level protocol stack and tool set designed to improve performance storage applications, focusing on storage performance acceleration, which provides powerful functions and performance for processing high-speed storage devices. DPDK is an open source software library and tool set for high-performance packet processing, focusing on user-level protocol stacks, and its goal is to provide the performance and scalability required for high-throughput and low-latency network applications in the fields of network function virtualization and cloud computing.
[0049] The to-be-matched log statements corresponding to the components in the smart network card refer to the log statements corresponding to each component in the smart network card during the fault time period.
[0050] S202: for each log statement to be matched, determine the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and based on multiple similarities, determine at least one target log statement corresponding to the log statement to be matched from the log statement data set.
[0051] Among them, the log statement dataset is obtained based on the source code corresponding to each component in the smart network card.
[0052] The similarity between the log statement to be matched and each log statement in the pre-stored log statement data set may be cosine similarity.
[0053] Optionally, the computer device determines the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, which can be obtained by using a term frequency-inverse document frequency (TF-IDF) algorithm to perform similarity matching between the log statement to be matched and each log statement in the pre-stored log statement data set, or by inputting the log statement to be matched and each log statement in the pre-stored log statement data set into a bidirectional encoder representation from transformers (BERT) model, which is not limited here.
[0054] Among them, TF-IDF is a commonly used weighting technology for information retrieval and text mining. It is a statistical method used to evaluate the importance of a word to a document set or one of the documents in a corpus. BERT is a pre-trained language model based on Transformer that can be used for various natural language processing tasks, including text similarity calculation.
[0055] S203: Obtain a comparison result based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and corresponding similarities; the comparison result is used by the user to locate the fault of the smart network card.
[0056] In an optional implementation, after step S203, the computer device may further output a comparison result, so that the user can locate the fault of the smart network card based on the comparison result.
[0057] In an embodiment of the present application, when a smart network card fails, a computer device can obtain log statements to be matched corresponding to each component in the smart network card within a failure time period; the failure time period includes the moment when the smart network card fails; for each log statement to be matched, determine the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and based on multiple similarities, determine at least one target log statement corresponding to the log statement to be matched from the log statement data set; the log statement data set is obtained based on the source code corresponding to each component in the smart network card; based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and the corresponding similarities, obtain a comparison result; the comparison result is used by the user to locate the failure of the smart network card. By adopting this method, the computer device can determine the similarity between the log statements to be matched corresponding to each component in the smart network card within the fault time period and the log statements in the pre-stored log statement data set obtained based on the source code corresponding to each component in the smart network card, and based on the similarity, determine at least one target log statement corresponding to the log statement to be matched from the log statement data set, so that at least one source code corresponding to the log statement to be matched within the fault time period can be quickly determined, thereby facilitating improving the efficiency of smart network card fault locating.
[0058] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of another intelligent network card fault location method provided in an embodiment of the present application. Figure 2 The difference between the SmartNIC location method shown is that Figure 3 The method also specifically describes how the computer device obtains the log statements to be matched corresponding to each component in the smart network card during the fault time period when the smart network card fails, and how to determine at least one target log statement corresponding to the log statement to be matched from the log statement data set based on multiple similarities. Figure 3 As shown, the smart network card positioning method may include but is not limited to the following steps:
[0059] S301. When a fault occurs on the smart network card, based on preset log functions corresponding to various components in the smart network card, obtain multiple logs corresponding to each component;
[0060] Among them, each component in the smart network card may correspond to at least one preset log function.
[0061] Optionally, when a fault occurs on the smart network card, the computer device can use a one-click log collection script to obtain multiple logs corresponding to each component in the smart network card with one click.
[0062] S302: extract the log corresponding to the fault time period from the multiple logs corresponding to each component, and determine the log statement to be matched corresponding to the component based on the log corresponding to the fault time period.
[0063] The fault time period includes the time when the smart network card fails. Optionally, the fault time period can be determined by the computer device when it detects a selection operation for the time period selection option in the user interface, or when it detects an input operation for the time period input box in the user interface, which is not limited here. In other words, the user can select the fault time period through the time period selection option in the user interface, or can enter the fault time period in the time period input box in the user interface.
[0064] Optionally, the computer device determines that the to-be-matched log statement corresponding to each component may include limited troubleshooting components represented by "ERROR" and "FATAL" fields obtained by simply searching the log log corresponding to the component during the fault time period.
[0065] S303: For each log statement to be matched, determine the similarity between the log statement to be matched and each log statement in the pre-stored log statement data set.
[0066] Among them, the log statement dataset is obtained based on the source code corresponding to each component in the smart network card.
[0067] In an optional implementation, the computer device determines the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and may use a TF-IDF algorithm to perform similarity matching on the log statement to be matched and each log statement in the pre-stored log statement data set to obtain the similarity between the log statement to be matched and each log statement in the pre-stored log statement data set.
[0068] Optionally, the computer device uses a TF-IDF algorithm to perform similarity matching between the log statement to be matched and each log statement in a pre-stored log statement data set, so as to obtain the similarity between the log statement to be matched and each log statement in the pre-stored log statement data set, which may include but is not limited to the following steps:
[0069] Step 1: Import the TF-IDF vectorizer and cosine similarity calculation function.
[0070] Step 2: Create a TF-IDF vectorizer TfidfVectorizer(), which is used to convert text into a TF-IDF weight matrix.
[0071] Step 3. Use the fit_transform() method of the vectorizer to convert the two input sentences (one log sentence to be matched and one log sentence in the log sentence dataset) into a TF-IDF weight matrix tfidf_matrix.
[0072] Step 4. Use the cosine similarity calculation function (cosine_similarity()) to calculate the cosine similarity between two sentences in the TF-IDF weight matrix.
[0073] In another optional embodiment, the computer device determines the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, which can be done by inputting the log statement to be matched and each log statement in the pre-stored log statement data set into a BERT model to obtain the similarity between the log statement to be matched and each log statement in the pre-stored log statement data set.
[0074] Optionally, the computer device inputs the log sentence to be matched and each log sentence in the pre-stored log sentence data set into the BERT model to obtain the similarity between the log sentence to be matched and each log sentence in the pre-stored log sentence data set, which may include but is not limited to the following steps:
[0075] Step 1: Use BERT's tokenizer to encode the two input sentences (a log sentence to be matched and a log sentence in the log sentence dataset) into a token sequence.
[0076] Step 2: Convert the token sequence into a torch tensor and input it into the BERT model.
[0077] Step 3: Obtain the vector representation of the [CLS] token corresponding to the two sentences through the output of the BERT model.
[0078] Step 4: Use cosine similarity to calculate the similarity between the vector representations of the [CLS] tokens corresponding to the two sentences.
[0079] S304 . Select a preset number of log statements corresponding to the log statements to be matched from the log statement data set according to the principle of selecting from high to low similarity.
[0080] Exemplarily, assuming that the preset number is 5, assuming that the log statement to be matched is log statement 1 to be matched, assuming that the similarity between log statement 1 to be matched and log statement 1 in the log statement data set is 0.92, the similarity between log statement 1 to be matched and log statement 2 in the log statement data set is 0.71, the similarity between log statement 1 to be matched and log statement 3 in the log statement data set is 0.73, the similarity between log statement 1 to be matched and log statement 4 in the log statement data set is 0.90, the similarity between log statement 5 in the log statement data set is 0.91, the similarity between log statement 6 in the log statement data set is 0.88, and the similarity between log statement 1 to be matched and log statement 7 in the log statement data set is 0.85. In this case, the computer device can select log statement 1, log statement 5, log statement 4, log statement 6 and log statement 7 in the log statement data set according to the principle of selecting similarities from high to low, and use the above 5 selected log statements as the target log statements corresponding to log statement 1 to be matched.
[0081] S305: Use the selected preset number of log statements as at least one target log statement corresponding to the log statement to be matched.
[0082] Since at least one target log statement corresponding to the log statement to be matched is selected from the log statement data set, and the log statement data set is obtained based on the source code corresponding to each component in the smart network card, therefore, the at least one target log statement corresponding to the log statement to be matched is also the log statement in at least one source code corresponding to the log statement to be matched.
[0083] S306. Obtain statement information corresponding to each target log statement; the statement information includes function name, file name, and submission author information.
[0084] In an optional implementation, the statement information corresponding to the target log statement may be obtained by the computer device from pre-stored log list information.
[0085] Exemplarily, the log list information may be shown in Table 1 below.
[0086] Table 1 log list information table
[0087]
[0088] That is, after obtaining at least one target log statement (i.e., a log statement in the source code) that matches each log statement to be matched during the fault time period, the computer device can obtain the statement information corresponding to each target log statement from the database. This helps users locate the fault of the smart network card more quickly in the future.
[0089] S307 . Obtain a comparison result based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched and the corresponding similarity, and statement information corresponding to each target log statement.
[0090] In an optional embodiment, the computer device can also output the comparison result. Figure 4 , Figure 4 Schematic diagram of comparison results displayed on a user interface provided in an embodiment of the present application. Figure 4 As shown, the comparison result includes a fault log timeline part, a matched source code part, and a function call timeline part. The fault log timeline part includes five log statements to be matched corresponding to multiple components in the smart network card on the fault timeline; the matched source code part includes the log statements in the five source codes corresponding to the log statement 2 to be matched (i.e., the target statements) obtained by text similarity matching when a selection operation for the log statement 2 to be matched is detected, and the similarity between the log statement 2 to be matched and the log statements in each source code corresponding thereto; the function call timeline part includes the statement information corresponding to the log statement in the source code with the highest matching degree matched by each log statement to be matched.
[0091] In the embodiment of the present application, on the one hand, the computer device can obtain multiple log logs corresponding to each component based on the preset log function corresponding to each component in the smart network card when a fault occurs in the smart network card; from the multiple log logs corresponding to each component, the log log corresponding to the fault time period is intercepted, and the log statement to be matched corresponding to the component is determined based on the log log corresponding to the fault time period, so that the subsequent similarity comparison of all log statements corresponding to each component with each log statement in the pre-stored log statement data set can be avoided, thereby reducing the amount of calculation when locating the fault of the smart network card, and thus, it is beneficial to improve the efficiency of locating the fault of the smart network card. On the other hand, the computer device can determine the similarity between the log statements to be matched corresponding to each component in the smart network card in the fault time period and the log statements in the pre-stored log statement data set obtained based on the source code corresponding to each component in the smart network card, and based on the similarity, determine at least one target log statement corresponding to the log statement to be matched from the log statement data set, so that at least one source code corresponding to the log statement to be matched in the fault time period can be quickly determined, thereby, it is beneficial to improve the efficiency of locating the fault of the smart network card.
[0092] In an optional embodiment, Figure 2 and Figure 3 The log statement database mentioned in the smart network card fault locating method shown is determined by a computer device in the following manner: obtaining the source code corresponding to each component in the smart network card; based on the preset log function corresponding to each component, obtaining the log log corresponding to the component from the source code corresponding to each component; based on the log log corresponding to each component, determining multiple log statements corresponding to each component; based on the multiple log statements corresponding to each component, obtaining a log statement data set, and storing the log statement data set.
[0093] In some embodiments, the various codes of the software are usually managed by code management tools such as github and gitea. In this case, the computer device obtains the source code corresponding to each component in the smart network card by using the git clone command to obtain the source code corresponding to each component.
[0094] In some embodiments, the preset log function corresponding to each component may include at least one. For example, the preset log function corresponding to the OVS component in the smart network card may be as shown in Table 2 below.
[0095] Table 2 Preset log function table corresponding to OVS components
[0096]
[0097] That is, the computer device can obtain the log corresponding to the OVS component from the source code corresponding to the OVS component based on VLOG_DBG, VLOG_INFO, VLOG_WARN, VLOG_ERR and VLOG_FATAL.
[0098] For another example, the preset log functions corresponding to the SPDK component may include but are not limited to SPDK_NOTICELOG, SPDK_WARNLOG, SPDK_PRINTF, SPDK_ERRLOG, and SPDK_INFOLOG. In other words, the computer device can obtain the log corresponding to the SPDK component from the source code corresponding to the SPDK component based on the above log functions.
[0099] In some embodiments, the computer device obtains the log statement data set based on the multiple log statements corresponding to each component, which may include: performing format symbol replacement processing on the multiple log statements corresponding to each component to obtain the multiple processed log statements corresponding to each component; and obtaining the log statement data set based on the multiple processed log statements corresponding to each component. This is conducive to improving the efficiency of subsequent similarity matching processing (i.e., for each log statement to be matched, determining the similarity between the log statement to be matched and each log statement in the pre-stored log statement data set).
[0100] For example, assuming that the log statement is ""Changed zone limit of %u for zone %d", limit, zone", in this case, the computer device can replace %u and %d in the log statement, for example, replacing %u with a randomly generated unsigned integer (for example, 2), and replacing %d with a randomly generated positive integer (for example, 1), to obtain the replaced log statement, that is, ""Changed zone limit of 2 for zone 1", limit, zone".
[0101] In some embodiments, the computer device stores the log statement data set, which may be storing the log statement data set in a database (eg, mysql, postgresql).
[0102] For example, see Figure 5 , Figure 5 Schematic diagram of the process of obtaining and storing a log statement data set corresponding to a smart network card provided in an embodiment of the present application. Figure 5As shown, the computer device can first obtain the source code of the smart network card components, such as OVS, SPDK and other components, from the source code repository, and then obtain the log statement corresponding to each component. Then, the computer device can merge the log statements corresponding to each component to obtain a log list information table, wherein the log list information table includes the component name, log content (or log statement), log level, function name, class name, file name and finally submission author information. Afterwards, the computer device can replace the special characters in the log content in the log list information table to obtain a processed log list information table. Finally, the computer device can store the processed log list information table in the database.
[0103] By adopting this implementation mode, the computer device can obtain multiple log statements corresponding to each component in the smart network card from the source code corresponding to the component in advance, and obtain a log statement data set based on the multiple log statements corresponding to each component, and store the log statement data set. This is conducive to directly obtaining the log statement data set from the database during the process of locating the smart network card fault, thereby improving the efficiency of locating the smart network card fault.
[0104] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0105] Based on the same inventive concept, the embodiment of the present application also provides a smart network card fault location device for implementing the smart network card fault location method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more smart network card fault location device embodiments provided below can refer to the limitations of the smart network card fault location method above, and will not be repeated here.
[0106] See also Figure 6 , Figure 6 Schematic diagram of a structure of a smart network card fault location device provided in an embodiment of the present application. Figure 6 As shown, the intelligent network card fault location device may include but is not limited to:
[0107] The acquisition module 601 is used to acquire, when a fault occurs on the smart network card, log statements to be matched corresponding to each component in the smart network card within a fault time period; the fault time period includes the time when the fault occurs on the smart network card;
[0108] A determination module 602 is used to determine, for each of the log statements to be matched, a similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and determine, based on a plurality of the similarities, at least one target log statement corresponding to the log statement to be matched from the log statement data set; the log statement data set is obtained based on source code corresponding to each component in the smart network card;
[0109] The comparison result obtaining module 603 obtains a comparison result based on the multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and the corresponding similarities; the comparison result is used by the user to locate the fault of the smart network card.
[0110] In one embodiment, when the acquisition module 601 is used to obtain the log statements to be matched corresponding to each component in the smart network card within the fault time period when a fault occurs in the smart network card, it is specifically used to: when a fault occurs in the smart network card, based on the preset log function corresponding to each component in the smart network card, obtain multiple log logs corresponding to each component; from the multiple log logs corresponding to each component, intercept the log log corresponding to the fault time period, and determine the log statement to be matched corresponding to the component based on the log log corresponding to the fault time period.
[0111] In one embodiment, when the determination module 602 is used to determine at least one target log statement corresponding to the log statement to be matched from the log statement data set based on multiple similarities, it is specifically used to: select a preset number of log statements corresponding to the log statement to be matched from the log statement data set according to the principle of selecting similarities from high to low; and use the selected preset number of log statements as at least one target log statement corresponding to the log statement to be matched.
[0112] In one embodiment, the acquisition module 601 is also used to: obtain statement information corresponding to each target log statement; the statement information includes function name, file name and submission author information; the comparison result acquisition module 603 is also used to obtain the comparison result based on multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched and the corresponding similarity, and the statement information corresponding to each target log statement.
[0113] In one embodiment, the device may further include a log statement data set acquisition and storage module. The acquisition module 601 is also used to acquire the source code corresponding to each component in the smart network card; based on the preset log function corresponding to each component, the log log corresponding to the component is acquired from the source code corresponding to each component; the determination module 602 is also used to determine the multiple log statements corresponding to each component based on the log log corresponding to each component; the log statement data set acquisition and storage module is used to obtain the log statement data set based on the multiple log statements corresponding to each component, and store the log statement data set.
[0114] In one embodiment, when the log statement data set acquisition and storage module is used to obtain a log statement data set based on multiple log statements corresponding to each component, it is specifically used to: perform format symbol replacement processing on the multiple log statements corresponding to each component to obtain multiple processed log statements corresponding to each component; and obtain a log statement data set based on the multiple processed log statements corresponding to each component.
[0115] Each module in the above-mentioned intelligent network card fault location device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the terminal device in the form of hardware, or can be stored in the memory in the terminal device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0116] In an exemplary embodiment, the present application provides a computer device, which may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for locating a fault of an intelligent network card is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0117] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] In an exemplary embodiment, the present application provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned smart network card positioning method when executing the computer program.
[0119] In an exemplary embodiment, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above-mentioned smart network card positioning method are implemented.
[0120] In an exemplary embodiment, the present application provides a computer program product, including a computer program, which implements the steps in the above-mentioned smart network card positioning method when executed by a processor.
[0121] It should be noted that the data involved in this application (including but not limited to log statements to be matched, log statement data sets, similarities, comparison results, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0122] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0123] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0124] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for locating faults of an intelligent network card, characterized in that: The method comprises: In the case where the smart network card fails, obtaining the log statements to be matched corresponding to each component in the smart network card during the failure time period; the failure time period includes the time when the smart network card fails; For each of the log statements to be matched, determine the similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and based on a plurality of the similarities, determine at least one target log statement corresponding to the log statement to be matched from the log statement data set; the log statement data set is obtained based on the source code corresponding to each component in the smart network card; Based on the multiple log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and the corresponding similarities, a comparison result is obtained; the comparison result is used by the user to locate the fault of the smart network card.
2. The method according to claim 1, characterized in that: When a fault occurs on the smart network card, obtaining the log statements to be matched corresponding to the components in the smart network card during the fault time period includes: In the event of a fault in the smart network card, based on a preset log function corresponding to each component in the smart network card, a plurality of log logs corresponding to each component are obtained; From the multiple log logs corresponding to each of the components, the log log corresponding to the fault time period is intercepted, and based on the log log corresponding to the fault time period, the log statement to be matched corresponding to the component is determined.
3. The method according to claim 1, characterized in that: The determining, based on the plurality of similarities, at least one target log statement corresponding to the log statement to be matched from the log statement data set comprises: According to the principle of selecting similarities from high to low, selecting a preset number of log statements corresponding to the log statements to be matched from the log statement data set; The selected preset number of log statements are used as at least one target log statement corresponding to the log statement to be matched.
4. The method according to claim 1, characterized in that: The method further comprises: Obtain statement information corresponding to each of the target log statements; the statement information includes function name, file name, and submission author information; A comparison result is obtained based on the plurality of log statements to be matched, at least one target log statement corresponding to each of the log statements to be matched and the corresponding similarities, and statement information corresponding to each of the target log statements.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Obtain source code corresponding to each component in the smart network card; Based on the preset log function corresponding to each of the components, obtain the log corresponding to the component from the source code corresponding to each of the components; Based on the log log corresponding to each of the components, determine a plurality of log statements corresponding to each of the components; Based on the multiple log statements corresponding to each of the components, the log statement data set is obtained, and the log statement data set is stored.
6. The method according to claim 5, characterized in that The obtaining the log statement data set based on the multiple log statements corresponding to each of the components includes: Perform format symbol replacement processing on the multiple log statements corresponding to each of the components to obtain the processed multiple log statements corresponding to each of the components; Based on the processed multiple log statements corresponding to each of the components, the log statement data set is obtained.
7. A smart network card fault location device, characterized in that: The device comprises: An acquisition module, used for acquiring, when a fault occurs on the smart network card, log statements to be matched corresponding to each component in the smart network card within a fault time period; the fault time period includes the time when the fault occurs on the smart network card; A determination module, configured to determine, for each of the log statements to be matched, a similarity between the log statement to be matched and each log statement in a pre-stored log statement data set, and determine, based on a plurality of the similarities, at least one target log statement corresponding to the log statement to be matched from the log statement data set; the log statement data set is obtained based on a source code corresponding to each component in the smart network card; The comparison result obtaining module obtains the comparison result based on the plurality of log statements to be matched, at least one target log statement corresponding to each log statement to be matched, and the corresponding similarity; the comparison result is used by the user to locate the fault of the smart network card.
8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Anomaly detection method and device
CN111290870A
Matching statement determination method and device, equipment and storage medium
CN111414746A
Semantic matching method and device, computer equipment and storage medium
CN112149424A
Log matching method and device, storage medium and product
CN114595207A