Data processing method and device
By independent of the log information configuration file and parsing code, the problem of increasing code volume and high maintenance costs caused by the integration of log information analysis logic and description information in traditional code design logic is solved, and efficient log information analysis and maintenance is achieved.
Patent Information
- Application Number
- CN202411514955.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-01-14
AI Technical Summary
The traditional code design logic structure integrates log information parsing logic and log description information into the same code segment, resulting in an increase in code volume, high maintenance costs, and reducing the efficiency of R&D personnel.
通过将日志信息配置文件和日志信息解析代码独立出来,基于预先建立的配置文件对智能平台管理接口数据进行解析处理,独立更新配置文件和解析代码,避免重写解析代码。
It reduces the maintenance cost of log information parsing code, improves maintenance efficiency, avoids excessive increase in the amount of code, and simplifies the log information parsing process.
Smart Images

Figure CN119311659A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audit log technology, and in particular to a data processing method and device. Background Art
[0002] The logging function of the Baseboard Management Controller (BMC) is used to record the logs of various parts of the entire server system. The log content includes the parts defined by the Intelligent Platform Management Interface (IPMI) specification and the parts defined by the Original Equipment Manufacturer (OEM).
[0003] The traditional code design logic structure is to integrate the log information parsing logic and log description information in the same code segment or code file. During the log analysis process, the code is judged based on the various parameter data of the log, and then the corresponding log description information is matched. For example, when the IPMI Command command is used to start the server, the code will match the Command command and the passed parameters, and find the corresponding description information from the array. However, this code design logic structure will increase the amount of code as the number of OEM command commands increases, and the subsequent maintenance cost will also increase, reducing the efficiency of R&D personnel in code maintenance. Summary of the invention
[0004] The technical solution of this application is implemented as follows:
[0005] The present application provides a data processing method, which includes:
[0006] Obtain intelligent platform management interface data;
[0007] Based on the pre-established log information configuration file and log information parsing code, the intelligent platform management interface data is parsed and processed to obtain target log description information; the log information configuration file and the log information parsing code are independent of each other.
[0008] The present application provides a data processing device, including:
[0009] A first acquisition module is used to acquire intelligent platform management interface data;
[0010] The first data analysis module is used to parse and process the intelligent platform management interface data based on a pre-established log information configuration file and a log information analysis code to obtain target log description information; the log information configuration file and the log information analysis code are independent of each other.
[0011] The present application provides a data processing device, including:
[0012] a memory for storing executable data processing instructions;
[0013] The processor is used to implement the data processing method provided in the embodiment of the present application when executing the executable data processing instructions stored in the memory.
[0014] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. The computer-executable instructions are configured to execute the steps of the above-mentioned data processing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;
[0016] Figure 2 A schematic diagram of the structure branches of a BMC-based log parsing system provided in an embodiment of the present application;
[0017] Figure 3 A flow chart of a log data processing method based on BMC provided in an embodiment of the present application;
[0018] Figure 4 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0019] Figure 5 A schematic diagram of the composition structure of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] The technical solutions 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.
[0021] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0022] In the following description, reference is made to “some embodiments\other embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments\other embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0023] In the following description, the terms "first\second\" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0025] Based on the problems existing in the related art, the present application embodiment provides a data processing method, such as Figure 1 FIG. 1 is a flow chart of a data processing method provided in an embodiment of the present application, and the method comprises the following steps:
[0026] S101. Obtain intelligent platform management interface data.
[0027] In some embodiments, the intelligent platform management interface data may be data obtained through IPMI, and the intelligent platform management interface data may be an IPMI command or an OEM command. The IPMI command or the OEM command may include network function NetFunction identification information, command command identification information, and request data requst_data identification information, etc.
[0028] In some embodiments, when R&D personnel or testers need to perform log analysis or log audit on electronic devices, they can input intelligent platform management interface data through the IPMI interface, and then obtain IPMI data from the intelligent platform management interface.
[0029] S102: Based on the pre-established log information configuration file and log information parsing code, the intelligent platform management interface data is parsed and processed to obtain target log description information.
[0030] It should be noted that the log information configuration file can be a pre-established JSON file, and the log information configuration file can record at least one NetFunction description information and corresponding NetFunction identification information of the electronic device; at least one command identification information and corresponding command description information can be recorded under the directory of the same NetFunction identification information; at least one log description information matching rule and identification information corresponding to the log description information matching rule can be recorded under the directory of each command identification information (or command description information); each log description information matching rule (or identification information corresponding to the log description information matching rule) can include multiple log description information and identification information corresponding to the log description information. Among them, the NetFunction description information can represent the name of the functional module of the electronic device; the command description information can be used to describe the function of the functional module; the log description information matching rule can be used to determine the calculation method of the identification information corresponding to the log description information; the log description information can be used to describe multiple sub-functions of the functional module.
[0031] In some embodiments, the log information parsing code may be a program code stored in one or more program files. The log information parsing code includes log information parsing logic and may be used to parse the intelligent information management platform data to obtain log description information corresponding to the intelligent management platform data.
[0032] In some embodiments, the log information configuration file and the log information parsing code are independent of each other. Modification of the log information parsing code does not affect the content of the log information configuration file; after updating the content of the log information configuration file, only the corresponding logic description can be modified in the corresponding module of the log information parsing code, without rewriting the log information parsing code or modifying the overall architecture of the log information parsing code.
[0033] In the embodiment of the present application, the intelligent platform management interface data is obtained; based on the pre-established log information configuration file and log information parsing code, the intelligent platform management interface data is parsed and processed to obtain the target log description information. In this way, since the log information configuration file and the log information parsing code are independent of each other, after the content of the log information configuration file is updated, the code volume of the log information parsing code will not be greatly increased, and the log information parsing code does not need to be redesigned, so the maintenance cost of the log information parsing code in the later stage can be reduced, and the maintenance efficiency of the log information parsing code can be improved.
[0034] In some embodiments of the present application, after parsing and processing the intelligent platform management interface data based on a pre-established log information configuration file and log information parsing code to obtain the target log description information and the above-mentioned step S102, the following steps S201 to S202 can also be executed, and each step is described separately below.
[0035] S201, updating the log information configuration file and the log information parsing code to obtain a new log information configuration file and a new log information parsing code.
[0036] In some embodiments, the content recorded in the log information configuration file can be updated, and a new log information configuration file can be obtained after the update. The method of updating the log information configuration file may include adding, deleting, modifying or replacing, etc. The modified content may include at least one of NetFunction description information and corresponding NetFunction identification information, command identification information and corresponding command description information, log description information matching rules and identification information corresponding to the log description information matching rules, and log description information and identification information corresponding to the log description information.
[0037] In some embodiments, after the content in the log information configuration file is updated, the log information parsing code may also be updated to obtain a new log information parsing code. The method of updating the log information parsing code may also include adding, deleting, modifying or replacing the code.
[0038] Exemplarily, if a type of log description information and identification information of the log description information are added to the log information configuration file, then in the log information parsing code, the log description information and the identification information corresponding to the log description information can be added to the code segment for matching the log description information according to the identification information corresponding to the log description information; if the command identification information corresponding to a certain command description information is modified in the log information configuration file, then in the log information parsing code, the command identification information corresponding to the command description information can be modified to the modified command identification information in the log information configuration file. It should be noted that the update method of the log information configuration file and the log information parsing code here is only an exemplary description, and this application does not limit this.
[0039] In other embodiments, the log information parsing code may be updated without updating the content of the log information configuration file. The updated code may be content unrelated to the log information parsing logic, for example, modifying the if conditional statement in the log information parsing code to a switch conditional statement.
[0040] S202: Deploy the new log information parsing code to the smart platform after burning, so as to parse and process the smart platform management interface data based on the burned log information parsing code and the new log information configuration file.
[0041] In some embodiments, after the log information parsing code is updated to obtain a new log information parsing code, the new log information parsing code needs to be burned into the smart platform (BMC) before the new log information can take effect. Therefore, the new log information parsing code needs to be burned and deployed to the smart platform before the smart platform management interface data can be parsed and processed based on the new log information parsing code.
[0042] In some embodiments, the new log information configuration file does not need to be burned and can be used directly. After the new log information parsing code is burned and deployed to the intelligent platform, the management interface data of the intelligent management platform can be parsed and processed based on the new log information configuration file and the new log information parsing code to determine the new target log description information.
[0043] In some embodiments, when the log information configuration file is not modified but the log information parsing code is updated, the smart platform management interface data can be parsed based on the new log information parsing code burned and deployed to the smart platform and the unmodified log information configuration file.
[0044] It can be understood that when the log information configuration file and the log information parsing code are updated to obtain a new log information configuration file and a new log information parsing code, only the new log information parsing code is burned and deployed to the smart platform without the need to burn the new log information configuration file. Therefore, the convenience of maintaining the log information configuration file can be improved.
[0045] In some embodiments of the present application, the log information configuration file includes at least one first log description information matching rule, the first log description information, and identification information of different first log description information; the intelligent platform management interface data includes log information request data. Based on this, based on the pre-established log information configuration file and the log information parsing code, the intelligent platform management interface command data and the log information request data are parsed and processed to obtain the target log description information, that is, the above step S102 can be implemented by the following steps S1021 to S1024, and each step is described below.
[0046] S1021. Determine a second log description information matching rule corresponding to the log information request data from at least one first log description information matching rule.
[0047] In some embodiments, the log information request data requst_data may be a log information configuration file under the same command description information (or command identification information) that may include one or more first log description information matching rules. After determining the command description information, if the directory of the command description information includes multiple first log description information matching rules, the identification information of the request data requst_data in the intelligent management platform interface data and the identification information corresponding to the log description information matching rule in the log information configuration file can be matched, thereby determining the second log description information matching rule corresponding to the log information request data from the multiple first log description information matching rules.
[0048] In some embodiments, before determining the second log description information matching rule corresponding to the log information request data from at least one first log description information matching rule, the target NetFunction description information can be determined by matching the NetFunction identification information in the intelligent management platform interface data and the NetFunction identification information in the log information configuration file; the command identification information in the intelligent management platform interface data and the command identification information under the target NetFunction description information directory are matched to determine the target command description information, and then, the second log description information matching rule is determined under the target command description information.
[0049] S1022: Utilize the log information parsing code to parse the log information request data and the second log description information matching rule to obtain a corresponding parsing result.
[0050] In some embodiments, after determining the second log description information matching rule, the log information parsing code can be used to perform parsing based on the log information request data and the second log description information matching rule to determine the parsing result determined by the log description information matching rule. The parsing result can be obtained after performing logical operations based on the log information request data and the second log description information matching rule.
[0051] Exemplarily, if the description of the second log description information matching rule is: "calcmethod":"&0x800x80", and the log information request data request data is 0x01, the analysis logic of the corresponding log information parsing code can be: whether the result of 0x01&0x80 is 0x80, if so, the parsing result is A; if not, the parsing result is B, where A and B are identification information of the log description information, and both A and B can be defined in the log information parsing code.
[0052] S1023. Match the parsing result and the identification information to obtain target identification information.
[0053] In some embodiments, the parsing result may be identification information of the log description information, and the parsing result may be numbers, characters, etc. After determining the parsing result, the parsing result and the identification information of the log description information under the second log description information matching rule may be matched to determine the target identification information.
[0054] S1024: Determine target log description information from the first log description information based on the target identification information.
[0055] In some embodiments, after the target identification information is determined, the target identification information and identification information of the first log description information may be matched, and the first log description information corresponding to the target identification information may be determined as the target log description information.
[0056] It can be understood that by utilizing the log information parsing code to parse the log information request data and the second log information matching rules to obtain the corresponding parsing result, and then matching the parsing result with the identification information of the first log description information to obtain the target identification information, and determining the target log description information based on the target identification information, the log information parsing code and the log information configuration file are linked to each other to quickly parse the log information request data and obtain the target log description information.
[0057] In some embodiments of the present application, "parsing and processing the log information request data and the second log description information matching rules to obtain the corresponding parsing results" in step S1022 can be implemented by the following step S301A or step S301B, and step S301A and step S301B are explained respectively below.
[0058] S301A: If it is determined that the description content of the second log description information matching rule is empty, the log information request data is used as the parsing result.
[0059] In some embodiments, the description content of the second log description information matching rule is empty, that is, there is no content about the second log description information matching rule in the log information configuration file. In this case, the input content of the log description information matching rule in the log information request data requst_data can be used as the parsing result.
[0060] Exemplarily, if the log information request data requst_data is "0x02", where the second 0 represents the identification information of the second log description information matching rule, 2 can be represented as the input content of the log description information matching rule, and the second log description information matching rule is described as: "calcmethod":"", that is, the description content of the second log description information matching rule is empty, then the decimal number 2 corresponding to the hexadecimal number 0x02 can be used as the parsing result, that is, the first log description information corresponding to 2 is finally determined as the target log description information.
[0061] For example, if the intelligent platform management interface data is obtained as 0x05 0x01, the content of the log information configuration file is as follows:
[0062]
[0063]
[0064] By matching 0x05, it can be determined that the NetFunction description information is "NetFn:Chassis" and the command description information is "Chassis Identify". Since the log information matching rule is empty, the lower 4 digits 0001 (corresponding to the decimal number 1) of the binary number 00000001 corresponding to 0x01 can be determined as the target identifier, that is, the log description information corresponding to 1: "-Provides intrusion" is determined as the log description information of the target.
[0065] S301B: If it is determined that the description content of the second log description information matching rule is not empty, a calculation is performed according to the description content of the second log description information matching rule and the log information request data to obtain a corresponding parsing result.
[0066] In some embodiments, when the second log description information matching rule has description content, the log information request data and the description content of the second log description information matching rule can be combined to perform calculations to obtain corresponding calculation results, namely, parsing results.
[0067] Exemplarily, if the description content of the second log description information matching rule is: ""calcmethod":"&0x800x80", and the log information request data is 0x02, the log information parsing code can be used to determine whether 0x02&0x80 is equal to 0x80, and if it is, C is determined as the parsing result; if it is not, D is determined as the parsing result. C and D are both identification information of the log description information, which can be represented by numbers. Both C and D can be defined in the log information parsing code.
[0068] It is understandable that when determining whether the description content of the second log description information matching rule is empty or not empty, different analysis results can be determined by using the log information parsing code in combination with the log information request data to perform different calculations, thereby achieving diversity in the analysis of the log description information matching rule.
[0069] In some embodiments of the present application, the log information configuration file also includes a content replacement rule for the first log description information. Based on the target identification information, the target log description information is determined from the first log description information, that is, the above-mentioned step S1024 can be implemented by the following steps S401 to S403, and each step is described separately below.
[0070] S401: Determine second log description information corresponding to a target identifier from first log description information.
[0071] In some embodiments, after the target log information used to identify the log description information is determined, the first log description information corresponding to the target identifier may be determined as the second log description information, that is, the identification information corresponding to the second log description information is the target identifier.
[0072] S402: If the second log description information includes a variable parameter, the second log description information is updated based on the variable parameter and the content replacement rule to obtain updated second log description information.
[0073] In some embodiments, the variable parameter may be a parameter in the second log description information that can be replaced or modified, and the content replacement rule may include replacing the variable parameter with a fixed parameter, or determining a parameter based on a specific calculation rule and replacing the variable parameter with the calculated parameter.
[0074] In some embodiments, when variable parameters and content replacement rules are determined in the second log description information, the content replacement rules can be calculated by the log information parsing code, and the variable parameters in the second log description information are replaced with the calculated results to obtain new second log description information.
[0075] S403: Determine the updated second log description information as the target log description information.
[0076] In some embodiments, after the second log description information is modified based on the variable parameters and content replacement rules in the second log information, the new second log description information obtained after the modification can be determined as the final target log description information.
[0077] It is understandable that, when there are variable parameters in the second log description information, the second log description information is updated based on the variable parameters and the content replacement rule to obtain new second log information, which can ensure the accuracy of the target log information finally obtained.
[0078] In some embodiments of the present application, after determining the second log description information corresponding to the target identifier from the first log description information, that is, after step S401, the following step S501 may be performed, which is described below.
[0079] S501: If the second log description information does not include a variable parameter, determine the second log description information as target log description information.
[0080] In some embodiments, if the second log description information determined from the first log description information based on the target identifier does not include a variable parameter, the second log description information may be directly determined as the target log description information.
[0081] It is understandable that, when it is determined that the second log description information does not include a variable parameter, the second log description information is directly determined as the target log description information, so that the log description information corresponding to the log request information can be quickly obtained.
[0082] In some embodiments of the present application, the intelligent platform management interface data includes intelligent platform management interface command data. Based on this, the intelligent platform management interface data is parsed and processed based on a pre-established log information configuration file and a log information parsing code to obtain the target log description information, that is, after step S102, the following steps S601 to S602 can also be executed. Each step is described below.
[0083] S601: Determine command description information corresponding to intelligent platform management interface command data from a log information configuration file.
[0084] In some embodiments, the command description information can be used to describe the functions of the functional modules of the electronic device, the intelligent platform management interface command data can be command identification information, and the log information configuration file can also include command identification information. Therefore, the command identification information in the intelligent platform management interface data and the command identification information in the log information configuration file can be matched to determine the command description information corresponding to the intelligent platform management interface command data.
[0085] S602: Combine the command description information and the target log description information to obtain log information corresponding to the intelligent platform management interface data.
[0086] In some embodiments, after the command description information and the target log description information are determined, the command description information and the target log description information can be combined in an appended manner, for example, the target log description information and the command description information can be spliced, and the target log description information can be used as the content within the command description information hierarchy. The two description information are spliced to obtain the log information corresponding to the intelligent platform management interface data.
[0087] For example, if the command description information is: "Chassis Control", and the target log description information is: "-Power Off", then the log information obtained by combining the two description information may be: "Chassis Control, -Power Off".
[0088] In some embodiments, the intelligent platform management interface data may also include network function NetFunction identification information, and the network function NetFunction identification information and the NetFunction identification information in the log information configuration file may be matched to determine the NetFunction description information corresponding to the network function NetFunction identification information, and the NetFunction description information, command description information and target log description information are combined to obtain the final log information corresponding to the intelligent platform management interface data.
[0089] It can be understood that by determining the command description information corresponding to the intelligent platform management interface data from the log information configuration file and combining the command description information and the target log description information, relatively complete log information can be obtained, so that R&D personnel can quickly determine the sub-functions of the functional modules that need to be tested and log analyzed based on the log information.
[0090] In some embodiments of the present application, based on a pre-established log information configuration file and a log information parsing code, the intelligent platform management interface data is parsed and processed to obtain the target log description information, that is, after step S102, the following steps S701 to S703 can also be executed, and each step is described below.
[0091] S701. Acquire newly added intelligent platform management interface command data and log description information matching rules corresponding to the newly added intelligent platform management interface command data.
[0092] In some embodiments, after obtaining the newly added intelligent platform management interface command data and the corresponding log description information matching rules, the newly added content can be added to the log information configuration file to update the log information configuration file, where the newly added intelligent platform management interface command data can be OEM command identification information and corresponding command description information.
[0093] In some embodiments, the log description information matching rules corresponding to the newly added intelligent platform management interface command data may include one or more, different log description information matching rules are different, and the identification information corresponding to the matching rules with more detailed log descriptions is also different.
[0094] S702: Add the newly added intelligent platform management interface command data and the log description information matching rules corresponding to the newly added intelligent platform management interface command data to the log information configuration file to obtain a reference log information configuration file.
[0095] In some embodiments, the reference log information configuration file is a new log information configuration file obtained by adding the newly added intelligent platform management interface command data and the corresponding log description information matching rules to the log information configuration file. The log description information matching rules corresponding to the newly added intelligent platform management interface command data are in the directory of the newly added intelligent platform management interface command data, and the identification information corresponding to the log description information matching rules is also in the directory of the newly added intelligent platform management interface command data. The log description information matching rules and the identification information corresponding to the log description information matching rules can be at the same level under the directory of the newly added intelligent platform management interface command data.
[0096] In some embodiments, if the log description information matching rules corresponding to the newly added intelligent platform management interface command data include multiple ones, each log description information matching rule and corresponding identification information can be added to the directory of the newly added intelligent platform management interface command data respectively, and each log description information matching rule (or log description information matching rules) is at the same level.
[0097] In some embodiments, the newly added log information configuration content may also include log description information. The newly added log description information and corresponding identification information may be added to the directory of the log description information matching rule corresponding to the newly added log description information, and arranged side by side with the existing log description information and corresponding identification information under the directory of the log description information matching rule.
[0098] S703: parse and process the intelligent platform management interface data based on the reference log information configuration file.
[0099] In some embodiments, after obtaining the reference log information configuration file, the log information parsing code can be updated according to the newly added smart platform management interface data and the corresponding log description information matching rules, and the updated log information parsing code can be burned and deployed to the smart platform to parse and process the smart platform management interface data based on the reference log information and the updated log information parsing code.
[0100] It can be understood that by adding the newly added intelligent platform management interface command data and the corresponding log description information matching rules to the log information configuration file, a reference log information configuration file is obtained, which enables convenient and fast updating of the log information configuration file and avoids the expansion inconvenience caused by coupling the content of the log information configuration file to the log information parsing code.
[0101] In some embodiments of the present application, in step S702, the method of adding the log description information matching rule corresponding to the newly added intelligent platform management interface command data to the log information configuration file can be implemented by the following step S801, which is described below.
[0102] S801. If the log description information matching rule corresponding to the newly added intelligent platform management interface command data is the same as the existing log description information matching rule in the log information configuration file, copy the existing log description information matching rule to the directory of the newly added intelligent platform management interface command data.
[0103] In some embodiments, the log description information matching rules corresponding to the newly added intelligent platform management interface command data are the same as the existing log description information matching rules in the log information configuration file, indicating that the calculation method for determining the target log description information under the directory of the newly added intelligent platform management interface command data is the same. In this case, the existing log description information matching rules in the log information configuration file can be directly copied to the directory of the newly added intelligent platform management interface command data. The directory of the newly added intelligent platform management interface command data can also include identification information corresponding to the log description information matching rules obtained after copying. The identification information may be the same as or different from the identification information of the existing log description information matching rules in the original log information configuration file.
[0104] In some embodiments, for the log information parsing code, only the code corresponding to the existing log description information matching rule in the original log information parsing code can be copied to the newly added intelligent platform management interface command data code segment, thereby realizing the update of the log information parsing code.
[0105] It can be understood that when the log description information matching rules corresponding to the newly added intelligent platform management interface command data are the same as the existing log description information matching rules in the log information configuration file, directly copying the existing log description information matching rules to the directory of the newly added intelligent platform management interface command data can achieve rapid updating of the log information configuration file, thereby improving the efficiency of updating the log information configuration file.
[0106] In the embodiment of the present application, the intelligent platform management interface data is obtained; based on the pre-established log information configuration file and log information parsing code, the intelligent platform management interface data is parsed and processed to obtain the target log description information. In this way, since the log information configuration file and the log information parsing code are independent of each other, after the content of the log information configuration file is updated, the code volume of the log information parsing code will not be greatly increased, and the log information parsing code does not need to be redesigned. Therefore, the maintenance cost of the log information parsing code in the later stage can be reduced, and the maintenance efficiency of the log information parsing code can be improved.
[0107] Next, the implementation process of the application embodiment in the actual application scenario is introduced.
[0108] like Figure 2 As shown in FIG. 1 , a schematic diagram of a structure branch of a log parsing system based on BMC provided by the present application is shown in FIG. Figure 2 It can be seen that the BMC-based log parsing system 900 includes two separate parts: code parsing logic 901 (equivalent to the "log information parsing code" in other embodiments) and log information storage file 902 (equivalent to the "log information configuration file" in other embodiments), wherein the log information storage file 902 stores command description information 9021, parameter classification formula 9022 (equivalent to the "log description information matching rule" in other embodiments), log description information 9023 and command parameters 9024 (equivalent to the "intelligent platform management interface command data" in other embodiments).
[0109] like Figure 3 FIG. 1 is a flow chart of a log data processing method based on BMC provided by the present application, the method comprising:
[0110] S11, obtaining IPMI command and parameter data (equivalent to "intelligent platform management interface data" in other embodiments).
[0111] In some embodiments, the IPMI command may include a NetFunction identifier and a command identifier, and the command parameters may include a parameter classification formula identifier and a log description information identifier. The IPMI command and parameter data may both be hexadecimal numbers. Exemplarily, the IPMI command may be 0x01, where the second 0 corresponds to the NetFunction identifier and 1 corresponds to the command identifier; the parameter data may be 0x02, where the first 0 corresponds to the parameter classification formula description information and 2 corresponds to the log description information identifier.
[0112] In some embodiments, if data is input to the IPMI command interface, the callback function may be triggered, and the input parameters and commands may be received by calling the callback function.
[0113] S12. Parse the command description based on the IPMI command to obtain target command description information.
[0114] In some embodiments, the code parsing logic 901 may be used to match the command identifier in the IPMI command with the command identifier in the log information storage file 902, thereby determining the target command description information and completing the parsing of the command description.
[0115] S13. Analyze the parameter classification formula based on the target command description information and the parameter data to obtain the target parameter classification formula (equivalent to the “second log description information matching rule” in other embodiments).
[0116] In some embodiments, the code parsing logic 901 can be used to match the identifier of the parameter classification formula in the parameter data with the identifier of the parameter classification formula under the target command description information directory in the log information storage file 902, so as to determine the target parameter classification formula. The target parameter classification formula contains operators and calculation data, which are used to distinguish the identifiers of different log description information.
[0117] S14. Calculate according to the target parameter classification formula to obtain a calculation result (equivalent to the "analysis result" in other embodiments), and match the corresponding target log description information based on the calculation result.
[0118] In some embodiments, the code parsing logic 901 can be used to calculate the content corresponding to the target parameter classification formula to obtain a calculation result, and the identifier of the log description information under the target parameter classification formula can be matched according to the calculation result, so as to determine the target log description information. Further, if there are variable parameters in the target log description information, the preprocessing characters in the target log description information (equivalent to the "variable parameters" in other embodiments) are replaced with actual data, wherein the actual data can be determined by calculating the obtained parameter data and the log description information replacement rule by the code parsing logic 901.
[0119] S15. Output target log description information.
[0120] The BMC-based log data processing method provided by the embodiment of the present application stores log-related data in a unified manner in a json file, which has a clear structure and is easy to understand; the storage and processing of log-related data are separated, so that if it is necessary to add an OEM command to the existing log description information matching rule, it is only necessary to modify the json configuration file, which is conducive to expansion and convenient maintenance.
[0121] The present application also provides a data processing device, Figure 4 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the data processing device 20 includes:
[0122] The first acquisition module 21 is used to acquire intelligent platform management interface data;
[0123] The first data analysis module 22 is used to parse and process the intelligent platform management interface data based on a pre-established log information configuration file and a log information analysis code to obtain target log description information; the log information configuration file and the log information analysis code are independent of each other.
[0124] In some embodiments, the data processing device 20 further includes:
[0125] The update module is used to update the log information configuration file and the log information parsing code to obtain a new log information configuration file and a new log information parsing code.
[0126] The burning module is used to deploy the new log information parsing code to the smart platform through burning, so as to parse and process the smart platform management interface data based on the burned log information parsing code and the new log information configuration file.
[0127] In some embodiments, the log information configuration file includes at least one first log description information matching rule, first log description information, and identification information of different first log description information; the intelligent platform management interface data includes log information request data; the first data parsing module 22 includes:
[0128] A first determination submodule, configured to determine a second log description information matching rule corresponding to the log information request data from the at least one first log description information matching rule;
[0129] A first parsing submodule, configured to parse the log information request data and the second log description information matching rule using the log information parsing code to obtain a corresponding parsing result;
[0130] A first matching submodule, used for matching the parsing result with the identification information to obtain target identification information;
[0131] The second determining submodule is configured to determine the target log description information from the first log description information based on the target identification information.
[0132] In some embodiments, the first parsing submodule includes:
[0133] A first determining unit, configured to use the log information request data as the parsing result if it is determined that the description content of the second log description information matching rule is empty;
[0134] The first calculation unit is used to calculate according to the description content of the second log description information matching rule and the log information request data to obtain a corresponding parsing result if it is determined that the description content of the second log description information matching rule is not empty.
[0135] In some embodiments, the log information configuration file also includes a content replacement rule for the first log description information; and the second determination submodule includes:
[0136] A second determining unit, configured to determine second log description information corresponding to the target identifier from the first log description information;
[0137] A first updating unit, configured to update the second log description information based on the variable parameter and the content replacement rule if the second log description information includes a variable parameter, so as to obtain updated second log description information;
[0138] The third determining unit is used to determine the updated second log description information as the target log description information.
[0139] In some embodiments, the second determining submodule further includes:
[0140] The fourth determining unit is configured to determine the second log description information as the target log description information if the second log description information does not include a variable parameter.
[0141] In some embodiments, the intelligent platform management interface data includes intelligent platform management interface command data; the data processing device 20 further includes:
[0142] A second acquisition module is used to acquire newly added intelligent platform management interface command data and a log description information matching rule corresponding to the newly added intelligent platform management interface command data;
[0143] An adding module, used to add the newly added intelligent platform management interface command data and the log description information matching rule corresponding to the newly added intelligent platform management interface command data to the log information configuration file to obtain a reference log information configuration file; wherein the log description information matching rule corresponding to the newly added intelligent platform management interface command data is under the directory of the newly added intelligent platform management interface command data;
[0144] The second data parsing module is used to parse and process the intelligent platform management interface data based on the reference log information configuration file.
[0145] In some embodiments, the adding module is also used to copy the existing log description information matching rule to the directory of the newly added intelligent platform management interface command data if the log description information matching rule corresponding to the newly added intelligent platform management interface command data is the same as the existing log description information matching rule in the log information configuration file.
[0146] It should be noted that the description of the data processing device of the embodiment of the present application is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment, so it is not repeated. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.
[0147] It should be noted that in the embodiment of the present application, if the above-mentioned data processing method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or the part that contributes to the relevant solution can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
[0148] Accordingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the data processing method provided in the above embodiment is implemented.
[0149] The embodiment of the present application also provides a data processing device. Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the data processing device 30 includes: a memory 31, a processor 32, a communication interface 33 and a communication bus 34. The memory 31 is used to store executable data processing instructions; the processor 32 is used to execute the executable data processing instructions stored in the memory to implement the data processing method provided in the above embodiment.
[0150] The description of the above data processing device and storage medium embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the data processing device and storage medium embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0151] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes at least one ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0152] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0153] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0154] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0155] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, disks or optical disks.
[0156] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a product to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0157] The above are only implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technical object familiar with the technical field can be easily thought of within the technical scope disclosed in the present application. Changes or substitutions should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A data processing method, comprising: Obtain intelligent platform management interface data; Based on the pre-established log information configuration file and log information parsing code, the intelligent platform management interface data is parsed and processed to obtain target log description information; the log information configuration file and the log information parsing code are independent of each other.
2. The method according to claim 1, further comprising: The log information configuration file and the log information parsing code are updated to obtain a new log information configuration file and a new log information parsing code; The new log information parsing code is burned and deployed to the smart platform, so as to parse and process the smart platform management interface data based on the burned log information parsing code and the new log information configuration file.
3. The method according to claim 1, wherein the log information configuration file includes at least one first log description information matching rule, first log description information, and identification information of different first log description information; the intelligent platform management interface data includes log information request data; Based on the pre-established log information configuration file and log information parsing code, the intelligent platform management interface command data and log information request data are parsed and processed to obtain target log description information, including: Determine a second log description information matching rule corresponding to the log information request data from the at least one first log description information matching rule; Utilizing the log information parsing code, the log information request data and the second log description information matching rule are parsed to obtain a corresponding parsing result; Matching the analysis result with the identification information to obtain target identification information; Based on the target identification information, the target log description information is determined from the first log description information.
4. According to the method of claim 3, the parsing of the log information request data and the second log description information matching rule to obtain a corresponding parsing result includes at least one of the following: If it is determined that the description content of the second log description information matching rule is empty, taking the log information request data as the parsing result; If it is determined that the description content of the second log description information matching rule is not empty, calculation is performed according to the description content of the second log description information matching rule and the log information request data to obtain a corresponding parsing result.
5. The method according to claim 3, wherein the log information configuration file further includes a content replacement rule for the first log description information; The determining the target log description information from the first log description information based on the target identification information includes: Determine second log description information corresponding to the target identifier from the first log description information; If the second log description information includes a variable parameter, updating the second log description information based on the variable parameter and the content replacement rule to obtain updated second log description information; The updated second log description information is determined as the target log description information.
6. The method according to claim 5, further comprising: If the second log description information does not include a variable parameter, the second log description information is determined as the target log description information.
7. The method according to claim 1, wherein the intelligent platform management interface data comprises intelligent platform management interface command data; the method further comprises: Determine the command description information corresponding to the intelligent platform management interface command data from the log information configuration file; The command description information and the target log description information are combined to obtain log information corresponding to the intelligent platform management interface data.
8. The method according to claim 1, wherein the log information configuration file includes intelligent platform management interface command data; the method further comprises: Acquire newly added intelligent platform management interface command data and log description information matching rules corresponding to the newly added intelligent platform management interface command data; Add the newly added intelligent platform management interface command data and the log description information matching rule corresponding to the newly added intelligent platform management interface command data to the log information configuration file to obtain a reference log information configuration file; wherein the log description information matching rule corresponding to the newly added intelligent platform management interface command data is under the directory of the newly added intelligent platform management interface command data; The intelligent platform management interface data is parsed and processed based on the reference log information configuration file.
9. The method according to claim 8, further comprising: If the log description information matching rule corresponding to the newly added intelligent platform management interface command data is the same as the existing log description information matching rule in the log information configuration file, the existing log description information matching rule is copied to the directory of the newly added intelligent platform management interface command data.
10. A data processing device, comprising: A first acquisition module is used to acquire intelligent platform management interface data; The first data analysis module is used to parse and process the intelligent platform management interface data based on a pre-established log information configuration file and a log information analysis code to obtain target log description information; the log information configuration file and the log information analysis code are independent of each other.