CN111949829A - XML (extensive markup language) analysis and wind control variable generation method - Google Patents
XML (extensive markup language) analysis and wind control variable generation method Download PDFInfo
- Publication number
- CN111949829A CN111949829A CN202010905287.8A CN202010905287A CN111949829A CN 111949829 A CN111949829 A CN 111949829A CN 202010905287 A CN202010905287 A CN 202010905287A CN 111949829 A CN111949829 A CN 111949829A
- Authority
- CN
- China
- Prior art keywords
- xml
- wind control
- control variable
- child node
- rule
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 18
- 238000004458 analytical method Methods 0.000 title claims abstract description 15
- 238000004364 calculation method Methods 0.000 claims abstract description 36
- 238000003491 array Methods 0.000 claims abstract description 15
- 230000002159 abnormal effect Effects 0.000 claims description 12
- 238000012423 maintenance Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000012954 risk control Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/84—Mapping; Conversion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/81—Indexing, e.g. XML tags; Data structures therefor; Storage structures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method for generating XML (extensive Makeup language) analysis and wind control variables, which comprises the following steps of: s1 XML dynamic parsing: the S11 parsing module reads and calls the Webservice interface of the external database interface to obtain returned XML data; s12, first traversing the primary node as a table name, and then generating a child node ID; s13, judging whether the child node has an array: if the child nodes have the arrays, the data are traversed in parallel, child node IDs are generated, whether the child nodes have the arrays or not is judged by the child node IDs, and if the child nodes do not have the arrays, whether the child nodes exist or not is judged; s2 is a wind control variable calculation method based on h2 database. The invention reduces the work of xml analysis development and maintenance and reduces the personnel investment; under the conditions of not modifying the existing code and not restarting the existing application service, the change of the xml is self-adapted; under the conditions of not modifying the existing codes and not restarting the existing application services, the wind control variable calculation configuration is modified on line, and the service shutdown maintenance time is reduced.
Description
Technical Field
The invention relates to the technical field of XML automatic parsing warehousing and wind control variable generation, in particular to a method for XML parsing and wind control variable generation.
Background
h2 database: an open source Java based memory embedded database engine;
XML: extensible markup language, a common data exchange message format; wind control variable: the method refers to the parameter of the wind control decision in the risk control system, and is the basic data of the wind control system decision; XML automatic parsing and warehousing: the XML tree message is converted into a two-dimensional table form and stored in a database. The method is different from a general wind control variable generation mode in that: 1. the analysis process and the analysis result are fully automatic, and configuration files and POJO objects are not needed; 2. the wind control variable rule can be configured without hard codes; 3. the method is completely internal-stored, and does not need to clean temporary data.
However, the prior art has the following disadvantages: 1. at present, most of XML analysis uses a Java Bean binding mode, one Java class corresponds to one section of XML data stream, and Java codes need to be modified and recompiled online every time change; most wind control variable calculation in the market needs to compile codes, for example, Java and other code modes which need to be compiled and redeployed online, and the change of the wind control variable calculation rule is not fast and flexible enough.
Disclosure of Invention
Based on the technical problems in the background art, the invention provides an XML analysis and wind control variable generation method.
The invention provides an XML (extensive Makeup language) analysis and wind control variable generation method, which comprises the following steps of:
s1 XML dynamic parsing:
the S11 parsing module reads and calls the Webservice interface of the external database interface to obtain returned XML data;
s12, first traversing the primary node as a table name, and then generating a child node ID;
s13, judging whether the child node has an array: if the child nodes have the arrays, the data are traversed in parallel, child node IDs are generated, whether the child nodes have the arrays or not is judged by the child node IDs, and if the child nodes do not have the arrays, whether the child nodes exist or not is judged;
s14, judging whether a child node exists: if the child node exists, generating a child node ID, judging whether the child node has a plurality of groups by the child node ID, and if the child node does not exist, acquiring the node content;
s2 wind control variable calculation method based on h2 database:
s21, acquiring a wind control variable calculation rule;
s22 executing the wind control variable rule SQL;
s23, judging whether the wind control variable rule SQL is abnormal:
if the wind control variable rule SQL is abnormal, taking a default value and finishing the calculation;
and if the wind control variable rule SQL is not abnormal, taking a rule result, if the rule result is correct, continuing to execute the wind control variable rule SQL, and if the rule result is incorrect, ending the calculation.
Preferably, each external database interface Webservice interface corresponds to a form style.
Preferably, the step S11 further includes determining the type of the XML node read, where the type of the node is divided into a start tag, a text tag, and an end tag.
Preferably, the XML parsing in the step S1 is implemented on an Android platform, and the programming language is java.
Preferably, the XML dynamic parsing in step S1 employs an XML parser, which is an XML parser built in the AS and is used to parse the XML script and generate the object required by the interpreter.
Preferably, the wind control variable calculation rule of step S2 includes a variable calculation module, and the variable calculation module is actually a powerful variable calculation engine and has the capability of constructing a database table, executing an SQL statement, and outputting a calculation result.
According to the XML analysis and wind control variable generation method, the XML analysis development and maintenance work is reduced, and the personnel investment is reduced; under the conditions of not modifying the existing code and not restarting the existing application service, the change of the xml is self-adapted; under the conditions of not modifying the existing codes and not restarting the existing application services, the wind control variable calculation configuration is modified on line, and the service shutdown maintenance time is reduced.
Drawings
FIG. 1 is a flow diagram of XML parsing;
FIG. 2 is an XML content diagram;
FIG. 3 is a diagram of XML parsing results;
FIG. 4 is a flow chart of wind control variable calculation;
FIG. 5 is a diagram of wind control variable calculation rules;
FIG. 6 is a graph of the results of the wind control variables.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments.
Referring to fig. 1 to 6, a method for generating an XML parsing variable and a wind control variable includes the following steps:
s1 XML dynamic parsing:
the S11 parsing module reads and calls the Webservice interface of the external database interface to obtain returned XML data;
s12, first traversing the primary node as a table name, and then generating a child node ID;
s13, judging whether the child node has an array: if the child nodes have the arrays, the data are traversed in parallel, child node IDs are generated, whether the child nodes have the arrays or not is judged by the child node IDs, and if the child nodes do not have the arrays, whether the child nodes exist or not is judged;
s14, judging whether a child node exists: if the child node exists, generating a child node ID, judging whether the child node has a plurality of groups by the child node ID, and if the child node does not exist, acquiring the node content;
s2 wind control variable calculation method based on h2 database:
s21, acquiring a wind control variable calculation rule;
s22 executing the wind control variable rule SQL;
s23, judging whether the wind control variable rule SQL is abnormal:
if the wind control variable rule SQL is abnormal, taking a default value and finishing the calculation;
and if the wind control variable rule SQL is not abnormal, taking a rule result, if the rule result is correct, continuing to execute the wind control variable rule SQL, and if the rule result is incorrect, ending the calculation.
In the invention, each external database interface Webservice interface corresponds to a form style.
In the present invention, the step S11 further includes determining the read XML node type, where the node type is divided into a start tag, a text tag, and an end tag.
In the invention, the XML analysis of the step S1 is realized on an Android platform, and the programming language is java.
In the present invention, the XML dynamic parsing in step S1 employs an XML parser, and the XML parser refers to an XML parser built in the AS and is used for parsing the XML script and generating an object required by the interpreter.
In the present invention, the wind control variable calculation rule of step S2 includes a variable calculation module, which is actually a powerful variable calculation engine and has the capability of constructing a database table, executing an SQL statement, and outputting a calculation result.
The invention comprises the following steps: XML dynamic analysis mode: the analysis module reads and calls a Webservice interface of an external database interface to obtain returned XML data; firstly, traversing a primary node as a table name, and then generating a child node ID; judging whether the child nodes have an array or not: if the child nodes have the arrays, the data are traversed in parallel, child node IDs are generated, whether the child nodes have the arrays or not is judged by the child node IDs, and if the child nodes do not have the arrays, whether the child nodes exist or not is judged; judging whether a child node exists: if the child node exists, generating a child node ID, judging whether the child node has a plurality of groups by the child node ID, and if the child node does not exist, acquiring the node content; the wind control variable calculation method based on h2database comprises the following steps: acquiring a wind control variable calculation rule; executing a wind control variable rule SQL; judging whether the wind control variable rule SQL is abnormal or not: if the wind control variable rule SQL is abnormal, taking a default value and finishing the calculation; and if the wind control variable rule SQL is not abnormal, taking a rule result, if the rule result is correct, continuing to execute the wind control variable rule SQL, and if the rule result is incorrect, ending the calculation.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.
Claims (6)
1. A method for XML analysis and wind control variable generation is characterized by comprising the following steps:
s1 XML dynamic parsing:
the S11 parsing module reads and calls the Webservice interface of the external database interface to obtain returned XML data;
s12, first traversing the primary node as a table name, and then generating a child node ID;
s13, judging whether the child node has an array: if the child nodes have the arrays, the data are traversed in parallel, child node IDs are generated, whether the child nodes have the arrays or not is judged by the child node IDs, and if the child nodes do not have the arrays, whether the child nodes exist or not is judged;
s14, judging whether a child node exists: if the child node exists, generating a child node ID, judging whether the child node has a plurality of groups by the child node ID, and if the child node does not exist, acquiring the node content;
s2 wind control variable calculation method based on h2 database:
s21, acquiring a wind control variable calculation rule;
s22 executing the wind control variable rule SQL;
s23, judging whether the wind control variable rule SQL is abnormal:
if the wind control variable rule SQL is abnormal, taking a default value and finishing the calculation;
and if the wind control variable rule SQL is not abnormal, taking a rule result, if the rule result is correct, continuing to execute the wind control variable rule SQL, and if the rule result is incorrect, ending the calculation.
2. The method for XML parsing and wind control variable generation according to claim 1, wherein each external database interface Webservice interface corresponds to a form style.
3. The method for XML parsing and wind control variable generation according to claim 1, wherein the step S11 further comprises determining the type of the XML node read, wherein the type of the node is divided into a start tag, a text tag and an end tag.
4. The method for generating the XML parsing and the wind control variable according to claim 1, wherein the XML parsing of the step S1 is implemented on an Android platform, and the programming language is java.
5. The method AS claimed in claim 1, wherein the dynamic XML parsing in step S1 employs an XML parser, which is an AS-built XML parser, for parsing the XML script and generating the object required by the interpreter.
6. The method according to claim 1, wherein the wind control variable calculation rule of step S2 includes a variable calculation module, which is a powerful variable calculation engine with the capability of constructing database tables, executing SQL statements, and outputting calculation results.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010905287.8A CN111949829B (en) | 2020-09-01 | XML analysis and wind control variable generation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010905287.8A CN111949829B (en) | 2020-09-01 | XML analysis and wind control variable generation method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111949829A true CN111949829A (en) | 2020-11-17 |
CN111949829B CN111949829B (en) | 2024-06-07 |
Family
ID=
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114219305A (en) * | 2021-12-16 | 2022-03-22 | 广州宸祺出行科技有限公司 | Method and system for enhancing stability of network appointment wind control system |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040161868A1 (en) * | 2003-02-19 | 2004-08-19 | Hong Sungkwon (Chris) | CMOS image sensor and method of fabrication |
US20080243904A1 (en) * | 2007-03-30 | 2008-10-02 | The University Court Of The University Of Edinburgh | Methods and apparatus for storing XML data in relations |
US20100002704A1 (en) * | 2008-07-03 | 2010-01-07 | Netwitness Corporation | System and Method for End-User Custom Parsing Definitions |
CN106570400A (en) * | 2016-10-11 | 2017-04-19 | 杭州安恒信息技术有限公司 | System and method for preventing attacks by self-learning in cloud environment |
CN106952053A (en) * | 2017-04-07 | 2017-07-14 | 北京工业大学 | A kind of Supply chain financing method based on dynamic flow |
CN107862425A (en) * | 2017-08-29 | 2018-03-30 | 平安普惠企业管理有限公司 | Air control collecting method, equipment, system and readable storage medium storing program for executing |
CN108536846A (en) * | 2018-04-13 | 2018-09-14 | 深圳壹账通智能科技有限公司 | Air control engine variable library rule adaptation method, device, equipment and storage medium |
CN108876193A (en) * | 2018-07-13 | 2018-11-23 | 四川享宇金信金融服务外包有限公司 | A kind of air control model building method based on credit score |
CN109799976A (en) * | 2019-01-11 | 2019-05-24 | 上海凯岸信息科技有限公司 | Real-time air control variable calculation method based on distributive type computing engines |
CN110189220A (en) * | 2019-05-09 | 2019-08-30 | 天创信用服务有限公司 | A kind of risk analysis decision-making technique, device, system and storage medium |
CN110458595A (en) * | 2019-06-21 | 2019-11-15 | 平安普惠企业管理有限公司 | Rules process method, electronic device and the computer equipment of configurableization |
CN110766289A (en) * | 2019-09-26 | 2020-02-07 | 北京淇瑀信息科技有限公司 | Dynamic wind control rule adjusting method and device and electronic equipment |
CN111475144A (en) * | 2020-04-13 | 2020-07-31 | 深圳前海微众银行股份有限公司 | Wind control decision method, device, equipment and computer readable storage medium |
CN111580874A (en) * | 2020-04-09 | 2020-08-25 | 深圳壹账通智能科技有限公司 | System safety control method and system for data application and computer equipment |
Patent Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040161868A1 (en) * | 2003-02-19 | 2004-08-19 | Hong Sungkwon (Chris) | CMOS image sensor and method of fabrication |
CN1774814A (en) * | 2003-02-19 | 2006-05-17 | 微米技术有限公司 | CMOS image sensor and method of fabrication |
US20080243904A1 (en) * | 2007-03-30 | 2008-10-02 | The University Court Of The University Of Edinburgh | Methods and apparatus for storing XML data in relations |
US20100002704A1 (en) * | 2008-07-03 | 2010-01-07 | Netwitness Corporation | System and Method for End-User Custom Parsing Definitions |
CN106570400A (en) * | 2016-10-11 | 2017-04-19 | 杭州安恒信息技术有限公司 | System and method for preventing attacks by self-learning in cloud environment |
CN106952053A (en) * | 2017-04-07 | 2017-07-14 | 北京工业大学 | A kind of Supply chain financing method based on dynamic flow |
CN107862425A (en) * | 2017-08-29 | 2018-03-30 | 平安普惠企业管理有限公司 | Air control collecting method, equipment, system and readable storage medium storing program for executing |
CN108536846A (en) * | 2018-04-13 | 2018-09-14 | 深圳壹账通智能科技有限公司 | Air control engine variable library rule adaptation method, device, equipment and storage medium |
CN108876193A (en) * | 2018-07-13 | 2018-11-23 | 四川享宇金信金融服务外包有限公司 | A kind of air control model building method based on credit score |
CN109799976A (en) * | 2019-01-11 | 2019-05-24 | 上海凯岸信息科技有限公司 | Real-time air control variable calculation method based on distributive type computing engines |
CN110189220A (en) * | 2019-05-09 | 2019-08-30 | 天创信用服务有限公司 | A kind of risk analysis decision-making technique, device, system and storage medium |
CN110458595A (en) * | 2019-06-21 | 2019-11-15 | 平安普惠企业管理有限公司 | Rules process method, electronic device and the computer equipment of configurableization |
CN110766289A (en) * | 2019-09-26 | 2020-02-07 | 北京淇瑀信息科技有限公司 | Dynamic wind control rule adjusting method and device and electronic equipment |
CN111580874A (en) * | 2020-04-09 | 2020-08-25 | 深圳壹账通智能科技有限公司 | System safety control method and system for data application and computer equipment |
CN111475144A (en) * | 2020-04-13 | 2020-07-31 | 深圳前海微众银行股份有限公司 | Wind control decision method, device, equipment and computer readable storage medium |
Non-Patent Citations (2)
Title |
---|
S. JAN: ""Known XML Vulnerabilities Are Still a Threat to Popular Parsers and Open Source Systems"", 《2015 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY》, 31 December 2015 (2015-12-31), pages 233 - 241 * |
周雯 等: ""数据需求驱动的storm应用辅助开发框架"", 《计算机科学》, 30 September 2018 (2018-09-30), pages 81 - 88 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114219305A (en) * | 2021-12-16 | 2022-03-22 | 广州宸祺出行科技有限公司 | Method and system for enhancing stability of network appointment wind control system |
CN114219305B (en) * | 2021-12-16 | 2023-06-23 | 广州宸祺出行科技有限公司 | Method and system for enhancing stability of network vehicle-closing wind control system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9710243B2 (en) | Parser that uses a reflection technique to build a program semantic tree | |
US20030097637A1 (en) | Schema generation apparatus, data processor, and program for processing in the same data processor | |
CN115639980A (en) | Draggable front-end logic arrangement method and device for low-code platform | |
CN108664546B (en) | XML data structure conversion method and device | |
CN111506314B (en) | Project development method, device, server and medium | |
CN101980546B (en) | Intelligent network platform, service execution method and method for analyzing service abnormality | |
CN113010183A (en) | Code conversion method and device | |
CN113254023B (en) | Object reading method and device and electronic equipment | |
US20020129335A1 (en) | Robust logging system for embedded systems for software compilers | |
CN111949829A (en) | XML (extensive markup language) analysis and wind control variable generation method | |
CN111949829B (en) | XML analysis and wind control variable generation method | |
CN111580821B (en) | Script binding method and device, electronic equipment and computer readable storage medium | |
CN115080011B (en) | Code generation method and system based on abstract syntax tree | |
CN115268918A (en) | Automatic conversion method from C + + code to C code based on rule template | |
US8108828B2 (en) | System for generating optimized computer data field conversion routines | |
JP2014228990A (en) | Control program creation apparatus and control program creation method | |
CN113821195A (en) | Method, device and equipment for generating executable program of target language | |
CN111708542A (en) | Test case generation method, system, device and storage medium | |
Schroeder et al. | Flexible automatic converting of NC programs. A cross-compiler for structured text | |
JP2015035174A (en) | Control program division device, control program division method, and recording medium therefor | |
CN111708526B (en) | API writing method | |
CN116755792A (en) | Service integration method and related equipment thereof | |
JP2008176520A (en) | Tag conversion device | |
CN116932041A (en) | Method, system and medium for generating and installing multi-platform customized system package | |
CN115469848A (en) | Method for realizing multi-file compiler at front end |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |