A method for processing report code based on structured data and related equipment

Through the report code processing method based on structured data, the problem of low report processing efficiency and editing conflicts in large-scale report projects is solved, efficient report code analysis, comparison and modification is achieved, and processing efficiency and data consistency are improved.

CN114818612BActive Publication Date: 2025-06-06AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210446109.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-26
Publication Date
2025-06-06
Estimated Expiration
2042-04-26

AI Technical Summary

Technical Problem

In the existing technology, when there are many reports in large-scale report projects, it is inefficient to use Cognos software to view, analyze and modify reports, and the editing content between developers of different report are prone to conflict and overwrite each other.

Method used

Provide a report code processing method based on structured data. By obtaining structured data files, traversing node elements, analyzing report codes, comparing the target report code set with the report code set to be compared, and modifying it according to the comparison results.

Benefits of technology

Improves the efficiency of report processing, saves processing time, avoids editing conflicts between different developers, and ensures data accuracy and consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818612B_ABST
    Figure CN114818612B_ABST
Patent Text Reader

Abstract

The present application provides a method and related equipment for processing report codes based on structured data, the method comprising: obtaining a structured data file; traversing the node elements of the structured data file, obtaining each report code under each query subject, parsing each report code, obtaining the parsing result of each report code, so as to obtain the parsing results of several report codes in the structured data file; obtaining a set of report codes to be compared from a preset file, comparing a target report code set with the set of report codes to be compared, and obtaining a comparison result; if the comparison result indicates that the target report code set needs to be modified, then modifying the target report code set according to the set of report codes to be compared. The present application can parse, compare and modify the report codes in the structured data file, saves processing time, improves processing efficiency, and does not require the participation of multiple developers, thus avoiding the problems of editing content conflicts and overwriting among developers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method for processing report codes based on structured data and related equipment. Background Art

[0002] Some current systems have problems such as redundant reports and low data utilization, and need to optimize and integrate the large number of reports contained in the system. For example, after years of construction, the Overseas Business Analysis System (OBAS) has basically met the requirements for reporting statistics and IFAR submission of overseas branches. However, since the existing reports of OBAS are accumulated from many years of historical needs and are numerous, there are problems such as redundant reports and low data utilization, and need to optimize and integrate the existing reports.

[0003] In the process of report optimization and integration, it is necessary to frequently view, compare and modify report codes. Currently, reports in the system are usually developed and deployed using Cognos, so Cognos software is usually used to view, compare and modify report codes.

[0004] However, for large-scale report projects, such as OBAS, when there are a large number of reports and large-scale optimization and integration is required, the efficiency of using Cognos software to view, analyze and modify reports cannot meet the project time requirements. In addition, the efficiency of multiple report developers editing a report project at the same time is low and it is easy to cause conflicts and overlaps between the editing contents of different report developers. Summary of the invention

[0005] In view of this, the present application provides a method and related device for processing report codes based on structured data, which is used to solve the problems of low efficiency and conflict and overlap of editing contents between different report developers in the prior art. The technical solution is as follows:

[0006] A method for processing report codes based on structured data, comprising:

[0007] Obtain a structured data file in the current project, wherein the structured data file is an XML file of a tree structure, wherein the node elements of the tree structure include a query subject and a report code, and the report code is a child node element of the query subject node element;

[0008] Traversing the node elements in the structured data file, obtaining each report code under each query subject, and parsing each obtained report code to obtain the parsing result of each report code; so as to obtain the parsing results of several report codes in the structured data file;

[0009] Obtaining a report code set to be compared from a preset file, and comparing a target report code set with the report code set to be compared to obtain a comparison result, wherein the target report code set includes at least one target report code, the target report code in the target report code set is determined according to the parsing results of a plurality of report codes, and the report code set to be compared includes at least one report code to be compared;

[0010] If the comparison result indicates that the target report code set needs to be modified, the target report code set is modified according to the report code set to be compared.

[0011] Optionally, the target report code set is compared with the report code set to be compared, and a comparison result is obtained, including:

[0012] For each report code in the report code set to be compared and the target report code set, the element structure information of the report code is used as a key and the report code is used as a value to generate a key-value pair corresponding to the report code;

