Data analysis method, data analysis device, electronic device and storage medium
By serializing the target program to obtain the attribute information of the structural object and parse the communication area data, the problem of slow parsing speed and large network resource occupancy caused by the communication area data analysis requires connection to the database, and efficient data analysis is achieved.
Patent Information
- Application Number
- CN202110674754.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-17
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2041-06-17
AI Technical Summary
In the prior art, communication area data analysis requires connection to a designated database, resulting in slow resolution and occupancy of network resources, which cannot effectively reduce the occupancy of network resources.
By obtaining the communication area data generated when calling the target program, serializing the target program to obtain structural objects, parsing the attribute information of the structural objects, and using these attribute information to parse the communication area data to generate a data list, avoiding dependence on the database.
Effectively reduce the use of network resources in the analysis communication area, improve the analysis speed, and realize the ability to analyze communication area data offline.
Smart Images

Figure CN113392112B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of computer technology and finance, and more specifically, to a data analysis method, a data analysis device, an electronic device, a readable storage medium, and a computer program product. Background Art
[0002] When testers conduct program testing, application support personnel are required to provide communication area data to facilitate problem troubleshooting.
[0003] In the process of implementing the concept of the present disclosure, the inventors discovered that the communication area data provided by application support personnel is usually binary data, and the binary data needs to be converted into actual field information that is easy to identify. Summary of the invention
[0004] In view of this, the present disclosure provides a data analysis method, a data analysis device, an electronic device, a readable storage medium and a computer program product.
[0005] One aspect of the present disclosure provides a data parsing method, comprising: obtaining communication area data generated when a target program is called; serializing the target program to obtain at least one structure object; determining at least one target structure object from the at least one structure object based on a data structure involved when the target program is called; parsing the at least one target structure object to obtain attribute information of the at least one target structure object; and parsing the communication area data using the attribute information of the target structure object to generate a data list.
[0006] According to an embodiment of the present disclosure, the above-mentioned target program includes at least one data structure, wherein each data structure includes multiple lines of data definition statements; wherein the above-mentioned serialization of the above-mentioned target program to obtain at least one structural object includes: for each data structure of the above-mentioned target program, using a policy chain to parse the multiple lines of data definition statements of the above-mentioned data structure to obtain multiple structural class syntax trees; and serializing the above-mentioned multiple structural class syntax trees to obtain the above-mentioned structural object.
[0007] According to an embodiment of the present disclosure, the above-mentioned policy chain includes multiple data parsers established for each data type respectively; wherein, the above-mentioned policy chain is used to parse multiple lines of data definition statements of the above-mentioned data structure to obtain multiple structural syntax trees, including: for each line of data definition statement, using the above-mentioned multiple data parsers in turn to identify the above-mentioned data definition statement; and using the data parser that successfully identifies the above-mentioned data definition statement to parse the above-mentioned data definition statement to generate a structural syntax tree.
[0008] According to an embodiment of the present disclosure, the above-mentioned communication area data includes data of passing parameters and data of return parameters when calling the above-mentioned target program; wherein, based on the data structure involved when calling the above-mentioned target program, at least one target structure object is determined from the above-mentioned at least one structure object, including: determining at least one data structure related to the above-mentioned passing parameters and the above-mentioned return parameters; and determining the above-mentioned at least one target structure object from the above-mentioned structure objects according to the name of the above-mentioned at least one data structure.
[0009] According to an embodiment of the present disclosure, the above-mentioned attribute information includes field order information and field attribute information; wherein, the above-mentioned parsing of the above-mentioned at least one target structure object to obtain the attribute information of the above-mentioned at least one target structure object includes: for each target structure object, parsing the above-mentioned target structure object to obtain a target structure linked list, wherein the above-mentioned target structure linked list includes multiple data fields; extracting multiple fields that do not contain subordinate fields from the above-mentioned multiple data fields as multiple target fields; obtaining the above-mentioned field order information according to the arrangement order of the above-mentioned multiple target fields; and obtaining the above-mentioned field attribute information according to the field attributes of the above-mentioned multiple target fields.
[0010] According to an embodiment of the present disclosure, when the number of the above-mentioned target structure objects is greater than 1, the above-mentioned attribute information also includes the order of multiple target structure objects; the above-mentioned method also includes: according to the order of the above-mentioned multiple target structure objects, using the attribute information of the above-mentioned target structure objects to parse the above-mentioned communication area data to generate a data list.
[0011] According to an embodiment of the present disclosure, the field attributes of the above-mentioned target field include field name, field type and field length; wherein, the above-mentioned use of the attribute information of the above-mentioned target structure object to parse the above-mentioned communication area data to generate a data list includes: extracting multiple data sequences from the above-mentioned communication area data according to the above-mentioned field order information and the field lengths of the above-mentioned multiple target fields, wherein the above-mentioned data sequences correspond to the above-mentioned target fields one-to-one; for each data sequence, selecting a decoding method based on the field type of the target field corresponding to the above-mentioned data sequence; based on the above-mentioned decoding method, performing code conversion on the above-mentioned data sequence to obtain parsed data; and generating a data list based on the name of the above-mentioned target structure object, the field names of the above-mentioned multiple target fields, the multiple parsed data and the above-mentioned multiple data sequences.
[0012] Another aspect of the present disclosure provides a data parsing device, including an acquisition module, a processing module, a selection module, a parsing module, and a generation module. The acquisition module is used to acquire communication area data generated when a target program is called; the processing module is used to serialize the target program to acquire at least one structure object; the selection module is used to determine at least one target structure object from the at least one structure object based on the data structure involved when calling the target program; the parsing module is used to parse the at least one target structure object to acquire attribute information of the at least one target structure object; and the generation module is used to parse the communication area data using the attribute information of the target structure object to generate a data list.
[0013] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method as described above.
[0014] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0015] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and when the instructions are executed, are used to implement the method as described above.
[0016] According to the embodiments of the present disclosure, because a technical means is adopted to obtain attribute information of a target structure object related to communication area data from a serialized object of a target program, and then use the attribute information to parse the communication area data to generate a data list, the technical problem that the communication area data needs to be connected to a specified database for parsing and the parsing speed is slow is at least partially overcome, thereby effectively reducing the occupation of network resources by parsing the communication area and improving the parsing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 A schematic diagram schematically shows communication zone data according to an embodiment of the present disclosure;
[0019] Figure 2 Schematically illustrates an exemplary system architecture 200 to which a data parsing method according to an embodiment of the present disclosure may be applied;
[0020] Figure 3 A flowchart of a data parsing method according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 4 A schematic diagram schematically shows the workflow of a language parsing system according to an embodiment of the present disclosure;
[0022] Figure 5 A block diagram of a data analysis device according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 6 A block diagram of an electronic device suitable for implementing a data parsing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0024] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0025] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0026] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0027] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0028] The communication area is the memory area containing data information sent when the program is called, or the memory area containing data information returned after the program is processed.
[0029] Figure 1 The diagram schematically shows communication area data according to an embodiment of the present disclosure.
[0030] like Figure 1 As shown, the communication area data is binary data encoded according to a certain code system.
[0031] In related technologies, when R&D personnel troubleshoot related problems in program operation, application support personnel can only provide Figure 1 The communication area binary data shown requires R&D personnel to convert the binary data through tools to obtain identifiable actual field information.
[0032] However, the communication area data parsing methods in the related art all need to connect to a specified database resource, such as a DB2 database. The communication area structure is parsed by defining the data structure in the program on the database, and then the fields of the program are encoded and displayed one by one according to the binary data in the communication area. The entire parsing process must be connected to the database through the Internet, and it is necessary to wait for the database to respond, which results in a slow parsing speed.
[0033] In view of this, the inventors have proposed a method for offline parsing of communication area data, which is used to at least partially solve the above-mentioned problems. Specifically, the embodiments of the present disclosure provide a data parsing method, a data parsing device, an electronic device, a readable storage medium and a computer program product. The method includes: obtaining communication area data generated when calling a target program; serializing the target program to obtain at least one structure object; determining at least one target structure object from at least one structure object based on the data structure involved when calling the target program; parsing at least one target structure object to obtain attribute information of at least one target structure object; and using the attribute information of the target structure object to parse the communication area data to generate a data list.
[0034] It should be noted that the data analysis method and device provided by the embodiments of the present disclosure can be used in the field of computer technology or finance. For example, when maintaining a bank system, the method provided by the embodiments of the present disclosure can be used to analyze the communication area data so that maintenance personnel can find operational problems in a timely manner. The data analysis method and device provided by the embodiments of the present disclosure can also be used in other fields besides the fields of computer technology and finance, and the application fields of the embodiments of the present disclosure are not limited.
[0035] Figure 2The exemplary system architecture 200 to which the data parsing method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 2 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0036] like Figure 2 As shown, the system architecture 200 according to this embodiment may include a terminal device 201 .
[0037] The terminal device 201 may be any electronic device having a display screen and supporting network communication or data processing functions, including but not limited to a smart phone, a tablet computer, a portable computer, and a desktop computer.
[0038] Various client applications may be installed on the terminal device 201, including but not limited to communication applications, programming environment applications, etc.
[0039] The data analysis method provided in the embodiment of the present disclosure can generally be executed by the terminal device 201, and accordingly, the data analysis device provided in the embodiment of the present disclosure can generally be set in the terminal device 201. For the program file 202 received or originally stored in the terminal device 201, the terminal device 201 can use the data analysis method or device provided in the embodiment of the present disclosure to extract the data list 203 of the target field from the program file 202, and display the data list 203 on the display screen of the terminal device 201.
[0040] It should be noted that there may be multiple terminal devices, and different terminal devices may exchange information via wired and / or wireless communication links. The data parsing method provided in the disclosed embodiment may be executed by one of the terminal devices, and the generated data list 203 may be transmitted to another terminal device via a communication link for display.
[0041] The system architecture 100 according to the embodiment of the present disclosure may further include a server 204 .
[0042] The server 204 may be a server or a server group that provides various services. The server 204 and the terminal device 201 may exchange information via wired and / or wireless communication links.
[0043] The data analysis method provided in the embodiment of the present disclosure may also be executed by the server 204, and accordingly, the data analysis device provided in the embodiment of the present disclosure may also be set in the server 204. The terminal device 201 may send the corresponding program file 202 to the server 204 via a communication link, and the server 204 may process the program file 202 using the method provided in the embodiment of the present disclosure to obtain a data list 203. The data list 203 may also be returned to the terminal device 201 or other terminal devices different from the terminal device 201 via the communication link for display.
[0044] In addition, the data analysis method provided by the embodiment of the present disclosure can also be executed by other servers or server groups different from server 204. Accordingly, the data analysis device provided by the embodiment of the present disclosure can also be set in other servers or server groups different from server 204, which will not be repeated here.
[0045] It should be understood that there may be multiple servers 204 . Figure 1 There is no limit on the number of terminal devices and servers.
[0046] Figure 3 The flowchart of the data parsing method according to the embodiment of the present disclosure is schematically shown.
[0047] like Figure 3 As shown, the method includes operations S310 to S350.
[0048] In operation S310, communication area data generated when a target program is called is acquired.
[0049] In operation S320 , the target program is serialized to obtain at least one structure object.
[0050] In operation S330, at least one target structure object is determined from the at least one structure object based on the data structure involved when the target program is called.
[0051] In operation S340, at least one target structure object is parsed to obtain attribute information of the at least one target structure object.
[0052] In operation S350, the communication area data is parsed using the attribute information of the target structure object to generate a data list.
[0053] According to an embodiment of the present disclosure, the target program may be one or more programs that are running in the system when the communication area data is interpreted.
[0054] According to the embodiments of the present disclosure, by serializing the target program, program objects, method objects, structure objects and database objects can be obtained. Among them, the program object is obtained by serializing the program definition statement, method definition statement and data structure definition statement of the target program; the method object is obtained by serializing the method statement of each method in the program file; the structure object is obtained by serializing the data definition statement of each data structure in the program file; the database object is obtained by serializing the structured query language statement in the program file.
[0055] According to an embodiment of the present disclosure, when the target program is running, it is usually necessary to import and export data through relevant parameters, and the imported and exported data are the communication area data that need to be parsed. According to the data structure involved in the relevant parameters, the data structure involved when calling the target program can be determined, and the target structure object can be determined accordingly. For example, the target program includes two functions, and the transfer parameters of the two functions are a, b and c, d respectively, and the return parameters are x and y respectively, wherein the data structure involved in a, b, c and d is A, and the data structure involved in x and y is Z. Then, according to the above method, the target structure object that can be determined is the structure object obtained after the data structures A and Z are serialized.
[0056] According to an embodiment of the present disclosure, a serialized object such as a structure object may be a data file in the form of binary data. By parsing the structure object, the structure object may be displayed to facilitate subsequent operations.
[0057] According to an embodiment of the present disclosure, attribute information of each parameter can be extracted from the parsed structure object, including but not limited to information such as the level, identifier, type, and length of the parameter.
[0058] According to the embodiments of the present disclosure, based on the order of each data structure and the order of each parameter in the data structure and in accordance with the length information of each parameter, a decoder corresponding to the type information may be selected to parse the communication area data.
[0059] According to an embodiment of the present disclosure, the generated data list may include parameter names and actual data obtained by parsing, so that the technician can understand the meaning of the data in the communication area. In some embodiments, the data list may also include corresponding unparsed communication area data, so that the technician can perform comparative analysis.
[0060] According to the embodiments of the present disclosure, because a technical means is adopted to obtain attribute information of a target structure object related to communication area data from a serialized object of a target program, and then use the attribute information to parse the communication area data to generate a data list, the technical problem that the communication area data needs to be connected to a specified database for parsing and the parsing speed is slow is at least partially overcome, thereby effectively reducing the occupation of network resources by parsing the communication area and improving the parsing speed.
[0061] Reference below Figure 4 , combined with specific embodiments Figure 3 The method shown is further explained.
[0062] Figure 4 The following is a schematic diagram schematically showing the workflow of the language parsing system according to an embodiment of the present disclosure.
[0063] like Figure 4 As shown, the system uses a policy chain 420 to identify and parse a target program 410 to generate a syntax tree 430 , and then serializes the syntax tree 430 to obtain a corresponding serialized object 440 .
[0064] According to an embodiment of the present disclosure, the policy chain 420 may include multiple data parsers 421 established for each data type. For example, the policy chain 420 may include multiple DataItem-define parsers established for integer variables, floating-point variables, character variables, array variables, and other variable types, and a Record-define parser established for the functional statement of the data structure definition statement.
[0065] According to an embodiment of the present disclosure, the syntax tree 430 may include a structure-type syntax tree 431 generated after the corresponding data definition statement or data structure definition statement is parsed by the data parser 421. For example, the syntax tree 430 may include a Dataitem syntax tree generated by applying a DataItem-define parser to parse a statement defining a variable, and a Record syntax tree generated by applying a Record-define parser to parse a statement defining a data structure.
[0066] According to an embodiment of the present disclosure, a program file may include multiple data structures, and a data structure may include data structure definition statements and specific data definition statements. The step of using the policy chain 420 to identify and parse the target program includes: for each line of data definition statement, using multiple data parsers 421 in turn to identify the data definition statement, and using the data parser 421 that successfully identifies the data definition statement to parse the data definition statement to generate a structure class syntax tree 431.
[0067] According to an embodiment of the present disclosure, the serialized object 440 may include a structure object 441 .
[0068] According to an embodiment of the present disclosure, all structure class syntax trees 431 belonging to the same data structure are serialized to obtain a structure object 441 corresponding to the data structure. For example, the Record syntax tree and Dataitem syntax tree generated by parsing a statement in a data structure can be serialized to obtain a Record object of the data structure.
[0069] According to an embodiment of the present disclosure, at least one target structure object can be determined from the structure object 441 based on the data structure involved when calling the target program. For example, the name of the data structure involved in the communication area data can be determined based on the transfer parameters and return parameters when calling the target program, and the target structure object can be determined from the structure object 441 based on the name.
[0070] According to an embodiment of the present disclosure, for a target structure object, the target structure object is parsed to obtain a target structure linked list to obtain information contained in the target structure object.
[0071] According to an embodiment of the present disclosure, the target structure linked list may include the name and type of the corresponding data structure, as well as attribute information of each field in the data structure.
[0072] Take the serialized object obtained after the EGL program is serialized as an example. In a structure linked list, the name of the data structure is record_name, the type is basicRecord, and then it includes multiple CodeRecordItem data blocks. Each CodeRecordItem data block is used to represent the attribute information of a field in the data structure. In one of the data blocks, the information in class indicates the data type and address of the field, "A" indicates that the field is a variable in the EGL program, "@" indicates the address pointer, and "123456" indicates the storage address of the field in the memory; level indicates the level of the field; id corresponds to idOrigin, the latter is the identifier of the field in the EGL program, and the former is the identifier renamed based on platform compatibility considerations; type indicates the type of the field, such as int indicates integer type, decimal indicates compressed numeric type, string indicates character type, etc.; length indicates the length of the field; the content in masterRecord indicates the subordinate field of the field, and the content in subRecord indicates the superior field of the field.
[0073] According to an embodiment of the present disclosure, when a field contains subordinate fields, the information of the field is not directly stored in the address corresponding to the field, but is pointed to the address of its subordinate field through a pointer, so the communication area data only contains the information of the field with the lowest level. Therefore, some fields that do not contain subordinate fields can be extracted from the target structure linked list as target fields.
[0074] For example, the level of field B1 is 4, B1 has two subordinate fields C1 and C2, and the level of C1 and C2 is 5 and has no subordinate fields. Therefore, when parsing the communication area data, field B1 can be ignored, and the information of fields C1 and C2 can be extracted for subsequent operations.
[0075] According to an embodiment of the present disclosure, the acquired attribute information for communication area data parsing includes field sequence information indicating the arrangement order of each target field and attribute information of each target field.
[0076] According to an embodiment of the present disclosure, when the number of target structure objects is greater than 1, the attribute information further includes the order of the multiple target structure objects. The order is the same as the order when the communication area data is generated, for example, the target structure object of the transmission parameter may be in front, and the target structure object of the return parameter may be in the back.
[0077] According to an embodiment of the present disclosure, communication area data can be parsed according to the attribute information of the target structure object to generate a data list, which specifically includes the following steps: first, based on the field order information and the field lengths of multiple target fields, multiple data sequences are extracted from the communication area data, wherein the data sequences and the target fields correspond one to one; second, for each data sequence, a decoding method is selected based on the field type of the target field corresponding to the data sequence; then, based on the decoding method, the data sequence is converted into a code system to obtain the parsed data.
[0078] For example, there is a communication area data of 00 11 0C F2 F0 F2 F2 60 F0 F6 60 F2 F0. According to the order of the target structure object and the order of the target field, the fields corresponding to the communication area data are the field ZONENO and the field WORKDATE of the structure object named AWC_LANG_COMM. Among them, the length of the field ZONENO is 6, and the type is compressed data type; the length of the field WORKDATE is 20, and the type is character type. Therefore, according to the length of the two fields, the communication area data can be divided into two data sequences. Afterwards, based on the type of each field, the first data sequence 00 11 0C can be converted using the compressed format, and the converted data is 00110; the second data sequence F2 F0 F2 F2 60 F0 F660 F2 F0 can be converted according to the EBCDIC code system, and the converted data is 2022-06-20.
[0079] According to the embodiments of the present disclosure, other types of target fields other than the above two types can also be processed according to preset rules. For example, for Chinese characters, they can be converted according to the GB18030 code system; for encrypted data, binary data can be maintained without conversion.
[0080] According to an embodiment of the present disclosure, after completing the communication area data parsing, the name of the target structure object, the field name of the target field, the parsed data and the data sequence can be filled into the data list according to the format of the data list. The data list can be as shown in Table 1.
[0081] Table 1
[0082] COM Data Hex AWC_LANG_COMM->3ZONENO decimal(5); 00110 00... AWC_LANG_COMM->3WORKDATA; 2022-06-20 F2...
[0083] According to an embodiment of the present disclosure, the data list may include three columns: "COM", "Data" and "Hex". The "COM" column includes the name of the target structure object, the field name of the target field, the level of the target field, the type and length of the target field; the "Data" column includes the information of the target field actually parsed; and the "Hex" column includes the communication area data corresponding to the target field.
[0084] For example, for each row of the data list, in the "COM" column, "AWC_LANG_COMM" can be filled in as the name of the target structure object. The name of the target structure object and the target field can be distinguished by the symbol "->"; then, "3" indicating the level of the target field, "ZONENO" indicating the field name of the target field, "decimal(5)" indicating the type and length of the target field, and comment information can be added in sequence. These target field information can be distinguished by spaces. In the "Data" column, the information of the target field actually parsed can be filled in. In this example, according to the specification of the compressed data type, the actual length of the target field is 5 bits plus 1 sign bit, but the parsed data is "00110". In the "Hex" column, the communication area data corresponding to the target field can be filled in, which is "00 11 0C" in this example.
[0085] Figure 5 A block diagram of a data parsing device according to an embodiment of the present disclosure is schematically shown.
[0086] like Figure 5 As shown, the data analysis device includes an acquisition module 510 , a processing module 520 , a selection module 530 , a parsing module 540 and a generation module 550 .
[0087] The acquisition module 510 is used to acquire the communication area data generated when the target program is called.
[0088] The processing module 520 is used to serialize the target program to obtain at least one structure object.
[0089] The selection module 530 is used to determine at least one target structure object from at least one structure object based on the data structure involved when calling the target program.
[0090] The parsing module 540 is configured to parse at least one target structure object to obtain attribute information of the at least one target structure object.
[0091] The generating module 550 is used to parse the communication area data using the attribute information of the target structure object to generate a data list.
[0092] According to the embodiments of the present disclosure, because a technical means is adopted to obtain attribute information of a target structure object related to communication area data from a serialized object of a target program, and then use the attribute information to parse the communication area data to generate a data list, the technical problem that the communication area data needs to be connected to a specified database for parsing and the parsing speed is slow is at least partially overcome, thereby effectively reducing the occupation of network resources by parsing the communication area and improving the parsing speed.
[0093] According to an embodiment of the present disclosure, the target program includes at least one data structure, and each data structure includes multiple lines of data definition statements.
[0094] The processing module 520 includes a first processing unit and a second processing unit.
[0095] The first processing unit is used to parse multiple lines of data definition statements of each data structure of the target program using the policy chain to obtain multiple structure class syntax trees.
[0096] The second processing unit is used to serialize multiple structure class syntax trees to obtain structure objects.
[0097] According to an embodiment of the present disclosure, the policy chain includes multiple data parsers established for each data type.
[0098] The first processing unit includes a first sub-processing unit and a second sub-processing unit.
[0099] The first processing sub-unit is used to use multiple data parsers to identify the data definition statement in sequence for each line of data definition statement.
[0100] The second processing sub-unit is used to parse the data definition statement using the data parser that successfully identifies the data definition statement to generate a structured syntax tree.
[0101] According to an embodiment of the present disclosure, the communication area data includes data of passed parameters and data of returned parameters when calling a target program.
[0102] The selection module 530 includes a first selection unit and a second selection unit.
[0103] The first selection unit is used to determine at least one data structure related to the passing parameter and the returning parameter.
[0104] The second selection unit is used to determine at least one target structure object from the structure objects according to the name of at least one data structure.
[0105] According to an embodiment of the present disclosure, the attribute information includes field order information and field attribute information.
[0106] The parsing module 540 includes a first parsing unit, a second parsing unit, a third parsing unit and a fourth parsing unit.
[0107] The first parsing unit is used to parse the target structure object for each target structure object to obtain a target structure linked list, wherein the target structure linked list includes a plurality of data fields.
[0108] The second parsing unit is used to extract a plurality of fields that do not include subordinate fields from the plurality of data fields as a plurality of target fields.
[0109] The third parsing unit is used to obtain field sequence information according to the arrangement sequence of the multiple target fields.
[0110] The fourth parsing unit is used to obtain field attribute information according to field attributes of multiple target fields.
[0111] According to an embodiment of the present disclosure, when the number of target structure objects is greater than 1, the attribute information further includes the order of the multiple target structure objects.
[0112] The generating module 550 is further used to parse the communication area data according to the sequence of the plurality of target structure objects using the attribute information of the target structure objects to generate a data list.
[0113] According to an embodiment of the present disclosure, the field attributes of the target field include field name, field type and field length.
[0114] The generation module 550 includes a first generation unit, a second generation unit, a third generation unit and a fourth generation unit.
[0115] The first generating unit is used to extract multiple data sequences from the communication area data according to the field sequence information and the field lengths of multiple target fields, wherein the data sequences correspond to the target fields one by one.
[0116] The second generating unit is used to select a decoding method for each data sequence based on a field type of a target field corresponding to the data sequence.
[0117] The third generating unit is used to perform code conversion on the data sequence based on the decoding method to obtain parsed data.
[0118] The fourth generating unit is used to generate a data list based on the name of the target structure object, the field names of the multiple target fields, the multiple parsed data and the multiple data sequences.
[0119] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0120] For example, any multiple of the acquisition module 510, the processing module 520, the selection module 530, the parsing module 540, and the generation module 550 can be combined in one module / unit / subunit for implementation, or any one of the modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least part of the functions of one or more of these modules / units / subunits can be combined with at least part of the functions of other modules / units / subunits and implemented in one module / unit / subunit. According to an embodiment of the present disclosure, at least one of the acquisition module 510, the processing module 520, the selection module 530, the parsing module 540, and the generation module 550 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the acquisition module 510, the processing module 520, the selection module 530, the parsing module 540 and the generation module 550 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be performed.
[0121] It should be noted that the data analysis device part in the embodiment of the present disclosure corresponds to the data analysis method part in the embodiment of the present disclosure. The description of the data analysis device part specifically refers to the data analysis method part, which will not be repeated here.
[0122] Figure 6 A block diagram of an electronic device suitable for implementing a data parsing method according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0123] like Figure 6 As shown, the computer electronic device 600 according to the embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0124] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0125] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0126] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0127] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0128] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0129] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or the RAM 603 described above and / or one or more memories other than the ROM 602 and the RAM 603 .
[0130] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the data parsing method provided by the embodiment of the present disclosure.
[0131] When the computer program is executed by the processor 601, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0132] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0133] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0135] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data analysis method, comprising: Get the communication area data generated when calling the target program; Serializing the target program to obtain at least one structure object; Determining at least one target structure object from the at least one structure object based on a data structure involved when calling the target program; Parsing the at least one target structure object to obtain attribute information of the at least one target structure object; as well as parsing the communication area data using the attribute information of the target structure object to generate a data list; Wherein, parsing the at least one target structure object comprises: For each target structure object, the target structure object is parsed to obtain a target structure linked list, wherein the target structure linked list includes a plurality of data fields; Extracting a plurality of fields excluding subordinate fields from the plurality of data fields as a plurality of target fields, wherein the subordinate fields of the data fields include fields associated with the data fields and whose level is located at a level below that of the data fields; The field attributes of the target field include field name, field type and field length; The method of using the attribute information of the target structure object to parse the communication area data to generate a data list includes: Extracting a plurality of data sequences from the communication area data according to the field sequence information included in the attribute information and the field lengths of the plurality of target fields, wherein the data sequences correspond to the target fields one by one; For each data sequence, selecting a decoding mode based on a field type of a target field corresponding to the data sequence; Based on the decoding method, performing code conversion on the data sequence to obtain parsed data; and A data list is generated based on the name of the target structure object, the field names of the plurality of target fields, the plurality of parsed data and the plurality of data sequences.
2. The method according to claim 1, wherein: The target program includes at least one data structure, wherein each data structure includes multiple lines of data definition statements; The step of serializing the target program to obtain at least one structure object includes: For each data structure of the target program, using a policy chain to parse multiple lines of data definition statements of the data structure to obtain multiple structure class syntax trees; and The multiple structure class syntax trees are serialized to obtain the structure object.
3. The method according to claim 2, wherein: The strategy chain includes a plurality of data parsers established for each data type; The strategy chain is used to parse multiple lines of data definition statements of the data structure to obtain multiple structure-class syntax trees, including: For each line of data definition statements, using the multiple data parsers in sequence to identify the data definition statements; and The data definition statement is parsed using a data parser that successfully identifies the data definition statement to generate a structured syntax tree.
4. The method according to claim 1, wherein: The communication area data includes the data of the passed parameters and the data of the returned parameters when calling the target program; Wherein, based on the data structure involved in calling the target program, determining at least one target structure object from the at least one structure object comprises: determining at least one data structure associated with the passed parameter and the returned parameter; and The at least one target structure object is determined from the structure objects according to the name of the at least one data structure.
5. The method according to claim 1, wherein: The attribute information includes field sequence information and field attribute information; The step of parsing the at least one target structure object to obtain attribute information of the at least one target structure object includes: Acquiring the field sequence information according to the arrangement order of the plurality of target fields; and The field attribute information is acquired according to the field attributes of the multiple target fields.
6. The method according to claim 5, wherein: When the number of the target structure objects is greater than 1, the attribute information further includes the order of the multiple target structure objects; The method further comprises: According to the order of the plurality of target structure objects, the communication area data is parsed using the attribute information of the target structure objects to generate a data list.
7. A data analysis device, comprising: The acquisition module is used to obtain the communication area data generated when the target program is called; A processing module, used for serializing the target program to obtain at least one structure object; A selection module, for determining at least one target structure object from the at least one structure object based on a data structure involved when calling the target program; A parsing module, used for parsing the at least one target structure object to obtain attribute information of the at least one target structure object; as well as A generating module, used for parsing the communication area data using the attribute information of the target structure object to generate a data list; Wherein, the parsing module is used for: For each target structure object, the target structure object is parsed to obtain a target structure linked list, wherein the target structure linked list includes a plurality of data fields; Extracting a plurality of fields excluding subordinate fields from the plurality of data fields as a plurality of target fields, wherein the subordinate fields of the data fields include fields associated with the data fields and whose level is located at a level below that of the data fields; The field attributes of the target field include field name, field type and field length; Wherein, the generating module is used for: Extracting a plurality of data sequences from the communication area data according to the field sequence information included in the attribute information and the field lengths of the plurality of target fields, wherein the data sequences correspond to the target fields one by one; For each data sequence, selecting a decoding mode based on a field type of a target field corresponding to the data sequence; Based on the decoding method, performing code conversion on the data sequence to obtain parsed data; and A data list is generated based on the name of the target structure object, the field names of the plurality of target fields, the plurality of parsed data and the plurality of data sequences.
8. An electronic device comprising: one or more processors; a memory for storing one or more instructions, Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having executable instructions stored thereon, wherein when the executable instructions are executed by a processor, the processor is enabled to implement the method according to any one of claims 1 to 6.
10. A computer program product, comprising computer executable instructions, which are used to implement the method of any one of claims 1 to 6 when executed.
Citation Information
Patent Citations
Method for analyzing network data package
CN103001971A
Code stream analysis method and device
CN104021147A