CN110209389B - XML-based data generation tool development system - Google Patents

XML-based data generation tool development system Download PDF

Info

Publication number
CN110209389B
CN110209389B CN201910485783.XA CN201910485783A CN110209389B CN 110209389 B CN110209389 B CN 110209389B CN 201910485783 A CN201910485783 A CN 201910485783A CN 110209389 B CN110209389 B CN 110209389B
Authority
CN
China
Prior art keywords
data
module
xml
script
input
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
Application number
CN201910485783.XA
Other languages
Chinese (zh)
Other versions
CN110209389A (en
Inventor
陈进
黄鹏
魏洋
辛春辉
万娇
李彪
毛家明
吴柯怡
母雯
蒋远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casco Signal Cherngdu Ltd
Original Assignee
Casco Signal Cherngdu Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Casco Signal Cherngdu Ltd filed Critical Casco Signal Cherngdu Ltd
Priority to CN201910485783.XA priority Critical patent/CN110209389B/en
Publication of CN110209389A publication Critical patent/CN110209389A/en
Application granted granted Critical
Publication of CN110209389B publication Critical patent/CN110209389B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a data generation tool development method based on XML (extensive makeup language), which belongs to the technical field of initialization of configuration data and comprises a programmable XML configuration script, an input adapter module, a data structure module, a general tool module, a data analysis module, an IOC (input object model) attribute automatic assembly module, a script analysis module, a file output module, a class mapping module, a grammar intelligent prompt module, a script debugging module and an operation log output module.

Description

XML-based data generation tool development system
Technical Field
The invention relates to the technical field of initialization of configuration data, in particular to a development system of a data generation tool based on XML.
Background
In the field of railway and urban rail transit at home and abroad, the normal operation of most real-time online control and/or monitoring systems needs to be completed with initialization of configuration data in advance, the higher the complexity of the system is, the larger the amount of the configuration data is, and in order to realize the initialization configuration of the system prefabricated data, a large amount of configuration data generation work needs to be completed offline before the system operates.
In order to ensure the accuracy and safety of data, the generation of configuration data is usually performed by a data configuration tool. In recent years, the field of rail transit is rapidly developed, a data configuration tool is required to be rapidly developed, safe and reliable data are accurately generated, the existing data configuration tool is completed by selecting a programming language to independently encode by encoding personnel, a large number of repeated encoding problems exist among the configuration tools, the requirement for rapid development of the tools cannot be met, and the development efficiency is low.
In the prior art, for example, chinese patent publication No. CN102799709B, publication time of 2015, 4 months and 1 days, entitled "system simulation test environment construction and configuration system and method based on XML", discloses a system simulation test environment construction and configuration system and method based on XML, where the system includes a simulation test configurator, a performance parameter editor, a member monitoring service, a data access service, a test configuration library, a test resource library, and an equipment performance library. In the method, a test manager uses a simulation test configurator to configure seats, simulator working parameters, interaction relations, command relations and the like on a master console; the master console broadcasts and sends an initialization command; the member monitoring service on each seat receives the initialization command, downloads and starts a corresponding simulator program from the database; when the simulator is started, reading performance parameters required by the operation of the simulator from an equipment performance database through a data access service, downloading a configuration file in an XML format from a test configuration library through the data access service, and reading the operation parameters of the simulator; and finishing initialization work after the system is started, and waiting for the start of the simulation test.
Functionally, the data configuration tool obtains output data in a specified format through logical operation of specified rules on input data in a specific format, the formats of the processed and generated data are various, the development mode of independently developing the data configuration tool cannot be uniformly adapted to input files and output files in different formats, different tool developers may bring difference of tool quality, and the safety requirements of the production of the data generated by the data configuration tool in the field of rail transit cannot be met.
Disclosure of Invention
The invention aims to provide a data configuration tool development framework based on XML configuration, which is used for helping developers to quickly and accurately develop a safe data configuration system by constructing a uniform data configuration tool development platform which provides a programming interface externally in the form of XML scripts.
The purpose of the invention is realized by the following technical scheme:
an XML-based data generation tool development system, characterized by: the system comprises an input adapter module for receiving input data, a script parsing module for parsing grammar of a programmable XML configuration script, a data parsing module for logic operation, a file output module for outputting intermediate data generated in the parsing process of the programmable XML configuration script and a parsing result of the data parsing module to a specified format file, a grammar intelligent prompting module for prompting when the XML configuration script is keyed, a class mapping module for automatically mapping the intermediate data into C # data classes when the system is expanded, and a script debugging module for debugging the XML script;
and a data structure module used for storing the input data loaded by the input adapter module and the intermediate data in a uniform data structure and an IOC attribute automatic assembly module used for automatically injecting corresponding data nodes of the intermediate data into attributes of C # data classes in the expanded task processor and injecting data generated after the operation of the task processor into corresponding intermediate data nodes are arranged between the input adapter module and the file output module.
The input adapter module is used for identifying and reading input files with different formats at a file input end and loading the input files into the data structure module, wherein the input formats of the input files comprise one or more of xml, par, ini, execl and csv.
The data structure module is used for packaging the input files of different formats recognized and read by the input adapter module into a uniform data structure format and providing a uniform operation interface for an upper operation layer aiming at the input files of different formats.
The data structure module divides the data of the input file into metadata and operation data, and the metadata encapsulates basic data types in a C # data class, so that different types of metadata can be legally mutually converted, and weak type language features are presented in a programmable XML configuration script; the metadata also encapsulates the input data loaded by the input adapter module into an input type data structure, so that the system can conveniently and uniformly operate the input data; the operation data is a carrier which generates intermediate data when the programmable XML configuration script is analyzed, and the operation data adopts a tree structure to store the intermediate data.
The programmable XML configuration script is written in and used for compiling the business logic of a specific data generation tool by using a self-defined grammar, the business logic defines the process of specifically processing input data loaded to the data structure module and obtaining intermediate data, and outputs the intermediate data to the output mode of an output file; when the logic of the data generation tool is difficult to implement in the XML configuration script, the development system provides a mode of the task processor to support system extension, the logic is transferred to the C # code of the background inheritance self system extension interface CommonTask to be implemented, and the XML script provides a special mounting hook tag to link the C # code of the background task processor to integrally run.
The script parsing module is used for parsing the grammar of the programmable XML configuration script, running the script, executing script grammar operation, and calling a data parser module of the next layer of operation to perform specific data protocol operation and conversion processing on input data loaded to the data structure module to generate intermediate data.
The attributes of the C # data class comprise class attributes modified by Member, alias and InitValue; the IOC attribute automatic assembly module instantiates the class attributes modified by the characteristics of number, alias and InitValue in the injection task processor, then automatically assembles the specified intermediate data value to the attribute of the class, and after the processing of the extended task in the class is finished, the IOC attribute automatic assembly module automatically assembles the class attribute value modified by the injection characteristic Refill to the specified intermediate data node.
And the file output module outputs the intermediate data generated by the script parsing module to a file with a specified format according to an intermediate data output mode defined in the programmable XML configuration script, wherein the specified format comprises one or more of binary system, TXT text, ini, par and XML.
The class mapping module is used for automatically converting the intermediate data nodes appointed in the programmable XML configuration script into corresponding C # data classes for the task processor generated when the system is expanded before the system runs according to the data mapping mode defined in the XML script grammar.
The intelligent grammar prompting module is used for carrying out intelligent keyword prompting, user input tracking and intelligent function signature prompting built in the data parser module on the XML grammar defined by the system when the programmable XML configuration script is edited and typed.
The debugging module is used for debugging the programmable XML configuration script by tracing the pointed intermediate data node path, applying for accessing the value of the data node in the memory and displaying the value of the data node at the input front end of the programmable XML configuration script when the system runs.
The system also comprises a universal tool module, wherein the universal tool module comprises a starting and calling interface of the system, a universal data operation method model, a universal input and output stream operation type model and a system abnormity tracking tool type model.
The system also comprises a running log output module used for outputting the running log.
Corresponding to the system, the invention also discloses a development method of the XML-based data generation tool development system, which comprises the following steps:
inputting a programmable XML configuration script, and defining grammar in the programmable XML configuration script in a structured mode;
data input, namely reading input file data into an input data structure in a data structure module defined in the system through an IO adapter appointed in an input adapter module, and verifying the legality of the read data through the IO adapter in the reading process; the input type data structure is a top level parent class abstracted from input data in the data structure module, and provides a uniform operation interface for the upper layer for different input format data; for example, for a par input file and an xml input file, the interfaces for taking the specified node data are Child functions;
data processing, wherein a script parsing module performs syntax parsing on the programmable XML configuration script and generates intermediate data; the data structure module converts the file data input in the data input process and the intermediate data generated by the script analysis module into a uniform data structure for storage; the system expands and generates a task processor in the data analyzer module, and the task processor calls function logic contained in the analysis result of the script analysis module to perform logic operation processing on the intermediate data and the file data converted by the data structure module; the IOC attribute automatic assembly module automatically injects corresponding data nodes of the intermediate data into attributes of C # data in a task processor, and injects data generated after the operation of the task processor into the corresponding intermediate data nodes;
and outputting the file, wherein the file output module outputs intermediate data generated in the process of analyzing the programmable XML configuration script and the analysis result of the data analysis module to a file with a specified format.
And the file output module outputs the generated intermediate data to a text in a specified format according to the output mode configuration of the output file in the programmable XML configuration script. And similarly, the file output module establishes a corresponding output agent according to the output mode configuration of the output file in the programmable XML configuration script, syntax verification is carried out on the output mode configuration in the agent establishing process, the verification does not pass through prompting of error configuration reasons by error reporting, and then the intermediate data is delivered to the output agent for analysis. Taking binary text output as an example, the output agent searches intermediate data nodes from top to bottom according to a tree structure of the intermediate data, converts the nodes into data types specified by the styles according to the configuration of the style attributes of the data nodes in the XML configuration script, and outputs the intermediate node data according to the byte length specified by the value attributes in the XML configuration script.
The syntax in the programmable XML configuration script is a development syntax defined by structuring and defining the label, attribute and value attribute values in the XML configuration script.
The labels comprise a plurality of labels in the list of member, variable, operator, source, param, result, qualification, func, task, log, etc.; the member, the variable and the operator are used for generating intermediate data and modifying the intermediate data; the func is used to customize the input of a function in a programmable XML configuration script.
The attributes comprise name, value, alias, default, tostyle, tocs, refill, style and the like; the name and alias are used for specifying the variable name of the intermediate data; the default is used for setting a default value of the intermediate data; the value is used to generate the value of the variable indicated by the name.
The value attribute value is used for defining types such as assignment operation, function call, function pointer reference, analysis proxy reference, intermediate data value reference and the like.
The programmable XML configuration script is input in a tree structure by taking an XML tag as a unit.
The syntax parsing of the programmable XML configuration script comprises a parsing agent creating process: and generating an analysis agent which is consistent with the tree structure input by the XML by taking the XML tag as a unit, namely the analysis agent is also in the tree structure, the hierarchical relationship is the same as the corresponding programmable XML configuration script, and the analysis agent is recursively analyzed according to the tree structure. And in the process of creating, syntax checking is carried out on the programmable XML configuration script, whether the syntax of the programmable XML configuration script meets the syntax of the XML script designed by the platform is checked, if the syntax of the XML script does not meet the syntax of the XML script designed by the platform, an error is reported, and the error position of the syntax of the programmable XML configuration script is prompted.
The data processing also comprises a process of creating a context operating environment: the context operation environment is used for storing the integral state of the system at a certain time when the system operates, and the state comprises input type data loaded into the system by the input adapter module at the current time, intermediate data generated in the analysis process of the programmable XML configuration script, method function classes of operation data in the data analysis module loaded through a reflection mechanism and a task processor expanded by the system. The runtime context is created by a factory method of the script analysis module, and after the creation is completed, the method function class of the operation data in the data analysis module and the task processor expanded by the system are loaded to the runtime context through a reflection mechanism.
The data processing system comprises a system runtime context environment, an analysis agent and input type data loaded by an input adapter module, wherein all elements of the data processing are formed by the input type data loaded by the script analysis module, when the script analysis module runs and analyzes the data, the input type data is loaded into the context runtime environment created during the runtime, then the analysis agent is responsible for analyzing the context runtime environment, the analysis agent is a carrier and an executor of XML grammar defined by the system, and when the analysis is carried out, the analysis agent analyzes the programmable XML configuration script sequentially according to the sequence of tags, attributes, value attribute values and lower sub-tags of the grammar.
If the debugging of the programmable XML configuration script is involved in the process of running the analysis agent, the script debugging module can track the position of a user mouse, when the mouse position points to the name of the intermediate data node in the XML configuration script, the script debugging module encapsulates the identified intermediate data node path into a request and sends the request to the runtime context environment, after the runtime context environment receives the request, the requested intermediate data node path is analyzed, the value of the intermediate data node is inquired, the value is encapsulated into a reply message and sent to the script debugging module, and the script debugging module displays the real-time value of the inquired node in the XML configuration script.
In the data processing, when the tag of the XML configuration script is member or variable, the parsing agent generates a middle data node named as a name attribute value in a runtime context, the node value is generated according to a mode specified by a value attribute value, and when the value attribute value type is assignment operation, the node value is the value attribute value; when the value attribute value type is the intermediate data value reference type, the analysis proxy object searches a variable under a path from a runtime context according to the path indicated in the value attribute value, and assigns the variable value to the node; when the value attribute value type is a function call type, the analysis proxy object searches out a method function object indicated in the value attribute value from a runtime context environment, transmits a child tag proxy of the current analysis proxy object and the runtime context environment to the method function object, recursively analyzes the variable value of the child tag proxy by the method function object as a function entry parameter of the method function object, then the method function object calculates a method function return value according to the analyzed function entry parameter analysis and the design logic of the function, returns the return value to the current analysis proxy object, generates an intermediate data node named as a name value as the return value by the analysis proxy object, stores the intermediate data node generated by the memer tag analysis in the runtime context environment as a global variable, stores the intermediate data generated by the variable tag analysis in the runtime context environment as a local variable, and deletes the intermediate data generated by the variable tag analysis when a parent agent of the current analysis proxy object finishes the analysis. When the label is an oper, the resolution of the value attribute value is equal to the number and the variable, and only the return value is discarded and is not stored in the runtime context environment. When the label is task, the analysis agent object searches a task processor specified by the value attribute value from the runtime context environment, and calls the task processor to complete the generation of the intermediate data node of the specific logic.
The task processor realizes data processing, the data processing can be completed based on a local method function in a system data parser module through compiling a programmable XML configuration script, and when the business logic is too complex, an intermediate data node can be generated by expanding the task processor:
firstly, configuring an intermediate data node to be used by a task processor in a programmable XML configuration script by using tocs, tostyle and refill;
then automatically generating a corresponding C # data class for the configured intermediate data node through a class mapping module, quoting the generated C # data class in the expanded task processor, indicating a path for injecting an intermediate data node for the quoting in the runtime through an InitValue characteristic provided by a system, automatically injecting a specified intermediate data node value into the quoting in the runtime of a task through an IOC attribute automatic assembly module, rewriting a Run method of the task processor, and completing a specific logic data processing logic;
and finally, injecting the Run method processing result data back to the specified intermediate data node in the runtime context environment through the reflill characteristic provided by the system, wherein during task runtime, the IOC attribute automatic assembly module automatically scans the field modified by the reflill in the task processor after the Run method is executed, and injects the field value back to the specified intermediate data node in the runtime context environment.
Compared with the prior art, the invention has the following advantages:
the development is rapid, in the scheme, a programmable configuration script grammar provided by a uniform development platform calls a rich data operation class library in the platform, code repetition caused by independent coding can be reduced, a developer can rapidly construct own application, for business logic which is difficult to realize by XML scripts, the platform also provides a flexible and convenient C # expansion task processor expansion mode for processing, meanwhile, the processing mode shields the processing of a MetaFly bottom data structure, the developer does not have the cost of learning the bottom data structure, and the development difficulty is reduced.
And (3) accurate data processing: in the scheme, because a tested data operation base class is provided for a developer to call, and meanwhile, the unified data structure is packaged and formatted to output data operation, data calculation errors caused by independent coding in independent development are shielded.
And (4) safe output: in the scheme, a platform development mode is adopted, so that the problem of coding quality caused by the quality difference of coding personnel in independent coding is effectively solved; the risk brought by independent coding is avoided by a configured data output mode, and the quality safety of tool development is improved.
Drawings
The foregoing and following detailed description of the invention will be apparent when read in conjunction with the following drawings, in which:
FIG. 1 is a schematic diagram of a preferred embodiment of the development system of the present invention;
FIG. 2 is a logic diagram of a preferred scheme of the development system corresponding to the development algorithm.
Detailed Description
The technical solutions for achieving the objects of the present invention are further illustrated by the following specific examples, and it should be noted that the technical solutions claimed in the present invention include, but are not limited to, the following examples.
Example 1
As a most basic implementation of the present invention, the present embodiment discloses an XML-based data generation tool development system, as shown in fig. 1, including an input adapter module for receiving input data, a script parsing module for parsing syntax of a programmable XML configuration script, a data parsing module for logic operation, a file output module for outputting intermediate data generated in the parsing process of the programmable XML configuration script and a parsing result of the data parsing module to a file with a specified format, a syntax intelligent prompting module for prompting when the XML configuration script is keyed, a class mapping module for automatically mapping the intermediate data into C # data classes when the system is extended, and a script debugging module for debugging the XML script; and a data structure module used for storing the input data loaded by the input adapter module and the intermediate data in a uniform data structure and an IOC attribute automatic assembly module used for automatically injecting corresponding data nodes of the intermediate data into attributes of C # data classes in the expanded task processor and injecting data generated after the operation of the task processor into corresponding intermediate data nodes are arranged between the input adapter module and the file output module.
Defining syntax in the programmable XML configuration script in a structured manner; reading input file data into an input data structure in a data structure module defined in the system through an IO adapter appointed in an input adapter module, and verifying the legitimacy of the read data by the IO adapter in the reading process; the input type data structure is a top level parent class abstracted from input data in the data structure module, and provides a uniform operation interface for the upper layer for different input format data; for example, for par input files and xml input files, the interface for taking specified node data is a Child function; the script parsing module parses the programmable XML configuration script and generates intermediate data; the data structure module converts the file data input in the data input process and the intermediate data generated by the script analysis module into a uniform data structure for storage; the system is expanded and generates a task processor in the data parser module, and the task processor calls function logic contained in the parsing result of the script parsing module to perform logic operation processing on the intermediate data and the file data converted by the data structure module; the IOC attribute automatic assembly module automatically injects the corresponding data node of the intermediate data into the attribute of the C # data class in the task processor, and injects the data generated after the operation of the task processor into the corresponding intermediate data node; and the file output module outputs the intermediate data generated in the process of analyzing the programmable XML configuration script and the analysis result of the data analysis module to a file with a specified format.
Example 2
As a preferred embodiment of the present invention, this embodiment discloses an XML-based data generation tool development system, which includes, as shown in fig. 1, a programmable XML configuration script, an input adapter module, a data structure module, a general tool module, a data parsing module, an IOC attribute automatic assembly module, a script parsing module, a file output module, a class mapping module, a syntax intelligent prompt module, a script debugging module, and an operation log output module.
The programmable XML configuration script is defined as a calling interface that the platform opens to developers for configuring tool specific business logic. The grammar defines a tree structure by using XML and a recursive analysis mode of a script, and simultaneously, the grammar simulates concepts such as local variables, global variables, data citations, custom functions, variable action domains and the like by using the definitions of different tags and attributes of the XML, and the platform is responsible for analyzing the tags and the attributes according to the simulated concepts.
The input adapter module is mainly responsible for reading input files IO with different formats, and the input adapter module is adapted to input data with main formats such as xml, par, ini, execl and csv at present.
The data structure module is used for uniform data format, input files with different formats are packaged into the uniform data format, and a uniform operation interface is provided for an upper layer aiming at the input data with different formats.
The general tool modules, namely tool classes and the like, are responsible for uniformly tracking the processing exception of each layer of module under the hierarchical architecture, and some general tool classes and the like.
And the data analysis module, namely a data operation class library, is responsible for processing specific business logic operation.
And when the IOC attribute automatic assembly module is responsible for expanding the task processor, automatically injecting the attributes and automatically backfilling the attributes of the task processor to the XML data node.
The script parsing module is responsible for parsing the interpretation of the business logic script written by the XML grammar.
The file output module is responsible for outputting intermediate data generated by XML script analysis to a file with a specified format, and currently, export is adapted to main output formats such as binary, text, ini, par and XML.
And the operation log output module is used for outputting the operation log.
The class mapping module is responsible for automatically mapping XML data nodes to C # data classes; the grammar intelligent prompting module is responsible for automatic completion and grammar prompting during XML compiling; the script debugging module is responsible for debugging the XML script.
And the programmable XML script syntax is defined as a calling interface which is opened to a developer by the platform and is used for configuring specific service logic of the tool. The grammar defines a tree structure by using XML and a recursive analysis mode of a script, and simultaneously, the grammar simulates concepts such as local variables, global variables, data citations, custom functions, variable action domains and the like by using the definitions of different tags and attributes of the XML, and the platform is responsible for analyzing the tags and the attributes according to the simulated concepts.
Input data of different formats are uniformly adapted. The platform uses the input data adapter module to load the main input file format used for data configuration in the rail transit field into a unified data structure, and provides a unified operation interface for the previous operation layer aiming at input data of different formats.
A task processor extension method. The platform provides a plug-in mapping module to translate the front-end intermediate data node into an equivalent C # data class, then an automatic assembly module of the platform realizes automatic injection of the task extender attribute during operation, a developer can conveniently index the front-end data node data through the C # data class, and the process does not need the developer to manually unpack a built-in data structure of the system, so that the development difficulty is reduced. For the data processed by the task processor, the system can be automatically filled into the front-end XML data node in a [ refer ] annotation mode. The notes provided by the system are [ InitValue (path) ], [ Member (path) ], [ Alias (path) ] and [ Alias (path) ] for realizing the attribute injection to the task processor, and the difference is that the InitValue must have an XML script node template, the injected attribute is unpacked, the Member and Alias can have no template, and the injected attribute supports the native data structure of the system and is not unpacked. For example, the system preferably provides an [ ExportFunc (funcname) ] annotation, conveniently integrating the task processor developed by the user into the platform, called by the < task value = "funcname"/> tag at the front end of the XML script.
And uniformly outputting the data of the programmable configuration. The output adaptation module in the system provides adaptation of a mainstream output data format in the rail transit field, and the accurate output of data can be finished by configuring output part logic, namely the output data node format and an adapter used for output through XML.
And (4) debugging mode of the XML script. The XML script is only a carrier for running the service logic by the tool, and the IDE compiler does not provide the debugging function for the custom script. The system provides a debugging breakpoint function and a VS debugging plug-in, the plug-in realizes the identification and path recombination of mouse positioning nodes and sends a data request to the current context, the state of the context is controlled by the breakpoint function, the context returns a data value of an application node and then is delivered to the plug-in, and the plug-in is responsible for front-end real-time display.
The development system realizes development in the following way:
1. the input file is read into an input data structure defined in the platform through a specified IO adapter in the input adapter module, the input data structure is a top-level parent class abstracted from input data, and for different input format data, the input data structure provides a uniform operation interface for an upper layer. For example, for a par input file, an xml input file, the interface that takes the specified node data is a Child function.
2. And creating a platform context runtime environment example, and loading the data operation function library class in the data parser module and the task manager of the C # extension in the current tool project into the context environment through a reflection mechanism by using a delayed instantiation loading technology for runtime calling. The deferred instantiation loaded library class object creates a library class object only when a runtime call to the corresponding processing library class.
3. An instance of a node parsing agent is created from the XML script, the parsing agent being a one-to-one mapping of the tagged nodes in the XML script. The process firstly carries out grammar check on the XML script, maps script nodes to the analysis agent tree only after the grammar check is passed, otherwise reports errors and prompts developers, types of grammar errors and contents of the error nodes.
4. And analyzing the XML script agent. The input data, context environment and rule agent constitute all elements of the rule parsing. When the analysis is operated, firstly, the input data is pressed into the context environment, then the specific example analysis of the interpretation parameter definition information (corresponding to the XML tag level) held in the current agent is delegated according to the context environment information, and the interpretation parameter definition information delegates the context environment to the parameter value information entity analysis generated by the value attribute mapping held by the context environment. The parameter value information entity can be divided into the following parts according to style: parameter referencing, function handling, function delegation, XML script referencing, value parsing, and Lambda expression. As an example of function processing: when the value attribute value is func style, the current parameter value information entity will find out the library function entity specified by func from the context, and entrust the current proxy object and context environment to the function entity for processing. Although different functions define different data processing modes, the functions can be considered in an overall abstraction manner that the functions are concrete operation processing procedures for parameters of the incoming functions, and the function parameters are return values of recursive analysis results of proxy child nodes of the current proxy, and through the recursive analysis, the return values of the call function analysis of the current proxy can determine whether to press the return values into a context environment or to press the return values into a global variable or a local variable according to the XML tag type corresponding to the proxy. If the label of the current value is the member, pressing the value return value into the context data pool persistent area; if the located tag is variable, pressing a return value into the transient time zone of the context data pool; if it is an oper, the return value is discarded. The data in the XML script is designed in a weak type, and when a specific function is called to process the data, the analyzed parameters are uniformly converted into high-precision data types to participate in specific operation.
5. In order to deal with extremely complex service scenes, the platform provides an expansion mode of a task processor and easily supports writing complex service logic by using C #. The class generator plug-in of the system can automatically generate a corresponding C # data class by taking the data node defined and generated in the XML script as a template, the leaf node attribute of the data class is unpacked, and the data class can be conveniently indexed through the combination of an indexer and the attribute. If the processing of the task processor written in C # is involved in the analysis process, the system analyzes according to the following modes: firstly, path specified data in a system [ InitValue (path) ] is specified and injected into an unpacking attribute node specified by the InitValue by an automatic assembly module, and then a Run method rewritten in a current task processor is operated to calculate service logic. Finally, backfilling the attribute value modified by [ refer (path) ] in the processor to the node specified by the path in the context data pool.
6. If the debugging of the XML script is involved in the analysis process, the script debugging module encapsulates the identified XML node path pointed by the mouse into a request to be sent to the system, the system unpacks the request after receiving the request, queries a node value from the context data pool, and sends the node value to the plug-in to be displayed in the XML configuration script.
7. And analyzing the XML script output part configuration. The system maps the label nodes of the output XML configuration script to the object examples of the file output module one by one, in the process, the configuration grammar of the part of the script is checked, only if the checking is successful, the file output module examples are generated, otherwise, errors are reported, and developers are prompted to configure error positions. The file export module instance is a proxy for the export portion that is responsible for translating the intermediate data into an export file of a specified format. For the intermediate data node generated by analyzing the rule part, the system can quickly and accurately output the data structuralized to the output file with the specified format in a configuration mode. The corresponding mapping relation of a tree structure exists between the configuration of an XML output part and an intermediate data structure, and the front end of the XML is designed in a weak type grammar, so that a developer needs to indicate the node name of a current output node, the output style of the current node, the byte length of the current node and the like, namely, the intermediate data can be accurately converted into a specified data type, a specified format and an occupied byte length for formatted output by an output adaptation module, the output format (style) of the system is divided into a composite type and a simple type, the composite type is a combination of the simple type, and the simple type is an atomic type which can not be divided again. When the file output module instance is analyzed, a specified data node is taken out from the context according to the name of the current agent, then the data is converted into type data specified by an output format (style), if the output format (style) is a composite type, the next-level node is recursively analyzed until the simple type at the bottom layer is analyzed; if the output format (style) is a simple type, such as a binary output long type, the node data is unpacked into the long type and output to the binary file with the byte length specified by value.

Claims (10)

1. An XML-based data generation tool development system, characterized by: the system comprises an input adapter module for receiving input data, a script parsing module for parsing grammar of a programmable XML configuration script, a data parsing module for logic operation, a file output module for outputting intermediate data generated in the parsing process of the programmable XML configuration script and a parsing result of the data parsing module to a file with a specified format, a grammar intelligent prompting module for prompting when the XML configuration script is keyed in, a class mapping module for automatically mapping the intermediate data into C # data classes when the system is expanded, and a script debugging module for debugging the XML script;
and a data structure module used for storing the input data loaded by the input adapter module and the intermediate data in a uniform data structure and an IOC attribute automatic assembly module used for automatically injecting corresponding data nodes of the intermediate data into attributes of C # data classes in the expanded task processor and injecting data generated after the operation of the task processor into corresponding intermediate data nodes are arranged between the input adapter module and the file output module.
2. An XML-based data generation tool development system according to claim 1, wherein: the input adapter module is used for identifying and reading input files with different formats at a file input end and loading the input files into the data structure module, wherein the input formats of the input files comprise one or more of xml, par, ini, execl and csv.
3. An XML-based data generation tool development system according to claim 1 or 2, wherein: the data structure module is used for packaging the input files of different formats recognized and read by the input adapter module into a uniform data structure format and providing a uniform operation interface for an upper operation layer aiming at the input files of different formats.
4. An XML-based data generation tool development system according to claim 1, wherein: the script parsing module is used for parsing the grammar of the programmable XML configuration script, running the script, executing script grammar operation, and calling a data parser module of the next layer of operation to perform specific data protocol operation and conversion processing on input data loaded to the data structure module to generate intermediate data.
5. An XML-based data generation tool development system according to claim 1, wherein: and the file output module outputs the intermediate data generated by the script parsing module to a file with a specified format according to an intermediate data output mode defined in the programmable XML configuration script, wherein the specified format comprises one or more of binary system, TXT text, ini, par and XML.
6. An XML-based data generation tool development system according to claim 1, wherein: and the file output module outputs the intermediate data generated by the script parsing module to a file with a specified format according to an intermediate data output mode defined in the programmable XML configuration script, wherein the specified format comprises one or more of binary system, TXT text, ini, par and XML.
7. An XML-based data generation tool development system according to claim 1, wherein: the class mapping module is used for automatically converting the intermediate data nodes appointed in the programmable XML configuration script into corresponding C # data classes for the use of a task processor generated during system expansion before the system runs according to the data mapping mode defined in the XML script syntax.
8. An XML-based data generation tool development system according to claim 1, wherein: the intelligent grammar prompting module is used for carrying out intelligent keyword prompting, user input tracking and intelligent function signature prompting built in the data parser module on the XML grammar defined by the system when the programmable XML configuration script is edited and typed.
9. An XML-based data generation tool development system according to claim 1, wherein: the system also comprises a general tool module which comprises a starting and calling interface of the system, a general data operation method model, a general input and output stream operation type model and a system abnormity tracking tool type model.
10. An XML-based data generation tool development system according to claim 1, wherein: the system also comprises a running log output module used for outputting the running log.
CN201910485783.XA 2019-06-05 2019-06-05 XML-based data generation tool development system Active CN110209389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910485783.XA CN110209389B (en) 2019-06-05 2019-06-05 XML-based data generation tool development system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910485783.XA CN110209389B (en) 2019-06-05 2019-06-05 XML-based data generation tool development system

Publications (2)

Publication Number Publication Date
CN110209389A CN110209389A (en) 2019-09-06
CN110209389B true CN110209389B (en) 2023-03-14

Family

ID=67791020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910485783.XA Active CN110209389B (en) 2019-06-05 2019-06-05 XML-based data generation tool development system

Country Status (1)

Country Link
CN (1) CN110209389B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111679867B (en) * 2020-05-29 2024-02-27 中国航空工业集团公司西安航空计算技术研究所 Method for generating configuration data of embedded system
CN114691486A (en) * 2020-12-30 2022-07-01 腾讯科技(深圳)有限公司 Program debugging method and device and computer equipment
CN114510298B (en) * 2022-04-20 2022-08-02 科大讯飞股份有限公司 Intelligent engine access and call method and related platform, device, equipment and medium
CN115291883B (en) * 2022-07-12 2023-05-05 湖南于一科技有限公司 Method for realizing development and operation of robot by custom script parser

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004355186A (en) * 2003-05-28 2004-12-16 Hitachi Ltd Method and device for supporting editing of input/output data of computing program
JP2005011082A (en) * 2003-06-19 2005-01-13 Dainippon Printing Co Ltd Xml structure conversion system, method, program and recording medium
CN101282345A (en) * 2008-03-03 2008-10-08 北京航空航天大学 Method for converting XML based on formalization description and state ontroller system
CN102609255A (en) * 2012-01-19 2012-07-25 中国科学院计算机网络信息中心 Generation method for Spring IOC (Inversion of Control) configuration file
CN107133024A (en) * 2016-02-29 2017-09-05 北京广联达正源兴邦科技有限公司 Business management system based on OSGI frameworks

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003526843A (en) * 1999-12-08 2003-09-09 クゥアルコム・インコーポレイテッド E-mail software and method and system for distributing advertisements to client devices
CA2360645C (en) * 2001-10-31 2006-03-07 Ibm Canada Limited-Ibm Canada Limitee Dynamic generic framework for distributed tooling
US20080154939A1 (en) * 2006-12-22 2008-06-26 Unisys Corporation Information transfer from object-oriented repository to relational database
JP4835859B2 (en) * 2007-02-15 2011-12-14 日本電気株式会社 State transition diagram creation device and state transition diagram creation method
WO2016160626A1 (en) * 2015-03-27 2016-10-06 Globallogic, Inc. Determining actions based on imputing meaning to sensed information in a distributed computing environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004355186A (en) * 2003-05-28 2004-12-16 Hitachi Ltd Method and device for supporting editing of input/output data of computing program
JP2005011082A (en) * 2003-06-19 2005-01-13 Dainippon Printing Co Ltd Xml structure conversion system, method, program and recording medium
CN101282345A (en) * 2008-03-03 2008-10-08 北京航空航天大学 Method for converting XML based on formalization description and state ontroller system
CN102609255A (en) * 2012-01-19 2012-07-25 中国科学院计算机网络信息中心 Generation method for Spring IOC (Inversion of Control) configuration file
CN107133024A (en) * 2016-02-29 2017-09-05 北京广联达正源兴邦科技有限公司 Business management system based on OSGI frameworks

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
《Automatic conversion of scientific data into canonical format》;Mariana Goranova;《2011 IEEE EUROCON - International Conference on Computer as a Tool》;20110427;全文 *
基于Spring Boot的信息化服务管理系统的设计与实现;莫秋晶;《电子技术与软件工程》;20181130;全文 *
整合ESMSH框架的Java EE应用架构;欧阳宏基;《计算机测量与控制》;20181231;全文 *

Also Published As

Publication number Publication date
CN110209389A (en) 2019-09-06

Similar Documents

Publication Publication Date Title
CN110222318B (en) XML-based data generation tool development method
CN110209389B (en) XML-based data generation tool development system
CN107273117B (en) Programming-friendly agile code automatic generation system
US7707553B2 (en) Computer method and system for automatically creating tests for checking software
CN106776343A (en) A kind of web application automated test tool and method
TW200412495A (en) A generic software testing system and mechanism
Bonfanti et al. Design and validation of a C++ code generator from abstract state machines specifications
CN110597501A (en) Natural language programming method and device based on strong static scripting language
CN116661756B (en) Object analysis method and device based on low-code DSL
US10824402B2 (en) Bytecode generation from UML models
Wu et al. Unit testing for domain-specific languages
Rahman et al. A DSL for importing models in a requirements management system
CN115794254A (en) Component research and development management platform and method based on cloud computing
Granda et al. Towards a Model-Driven Testing Framework for GUI Test Cases Generation from User Stories.
Gargantini et al. A metamodel-based simulator for ASMs
Pomante et al. A model-driven approach for the development of an ide for spacecraft on-board software
Barroca et al. Integrating a neutral action language in a devs modelling environment
Zeiß A refactoring tool for TTCN-3
Itsykson Partial specifications of libraries: Applications in software engineering
Pereira et al. Development of self-diagnosis tests system using a DSL for creating new test suites for integration in a cyber-physical system
Graf et al. Gaining insight into executable models during runtime: Architecture and mappings
Schulz Integrating performance tests in a generative software development platform
CN116166567B (en) Test case generation method and device based on graphic programming
Reyes et al. Siddhartha: a method for developing domain-specific test driver generators
Janssen Transforming Source Code into Symbolic Transition Systems for Practical Model-Based Testing

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
GR01 Patent grant