[0013] For each target report code in the target report code set, the key-value pair corresponding to the target report code is compared with the key-value pair corresponding to each report code to be compared in the report code set to obtain the comparison result corresponding to the target report code; so as to obtain the comparison result corresponding to each target report code in the target report code set.

[0014] Optionally, the key-value pair corresponding to the target report code is compared with the key-value pair corresponding to each report code to be compared in the report code set to be compared, to obtain a comparison result corresponding to the target report code, including:

[0015] Compare the key in the key-value pair corresponding to the target report code with the key in the key-value pair corresponding to each report code to be compared in the report code set to be compared, and obtain the report code to be compared with the same key as the report code to be compared corresponding to the target report code;

[0016] The value in the key-value pair corresponding to the target report code is compared with the value in the key-value pair corresponding to the report code to be compared corresponding to the target report code to obtain a comparison result corresponding to the target report code.

[0017] Optionally, if the comparison result indicates that the target report code set needs to be modified, the target report code set is modified according to the report code set to be compared, including:

[0018] For each target report code in the target report code set, if the comparison result corresponding to the target report code indicates that the target report code needs to be modified, the target report code is modified according to the report code to be compared corresponding to the target report code.

[0019] Optionally, the target report code is modified according to the report code to be compared corresponding to the target report code, including:

[0020] Convert the report code to be compared corresponding to the target report code into the report code to be compared that meets the requirements of the XML format file;

[0021] The target report code is modified according to the report code to be compared that meets the requirements of the XML format file.

[0022] Optionally, also include:

[0023] Output the analysis results and / or comparison results to a document format file.

[0024] Optionally, the preset file is an EXCEL file and / or a structured data file in other projects.

[0025] A processing device for report code based on structured data, comprising: an acquisition module, a traversal module, a comparison module and a modification module;

[0026] The acquisition module is used to acquire the structured data file in the current project, wherein the structured data file is an XML file of a tree structure, and the node elements of the tree structure include a query subject and a report code, and the report code is a child node element of the query subject node element;

[0027] The traversal module is used to traverse the node elements in the structured data file, obtain each report code under each query subject, and parse each obtained report code to obtain the parsing result of each report code; so as to obtain the parsing results of several report codes in the structured data file;

[0028] A comparison module is used to obtain a report code set to be compared from a preset file, and compare a target report code set with the report code set to be compared to obtain a comparison result, wherein the target report code set includes at least one target report code, the target report code in the target report code set is determined according to the parsing results of a plurality of report codes, and the report code set to be compared includes at least one report code to be compared;

[0029] The modification module is used to modify the target report code set according to the report code set to be compared if the comparison result indicates that the target report code set needs to be modified.

[0030] A processing device for report codes based on structured data, comprising a memory and a processor;

[0031] Memory, used to store programs;

[0032] The processor is used to execute the program to implement each step of any of the above-mentioned methods for processing report codes based on structured data.

[0033] A readable storage medium stores a computer program thereon. When the computer program is executed by a processor, the computer program implements the steps of any of the above-mentioned methods for processing report codes based on structured data.

[0034] Through the above technical solution, it can be known that the processing method of report codes based on structured data provided by the present application first obtains the structured data file, then traverses the node elements in the structured data file, obtains each report code under each query subject, and parses each report code obtained to obtain the parsing result of each report code, so as to obtain the parsing results of several report codes in the structured data file, and then obtains the report code set to be compared from the preset file, and compares the target report code set with the report code set to be compared to obtain the comparison result. If the comparison result indicates that the target report code set needs to be modified, the target report code set is modified according to the report code set to be compared. It can be seen that the present application can parse, compare and modify the report codes in the structured data file. Compared with the method of using Cognos software in the prior art, the present application can save a lot of processing time and improve processing efficiency. Moreover, the whole process does not require the participation of multiple developers, which saves the time of developers and avoids the problem of conflict and overlap of editing content between different report developers. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0036] Figure 1 A flowchart of a method for processing report codes based on structured data provided in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of the structure of a report code processing device based on structured data provided in an embodiment of the present application;

