CN112699279B - Method, device, equipment and storage medium for automatically processing components - Google Patents

Method, device, equipment and storage medium for automatically processing components Download PDF

Info

Publication number
CN112699279B
CN112699279B CN202011629591.0A CN202011629591A CN112699279B CN 112699279 B CN112699279 B CN 112699279B CN 202011629591 A CN202011629591 A CN 202011629591A CN 112699279 B CN112699279 B CN 112699279B
Authority
CN
China
Prior art keywords
component
file
components
template
syntax tree
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
CN202011629591.0A
Other languages
Chinese (zh)
Other versions
CN112699279A (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.)
Bigo Technology Pte Ltd
Original Assignee
Bigo Technology Pte 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 Bigo Technology Pte Ltd filed Critical Bigo Technology Pte Ltd
Priority to CN202011629591.0A priority Critical patent/CN112699279B/en
Publication of CN112699279A publication Critical patent/CN112699279A/en
Application granted granted Critical
Publication of CN112699279B publication Critical patent/CN112699279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/904Browsing; Visualisation therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for automatically processing components, wherein the method comprises the following steps: acquiring locally stored component management data, and analyzing the component management data to obtain a template file and a script file; analyzing the template file and the script file to generate an abstract syntax tree; traversing the abstract syntax tree, and carrying out information screening according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of preset type information; substituting the plurality of pieces of preset type information into a preset document template, and outputting a visual display interface; monitoring the components displayed in the visual display interface, and when the components are detected to be called, generating visual case parameters according to a calling result for storage.

Description

