Data processing method and device and electronic equipment
By automatically matching and filtering the target log template of the energy storage system log data, performing de-redundant processing and Huffman compression, it solves the problems of manual participation and redundancy in the existing technology, and achieves efficient and intelligent log data processing and transmission. .
Patent Information
- Application Number
- CN202310363424.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, the parsing process of energy storage system log data requires manual participation and frequent updating of log templates, resulting in low efficiency, and the parsed data contains redundant information, which wastes storage space and is not conducive to data transmission.
By automatically matching the target log template file, the log data is filtered and redundantly processed, and compressed log files are generated. The Huffman algorithm is used for data compression to achieve intelligent processing and data optimization without manual participation.
It improves the intelligence and efficiency of log data processing, reduces redundant information, saves storage space and improves data transmission efficiency.
Smart Images

Figure CN118733374A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device and electronic equipment. Background Art
[0002] When the energy storage system is running, it will generate a huge amount of log data. Technical engineers can understand the operating status of the energy storage system by analyzing the log data. For security reasons, the equipment in the energy storage system is generally not connected to the external network, so the log data is generally processed regularly by technical engineers and sent back to the remote end for analysis and statistics. The log data is in a batch offline state.
[0003] For the parsing of log data, the main parsing solutions currently include: technical engineers select preset candidate normalized templates, and then match the format of the log data of the energy storage system with the candidate normalized template to parse the log data. However, in this process, if the candidate normalized template does not match the log data, it is necessary to manually correct or update the candidate normalized template, and finally manually calibrate the log template that matches the log data, and then parse the log data through the log template. Every time the log data is updated, it is necessary to manually recalibrate the log template, resulting in low efficiency of the data processing process, inability to achieve automated processing, and lack of intelligence. In addition, the parsed data is not further optimized, resulting in too much redundant information in the data, wasting storage space, and not conducive to data transmission. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art.
[0005] To this end, an object of the present invention is to propose a data processing method, which performs big data analysis on massive log data and automatically matches a suitable target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to data characteristics, so that there is no excessive redundant information in the obtained compressed log file, which is conducive to saving storage space and improving data transmission efficiency.
[0006] To this end, a second object of the present invention is to provide a data processing device.
[0007] To this end, a third object of the present invention is to provide an electronic device.
[0008] To this end, a fourth object of the present invention is to provide a computer-readable storage medium.
[0009] In order to achieve the above-mentioned objectives, an embodiment of the first aspect of the present invention proposes a data processing method, comprising the following steps: filtering log data according to a target log template file to obtain a dynamic data part, and creating a variable object for the dynamic data part; analyzing whether the variable object has changed; if so, recording the dynamic data corresponding to the changed variable object, otherwise, recording the basic information of the variable object; compressing the recorded dynamic data and / or basic information to obtain a compressed log file.
[0010] According to the data processing method of the embodiment of the present invention, the log data is filtered according to the target log template file to obtain the dynamic data part, a variable object is created for the dynamic data part, and whether the variable object has changed is analyzed. If so, the dynamic data corresponding to the changed variable object is recorded, otherwise, the basic information of the variable object is recorded, and finally the recorded dynamic data and / or basic information is compressed to obtain a compressed log file. Therefore, the present invention can perform big data analysis on a huge amount of log data and automatically match a suitable target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to the data characteristics, so that there is no excessive redundant information in the obtained compressed log file, which is conducive to saving storage space and improving data transmission efficiency.
[0011] In addition, the data processing method of the above embodiment of the present invention may also have the following additional technical features:
[0012] In some embodiments, before filtering the log data according to the target log template file, it also includes: receiving the log data, and selecting the target log template file according to the type of the log data.
[0013] In some embodiments, selecting a log template file according to the type of the log data includes: determining whether there is a log template file that matches the type of the log data; if so, using the matching log template file as the target log template file; otherwise, constructing a new log template file to serve as the target log template file.
[0014] In some embodiments, constructing a new log template file includes: acquiring multiple unit data in the log data; parsing the multiple unit data to generate a rule set; and generating the new log template file according to the rule set.
[0015] In some embodiments, the plurality of unit data are parsed and processed, including: performing discrete processing on each of the unit data to obtain a digital content portion and a non-digital content portion; performing statistical analysis on the digital content portion and the non-digital content portion respectively; generating corresponding rules according to the statistical analysis results, wherein the rules have a unique identifier; and generating the rule set according to the rules corresponding to the plurality of unit data obtained.
[0016] In some embodiments, each of the unit data is discretely processed, including: identifying digital content and non-digital content in the unit data; and isolating the digital content and non-digital content.
[0017] In some embodiments, after isolating the digital content and the non-digital content, the method further includes: performing word frequency statistics on the isolated non-digital content according to preset keywords, and sorting the non-digital content according to the statistical results.
[0018] In some embodiments, statistical analysis is performed on the non-digital content portion, including: identifying dynamically changing content and unchanged content in the non-digital content portion; summarizing the dynamically changing content in the non-digital content portion to generate a first macro definition set, and identifying the first macro definition set; adding the unchanged content in the non-digital content portion to a preset initial log template file.
[0019] In some embodiments, performing statistical analysis on the digital content portion includes: identifying dynamically changing content and unchanged content in the digital content portion; summarizing the dynamically changing content in the digital content portion to generate a second macro definition set, and identifying the second macro definition set; adding the unchanged content in the digital content portion to a preset initial log template file.
[0020] In some embodiments, generating the new log template file according to the rule set includes: converting the rule set into a template file in a preset format to obtain the new log template file.
[0021] In some embodiments, the unit data includes at least one line of data in the log data.
[0022] In some embodiments, after determining that there is a log template file that matches the type of the log data, it also includes: parsing the log data according to the log template file; if there is a data portion that cannot be parsed in the log data, generating a new rule set based on the data portion that cannot be parsed; updating the log template file according to the new rule set, and using the updated log template file as the target log template file.
[0023] In some embodiments, there is a corresponding relationship between the type of the log data and the target log template file, and the corresponding relationship is pre-calibrated.
[0024] In some embodiments, creating a variable object for the dynamic data portion includes: creating variable objects for the data of the dynamic data portion respectively, and mapping each data with the variable object in a one-to-one correspondence.
[0025] In some embodiments, creating variable objects for the data of the dynamic data portion respectively includes: using the content corresponding to the data of the dynamic data portion as the corresponding variable object.
[0026] In some embodiments, the target log template file also includes multiple time intervals, and the method further includes: recording the time when each rule is generated.
[0027] In some embodiments, the basic information includes: an identifier and generation time of a rule in which the data corresponding to the variable object is located.
[0028] In some embodiments, the recorded dynamic data and / or basic information is compressed using a Huffman algorithm to obtain the compressed log file.
[0029] In some embodiments, after obtaining the compressed log file data, the method further includes: storing the compressed log file and identifying a target log template file in the compressed log file.
[0030] In some embodiments, after obtaining the compressed log file data, it also includes: transmitting the compressed log file to a data restoration device; the data restoration device decompresses and restores the compressed log file according to the target log template file, and outputs the log data.
[0031] In some embodiments, before the data restoration device decompresses and restores the compressed log file according to the target log template file, it also includes: synchronously sending the selected target log template file to the data restoration device.
[0032] In some embodiments, after outputting the log data, the method further includes: searching for target data from the log data according to set filtering conditions.
[0033] In some embodiments, the setting of the screening condition includes: setting at least one of content, identification, keyword, time period, time point, and macro definition information.
[0034] In order to achieve the above-mentioned purpose, the second aspect of the embodiment of the present invention proposes a data processing device, including: a filtering module, used to filter the log data according to the target log template file, obtain the dynamic data part, and create a variable object for the dynamic data part; an analysis module, used to analyze whether the variable object has changed; a recording module, used to record the dynamic data corresponding to the changed variable object when the variable object changes, and record the basic information of the variable object when the variable object has not changed; a compression module, used to compress the recorded dynamic data and / or basic information to obtain a compressed log file.
[0035] According to the data processing device of the embodiment of the present invention, the log data is filtered according to the target log template file to obtain the dynamic data part, a variable object is created for the dynamic data part, and whether the variable object has changed is analyzed. If so, the dynamic data corresponding to the changed variable object is recorded, otherwise, the basic information of the variable object is recorded, and finally the recorded dynamic data and / or basic information is compressed to obtain a compressed log file. Therefore, the present invention can perform big data analysis on a huge amount of log data, and automatically match a suitable target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to the data characteristics, so that there is no excessive redundant information in the obtained compressed log file, which is conducive to saving storage space and improving data transmission efficiency.
[0036] In order to achieve the above-mentioned purpose, the third aspect embodiment of the present invention proposes an electronic device, which includes a data processing device as described in the second aspect embodiment of the present invention; or, the electronic device includes: a processor, a memory, and a data processing program stored in the memory and executable on the processor, and when the data processing program is executed by the processor, it implements the data processing method as described in the first aspect embodiment of the present invention.
[0037] According to the electronic device of the embodiment of the present invention, the log data is filtered according to the target log template file to obtain the dynamic data part, a variable object is created for the dynamic data part, and whether the variable object has changed is analyzed. If so, the dynamic data corresponding to the changed variable object is recorded, otherwise, the basic information of the variable object is recorded, and finally the recorded dynamic data and / or basic information is compressed to obtain a compressed log file. Therefore, the present invention can perform big data analysis on a huge amount of log data, and automatically match a suitable target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to the data characteristics, so that there is no excessive redundant information in the obtained compressed log file, which is conducive to saving storage space and improving data transmission efficiency.
[0038] In order to achieve the above-mentioned objectives, the fourth aspect embodiment of the present invention proposes a computer-readable storage medium, on which a data processing program is stored. When the data processing program is executed by a processor, the data processing method described in the first aspect embodiment of the present invention is implemented.
[0039] According to the computer-readable storage medium of an embodiment of the present invention, when the data processing program stored thereon is executed by the processor, the log data can be filtered according to the target log template file to obtain the dynamic data part, create a variable object for the dynamic data part, analyze whether the variable object has changed, and if so, record the dynamic data corresponding to the changed variable object, otherwise, record the basic information of the variable object, and finally summarize and compress the recorded dynamic data and / or basic information to obtain a compressed log file. Therefore, the present invention can perform big data analysis on a huge amount of log data, and automatically match a suitable target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to the data characteristics, so that there is no excessive redundant information in the obtained compressed log file, which is conducive to saving storage space and improving data transmission efficiency.
[0040] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0042] Figure 1 is a flow chart of a method for processing data according to an embodiment of the present invention;
[0043] Figure 2is an overall flow chart of a method for processing data according to a specific embodiment of the present invention;
[0044] Figure 3 is a structural block diagram of a data processing device according to an embodiment of the present invention;
[0045] Figure 4 is a structural block diagram of a data processing device according to another embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to be able to understand the features and technical contents of the embodiments of the present invention in more detail, the implementation of the embodiments of the present invention is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present invention. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0047] Reference below Figure 1-Figure 4 A data processing method, device and electronic device according to an embodiment of the present invention are described.
[0048] Figure 1 1 is a flow chart of a data processing method according to an embodiment of the present invention. The data processing method is applicable to an energy storage system, that is, the log data of the energy storage system can be processed by the method. Figure 1 As shown, the data processing method includes steps S1 to S4.
[0049] Step S1: Filter the log data according to the target log template file to obtain the dynamic data part, and create a variable object for the dynamic data part.
[0050] Specifically, the target log template is, for example, a pre-selected log template. Since the log data of the energy storage system is generally the record data of sensor variables, etc., and the main changes are mostly numbers, the embodiment of the present invention performs a preliminary classification analysis on the digital part and the non-digital part, and uses the selected target log template file to filter the constant data part in the log data to obtain the dynamic data part with changing content. Further, for the dynamic data part with dynamically changing content obtained by filtering, new object variables are created respectively, such as the specific content or value of each data in the dynamic data part, and a mapping relationship is made between the dynamic data part with data changes and the newly created objects. That is, object variables are used to represent each dynamically changing data in the dynamic data part in a one-to-one correspondence.
[0051] Step S2: Analyze whether the variable object has changed. That is, determine whether the variable object created by the dynamic data part and having a mapping relationship with it has changed. Specifically, the corresponding variable object can be determined by whether the specific content or value of each data in the dynamic data part has changed. If the specific content or value of a certain data in the dynamic data part has changed, it is determined that the variable object corresponding to the data has changed. Otherwise, it is determined that the variable object corresponding to the data has not changed.
[0052] Step S3: If yes, then record the dynamic data corresponding to the changed variable object; otherwise, record the basic information of the variable object.
[0053] Specifically, if a variable object is changed, that is, the specific content or value of the data in the corresponding dynamic data part is changed, then the dynamic data corresponding to the variable object is recorded, such as the specific content or value of the dynamic data. Otherwise, if a variable object is not changed, that is, the specific content or value of the data in the corresponding dynamic data part is not changed, then the basic information of the variable object is recorded, such as the generation time of the rule to which the corresponding dynamic data belongs.
[0054] Step S4: compress the recorded dynamic data and / or basic information to obtain a compressed log file. Specifically, if none of the dynamic variable objects have changed, the recorded dynamic data is empty, and the recorded basic information is compressed to obtain a compressed log file. If all of the dynamic variable objects have changed, the recorded basic information is empty, and the recorded dynamic data is compressed to obtain a compressed log file. If part of the dynamic variable object has not changed, and the other part has changed, the recorded dynamic data and basic information are compressed to obtain a compressed log file.
[0055] Specifically, the dynamic data corresponding to the variable objects that have changed and the basic information corresponding to the variable objects that have not changed in the dynamic data part obtained above are summarized, and the summarized data is compressed to obtain a compressed log file, which can then be transmitted to a remote processing device via wired or wireless communication, so that technical engineers can parse and view log data through the remote processing device to understand the operation of the energy storage system. At the same time, the compressed log file after compression processing removes redundant information, which is convenient for saving system storage space and also helps to improve data transmission efficiency.
[0056] It should be noted that in the data processing method described in the above embodiment of the present invention, the execution order of each step (such as but not limited to step S1 to step S4) is not specifically limited, and the execution order can be adjusted according to actual conditions.
[0057] Thus, the above-mentioned data processing method filters the log data according to the target log template file to obtain the dynamic data part, creates a variable object for the dynamic data part, analyzes whether the variable object has changed, and if so, records the dynamic data corresponding to the changed variable object, otherwise, records the basic information of the variable object, and finally compresses the recorded dynamic data and / or basic information to obtain a compressed log file. Thus, the present invention can perform big data analysis on log data, such as the massive log data of the energy storage system, and automatically match the appropriate target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to the data characteristics of the energy storage system, so that there is no excessive redundant information in the obtained compressed log file, which is conducive to saving storage space and improving data transmission efficiency.
[0058] In one embodiment of the present invention, before filtering the log data according to the target log template file, the process further includes: receiving the log data, and selecting the target log template file according to the type of the log data.
[0059] Specifically, the log data includes, for example, but is not limited to, the system, such as data related to some devices running in the energy storage system, such as sensors, batteries, containers, energy storage cabinets, etc. The data includes, for example, but is not limited to, the device name, device number, container number, battery cluster number, battery group number, battery cell number, and device operating power, operating voltage, operating current, operating status, etc. Furthermore, the target log template file can be selected according to the type of log data. Specifically, the type of log data includes, for example, at least one of the log data file name, the relevant data of the specified device, and the relevant data of the specified module. When generating the log template file, the correspondence between the type of log data and the log template file can be pre-calibrated. In other words, for different types of log data, the log template file matching or corresponding thereto is pre-calibrated. Furthermore, after the log data is obtained, the type of the log data is determined, such as the file name of the log data or the relevant data of the specified device contained therein or the relevant data of the specified module contained therein, etc., and the log template file matching or corresponding to the type of the log data can be selected accordingly, that is, the target log template file.
[0060] In one embodiment of the present invention, in step S1, a target log template file is selected according to the type of log data, including: determining whether there is a log template file that matches the type of log data; if so, using the matching log template file as the target log template file; otherwise, constructing a new log template file as the target log template file.
[0061] Specifically, after determining the type of log data, the target log template file is selected according to the type of log data. Specifically, the target log template file can be selected from the database, wherein, for example, multiple log template files are pre-stored in the database, and the log template files in the database can be continuously updated, such as adding new log template files or deleting unnecessary log template files. Thus, according to the type of log data, matching is performed in the database to determine whether there is a log template file that matches it. If so, the matched log template file is used as the target log template file; if not, a new log template file is constructed, and the constructed new log template file is used as the target log template file. At the same time, the new log template file is added to the database to update the database, so as to facilitate subsequent matching for the same type of log data.
[0062] In one embodiment of the present invention, the process of constructing a new log template file includes: acquiring multiple unit data in the log data; parsing the multiple unit data to generate a rule set; and generating a new log template file according to the rule set.
[0063] In one embodiment of the present invention, the unit data includes, for example, at least one line of data in the log data. For example, the unit data may include one line of data in the log data, or the unit data may include multiple lines of data in the log data. Thus, the log data can be divided into multiple unit data, thereby facilitating separate parsing and processing of the multiple unit data.
[0064] Specifically, the log data is divided into multiple unit data, each unit data includes at least one or more lines of data. Each unit data is parsed and processed to generate a rule set, and then the new log template file can be generated according to the rule set, and then the new log template file is used as the target log template file.
[0065] In one embodiment of the present invention, the above-mentioned process of parsing and processing multiple unit data includes: performing discrete processing on each unit data to obtain a digital content part and a non-digital content part; performing statistical analysis on the digital content part and the non-digital content part respectively; generating corresponding rules based on the statistical analysis results, and the rules have a unique identifier; and generating a rule set based on the rules corresponding to the obtained multiple unit data.
[0066] In one embodiment of the present invention, after isolating the digital content and the non-digital content, the method further includes: performing word frequency statistics on the isolated non-digital content according to preset keywords, and sorting the non-digital content according to the statistical results.
[0067] In one embodiment of the present invention, the above process of discretely processing each unit data includes: identifying digital content and non-digital content in the unit data; isolating the digital content and non-digital content, thereby obtaining a digital content part and a non-digital content part respectively.
[0068] Specifically, since the energy storage system generally records sensor variables, etc., and the main changes are mostly numbers, the embodiment of the present invention uses big data analysis technology to perform initial classification analysis on the digital part and the non-digital part. For example, after counting the sentence frequency of the key words associated with the log file, the digital part and the non-digital part data are again discretely processed and arranged in sequence, and finally the fixed part of the log file is analyzed through big data technology to calculate the rule set, and this rule set is used to generate a special template, that is, a new log template file.
[0069] Each unit data in the log data includes one line or multiple continuous lines of data. For each unit data, statistical analysis is performed separately. The non-digital content and digital content are first isolated. The previous single-line and multiple-line data are discretely processed and arranged in order, and finally the digital content part and the non-digital content part are obtained. The word frequency statistics of the non-digital content are performed according to the preset keywords to analyze whether the non-digital content has changed. The non-digital content is further sorted according to the word frequency statistics results, such as sorting in order from small to large or from large to small. Furthermore, statistical analysis is performed on the digital content part and the non-digital content part respectively, and corresponding rules are generated according to the statistical analysis results. Each rule has a unique identifier. Then, multiple rules can be obtained by performing analytical processing on multiple unit data, and multiple rules can generate a rule set.
[0070] In one embodiment of the present invention, the above-mentioned process of statistical analysis of the non-digital content part includes: identifying dynamically changing content and unchanged content in the non-digital content part; summarizing the dynamically changing content in the non-digital content part, generating a first macro definition set, and identifying the first macro definition set; adding the unchanged content in the non-digital content part to a preset initial log template file.
[0071] Specifically, statistical analysis is performed on the non-digital content part to quickly identify and locate dynamically changing content and unchanged content in the non-digital content part; the dynamically changing content in the non-digital content part is summarized to generate a first macro definition set, and the first macro definition set is marked; the unchanged content in the non-digital content part is added to a preset initial log template file. For example, the content with relevant constants that remain unchanged is quickly matched and located in the non-digital content part, that is, the unchanged content in the non-digital content part, and it is attributed to the initial log template file according to the corresponding position; and the content that changes in the non-digital content part, that is, the dynamically changing content in the non-digital content part, is summarized into the first macro definition set according to statistics, and is marked accordingly, recorded as Macro (macro instruction) 1, abbreviated as M1, so that the abbreviation can be used to quickly replace the dynamically changing non-digital content, which is convenient for data processing.
[0072] In one embodiment of the present invention, the above-mentioned process of statistical analysis of the digital content part includes: identifying dynamically changing content and unchanged content in the digital content part; summarizing the dynamically changing content in the digital content part to generate a second macro definition set, and identifying the second macro definition set; adding the unchanged content in the digital content part to a preset initial log template file.
[0073] Specifically, statistical analysis is performed on the digital content part to quickly identify and locate dynamically changing content and unchanged content in the digital content part; the dynamically changing content in the digital content part is summarized to generate a second macro definition set, and the second macro definition set is marked; the unchanged content in the digital content part is added to the preset initial log template file. For example, the relevant constant unchanged content in the digital content part is quickly matched and located, that is, the unchanged content in the digital content part, and it is also attributed to the initial log template file according to the corresponding position; and the changing content in the digital content part, that is, the dynamically changing content in the digital content part, is summarized into the second macro definition set according to statistics, and is marked accordingly, recorded as {$V1}, abbreviated as V1, so that the abbreviation can be used to quickly replace the dynamically changing digital content, which is convenient for data processing.
[0074] In one embodiment of the present invention, generating corresponding rules according to the statistical analysis results includes: generating rules according to the first macro definition set, the second macro definition set and the initial log template file.
[0075] Specifically, after statistically analyzing the non-digital content part and the digital content part in each unit data, and distinguishing the constant content and the dynamically changing content, the first macro definition set M1, the second macro definition set V1 and the initial log template filled with the constant content of the non-digital content part and the digital content part are obtained. Then, a rule Rule can be formed according to the first macro definition set M1, the second macro definition set V1 and the initial log template, and the rule is marked with an ID, such as Rule1. Therefore, after parsing multiple unit data, multiple rules can be obtained, and the multiple rule sets are processed to obtain a rule set.
[0076] In one embodiment of the present invention, generating a new log template file according to a rule set includes: converting the rule set into a template file in a preset format to obtain a new log template file.
[0077] Specifically, the rule set is converted into a file in a specific format and outputted to obtain a new log template file, which is then used as the target log template file. In a specific embodiment, the preset format is Json format, that is, the rule set is converted into a template file in Json format and outputted to obtain a new log template file, i.e., the target log template file.
[0078] In a specific embodiment, an example of a target log template file obtained is as follows:
[0079]
[0080]
[0081] In one embodiment of the present invention, after determining that there is a log template file that matches the type of log data, it also includes: parsing the log data according to the log template file; if there is a data portion in the log data that cannot be parsed, generating a new rule set based on the data portion that cannot be parsed; updating the log template file according to the new rule set, and using the updated log template file as the target log template file.
[0082] Specifically, as mentioned above, after determining that there is no log template file that matches the log data type, a new log template file is constructed as the target log template file. When it is determined that there is a log template file that matches the log data type, the log data can be parsed according to the matched log template file, and the parsing result can be analyzed. When there is a data part in the log data that cannot be parsed by the log template file, such as one or more unit data that cannot be successfully parsed by the log template file, it is considered that the log template file is not applicable to the type of the log data and is not a suitable target log template file. Then, the log template file needs to be updated and the updated log template file is used as the target log template file. Specifically, a new rule set can be generated according to the above-mentioned data part that cannot be parsed (such as one or more unit data that cannot be parsed), and then the log template file is updated according to the new rule set, and the updated log template file is used as the target log template file. Thus, the updated target log template file can successfully parse the data part that the previous target could not parse, and then all log data can be successfully parsed. Therefore, real-time matching and online updating of log template files can be achieved through big data, and the appropriate target log template files can be automatically matched without manual participation and changing the log template, thereby improving the intelligence of the processing process. It should be noted that in this process, the process of generating a new rule set based on the data part that cannot be parsed (one or more unit data) and updating the log template file based on the new rule set is similar to the aforementioned process of building a new log template file. For details, please refer to the aforementioned related description part. In order to reduce redundancy, it will not be repeated here.
[0083] Furthermore, the updated target log template file may be stored in a database to expand and update the log template in the database, so as to facilitate subsequent analysis of the corresponding data portion in the corresponding log data.
[0084] In one embodiment of the present invention, there is a corresponding relationship between the type of log data and the target log template file, and the corresponding relationship is obtained by pre-calibration.
[0085] Specifically, the type of log data includes, for example, at least one of the log data file name, the relevant data of the specified device, and the relevant data of the specified module. When generating a log template file, the correspondence between the type of log data and the log template file can be pre-calibrated. In other words, for different types of log data, the log template files that match or correspond to them are pre-calibrated. Then, after the log data is acquired, the type of log data is determined, such as the file name of the log data or the relevant data of the specified device contained therein or the relevant data of the specified module contained therein, etc., and based on this, a log template file that matches or corresponds to the type of log data can be selected, which is the target log template file.
[0086] In one embodiment of the present invention, in step S1, creating a variable object for the dynamic data part includes: creating variable objects for the data in the dynamic data part respectively, and mapping each data with the variable object in a one-to-one correspondence.
[0087] Specifically, a model is built according to the target log template file, and variable objects are created for the dynamic data part whose content changes dynamically and mapped one by one. That is, the content or value of each rule in the target log template, such as Value, is mapped to log data in units of one line or multiple consecutive lines using a variable object, and then processing is performed separately according to whether the Value changes or not.
[0088] In one embodiment of the present invention, creating variable objects for the data in the dynamic data part includes: taking the content corresponding to the data in the dynamic data part as the corresponding variable object. In other words, taking the specific content or value (referred to as Value) of the data that changes in the dynamic data part as its corresponding variable object.
[0089] In one embodiment of the present invention, the target log template file also includes multiple time intervals, and the method further includes: recording the time when each rule is generated. For example, if the rule set includes multiple rules, such as Rule1, Rule2, Rule3...RuleN, the time when each rule, namely Rule1, Rule2, Rule3...RuleN is generated is recorded respectively, and the time can be accurate to minutes and seconds. The time interval can be accurate to year, month, day and hour.
[0090] In one embodiment of the present invention, the basic information of the variable object includes: the identifier and generation time of the rule to which the data corresponding to the variable object belongs. That is, the identifier of the rule to which the data Value corresponding to each variable belongs and the generation time of the rule, such as Rule1, which is the generation time of Rule1, or Rule2, which is the generation time of Rule2, etc.
[0091] For example, after the log data is filtered by the target log template file that matches it, it is output to a new log data file. Specifically, after the log data is filtered by the target log template file, the remaining data are all dynamically changing data, that is, the dynamic data part, and the non-numeric content part in the dynamic data part is enumerated with macro definition variables, replaced by abbreviations such as "M1", where M is a special character added and 1 is the ID of the macro definition set. The numeric content part Value in the dynamic data part can be replaced by "V1", where 1 is the ID of the Value under this rule. {$Time} is used to divide the time period, and the log data of the hour is recorded in hours, with the year, month, day and time being accurate, so as to avoid recording redundant data in time. The generation time of each rule only records minutes and seconds, and {$Time} is recorded when entering the next hour interval. Furthermore, when parsing log data, if the value of a variable object changes in the corresponding log data, the changed value of the corresponding mapped variable object is recorded; if the value of the variable object of the corresponding rule does not change, the ID and generation time of the rule (accurate to minutes and seconds) are directly recorded once, so that redundant data is not recorded, the purpose of removing redundancy and duplication is achieved, the simplicity and accuracy of the data is ensured, and the subsequent data transmission is facilitated. Among them, the above-mentioned set time is a fixed length.
[0092] In a specific embodiment, an example of an uncompressed data file (including recorded dynamic data and / or basic information) after being parsed and processed by the target log template file is as follows:
[0093]
[0094] Therefore, after the log data is parsed and processed through the above-mentioned target log template file, the obtained data file will simplify the matching of the changing digital part as much as possible, and the final format is composed of <year, month, day, and time> and <minutes and seconds + RuleID + Value digital part + separator '|' + macro definition 'M'>, thereby removing redundant data and duplicate data, and only recording the changed data. The unchanged data is retained through the template, thereby ensuring the simplicity and accuracy of the data, saving storage space, and improving the subsequent data transmission efficiency.
[0095] In one embodiment of the present invention, in step S4, the recorded dynamic data and / or basic information is compressed, for example, by using a Huffman algorithm to obtain a compressed log file.
[0096] Specifically, the data file (including recorded dynamic image data and basic information) obtained after filtering and deletion in the above process is compressed. Since the energy storage system generally records sensor variables, etc., most of the main changes are numbers. Therefore, based on this feature, the embodiment of the present invention adopts the Huffman algorithm for data compression, so that the final data obtained after compression only contains 10 characters from 0 to 9, plus a few special characters, a total of no more than 16 characters. According to this design, theoretically, excluding the length of the previously filtered data, the length of the filtered data can be compressed to half, that is, the compression rate reaches 50%. Since the repetition rate of the log variables recorded by the energy storage system in a steady state is relatively high, it can optimize and adapt to the characteristics of the Huffman algorithm, so that the types of characters appear as few as possible, and the frequency of some characters appears high, thereby improving the compression efficiency and achieving the optimal compression effect, and further facilitating the transmission of the compressed file to the remote data processing device, which is conducive to improving the transmission efficiency.
[0097] Therefore, the embodiment of the present invention adopts the relevant technology of big data to analyze the log data and establish a log template, and the log template will be continuously adaptively improved and updated in the time accumulation analysis, and has high intelligence; further, the data filtered by the log template is de-redundanted and finally compressed by the Huffman algorithm. After the compression, only important change information and several special characters are left. More importantly, the variable object in the model will be updated and a record will be generated only after the data changes, so that a large amount of redundant information can be removed, making the output log file more streamlined, which is conducive to saving storage space and improving the efficiency of remote data transmission.
[0098] In one embodiment of the present invention, after obtaining the compressed log file data, it also includes: storing the compressed log file and identifying the target log template file in the compressed log file. Specifically, the compressed log file obtained after compression is stored to facilitate file transmission, and the target log template file used in the compressed log file is further identified so that the compressed log file and the target log template file have a corresponding relationship, which is convenient for subsequent use when decompressing the compressed log file.
[0099] In one embodiment of the present invention, after obtaining the compressed log file data, it also includes: transmitting the compressed log file to a data restoration device; the data restoration device decompresses and restores the compressed log file according to the target log template file, and outputs the log data.
[0100] Specifically, the data restoration device is a remote data processing device, such as but not limited to a back-end server. After obtaining the compressed log file, the compressed log file is transmitted to the data restoration device via wired or wireless communication. The compressed log file removes redundant and repeated information, making the compressed log file concise, thereby saving storage space and facilitating efficient transmission. After receiving the compressed log file, the data restoration device uses the Huffman algorithm to decompress the compressed log file, and retrieves the target log template file corresponding to the compressed log file. The decompressed log file is restored through the target log template file to obtain the log data of the energy storage system for the convenience of technical engineers to view.
[0101] In one embodiment of the present invention, before the data restoration device decompresses and restores the compressed log file according to the target log template file, it also includes: synchronously sending the selected target log template file to the data restoration device. Specifically, after selecting a target log template file that matches the type of log data, the matched target log template file is sent to the data restoration device for storage, so that after receiving the compressed log file obtained after the log data is parsed, the compressed log file is decompressed and restored by calling the corresponding target log template file to obtain the log data, so that the technical engineer can view it easily.
[0102] In one embodiment of the present invention, after outputting the log data, it further includes: searching for target data from the log data according to the set screening conditions. That is, the screening conditions can be set and input according to actual needs, and then the required target data can be screened out from the log data, thereby filtering out redundant information, realizing personalized customization processing, and improving the work efficiency and work experience of technical engineers.
[0103] In one embodiment of the present invention, setting the screening condition includes: setting at least one of content, setting an identifier, setting a keyword, setting a time period, setting a time point, and setting macro definition information. Specifically, customized processing can be performed by setting and inputting at least one of the specific content, rule identifier, keyword, time period, time point, macro definition set identifier, etc., to screen out data that meets the screening condition, remove redundant information, and meet the user's personalized screening needs.
[0104] For example, after receiving the compressed log file, the data restoration device decompresses and restores the compressed log file to obtain the log data, and can directly save the log data and identify the corresponding target log template file. Furthermore, the log data can be customized according to different scenarios. For example, if a technical engineer needs to view and analyze specific sensors and other data, the "Content (content / directory)" and {$V1} of the target log template file are used as filtering conditions. The desired data can be quickly filtered out through the filtering conditions, and the problem time context can be locked through "Error" or other macro definition sets. The device can also be locked to the target value, performance analysis, data curves, etc., to meet personalized customization needs.
[0105] In other words, the data restoration device can perform Huffman decompression processing on the transmitted data, and then restore the previous log data losslessly through the target log template file, and achieve faster parsing and response to the site or data observation and analysis. In addition, it can receive the filtering conditions customized by the user according to the needs of different application scenarios, and filter the rule set in the log file selection template accordingly, filter out specific sensors or other data, and realize customized processing of log data. That is, the compressed log file can be losslessly restored according to the previously generated target log template file, and customized filtering can be performed according to the rules in the template, which is beneficial for users to count log data and observe equipment performance, which brings great convenience to on-site and remote technical engineers and helps to improve work efficiency and work experience.
[0106] In summary, the overall execution process of the data processing method of the embodiment of the present invention can be summarized as follows: Based on the characteristics that the energy storage system log is mainly composed of digital information such as sensor status, power and voltage data. The overall design process is divided into a data analysis stage, a data processing stage, a data compression stage, and a data restoration stage. This method can perform adaptive data processing on the logs of different energy storage systems, and perform self-update learning based on the parts of the new log file that cannot be parsed by the template, thereby improving the intelligence of data processing. After the log data is filtered by the template file, the generated new format log file is compressed by the Huffman algorithm, and then transmitted as a whole from the Internet to the remote data processing device. After receiving the compressed log file, the remote data processing device decompresses it using the Huffman algorithm, and then reversely restores it losslessly using the log template, and can further realize customized processing of the log data.
[0107] Specifically, in the data analysis phase, big data analysis technology was used to first input the key feature words of the energy storage system. Since the energy storage system is generally a record of sensor variables, etc., the main changes are mostly numbers, so big data analysis adds rules to perform initial classification analysis on the digital part and the non-digital part. After counting the sentence frequency of the keywords associated with the log file, the digital part and the non-digital part of the data are discretized again and arranged in sequence. Finally, the fixed part of the log file is counted by big data analysis technology to generate a rule set, and this rule set is used to generate a special template, that is, the target log template file. Among them, different types of logs can be distinguished according to the similarity of the log data file name, and different templates can be output.
[0108] In the data processing stage, the target log template file generated in the data analysis stage is used to filter the constant data in the log data. The first step is to build a model for the log template, create new object variables for the remaining data changes, and map the data changes to the newly created variable objects. Furthermore, the data processing records the corresponding changed objects under the corresponding rules, while the unchanged objects only record the time when the corresponding rules occurred and the rule identifier.
[0109] In the data compression stage, the previously filtered and deleted log data is compressed. Similarly, since the energy storage system generally records sensor variables, etc., the main changes are mostly numbers. Therefore, the embodiment of the present invention adopts the Huffman algorithm, and the final data only contains 10 characters from 0 to 9, plus a few special characters, a total of no more than 16 characters. According to this design, theoretically, excluding the length of the previous filter, the filtered length can be compressed to half the length of the original data. Since the repetition rate of the log variables recorded by the energy storage system in a steady state is relatively high, it can optimize the adaptation to the characteristics of the Huffman algorithm, so that the number of characters appearing in the compressed data format is as small as possible, and the frequency of certain characters appearing is high, so that the compression efficiency is optimized, thereby achieving efficient compression, saving storage space, while maintaining the simplicity and accuracy of the data, which is conducive to improving the efficiency of data transmission to the remote end.
[0110] During the data restoration stage, the data restoration device can perform Huffman decompression on the transmitted data, and then losslessly restore the previous log data through the log template file, and achieve faster analysis to respond to on-site or data observation and analysis. Furthermore, it can also receive user-defined filter conditions input according to different application scenarios, and filter the rule set in the log file selection template based on this, filter out specific sensors or other data, realize customized data processing, and improve the efficiency and work experience of technical engineers.
[0111] In order to better understand the data processing method of the embodiment of the present invention, the following Figure 2 , the method is exemplarily described as a specific embodiment.
[0112] In a specific embodiment, Figure 2 As shown, the data processing method mainly includes the following steps S10 to S60, wherein the execution order of steps S10 to S60 is not limited.
[0113] Step S10: Obtain log data and determine whether there is a target log template file that matches the type of the log data.
[0114] Step S20: If it is determined that there is no matching target log template file, then start to create a new target log template file. Perform a unit parsing statistical analysis on the unit data in the log data (including one line or multiple continuous lines of data), first isolate the non-digital and digital data, perform discrete processing on the previous single line and multiple lines and arrange them in order, perform word frequency statistics based on keywords, and only analyze whether they have changed or not. Quickly match and locate the content with relevant constants that remain unchanged in the non-digital part, and attribute it to the initial log template according to the corresponding position, while the content that has changed in the non-digital part is summarized into a macro definition set according to statistics, and a related mark Macro (macro instruction) 1 is made, abbreviated as M1, and the abbreviation is used to quickly replace the non-digital part that has changed. The digital part is also attributed to the initial log template according to the statistical analysis of the corresponding position constant. The remaining content that has changed is recorded by the {$V1} mark, abbreviated as V1. After distinguishing the constant part and the dynamically changing part in the unit data, a rule is formed and the rule is marked with an ID, such as Rule1, etc. Then, multiple rules form a rule set, and the rule set is output as a template file in Json format to obtain the target log template file.
[0115] If it is determined that a matching target log template file already exists, the corresponding log template is directly selected according to the type of log data to parse the log data, and it is determined whether the parsing of the log data is successful. If successful, step S30 is executed. If the parsing is unsuccessful, for example, there are one or more unit data that cannot be parsed, the one or more unit data that cannot be parsed are re-entered into the big data analysis, the log template file is adjusted and updated, and a matching target log template file is obtained, so as to realize online learning and adaptive updating of the log template. Further, the updated target log template file is synchronized.
[0116] Step S30: Build a model based on the log template file, create variable objects for the changed data unit part and map them one by one, that is, the Value of each rule in the log model is mapped to a row or multiple consecutive rows of log data using a variable object, and process it separately according to whether the Value has changed.
[0117] Step S40: Filter the content information of the log data through the log template file and output it to a new data file. The remaining data after filtering according to the log template file are all dynamic data, and the non-digital part is enumerated by macro definition variables and replaced by the abbreviation "M1", where M is a special character and 1 is the ID of the macro definition. The variable data Value is also replaced by the abbreviation "V1", where 1 is the ID of the Value under this rule. {$Time} is used to divide the time period, and the log of the hour is recorded in hours. The final display includes the year, month, day and time, avoiding recording redundant data in time. The time of each rule only records the minutes and seconds, and when entering the next hour interval, {$Time} is recorded. Parse the log data. If the variable object Value changes in the corresponding log data, the corresponding mapped variable object will record the changed Value; if the variable object of the corresponding rule does not change in value, the ID and minutes and seconds of the rule can be directly recorded once (the time is a fixed length), so as to achieve the purpose of deduplication and not recording redundant data.
[0118] Step S50: According to the data obtained after the data processing process in the above step S40, the changed digital part is simplified and matched as much as possible to remove redundancy, and the final effect is to be obtained by <year, month, day, time> and <minutes and seconds + RuleID + Value digital part + separator '|' + macro definition 'M'>, and then compressed by Huffman algorithm to obtain a compressed log file, which can be transmitted to a remote data processing device through the network. Among them, the format of the output file of this design can better adapt to the compression characteristics of the Huffman algorithm, achieve efficient compression, and improve data transmission efficiency.
[0119] Step S60: After the remote data processing device receives the compressed log file, it can decompress and losslessly restore the compressed log file to obtain the original log data. The log data can be directly saved and the corresponding log template file can be identified. Furthermore, the log data can be customized according to different scenario applications. For example, if a technical engineer needs to analyze specific sensors and other data, the desired data can be quickly filtered out by using the template's "Content (content / directory)" and {$V1} as filtering conditions. The problem time context can also be locked through "Error" or other macro definitions, and the device can also be locked to the target value, performance analysis, data curves, etc. In this way, personalized customization of data can be achieved, which is conducive to improving work efficiency and enhancing work experience.
[0120] According to the data processing method of the embodiment of the present invention, log data is obtained, a target log template file is selected according to the type of log data, the log data is filtered according to the target log template file to obtain the dynamic data part, a variable object is created for the dynamic data part, and it is analyzed whether the variable object has changed. If so, the dynamic data corresponding to the changed variable object is recorded, otherwise, the basic information of the variable object is recorded, and finally the recorded dynamic data and / or basic information is summarized and compressed to obtain a compressed log file. Therefore, the present invention can perform big data analysis on a huge amount of log data, and automatically match a suitable target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to the data characteristics, so that there is no excessive redundant information in the obtained compressed log file, which is conducive to saving storage space and improving data transmission efficiency.
[0121] A further embodiment of the present invention also discloses a data processing device.
[0122] Figure 3 is a schematic diagram of the structure of a data processing device according to an embodiment of the present invention. Figure 3 As shown, the data processing device 100 includes: a filtering module 110 , an analyzing module 120 , a recording module 130 and a compression module 140 .
[0123] Specifically, the filtering module 110 is used to filter the log data according to the target log template file, obtain the dynamic data part, and create a variable object for the dynamic data part.
[0124] The analysis module 120 is used to analyze whether the variable object has changed.
[0125] The recording module 130 is used to record the dynamic data corresponding to the changed variable object when the variable object changes, and to record the basic information of the variable object when the variable object does not change.
[0126] The compression module 140 is used to aggregate and compress the recorded dynamic data and / or basic information to obtain a compressed log file.
[0127] In one embodiment of the present invention, Figure 4 As shown, the data processing device 100 further includes a selection module 150. The selection module 150 is used to receive log data and select a target log template file according to the type of log data.
[0128] In one embodiment of the present invention, the selection module 150 selects a log template file according to the type of log data, including: determining whether there is a log template file that matches the type of log data; if so, using the matching log template file as the target log template file; otherwise, constructing a new log template file as the target log template file.
[0129] In one embodiment of the present invention, the selection module 150 constructs a new log template file, including: obtaining multiple unit data in the log data; parsing the multiple unit data to generate a rule set; and generating a new log template file according to the rule set.
[0130] In one embodiment of the present invention, the selection module 150 parses and processes multiple unit data, including: performing discrete processing on each unit data to obtain a digital content part and a non-digital content part; performing statistical analysis on the digital content part and the non-digital content part respectively; generating corresponding rules based on the statistical analysis results, the rules having a unique identifier; and generating a rule set based on the rules corresponding to the obtained multiple unit data.
[0131] In one embodiment of the present invention, the selection module 150 performs discrete processing on each unit data, including: identifying digital content and non-digital content in the unit data; and isolating the digital content and the non-digital content.
[0132] In one embodiment of the present invention, after isolating the digital content and the non-digital content, the selection module 150 is further used to: perform word frequency statistics on the isolated non-digital content according to preset keywords, and sort the non-digital content according to the statistical results.
[0133] In one embodiment of the present invention, the selection module 150 performs statistical analysis on the non-digital content part, including: identifying dynamically changing content and unchanged content in the non-digital content part; summarizing the dynamically changing content in the non-digital content part, generating a first macro definition set, and identifying the first macro definition set; adding the unchanged content in the non-digital content part to a preset initial log template file.
[0134] In one embodiment of the present invention, the selection module 150 performs statistical analysis on the digital content portion, including: identifying dynamically changing content and unchanged content in the digital content portion; summarizing the dynamically changing content in the digital content portion to generate a second macro definition set, and identifying the second macro definition set; adding the unchanged content in the digital content portion to a preset initial log template file.
[0135] In one embodiment of the present invention, the selection module 150 generates corresponding rules according to the statistical analysis results, including: generating rules according to the first macro definition set, the second macro definition set and the initial log template file.
[0136] In one embodiment of the present invention, the selection module 150 generates a new log template file according to the rule set, including: converting the rule set into a template file in a preset format to obtain a new log template file.
[0137] In one embodiment of the present invention, the unit data includes at least one line of data in the log data.
[0138] In one embodiment of the present invention, after determining that there is a log template file that matches the type of log data, the selection module 150 is also used to: parse the log data according to the log template file; if there is a data portion in the log data that cannot be parsed, generate a new rule set based on the data portion that cannot be parsed; update the log template file according to the new rule set, and use the updated log template file as the target log template file.
[0139] In one embodiment of the present invention, there is a corresponding relationship between the type of log data and the target log template file, and the corresponding relationship is obtained by pre-calibration.
[0140] In one embodiment of the present invention, the filtering module 110 creates variable objects for the dynamic data part, including: creating variable objects for the data in the dynamic data part respectively, and mapping each data with the variable object in a one-to-one correspondence.
[0141] In one embodiment of the present invention, the filtering module 110 creates variable objects for the data in the dynamic data part respectively, including: taking the content corresponding to the data in the dynamic data part as the corresponding variable object.
[0142] In one embodiment of the present invention, the target log template file also includes multiple time intervals, and the selection module 150 is further used to record the time when each rule is generated.
[0143] In one embodiment of the present invention, the basic information includes: the identifier and generation time of the rule where the data corresponding to the variable object is located.
[0144] In one embodiment of the present invention, the compression module 140 compresses the recorded dynamic data and / or basic information by using the Huffman algorithm to obtain a compressed log file.
[0145] In one embodiment of the present invention, the data processing device 100 further includes a storage module (not shown in the figure). After the compression module 140 obtains the compressed log file data, the storage module is used to store the compressed log file and identify the target log template file in the compressed log file.
[0146] In one embodiment of the present invention, the data processing device 100 further includes a transmission module (not shown in the figure) and a data restoration device (not shown in the figure). After obtaining the compressed log file data, the transmission module is used to transmit the compressed log file to the data restoration device; the data restoration device decompresses and restores the compressed log file according to the target log template file, and outputs the log data.
[0147] In one embodiment of the present invention, before the data restoration device decompresses and restores the compressed log file according to the target log template file, the transmission module is further used to: synchronously send the selected target log template file to the data restoration device.
[0148] In one embodiment of the present invention, after outputting the log data, the data restoration device is further used to: search for target data from the log data according to a set screening condition.
[0149] In one embodiment of the present invention, setting the screening condition includes: setting at least one of content, setting an identifier, setting a keyword, setting a time period, setting a time point, and setting macro definition information.
[0150] It should be noted that, when processing data, the specific implementation method of the data processing device 100 is similar to the specific implementation method of the data processing method of any one of the above-mentioned embodiments of the present invention. Therefore, for a detailed exemplary description of the data processing device 100, please refer to the relevant description part of the above-mentioned data processing method. In order to reduce redundancy, it will not be repeated here.
[0151] Therefore, according to the data processing device 100 of the embodiment of the present invention, the acquired log data, selects the target log template file according to the type of log data, filters the log data according to the target log template file, obtains the dynamic data part, creates a variable object for the dynamic data part, analyzes whether the variable object has changed, and if so, records the dynamic data corresponding to the changed variable object, otherwise, records the basic information of the variable object, and finally summarizes and compresses the recorded dynamic data and / or basic information to obtain a compressed log file. Therefore, the present invention can perform big data analysis on a huge amount of log data, and automatically match a suitable target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to the data characteristics, so that there is no excessive redundant information in the obtained compressed log file, which is conducive to saving storage space and improving data transmission efficiency.
[0152] A further embodiment of the present invention also discloses an electronic device.
[0153] In one embodiment of the present invention, the electronic device includes the data processing device 100 described in any one of the above embodiments.
[0154] In another embodiment of the present invention, the electronic device includes: a processor, a memory, and a data processing program stored in the memory and executable on the processor, wherein the data processing program, when executed by the processor, implements the data processing method described in any one of the above embodiments of the present invention.
[0155] Therefore, when processing data, the specific implementation method of the electronic device can refer to the aforementioned description of the data processing method or the data processing device 100. In order to reduce redundancy, it will not be repeated here.
[0156] According to the electronic device of the embodiment of the present invention, log data is obtained, a target log template file is selected according to the type of log data, the log data is filtered according to the target log template file to obtain the dynamic data part, a variable object is created for the dynamic data part, and whether the variable object has changed is analyzed. If so, the dynamic data corresponding to the changed variable object is recorded, otherwise, the basic information of the variable object is recorded, and finally the recorded dynamic data and / or basic information is summarized and compressed to obtain a compressed log file. Thus, the present invention can perform big data analysis on a huge amount of log data, and automatically match a suitable target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to the data characteristics, so that there is no excessive redundant information in the obtained compressed log file, thereby saving storage space and improving data transmission efficiency.
[0157] A further embodiment of the present invention also discloses a computer-readable storage medium, on which a data processing program is stored. When the data processing program is executed by a processor, the data processing method described in any one of the above embodiments of the present invention is implemented. For a detailed description of the execution process of the data processing method, please refer to the relevant part of the previous text, which will not be repeated here.
[0158] Therefore, according to the computer-readable storage medium of an embodiment of the present invention, when the data processing program stored thereon is executed by the processor, log data can be obtained, a target log template file is selected according to the type of log data, the log data is filtered according to the target log template file, a dynamic data part is obtained, a variable object is created for the dynamic data part, and an analysis is performed on whether the variable object has changed. If so, the dynamic data corresponding to the changed variable object is recorded, otherwise, the basic information of the variable object is recorded, and finally the recorded dynamic data and / or basic information is summarized and compressed to obtain a compressed log file. Therefore, the present invention can perform big data analysis on a huge amount of log data, and automatically match a suitable target log template file without manual participation and changing the log template, thereby improving the intelligence of the processing process, and filtering, de-redundant processing and compression of the log data according to the data characteristics, so that there is no excessive redundant information in the obtained compressed log file, thereby saving storage space and improving data transmission efficiency.
[0159] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.
[0160] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A data processing method, It is characterized in that include: Filter the log data according to the target log template file to obtain a dynamic data part, and create a variable object for the dynamic data part; Analyze whether the variable object has changed; If yes, then record the dynamic data corresponding to the changed variable object; otherwise, record the basic information of the variable object; The recorded dynamic data and / or basic information is compressed to obtain a compressed log file.
2. The data processing method according to claim 1, It is characterized in that Before filtering the log data according to the target log template file, it also includes: The log data is received, and the target log template file is selected according to the type of the log data.
3. The data processing method according to claim 2, It is characterized in that Select a target log template file according to the type of the log data, including: Determine whether there is a log template file matching the type of the log data; If yes, the matching log template file is used as the target log template file; Otherwise, a new log template file is constructed to serve as the target log template file.
4. The data processing method according to claim 3, It is characterized in that Create a new log template file, including: Acquire multiple unit data in the log data; Parsing and processing the plurality of unit data to generate a rule set; The new log template file is generated according to the rule set.
5. The data processing method according to claim 4, It is characterized in that The plurality of unit data are analyzed and processed, including: Discretely process each of the unit data to obtain a digital content part and a non-digital content part; Perform statistical analysis on the digital content part and the non-digital content part respectively; Generate corresponding rules according to the statistical analysis results, wherein the rules have a unique identifier; The rule set is generated according to the obtained rules corresponding to the plurality of unit data.
6. The data processing method according to claim 5, It is characterized in that Discrete processing is performed on each of the unit data, including: Identify digital content and non-digital content in the unit data; The digital content and the non-digital content are isolated.
7. The data processing method according to claim 6, It is characterized in that After isolating the digital content and the non-digital content, the method further includes: The isolated non-digital content is statistically analyzed based on preset keywords, and the non-digital content is sorted based on the statistical results.
8. The data processing method according to claim 7, It is characterized in that Perform statistical analysis on the non-digital content, including: identifying dynamically changing content and non-changing content in the non-digital content portion; Summarizing dynamically changing contents in the non-digital content portion to generate a first macro definition set, and marking the first macro definition set; The unchanged content in the non-digital content portion is added to a preset initial log template file.
9. The data processing method according to claim 7, It is characterized in that Performing statistical analysis on said digital content portion, including: identifying dynamically changing content and non-changing content in the digital content portion; Summarizing the dynamically changing contents in the digital content portion to generate a second macro definition set, and marking the second macro definition set; The unchanged content in the digital content portion is added to a preset initial log template file.
10. The data processing method according to claim 4, It is characterized in that Generating the new log template file according to the rule set includes: The rule set is converted into a template file in a preset format to obtain the new log template file.
11. The data processing method according to claim 4, It is characterized in that The unit data includes at least one line of data in the log data.
12. The data processing method according to claim 4, It is characterized in that After determining that there is a log template file matching the type of the log data, the method further includes: Parsing the log data according to the log template file; If there is a data portion that cannot be parsed in the log data, generating a new rule set according to the data portion that cannot be parsed; The log template file is updated according to the new rule set, and the updated log template file is used as the target log template file.
13. The method for processing log data according to claim 1, It is characterized in that After getting the compressed log file data, it also includes: Transmitting the compressed log file to a data restoration device; The data restoration device decompresses and restores the compressed log file according to the target log template file, and outputs the log data.
14. A data processing device, It is characterized in that include: A filtering module, used for filtering the log data according to the target log template file, obtaining a dynamic data part, and creating a variable object for the dynamic data part; An analysis module, used for analyzing whether the variable object has changed; A recording module, used for recording the dynamic data corresponding to the changed variable object when the variable object changes, and for recording the basic information of the variable object when the variable object does not change; The compression module is used to compress the recorded dynamic data and / or basic information to obtain a compressed log file.
15. An electronic device, It is characterized in that include: The data processing device according to claim 14; or, A processor, a memory, and a data processing program stored in the memory and executable on the processor, wherein the data processing program, when executed by the processor, implements the data processing method according to any one of claims 1 to 13.
16. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a data processing program, and when the data processing program is executed by a processor, the data processing method according to any one of claims 1 to 13 is implemented.
Citation Information
Cited By
Cross-platform file incremental synchronization method, computer device, medium and product
CN119254769A