[0038] Figure 3 A hardware structure block diagram of a report code processing device based on structured data provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0040] In view of the problems existing in the prior art, the inventor of this case conducted in-depth research and finally proposed a method for processing report codes based on structured data. Next, the method for processing report codes based on structured data provided by this application is introduced in detail through the following embodiments.

[0041] See also Figure 1 , shows a flow chart of a method for processing report codes based on structured data provided in an embodiment of the present application. The method for processing report codes based on structured data may include:

[0042] Step S101: Obtain structured data files in the current project.

[0043] Specifically, all report codes in a Cognos project are stored in a structured data file in the project. Here, a Cognos project refers to an engineering project object in the Cognos software, and Cognos refers to a commonly used report design and publishing software.

[0044] The structured data file is a tree-structured XML (Extensible Markup Language) file, in which the node elements of the tree structure include query subjects and report codes, and the report code is a child node element of the query subject node element. Here, the query subject refers to a database query object in the Cognos software, and the report code written in the SQL language is used to query the database data, and the queried data is used for report display. The report code and other related information of the Cognos report are stored in the query subject.

[0045] The node element of the tree structure also includes a namespace, which is the parent node element of the query subject node element, that is, the namespace includes a number of query subjects.

[0046] It should be noted that the node element of the structured data file includes at least one namespace, each namespace includes at least one query subject, and each query subject includes at least one report code.

[0047] In this embodiment, when the report code in the current project needs to be processed (processing here means parsing, comparing and modifying), the structured data file in the current project can be obtained. Here, the current project refers to the current Cognos report project, and the report code in the current project is written in SQL (Structured Query Language) language.

[0048] Optionally, the structured data file in the current project may be named "model.xml". Based on this, optionally, the process of this step may include: using the JAVA method SAXReader() to read the structured data file named "model.xml" in the current Cognos project to be processed.

[0049] Step S102, traverse the node elements in the structured data file, obtain each report code under each query subject, and parse each obtained report code to obtain the parsing result of each report code; so as to obtain the parsing results of several report codes in the structured data file.

[0050] Specifically, all namespaces and query subjects under the namespaces may be traversed starting from the root node of the structured data file, and then the sub-elements may be traversed downward from the query subject to obtain each report code under each query subject.

[0051] Optionally, the above-mentioned namespace can be named "namespace", the query subject can be named "querySubject", and the report code can be named "sql". Then, this step can first traverse all namespaces with the element name of "namespace" from the structured data file; for each traversed "namespace", traverse all query subjects with the element name of "querySubject" in the "namespace"; traverse the sub-elements with the element name of "definition" in the "querySubject", traverse the sub-elements with the element name of "dbQuery" in the "definition", and traverse the sub-elements with the element name of "sql" in the "dbQuery", and the text content of the "sql" element node is the report code to be obtained in this step.

[0052] Optionally, in this step, the method elementIterator() may be used to recursively traverse from the root node of the structured data file to obtain each report code under each query subject.

[0053] It is understandable that it is inconvenient for developers to directly read the report code. In order to facilitate developers to determine the target report code that needs to be compared from the obtained report code, this step can be used to perform structural analysis on each obtained report code to obtain the analysis result of each report code.

[0054] Optionally, structural analysis of each report code specifically refers to extracting information such as source tables, target tables, parameters, etc. used in the report code.

[0055] Optionally, after obtaining the parsing result, the parsing result of each report code may be output to a document format file for saving, so that developers can view the parsing result.

[0056] Step S103: Obtain the report code set to be compared from the preset file, and compare the target report code set with the report code set to be compared to obtain a comparison result.

[0057] The target report code set includes at least one target report code, the target report code in the target report code set is determined according to the parsing results of several report codes, and the report code set to be compared includes at least one report code to be compared.

[0058] Specifically, the developer can determine all report codes that need to be compared based on the analysis results of the above-mentioned report codes. For easy distinction, the report codes that need to be compared are defined as target report codes, and all target report codes constitute a target report code set.

[0059] After the developer determines the target report code set, this step can obtain the report code set to be compared from the preset file, and then compare the target report code set with the report code set to be compared to obtain a comparison result.