Method, device, equipment and storage medium for automatically processing components
Technical Field
Embodiments of the present application relate to the field of computers, and in particular, to a method, an apparatus, a device, and a storage medium for automatically processing a component.
Background
In the project research and development process, project engineering is a systematic, modularized and standardized process, which can help developers to improve the production efficiency of coding, testing and maintenance stages and reduce the cost for enterprises. Writing detailed development documents, visualization cases, and test cases is an important step in project engineering. In the project engineering process of the front end, modularization enables the components to become low-coupling and high-cohesion, and effective component management is very important.
However, in the prior art, although the developer can implement the above engineering process by using the corresponding tool library, the developer is basically required to write or operate manually and is relatively independent, so that additional development and maintenance costs are caused, and the effect is poor.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for automatically processing components, which improve the research, development and maintenance efficiency of projects and reduce the cost.
In a first aspect, an embodiment of the present invention provides a method for automatically processing a component, where the method includes:
Acquiring locally stored component management data, and analyzing the component management data to obtain a template file and a script file;
analyzing the template file and the script file to generate an abstract syntax tree;
Traversing the abstract syntax tree, and carrying out information screening according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of preset type information;
Substituting the plurality of pieces of preset type information into a preset document template, and outputting a visual display interface;
Monitoring the components displayed in the visual display interface, and generating visual case parameters according to a calling result to store when the components are detected to be called.
In a second aspect, an embodiment of the present invention further provides an apparatus for automatically processing a component, where the apparatus includes:
The data analysis module is used for acquiring locally stored component management data, and analyzing the component management data to obtain a template file and a script file;
The grammar tree generation module is used for analyzing the template file and the script file to generate an abstract grammar tree;
the information generation module is used for traversing the abstract syntax tree, and carrying out information screening according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of preset type information;
the display interface generation module is used for substituting the plurality of preset type information into a preset document template and outputting a visual display interface;
And the component monitoring module is used for monitoring the components displayed in the visual display interface, and generating visual case parameters according to a calling result to store when the components are detected to be called.
In a third aspect, an embodiment of the present invention further provides a component automation processing apparatus, including:
One or more processors;
Storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the component automation processing method according to the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the component automation processing method according to the embodiments of the present invention.
In the embodiment of the invention, the module management data is acquired and is analyzed to obtain a template file and a script file, the template file and the script file are analyzed to generate an abstract syntax tree, the abstract syntax tree is traversed, information screening is carried out according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of preset type information, the plurality of preset type information is substituted into a preset document template, and a visual display interface is output; monitoring the components displayed in the visual display interface, and when the components are detected to be called, generating visual case parameters according to a calling result to store, so that the project research, development and maintenance efficiency is improved, and the cost is reduced.
Drawings
FIG. 1 is a flow chart of a method for automated processing of a component according to an embodiment of the present invention;
FIG. 1a is a flowchart of a method for parsing a template file and a script file according to an embodiment of the present invention;
FIG. 2 is a flow chart of another method for automated processing of a component according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for automated processing of a component according to an embodiment of the present invention;
FIG. 4 is a block diagram of an automated component handling apparatus according to an embodiment of the present invention;
Fig. 5 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in further detail below with reference to the drawings and examples. It should be understood that the particular embodiments described herein are illustrative only and are not limiting of embodiments of the invention. It should be further noted that, for convenience of description, only some, but not all of the structures related to the embodiments of the present invention are shown in the drawings.
Fig. 1 is a flowchart of a component automation processing method provided in an embodiment of the present invention, where the embodiment is applicable to software project development, and manages project flows, and specifically includes the following steps:
Step S101, acquiring locally stored component management data, and analyzing the component management data to obtain a template file and a script file.
The component management data may be a locally stored code file related to each flow management of the component, which includes a document, a use case file, and the like, such as a vue format file. In one embodiment, a project folder is created in advance, and component management data is stored into the created folder. When the project runs, the files under the appointed directory are scanned, if the component management data of the file in vue format is scanned, the component management data is correspondingly obtained, and the component management data is analyzed. And if the component management data exists under the specified directory, executing a corresponding document generation flow to create the component management data and storing the component management data in the created folder.
In one embodiment, the component management data is parsed after being obtained to obtain a template file and a script file, and illustratively css source codes and the like can also be parsed. Specifically, the process of resolving the component management data to obtain the template file and the script file may be to separate the template file and the script file according to the tag block identifier in the code corresponding to the component management data. Illustratively, the template file is identified as < template > and the script file is identified as < script > and </script >, i.e., code content between the separated < template > and </template > is determined as the template file, and code content between the separated < script > and </script > is determined as the script file.
And step S102, analyzing the template file and the script file to generate an abstract syntax tree.
In one embodiment, the parsed template file and script file are parsed to generate an abstract syntax tree. Specifically, as shown in fig. 1a, fig. 1a is a flowchart of a method for parsing a template file and a script file according to an embodiment of the present invention, where the method includes:
And S1021, analyzing the template file through a regular expression to obtain a template abstract syntax tree. The template file is a character string representation, and is analyzed through a large number of regular expressions. The regular expression is also called a regular expression or a conventional expression, and uses a single character string to describe and match a series of character strings conforming to a certain syntax rule. In the step, the sub-character strings are extracted from the character strings of the template file through the set regular expression based on pattern matching, and then the corresponding abstract syntax tree is generated.
The abstract syntax tree is also called syntax tree, and is a tree representation form of an abstract syntax structure of the source code. And expressing the sub-character strings obtained through analysis in a grammar tree form, wherein the template is compiled into an abstract grammar tree in the mount process of the vue file, and each node element of the generated abstract grammar tree corresponds to a corresponding type attribute.
And step S1022, analyzing the script file through a set compiler to obtain a script abstract syntax tree. In one embodiment, the script file is parsed by the set compiler plugin babel/partner to obtain a script abstract syntax tree, wherein the role of the compiler plugin babel/partner is to realize the conversion from the source code to the abstract syntax tree, and the corresponding execution is performed before use: npm sample@babel/parser.
The order of execution of the steps S1021 and S1022 is not limited, and the steps S1021 and S1022 may be executed after the step S1021 is executed, or the steps S1022 may be executed after the step S1021 is executed, and it is preferable that the steps S1021 and S1022 are executed in parallel.
Step S103, traversing the abstract syntax tree, and carrying out information screening according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of pieces of preset type information.
In one embodiment, each node element of the constructed abstract syntax tree corresponds to a corresponding type attribute, and in the process of traversing the abstract syntax tree, information screening is performed according to the type attribute to obtain a plurality of preset type information. Exemplary, the preset type information includes slot (slot) information and information corresponding to different attributes in the script file, such as method information, props information, event information, and the like corresponding to the attributes such as method, tips, events, and the like. The slot information can be understood as "pit-occupying", that is, a specific position is occupied in the component template, when the corresponding component label is used, the content in the component label can be automatically stuffed (that is, the information of the < slot > position in the component template is replaced); the method information is encapsulated function set data, props and the events attribute information are information related to communication between parent and child components. In one embodiment, after various preset types of information are obtained, they are integrated, for example, integrated into a code file and transmitted to a preset document template.
And step S104, substituting the plurality of pieces of preset type information into a preset document template, and outputting a visual display interface.
The preset document template is a preset file which can be multiplexed by a plurality of different component management data, different tag blocks and related attribute parameters are arranged in the preset document template, and the obtained preset type information is correspondingly brought into the preset document template and then is output through a visual display interface. Illustratively, method information, props information and events information are correspondingly carried in a < script > tag block in a preset template.
And step 105, monitoring the components displayed in the visual display interface, and generating visual case parameters according to a calling result to store when the components are detected to be called.
In one embodiment, one or more components are displayed through a visual display interface, and the one or more components are monitored, and the components may be buttons, text, lists, etc. by way of example, and may be any multiplexing component in software development capable of visual display. Correspondingly, when the component is detected to be called, generating a visual use case parameter according to a calling result for storage, so as to be used for subsequent visual viewing.
According to the scheme, the module management data are acquired and are analyzed to obtain the template file and the script file, the abstract grammar tree is further analyzed to generate the abstract grammar tree, the abstract grammar tree is traversed to obtain a plurality of preset types of information and substituted into the preset document template, the visual display interface is output, visual display of the module management data is realized, management and maintenance are convenient, meanwhile, the modules displayed in the visual display interface are monitored, when the modules are detected to be called, the visual case parameters are generated according to the calling result to be stored, the project development efficiency is improved, and developers can quickly and conveniently develop projects.
Fig. 2 is a flowchart of another method for automatically processing a component according to an embodiment of the present invention, which provides a specific manner of monitoring a component displayed in a visual display interface. As shown in fig. 2, the technical scheme is as follows:
Step S201, obtaining locally stored component management data, and analyzing the component management data to obtain a template file and a script file.
And step S202, analyzing the template file and the script file to generate an abstract syntax tree.
Step 203, traversing the abstract syntax tree, and performing information screening according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of preset type information.
And S204, substituting the plurality of pieces of preset type information into a preset document template, and outputting a visual display interface.
Step 205, determining a view file address corresponding to the visual display interface, acquiring a view file corresponding to the visual display interface according to the view file address, and traversing all components contained in the view file.
In one embodiment, after a visual display interface containing components is generated, determining a view file address corresponding to the visual display interface, storing a view file of the visual display interface in the view file address, and traversing all components contained in the view file. Illustratively, each component corresponds to a unique identifier or name, and the identifiers or names of the contained components are traversed.
And S206, if the components consistent with the records in the visualized component list are detected, determining the components as monitoring components, monitoring the data transmission values of the monitoring components, and generating and storing the visualized use case parameters according to the calling result when the change of the data transmission values is detected.
In one embodiment, a corresponding list of visual components may be generated for the components to be monitored, illustratively with the identification or name of the components to be monitored recorded. In the process of traversing the components contained in the current view file, determining whether components recorded in the visualized component list exist, if so, determining the components as monitoring components, and monitoring the calling condition of the components.
In one embodiment, the monitoring mode is to monitor the data transmission value of the monitoring component, and when the change of the data transmission value is detected, the visualized use case parameter is generated according to the calling result and stored. Taking a visual interface component generated by component management data in vue format as an example, deep monitoring is performed on props attribute values, and when props values change, the state or state of the component is indicated to change. Preferably, after detecting props value change, the local query is to store the use case corresponding to props value after change, if not, the visualized use case parameter is generated according to the calling result and stored. For example, taking a button control as an example, when the button control is invoked, the original shape is changed (such as height, width or overall shape), the change of props values is correspondingly monitored, and if the corresponding parameters of the changed control are not stored locally, the parameters of the control (i.e. the new use case) are stored locally.
According to the scheme, the view file address corresponding to the visual display interface is determined, the view file corresponding to the visual display interface is obtained according to the view file address, all components contained in the view file are traversed, if the components consistent with the records in the visual component list are detected, the components are determined to be monitoring components, visual monitoring of the components is achieved, if the components are changed, visual component use cases are locally stored, the development flow is optimized, the development period is saved, meanwhile, the monitoring efficiency can be remarkably improved by adopting a mode of monitoring data transfer value change, and meanwhile storage of new component use cases is facilitated.
On the basis of the above technical solution, after the modified data transfer value is stored, the method further includes: when a use case viewing instruction is detected, the stored modified data transfer value is transmitted to a corresponding component for visual display. For example, a visual use case viewer is started, a click operation instruction to a component is detected, and a locally stored corresponding use case parameter is transmitted to the component and displayed in response to the click operation instruction. In another embodiment, after saving the modified data transfer value, the method further comprises: when a component modification instruction is detected, recording the current modification parameters, performing deep copy processing on the original component parameters, modifying the copied component parameters according to the modification parameters, and transmitting the modified result into the component for visual display. The deep copy refers to copying the attribute of each level of the component object, and each copied component object is independently allocated with an independent memory space and cannot interfere with each other.
Fig. 3 is a flowchart of another method for automatically processing a component according to an embodiment of the present invention, and further includes a step of performing snapshot test processing before generating a visualization case parameter according to a call result for saving. As shown in fig. 3, the technical scheme is as follows:
Step 301, obtaining locally stored component management data, and analyzing the component management data to obtain a template file and a script file.
And step S302, analyzing the template file and the script file to generate an abstract syntax tree.
Step S303, traversing the abstract syntax tree, and carrying out information screening according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of preset type information.
And S304, substituting the plurality of pieces of preset type information into a preset document template, and outputting a visual display interface.
Step 305, determining a view file address corresponding to the visual display interface, acquiring a view file corresponding to the visual display interface according to the view file address, and traversing all components contained in the view file.
And step S306, if the components which are consistent with the records in the visualized component list are detected, determining the components as monitoring components, and monitoring the data transmission values of the monitoring components.
Step S307, when detecting the change of the data transfer value, determining whether the called component is a set fixed mode component, if so, executing step S308, otherwise, executing step S309.
Wherein the fixed pattern component is a component whose form or state must be single.
Step S308, recording a document object model structure of the called component, and comparing the document object model structure with a prestored stable document object model structure.
In one embodiment, the snapshot test processing may be performed by recording a document object model structure (i.e., a dom structure) of the invoked component, comparing the document object model structure with a pre-stored stable document object model structure, and if the structure comparison is consistent, determining that the snapshot test is successful. If the comparison results find inconsistent, the snapshot test process is defined as failed.
In one embodiment, before the snapshot test process, the method further comprises the step of setting a fixed mode component, specifically: and checking the visual use cases, setting the testing state of the component, designating only one stable version use case as an expectation, and storing the version component which corresponds to the stable document object model structure for subsequent comparison operation.
Step S310, determining whether the snapshot test processing is successful or not according to the comparison result, if so, executing step S309, otherwise, executing step S311.
Step S309, generating the visualized use case parameters according to the calling result and storing the visualized use case parameters.
Step S311, the operation of generating the visualization case and saving the parameters is not performed.
According to the scheme, when the change of the data transfer value is detected, whether the called component is a set fixed mode component is determined, if so, the document object model structure of the called component is recorded, the document object model structure is compared with the pre-stored stable document object model structure, and the visualized use case parameters are generated according to the calling result and stored according to the condition of successful snapshot test, namely, the snapshot test processing is added for the unalterable component, so that unexpected error is prevented, the project development error rate is reduced, the project research, development and maintenance efficiency is improved, and the cost is reduced.
It should be noted that, the steps S301 to S304 may be separately executed to implement the visual interface display of the component management data. Step S205 and step S206 may be performed separately to monitor the components after visualization processing and display in different projects, including subsequent steps of visual viewing of the components and real-time parameter modification. Steps S307 to S310 may be used as separate component snapshot test functions to ensure that the required form or state must be unique to the component.
Fig. 4 is a block diagram of an automated component handling device according to an embodiment of the present invention, where the device is configured to execute the automated component handling method according to the foregoing embodiment, and the device has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 4, the apparatus specifically includes: a data parsing module 101, a syntax tree generation module 102, an information generation module 103, a display interface generation module 104, and a component listening module 105, wherein,
The data analysis module 101 is configured to obtain locally stored component management data, and analyze the component management data to obtain a template file and a script file;
the grammar tree generating module 102 is used for analyzing the template file and the script file to generate an abstract grammar tree;
The information generating module 103 is configured to traverse the abstract syntax tree, and perform information screening according to type attributes of node elements in the abstract syntax tree to obtain a plurality of preset type information;
the display interface generation module 104 is configured to substitute the plurality of preset type information into a preset document template, and output a visual display interface;
And the component monitoring module 105 is used for monitoring the components displayed in the visual display interface, and generating and storing the visual case parameters according to the calling result when the components are detected to be called.
According to the scheme, the module management data are acquired and locally stored, the module management data are analyzed to obtain a template file and a script file, the template file and the script file are analyzed to generate an abstract syntax tree, the abstract syntax tree is traversed, information screening is carried out according to type attributes of node elements in the abstract syntax tree to obtain a plurality of preset type information, the preset type information is substituted into a preset document template, and a visual display interface is output; monitoring the components displayed in the visual display interface, and when the components are detected to be called, generating visual case parameters according to a calling result to store, so that the project research, development and maintenance efficiency is improved, and the cost is reduced.
In one possible embodiment, the template file is composed of a character string, and the syntax tree generating module 102 is specifically configured to:
analyzing the template file through a regular expression to obtain a template abstract syntax tree;
and analyzing the script file through a set compiler to obtain a script abstract syntax tree.
In one possible embodiment, the preset type information includes slot information and information corresponding to different attributes in the script file.
In one possible embodiment, the component listening module 105 is specifically configured to:
determining a view file address corresponding to the visual display interface, and acquiring a view file corresponding to the visual display interface according to the view file address;
Traversing all components contained in the view file, and determining the components as monitoring components if the components consistent with the records in the visualized component list are detected;
and monitoring the data transmission value of the monitoring component.
In one possible embodiment, the component listening module 105 is specifically configured to:
when the change of the data transfer value is detected, determining whether an application corresponding to the changed data transfer value is stored locally, and if the application does not exist, storing the changed data transfer value.
In one possible embodiment, the apparatus further comprises a component view module 106 for:
after the changed data transfer value is stored, when a use case viewing instruction is detected, the stored changed data transfer value is transmitted to a corresponding component for visual display.
In one possible embodiment, the apparatus further comprises a component modification module 107 for:
After the changed data transmission value is stored, when a component modification instruction is detected, recording the current modification parameter, performing deep copy processing on the original component parameter, modifying the copied component parameter according to the modification parameter, and transmitting the modified result into the component for visual display.
In one possible embodiment, the apparatus further comprises a snapshot testing module 108 for:
Before generating the visual case parameters according to the calling result for storage, determining whether the called component is a set fixed mode component, if so, performing snapshot test processing, and correspondingly, generating the visual case parameters according to the calling result for storage, wherein the method comprises the following steps:
if the snapshot test processing is successful, generating the visualized use case parameters according to the calling result for storage.
In one possible embodiment, the snapshot testing module 107 is specifically configured to:
recording a document object model structure of the called component;
And comparing the document object model structure with a prestored stable document object model structure, and determining whether snapshot test processing is successful or not according to a comparison result.
Fig. 5 is a schematic structural diagram of an automated component handling device according to an embodiment of the present invention, and as shown in fig. 5, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device may be one or more, one processor 201 being taken as an example in fig. 5; the processor 201, memory 202, input devices 203, and output devices 204 in the apparatus may be connected by a bus or other means, for example in fig. 5. The memory 202 is a computer readable storage medium, and may be used to store software programs, computer executable programs, and modules, such as program instructions/modules corresponding to the automated processing method of components in the embodiments of the present invention. The processor 201 executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory 202, i.e., implements the above-described component automation processing method. The input means 203 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a component automation processing method, the method comprising:
Acquiring locally stored component management data, and analyzing the component management data to obtain a template file and a script file;
analyzing the template file and the script file to generate an abstract syntax tree;
Traversing the abstract syntax tree, and carrying out information screening according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of preset type information;
Substituting the plurality of pieces of preset type information into a preset document template, and outputting a visual display interface;
Monitoring the components displayed in the visual display interface, and generating visual case parameters according to a calling result to store when the components are detected to be called.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments of the present invention may be implemented by software and necessary general purpose hardware, and of course may be implemented by hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, where the instructions include a number of instructions for causing a computer device (which may be a personal computer, a service, or a network device, etc.) to perform the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the above-mentioned assembly automation processing device, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the embodiments of the present invention are not limited to the particular embodiments described herein, but are capable of numerous obvious changes, rearrangements and substitutions without departing from the scope of the embodiments of the present invention. Therefore, while the embodiments of the present invention have been described in connection with the above embodiments, the embodiments of the present invention are not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A method for automated assembly handling, comprising:
Acquiring locally stored component management data, and analyzing the component management data to obtain a template file and a script file;
analyzing the template file and the script file to generate an abstract syntax tree;
Traversing the abstract syntax tree, and carrying out information screening according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of preset type information;
Substituting the plurality of pieces of preset type information into a preset document template, and outputting a visual display interface;
Determining a view file address corresponding to the visual display interface, acquiring a view file corresponding to the visual display interface according to the view file address, traversing all components contained in the view file, determining the components as monitoring components if the components which are consistent with the records in the list of the visual components are detected, monitoring the data transmission values of the monitoring components, and generating the visual use case parameters according to the calling result to store when the components are detected to be called.
2. The automated component processing method of claim 1, wherein the template file is composed of a string, and the parsing the template file and the script file to generate an abstract syntax tree comprises:
analyzing the template file through a regular expression to obtain a template abstract syntax tree;
and analyzing the script file through a set compiler to obtain a script abstract syntax tree.
3. The component automation processing method according to claim 1 or 2, wherein the preset type information includes slot information and information corresponding to different attributes in the script file.
4. The method for automatically processing components according to claim 1, wherein when the components are detected to be called, generating and storing the visualized use case parameters according to the calling result comprises:
when the change of the data transfer value is detected, determining whether an application corresponding to the changed data transfer value is stored locally, and if the application does not exist, storing the changed data transfer value.
5. The component automation processing method of claim 4, further comprising, after storing the modified data transfer value:
When a use case viewing instruction is detected, the stored modified data transfer value is transmitted to a corresponding component for visual display.
6. The component automation processing method of claim 4, further comprising, after storing the modified data transfer value:
When a component modification instruction is detected, recording the current modification parameters, performing deep copy processing on the original component parameters, modifying the copied component parameters according to the modification parameters, and transmitting the modified result into the component for visual display.
7. The component automation processing method according to claim 1, further comprising, before generating the visualized use case parameter according to the call result for saving:
And determining whether the called component is a set fixed mode component, if so, carrying out snapshot test processing, and correspondingly, generating and storing the visualized use case parameters according to the calling result, wherein the method comprises the following steps of:
if the snapshot test processing is successful, generating the visualized use case parameters according to the calling result for storage.
8. The method of automated component handling according to claim 7, wherein performing a snapshot test process comprises:
recording a document object model structure of the called component;
And comparing the document object model structure with a prestored stable document object model structure, and determining whether snapshot test processing is successful or not according to a comparison result.
9. An automated component handling device, comprising:
The data analysis module is used for acquiring locally stored component management data, and analyzing the component management data to obtain a template file and a script file;
The grammar tree generation module is used for analyzing the template file and the script file to generate an abstract grammar tree;
the information generation module is used for traversing the abstract syntax tree, and carrying out information screening according to the type attribute of the node element in the abstract syntax tree to obtain a plurality of preset type information;
the display interface generation module is used for substituting the plurality of preset type information into a preset document template and outputting a visual display interface;
The component monitoring module is used for determining a view file address corresponding to the visual display interface, acquiring a view file corresponding to the visual display interface according to the view file address, traversing all components contained in the view file, determining the components as monitoring components if the components which are consistent with the records in the visual component list are detected, monitoring data transmission values of the monitoring components, and generating visual case parameters according to a calling result to store when the components are detected to be called.
10. The component automation processing device of claim 9, further comprising a snapshot test module to: before generating the visualized use case parameters according to the calling result to save, determining whether the called component is a set fixed mode component, and if so, performing snapshot test processing.
11. A component automation processing apparatus, the apparatus comprising: one or more processors; storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the component automated processing method of any of claims 1-8.
12. A storage medium containing computer executable instructions for performing the component automation processing method of any of claims 1-8 when executed by a computer processor.
CN202011629591.0A 2020-12-31 2020-12-31 Method, device, equipment and storage medium for automatically processing components Active CN112699279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011629591.0A CN112699279B (en) 2020-12-31 2020-12-31 Method, device, equipment and storage medium for automatically processing components

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011629591.0A CN112699279B (en) 2020-12-31 2020-12-31 Method, device, equipment and storage medium for automatically processing components

