CN111949829B - XML analysis and wind control variable generation method - Google Patents
XML analysis and wind control variable generation method Download PDFInfo
- Publication number
- CN111949829B CN111949829B CN202010905287.8A CN202010905287A CN111949829B CN 111949829 B CN111949829 B CN 111949829B CN 202010905287 A CN202010905287 A CN 202010905287A CN 111949829 B CN111949829 B CN 111949829B
- Authority
- CN
- China
- Prior art keywords
- child node
- xml
- control variable
- wind control
- array
- 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.)
- Active
Links
- 238000004458 analytical method Methods 0.000 title claims abstract description 26
- 238000000034 method Methods 0.000 title claims abstract description 10
- 238000004364 calculation method Methods 0.000 claims abstract description 35
- 230000002159 abnormal effect Effects 0.000 claims description 12
- 238000013515 script Methods 0.000 claims description 3
- 238000012423 maintenance Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012954 risk control Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
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 an XML analysis and wind control variable generation method, which comprises the following steps: s1 XML dynamic analysis mode: s11, the analysis module reads and calls an external database interface Webservice interface to obtain returned XML data; s12, traversing the first-level node to serve as a table name, and then generating a child node ID; s13, judging whether the child node has an array: if the child node has an array, the data is traversed in parallel, a child node ID is generated, whether the child node has an array is judged by the child node ID, and if the child node does not have an array, whether the child node exists is judged; s2, a wind control variable calculation method based on h2 database. The invention reduces xml analysis development and maintenance work and personnel investment; adapting to changes in xml without modifying existing code, restarting existing application services; under the conditions of not modifying the existing codes and restarting the existing application service, the wind control variable computing configuration is modified on line, and the service shutdown maintenance time is reduced.
Description
Technical Field
The invention relates to the technical field of automatic XML analysis and warehouse entry and wind control variable generation, in particular to an XML analysis and wind control variable generation method.
Background
H2database: an open source Java-based memory embedded database engine;
XML: extensible markup language, a common data exchange message format; wind control variable: the parameter of the wind control decision in the risk control system is basic data of the wind control system decision; XML automatic analysis and warehouse entry: the XML tree message is converted into a two-dimensional table form and stored in a database. The difference from the general wind control variable generation mode is that: 1. the analysis process and the analysis result are fully automatic, and a configuration file and a POJO object are not needed; 2. the wind control variable rule is configurable and has no hard code; 3. and the memory is completely stored, and temporary data does not need to be cleaned.
However, the prior art has the disadvantages: 1. in the current stage, most of XML analysis uses a Java Bean binding mode, one Java class corresponds to one section of XML data stream, and each time of change, java codes need to be modified, and online is recompiled; most of wind control variable calculation in the market needs to write codes, such as Java and other code modes needing to be compiled and redeployed online, and wind control variable calculation rules are not fast and flexible to change.
Disclosure of Invention
Based on the technical problems in the background technology, the invention provides an XML parsing and wind control variable generation method.
The invention provides an XML analysis and wind control variable generation method, which comprises the following steps:
S1 XML dynamic analysis mode:
s11, the analysis module reads and calls an external database interface Webservice interface to obtain returned XML data;
s12, traversing the first-level node to serve as a table name, and then generating a child node ID;
S13, judging whether the child node has an array: if the child node has an array, the data is traversed in parallel, a child node ID is generated, whether the child node has an array is judged by the child node ID, and if the child node does not have an array, whether the child node exists is judged;
S14, judging whether a child node exists or not: if the child node exists, generating a child node ID, judging whether the child node has an array or not by the child node ID, and if the child node does not exist, acquiring node content;
S2, a wind control variable calculation method based on h2database comprises the following steps:
s21, acquiring a wind control variable calculation rule;
S22, executing a wind control variable rule SQL;
S23, 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 ending calculation;
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 read XML node type, where the node type 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 adopts an XML parser, which refers to an XML parser built in AS, for parsing an XML script and generating an object required by the interpreter.
Preferably, the wind-controlled variable calculation rule in step S2 includes a variable calculation module, where the variable calculation module is actually a powerful variable calculation engine, and has the capability of building a database table, executing an SQL statement, and outputting a calculation result.
According to the XML analysis and wind control variable generation method, XML analysis development and maintenance work are reduced, and personnel investment is reduced; adapting to changes in xml without modifying existing code, restarting existing application services; under the conditions of not modifying the existing codes and restarting the existing application service, the wind control variable computing configuration is modified on line, and the service shutdown maintenance time is reduced.
Drawings
FIG. 1 is an XML parsing flow diagram;
FIG. 2 is an XML content diagram;
FIG. 3 is a diagram of XML parsing results;
FIG. 4 is a flow chart of a wind controlled variable calculation;
FIG. 5 is a graph of a calculation rule for wind controlled variables;
FIG. 6 is a graph of the result of a pneumatic control variable.
Detailed Description
The following description of the technical solutions in the embodiments of the present invention will be clear and complete, and it is obvious that the described embodiments are only some embodiments of the present invention, but not all embodiments.
Referring to fig. 1-6, an XML parsing and wind controlled variable generation method includes the steps of:
S1 XML dynamic analysis mode:
s11, the analysis module reads and calls an external database interface Webservice interface to obtain returned XML data;
s12, traversing the first-level node to serve as a table name, and then generating a child node ID;
S13, judging whether the child node has an array: if the child node has an array, the data is traversed in parallel, a child node ID is generated, whether the child node has an array is judged by the child node ID, and if the child node does not have an array, whether the child node exists is judged;
S14, judging whether a child node exists or not: if the child node exists, generating a child node ID, judging whether the child node has an array or not by the child node ID, and if the child node does not exist, acquiring node content;
S2, a wind control variable calculation method based on h2database comprises the following steps:
s21, acquiring a wind control variable calculation rule;
S22, executing a wind control variable rule SQL;
S23, 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 ending calculation;
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 parsing of the step S1 is realized on an Android platform, and the programming language is java.
In the invention, the XML dynamic analysis of the step S1 adopts an XML analyzer, and the XML analyzer refers to an AS built-in XML analyzer, which is used for analyzing XML scripts and generating objects required by the interpreter.
In the invention, the wind control variable calculation rule in the step S2 comprises a variable calculation module, wherein the variable calculation module is actually a powerful variable calculation engine and has the capabilities of constructing a database table, executing SQL sentences and outputting calculation results.
The invention comprises the following steps: XML dynamic analysis mode: the analysis module reads and calls an external database interface Webservice interface to obtain returned XML data; traversing a first-level node as a table name, and then generating a child node ID; judging whether the child node has an array: if the child node has an array, the data is traversed in parallel, a child node ID is generated, whether the child node has an array is judged by the child node ID, and if the child node does not have an array, whether the child node exists is judged; judging whether a child node exists or not: if the child node exists, generating a child node ID, judging whether the child node has an array or not by the child node ID, and if the child node does not exist, acquiring node content; the wind control variable calculation method based on the h2database comprises the following steps: acquiring a calculation rule of the wind control variable; 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 ending calculation; 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 foregoing is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art, who is within the scope of the present invention, should make equivalent substitutions or modifications according to the technical scheme of the present invention and the inventive concept thereof, and should be covered by the scope of the present invention.
Claims (1)
1. The XML analysis and wind control variable generation method is characterized by comprising the following steps:
S1 XML dynamic analysis mode:
S11, the analysis module reads and calls an external database interface Webservice interface to obtain returned XML data; each external database interface Webservice interface corresponds to a form style;
The step S11 further comprises judging the read XML node types, wherein the node types are divided into a start tag, a text tag and an end tag;
s12, traversing the first-level node to serve as a table name, and then generating a child node ID;
S13, judging whether the child node has an array: if the child node has an array, the data is traversed in parallel, a child node ID is generated, whether the child node has an array is judged by the child node ID, and if the child node does not have an array, whether the child node exists is judged;
S14, judging whether a child node exists or not: if the child node exists, generating a child node ID, judging whether the child node has an array or not by the child node ID, and if the child node does not exist, acquiring node content;
The XML parsing of the step S1 is realized on an Android platform, and the programming language is java;
The XML dynamic analysis of the step S1 adopts an XML analyzer, wherein the XML analyzer refers to an AS built-in XML analyzer and is used for analyzing an XML script and generating an object required by the interpreter;
S2, a wind control variable calculation method based on h2database comprises the following steps:
s21, acquiring a wind control variable calculation rule;
S22, executing a wind control variable rule SQL;
S23, 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 ending calculation;
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 calculation;
the wind control variable calculation rule in the 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.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010905287.8A CN111949829B (en) | 2020-09-01 | 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 | 2020-09-01 | XML analysis and wind control variable generation method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111949829A CN111949829A (en) | 2020-11-17 |
CN111949829B true CN111949829B (en) | 2024-06-07 |
Family
ID=73367212
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010905287.8A Active CN111949829B (en) | 2020-09-01 | 2020-09-01 | XML analysis and wind control variable generation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111949829B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114219305B (en) * | 2021-12-16 | 2023-06-23 | 广州宸祺出行科技有限公司 | Method and system for enhancing stability of network vehicle-closing wind control system |
CN114239494A (en) * | 2021-12-20 | 2022-03-25 | 北京雅丁信息技术有限公司 | Automatic analysis method for electronic medical record based on XML |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1774814A (en) * | 2003-02-19 | 2006-05-17 | 微米技术有限公司 | CMOS image sensor and method of fabrication |
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 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
US8149841B2 (en) * | 2008-07-03 | 2012-04-03 | Emc Corporation | System and method for end-user custom parsing definitions |
-
2020
- 2020-09-01 CN CN202010905287.8A patent/CN111949829B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1774814A (en) * | 2003-02-19 | 2006-05-17 | 微米技术有限公司 | CMOS image sensor and method of fabrication |
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 |
---|
"Known XML Vulnerabilities Are Still a Threat to Popular Parsers and Open Source Systems";S. Jan;《2015 IEEE International Conference on Software Quality, Reliability and Security》;20151231;第233-241页 * |
"数据需求驱动的storm应用辅助开发框架";周雯 等;《计算机科学》;20180930;第81-88页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111949829A (en) | 2020-11-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111949829B (en) | XML analysis and wind control variable generation method | |
US9710243B2 (en) | Parser that uses a reflection technique to build a program semantic tree | |
CN110673854A (en) | SAS language compiling method, device, equipment and readable storage medium | |
CN111506314B (en) | Project development method, device, server and medium | |
CN111427583A (en) | Component compiling method and device, electronic equipment and computer readable storage medium | |
Yatapanage et al. | Slicing behavior tree models for verification | |
CN111767032B (en) | Method and device for processing expert rules of industrial equipment faults | |
CN116643739A (en) | Decision engine implementation method, device, equipment and storage medium | |
CN115268918A (en) | Automatic conversion method from C + + code to C code based on rule template | |
CN115357492A (en) | Formal verification method and device for Java software | |
CN113867714A (en) | Automatic code generation method adaptive to multiple languages | |
CN113672509A (en) | Automatic testing method, device, testing platform and storage medium | |
CN113608748A (en) | Data processing method, device and equipment for converting C language into Java language | |
CN112596737A (en) | Method, system, equipment and storage medium for scanning function call relation | |
Schroeder et al. | Flexible automatic converting of NC programs. A cross-compiler for structured text | |
CN111176993A (en) | Code static detection method based on abstract syntax tree | |
CN110928535A (en) | Derivative variable deployment method, device, equipment and readable storage medium | |
CN115081393B (en) | Method for real-time assembling text display of expressions | |
CN117421009B (en) | Signal code generation method, device, terminal equipment and storage medium | |
CN114385388B (en) | Algorithm processing method and device, electronic equipment and storage medium | |
JP2009080681A (en) | Program structure parsing method and device | |
JP2007133622A (en) | Engineering tool and program conversion method | |
CN116541289A (en) | Method, device, equipment and medium for realizing heterogeneous system automatic test | |
JP5045059B2 (en) | Automatic control program creation device | |
CN113360410A (en) | Test method of C code software and readable storage medium |
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 |