[0060] Optionally, the preset file is an EXCEL file and / or a structured data file in other projects, which may be, for example, a newly created project with the same name as the current project, the same structure of the structured data file and the same element names as those contained therein, but with different report codes.

[0061] Among them, if the preset file is an EXCEL file, the method provided by the prior art can be used to parse the EXCEL file to obtain the report code set to be compared in the EXCEL file; if the preset file is a structured data file in other projects, the method provided in the above steps can be used to parse the report code set to be compared from the structured data file in other projects.

[0062] Optionally, this step can also output the comparison result to a document format file for storage, so that developers can view it easily.

[0063] In an optional embodiment, the process of the step of "comparing the target report code set with the report code set to be compared to obtain a comparison result" may include:

[0064] Step S1031: for each report code in the report code set to be compared and the target report code set, the element structure information of the report code is used as a key and the report code is used as a value to generate a key-value pair corresponding to the report code.

[0065] Specifically, each node element in the structured data file corresponds to element structure information, that is, each report code in the structured data file corresponds to element structure information, and each report code in the preset file also corresponds to element structure information. Here, the element structure information is used to characterize the storage path of the corresponding report code. Optionally, the element structure information consists of the project name, the name of the namespace where the corresponding report code is located, the name of the query subject, the name of the report code, etc.

[0066] In this step, for each report code to be compared in the report code set to be compared, the element structure information of the report code to be compared can be used as the key and the report code to be compared can be used as the value to generate a key-value pair corresponding to the report code to be compared; similarly, for each target report code in the target report code set, the element structure information of the target report code can be used as the key and the target report code can be used as the value to generate a key-value pair corresponding to the target report code.

[0067] Step S1032: for each target report code in the target report code set, compare the key-value pair corresponding to the target report code with the key-value pair corresponding to each report code to be compared in the report code set to obtain a comparison result corresponding to the target report code; so as to obtain a comparison result corresponding to each target report code in the target report code set.

[0068] Optionally, in this step, the method entrySet() may be used to compare key-value pairs to obtain a comparison result corresponding to each target report code in the target report code set.

[0069] In an optional embodiment, the process of the step of "comparing the key-value pair corresponding to the target report code with the key-value pair corresponding to each report code to be compared in the report code set to be compared, and obtaining the comparison result corresponding to the target report code" may include:

[0070] a1. Compare the key in the key-value pair corresponding to the target report code with the key in the key-value pair corresponding to each report code to be compared in the report code set to be compared, and obtain the report code to be compared with the same key as the report code to be compared corresponding to the target report code.

[0071] a2. Compare the value in the key-value pair corresponding to the target report code with the value in the key-value pair corresponding to the report code to be compared corresponding to the target report code to obtain a comparison result corresponding to the target report code.

[0072] For example, a1 determines that the target report code 1 corresponds to the report code 1 to be compared. Then, the value in the key-value pair corresponding to the target report code 1 (i.e., the target report code 1) can be compared with the value in the key-value pair corresponding to the report code 1 to be compared (i.e., the report code 1 to be compared) to obtain the comparison result corresponding to the target report code 1.

[0073] Step S104: If the comparison result indicates that the target report code set needs to be modified, the target report code set is modified according to the report code set to be compared.

[0074] In this embodiment, the comparison result can reflect the difference between the target report code set and the report code set to be compared. If the comparison result indicates that there is a difference between the two sets, it means that the target report code set needs to be modified. If the comparison result indicates that there is no difference between the two sets, it means that the target report code set does not need to be modified.

[0075] In an optional embodiment, further to the above introduction, the process of this step "if the comparison result representation requires modification of the target report code set, modifying the target report code set according to the report code set to be compared" may include: for each target report code in the target report code set, if the comparison result representation corresponding to the target report code requires modification of the target report code, modifying the target report code according to the report code to be compared corresponding to the target report code.

[0076] Specifically, if the comparison result corresponding to the target report code indicates that the target report code needs to be modified, it means that there is a difference between the target report code and the corresponding report code to be compared. At this time, the target report code can be modified according to the report code to be compared corresponding to the target report code.