Publications (2)

Publication Number Publication Date
CN112699279A CN112699279A (en) 2021-04-23
CN112699279B true CN112699279B (en) 2024-06-18

Family

ID=75513423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011629591.0A Active CN112699279B (en) 2020-12-31 2020-12-31 Method, device, equipment and storage medium for automatically processing components

Country Status (1)

Country Link
CN (1) CN112699279B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114201236A (en) * 2021-12-14 2022-03-18 平安壹钱包电子商务有限公司 AST-based component configuration method, device, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508762A (en) * 2011-09-29 2012-06-20 用友软件股份有限公司 Data interaction control device and data interaction control method
CN110780874A (en) * 2019-10-25 2020-02-11 北京百度网讯科技有限公司 Method and apparatus for generating information

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9026903B1 (en) * 2011-01-11 2015-05-05 Google Inc. Abstract syntax tree interpreter for generating a valid HTML document
US10536523B2 (en) * 2014-05-11 2020-01-14 Microsoft Technology Licensing, Llc File service using a shared file access-rest interface
US10353701B2 (en) * 2014-09-29 2019-07-16 Sap Se Code analysis for cloud-based integrated development environments
CN108628746A (en) * 2018-05-04 2018-10-09 艺龙网信息技术(北京)有限公司 Automatic interface testing method and system
CN109189686A (en) * 2018-08-30 2019-01-11 中国平安人寿保险股份有限公司 Automation regression testing method, apparatus, storage medium and computer equipment
CN110609693B (en) * 2019-08-15 2023-05-26 深圳赛安特技术服务有限公司 Code updating method and device based on data standardization and terminal equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508762A (en) * 2011-09-29 2012-06-20 用友软件股份有限公司 Data interaction control device and data interaction control method
CN110780874A (en) * 2019-10-25 2020-02-11 北京百度网讯科技有限公司 Method and apparatus for generating information