[0077] In this step, the process of "modifying the target report code according to the report code to be compared corresponding to the target report code" may include: converting the report code to be compared corresponding to the target report code into the report code to be compared that meets the requirements of the XML format file, and modifying the target report code according to the report code to be compared that meets the requirements of the XML format file.

[0078] It is understandable that the report code to be compared in the EXCEL file does not meet the requirements of the XML format file. In order to make the modified target report code still meet the requirements of the XML format file, the report code to be compared corresponding to the target report code can first be verified and converted according to the requirements of the XML format file to generate the report code to be compared that meets the requirements of the XML format file, and then the content of the report code to be compared that meets the requirements of the XML format file is assigned to the target report code, thus completing the entire process of modifying the target report code.

[0079] It is worth noting that the modification process of this step is not to modify directly in the structured data file "model.xml" of the current project, but to temporarily store the modified target report code each time. After all the target report codes that need to be modified in the current project are modified, all the modified target report codes are written back to the structured data file "model.xml".

[0080] The processing method of report codes based on structured data provided by the present application first obtains a structured data file, then traverses the node elements in the structured data file, obtains each report code under each query subject, and parses each obtained report code to obtain the parsing result of each report code, so as to obtain the parsing results of several report codes in the structured data file, then obtains the report code set to be compared from the preset file, and compares the target report code set with the report code set to be compared to obtain the comparison result, and if the comparison result indicates that the target report code set needs to be modified, the target report code set is modified according to the report code set to be compared. It can be seen that the present application can parse, compare and modify the report codes in the structured data file. Compared with the method of using Cognos software in the prior art, the present application can save a lot of processing time and improve processing efficiency. Moreover, the whole process does not require the participation of multiple developers, which saves the time of developers and avoids the problem of conflict and overlap of editing content between different report developers.

[0081] At the same time, the analysis and comparison results are saved in a common document format, which makes it convenient for report developers to analyze and modify the reports and saves their development time.

[0082] It has been proved through testing that the method provided in this embodiment is used to parse, compare and modify the report code. Even for large report projects, the overall processing time will not be very long. For example, the parsing, comparison and modification of the OBAS report project takes about 1 minute, which can reduce a lot of development time and achieve the effect of improving development efficiency.

[0083] An embodiment of the present application also provides a processing device for a report code based on structured data. The processing device for a report code based on structured data provided in the embodiment of the present application is described below. The processing device for a report code based on structured data described below and the processing method for a report code based on structured data described above can refer to each other.

[0084] See also Figure 2 , shows a schematic diagram of the structure of a report code processing device based on structured data provided in an embodiment of the present application, such as Figure 2 As shown, the apparatus for processing report codes based on structured data may include: an acquisition module 201 , a traversal module 202 , a comparison module 203 and a modification module 204 .

[0085] The acquisition module 201 is used to acquire the structured data file in the current project, wherein the structured data file is an XML file of a tree structure, and the node elements of the tree structure include a query subject and a report code, and the report code is a child node element of the query subject node element.

[0086] The traversal module 202 is used to traverse the node elements in the structured data file, obtain each report code under each query subject, and parse each report code to obtain the parsing result of each report code; so as to obtain the parsing results of several report codes in the structured data file.

[0087] The comparison module 203 is used to obtain a report code set to be compared from a preset file, and compare the target report code set with the report code set to be compared to obtain a comparison result, wherein the target report code set includes at least one target report code, the target report code in the target report code set is determined according to the parsing results of several report codes, and the report code set to be compared includes at least one report code to be compared.

[0088] The modification module 204 is configured to modify the target report code set according to the report code set to be compared if the comparison result indicates that the target report code set needs to be modified.

[0089] The report code processing device based on structured data provided by the present application first obtains the structured data file by the acquisition module, then the traversal module traverses the node elements in the structured data file, obtains each report code under each query subject, and parses each report code obtained to obtain the parsing result of each report code, so as to obtain the parsing results of several report codes in the structured data file, and then the comparison module obtains the report code set to be compared from the preset file, and compares the target report code set with the report code set to be compared to obtain the comparison result, if the comparison result indicates that the target report code set needs to be modified, then the modification module modifies the target report code set according to the report code set to be compared. It can be seen that the present application can parse, compare and modify the report code in the structured data file. Compared with the method of using Cognos software in the prior art, the present application can save a lot of processing time and improve processing efficiency. Moreover, the whole process does not require the participation of multiple developers, which saves the time of developers and avoids the problem of conflict and overlap of editing content between different report developers.

[0090] In a possible implementation, the comparison module 203 may include: a key-value pair generation module and a key-value pair comparison module.

[0091] The key-value pair generation module is used to generate a key-value pair corresponding to each report code in the report code set to be compared and the target report code set, using the element structure information of the report code as the key and the report code as the value.

[0092] The key-value pair comparison module is used to compare the key-value pair corresponding to each target report code in the target report code set with the key-value pair corresponding to each report code to be compared in the report code set to obtain the comparison result corresponding to the target report code; so as to obtain the comparison result corresponding to each target report code in the target report code set.

[0093] In a possible implementation, the key-value pair comparison module may include: a key comparison module and a value comparison module.

[0094] Among them, the key comparison module is used to compare the key in the key-value pair corresponding to the target report code with the key in the key-value pair corresponding to each report code to be compared in the report code set to be compared, and obtain the report code to be compared with the same key as the report code to be compared corresponding to the target report code.

[0095] The value comparison module is used to compare the value in the key-value pair corresponding to the target report code with the value in the key-value pair corresponding to the report code to be compared corresponding to the target report code, so as to obtain the comparison result corresponding to the target report code.

[0096] In a possible implementation, the modification module 204 may be specifically used to modify each target report code in the target report code set according to the report code to be compared corresponding to the target report code if the comparison result corresponding to the target report code indicates that the target report code needs to be modified.

[0097] In a possible implementation, the modification module 204 may include: a conversion module and an assignment module when “modifying the target report code according to the report code to be compared corresponding to the target report code”.

[0098] The conversion module is used to convert the report code to be compared corresponding to the target report code into the report code to be compared that meets the requirements of the XML format file.

[0099] The assignment module is used to modify the target report code according to the report code to be compared that meets the requirements of the XML format file.

[0100] In a possible implementation, the apparatus for processing report codes based on structured data provided in the embodiment of the present application may further include: an output module.

[0101] The output module is used to output the parsing result and / or the comparison result to a document format file.

[0102] In a possible implementation, the preset file is an EXCEL file and / or a structured data file in other projects.

[0103] The embodiment of the present application also provides a processing device for report codes based on structured data. Optionally, Figure 3 The hardware structure block diagram of the report code processing device based on structured data is shown. Figure 3 , the hardware structure of the report code processing device based on structured data may include: at least one processor 301, at least one communication interface 302, at least one memory 303 and at least one communication bus 304;

[0104] In the embodiment of the present application, the number of the processor 301, the communication interface 302, the memory 303, and the communication bus 304 is at least one, and the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;

[0105] The processor 301 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;

[0106] The memory 303 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0107] The memory 303 stores a program, and the processor 301 can call the program stored in the memory 303, and the program is used to:

[0108] Obtain a structured data file in the current project, wherein the structured data file is an XML file of a tree structure, wherein the node elements of the tree structure include a query subject and a report code, and the report code is a child node element of the query subject node element;

[0109] Traversing the node elements in the structured data file, obtaining each report code under each query subject, and parsing each obtained report code to obtain the parsing result of each report code; so as to obtain the parsing results of several report codes in the structured data file;

[0110] Obtaining a report code set to be compared from a preset file, and comparing a target report code set with the report code set to be compared to obtain a comparison result, wherein the target report code set includes at least one target report code, the target report code in the target report code set is determined according to the parsing results of a plurality of report codes, and the report code set to be compared includes at least one report code to be compared;

[0111] If the comparison result indicates that the target report code set needs to be modified, the target report code set is modified according to the report code set to be compared.

[0112] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0113] The embodiment of the present application further provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the processing method of the report code based on structured data as described above is implemented.