Also Published As

Publication number Publication date
CN112699279A (en) 2021-04-23

Similar Documents

Publication Publication Date Title
US9747190B2 (en) Analysis system, analysis method, and computer program product
US5956513A (en) System and method for automated software build control
Xu et al. Largescale system problem detection by mining console logs
CN111736840A (en) Compiling method and running method of applet, storage medium and electronic equipment
CN110688307A (en) JavaScript code detection method, apparatus, device and storage medium
JP6163707B2 (en) Embedded device, program creation device, program
CN114138244A (en) Method and device for automatically generating model files, storage medium and electronic equipment
CN112699279B (en) Method, device, equipment and storage medium for automatically processing components
CN115904989A (en) Interface testing method, device, equipment and readable storage medium
JP2010140408A (en) Source code converting device
CN116088846A (en) Processing method, related device and equipment for continuous integrated code format
Deknop et al. A scalable log differencing visualisation applied to cobol refactoring
JP2020123268A (en) Debug support system, and debug support method
CN111126008A (en) XSD-based code generation method and device, computer equipment and storage medium
CN111488144A (en) Data processing method and equipment
JP2010140407A (en) Source code inspection device
US20040153871A1 (en) Automatic analysis of the properties of a system based on runtime logs
CN114385155A (en) vue project visualization tool generation method, device, equipment and storage medium
CN112783736B (en) Method and device for monitoring running body time of software component and electronic equipment
CN114371848A (en) Page joint debugging method, device, equipment and storage medium
CN114356783A (en) Method and device for automatically generating unit test code, storage medium and equipment
CN113760291A (en) Log output method and device
Dua et al. CGI based syslog management system for virtual machines
CN112416367A (en) Application resource change influence analysis system based on software reverse disassembly and analysis
JP2003303100A (en) Information processing system, method for constructing information processing system, and program therefor

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