[0114] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0115] Finally, it should be noted that, in this article, relational terms such as and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0116] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0117] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing report codes based on structured data, It is characterized in that include: Acquire a structured data file in the current project, wherein the structured data file is an XML file of a tree structure, the node elements of the tree structure include a query subject and a report code, and the report code is a child node element of the query subject node element; Traversing the node elements in the structured data file, obtaining each report code under each query subject, and parsing each obtained report code to obtain the parsing result of each report code; so as to obtain the parsing results of several report codes in the structured data file; Obtaining a report code set to be compared from a preset file, and comparing a target report code set with the report code set to be compared to obtain a comparison result, wherein the target report code set includes at least one target report code, the target report code in the target report code set is determined according to the parsing results of the plurality of report codes, and the report code set to be compared includes at least one report code to be compared; If the comparison result indicates that the target report code set needs to be modified, the target report code set is modified according to the report code set to be compared to obtain a structured data file including all modified target report codes.

2. The method for processing report codes based on structured data according to claim 1, It is characterized in that The step of comparing the target report code set with the report code set to be compared to obtain a comparison result includes: For each report code in the report code set to be compared and the target report code set, the element structure information of the report code is used as a key and the report code is used as a value to generate a key-value pair corresponding to the report code; For each target report code in the target report code set, the key-value pair corresponding to the target report code is compared with the key-value pair corresponding to each report code to be compared in the report code set to be compared, and the comparison result corresponding to the target report code is obtained; so as to obtain the comparison result corresponding to each target report code in the target report code set.

3. The method for processing report codes based on structured data according to claim 2, It is characterized in that The step of comparing the key-value pair corresponding to the target report code with the key-value pair corresponding to each report code to be compared in the report code set to be compared, and obtaining a comparison result corresponding to the target report code, includes: Compare the key in the key-value pair corresponding to the target report code with the key in the key-value pair corresponding to each report code to be compared in the report code set to be compared, and obtain the report code to be compared with the same key as the report code to be compared corresponding to the target report code; The value in the key-value pair corresponding to the target report code is compared with the value in the key-value pair corresponding to the report code to be compared corresponding to the target report code to obtain a comparison result corresponding to the target report code.

4. The method for processing report codes based on structured data according to claim 3, It is characterized in that If the comparison result indicates that the target report code set needs to be modified, modifying the target report code set according to the report code set to be compared includes: For each target report code in the target report code set, if the comparison result corresponding to the target report code indicates that the target report code needs to be modified, the target report code is modified according to the report code to be compared corresponding to the target report code.

5. The method for processing report codes based on structured data according to claim 4, It is characterized in that The step of modifying the target report code according to the report code to be compared corresponding to the target report code includes: Convert the report code to be compared corresponding to the target report code into the report code to be compared that meets the requirements of the XML format file; The target report code is modified according to the report code to be compared that meets the requirements of the XML format file.

6. The method for processing report codes based on structured data according to claim 1, It is characterized in that Also includes: The parsing result and / or the comparison result is output to a document format file.

7. The method for processing report codes based on structured data according to claim 1, It is characterized in that The preset file is an EXCEL file and / or a structured data file in other projects.

8. A processing device for report code based on structured data, It is characterized in that include: Get modules, traverse modules, compare modules and modify modules; The acquisition module is used to acquire a structured data file in the current project, wherein the structured data file is an XML file of a tree structure, the node elements of the tree structure include a query subject and a report code, and the report code is a child node element of the query subject node element; The traversal module is used to traverse the node elements in the structured data file, obtain each report code under each query subject, and parse each obtained report code to obtain the parsing result of each report code; so as to obtain the parsing results of several report codes in the structured data file; The comparison module is used to obtain a report code set to be compared from a preset file, and compare a target report code set with the report code set to be compared to obtain a comparison result, wherein the target report code set includes at least one target report code, the target report code in the target report code set is determined according to the parsing results of the plurality of report codes, and the report code set to be compared includes at least one report code to be compared; The modification module is used to modify the target report code set according to the report code set to be compared if the comparison result indicates that the target report code set needs to be modified, so as to obtain a structured data file including all modified target report codes.

9. A processing device for report codes based on structured data, It is characterized in that including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the method for processing report codes based on structured data as claimed in any one of claims 1 to 7.

10. A readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, each step of the method for processing report codes based on structured data as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Report processing method and apparatus, medium and electronic device

    CN108710708A

  • Page generation method and device

    CN110825745A