CN114840210A - Data drive view realization method and device, electronic equipment and storage medium - Google Patents
Data drive view realization method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114840210A CN114840210A CN202210439838.5A CN202210439838A CN114840210A CN 114840210 A CN114840210 A CN 114840210A CN 202210439838 A CN202210439838 A CN 202210439838A CN 114840210 A CN114840210 A CN 114840210A
- Authority
- CN
- China
- Prior art keywords
- file
- data
- configuration
- configuration content
- native
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 68
- 238000011161 development Methods 0.000 claims abstract description 72
- 230000006870 function Effects 0.000 claims description 47
- 238000012544 monitoring process Methods 0.000 claims description 23
- 238000009877 rendering Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 11
- 238000013507 mapping Methods 0.000 claims description 10
- 230000008859 change Effects 0.000 claims description 6
- 230000008569 process Effects 0.000 abstract description 5
- 238000012545 processing Methods 0.000 abstract description 5
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000004891 communication Methods 0.000 description 8
- 238000007726 management method Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 230000001960 triggered effect Effects 0.000 description 3
- 238000012790 confirmation Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to a data processing technology, and discloses a method for realizing a data-driven view, which comprises the following steps: acquiring a front-end project, and identifying a development file directory address of the front-end project; inquiring a script language file in a directory address of the development file, and extracting configuration content; judging whether the configuration content is a native language file developed by using native component grammar according to a preset native component identification rule; when the configuration content is not a native language file, determining that the configuration content does not need to perform a project compilation operation; when the configuration content is a native language file, item compiling operation is performed on the configuration content by utilizing a pre-constructed native component compiling rule, and a data view is rendered by utilizing a pre-constructed data driving view tool. The invention also provides a device for realizing the data driving view, electronic equipment and a storage medium. The invention can optimize the realization process of the data driving view.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for implementing a data-driven view, an electronic device, and a storage medium.
Background
The data-driven view refers to that when data variables in the front-end framework development component are changed, the user interface automatically generates corresponding dynamic view changes along with the change of the input data variables, and a developer does not need to manually modify the data variables in the component to complete the generation of the view changes of the user interface.
The existing data-driven view is usually developed on the basis of some common functions by simultaneously using the syntax of the vue framework and the act framework, and the problem that the same application function develops a component comprising multiple frameworks is caused. Aiming at the problems, the grammar of the native components defined in the current web development standard is introduced, and the components developed by using the native component grammar can be directly used in a browser without compiling. However, compared to the framework component development, the component development is performed through the syntax of the native component, and the syntax of the native component is relatively simple, and the developer needs to develop more relevant codes in terms of coding to complete the functions that can be automatically realized in the framework originally because the developer does not have the characteristic of the data-driven view. Therefore, the conventional data-driven view performs view rendering after modifying the data variables in the frame component, is complicated in implementation process, and cannot simply complete the data view change work of large-scale data input into a project.
Disclosure of Invention
The invention provides a method and a device for realizing a data-driven view, electronic equipment and a storage medium, and mainly aims to optimize the realization process of the data-driven view.
In order to achieve the above object, the present invention provides a method for implementing a data-driven view, including:
acquiring a front-end project, and identifying a development file directory address of the front-end project;
inquiring a script language file in the development file directory address, and extracting configuration contents in the script language file;
judging whether the configuration content is a native language file developed by using native component grammar according to a preset native component identification rule;
when the configuration content is not a native language file developed by using native component grammar, judging that the configuration content does not need to execute project compiling operation;
and when the configuration content is a native language file developed by using native component grammar, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule, and rendering a data view by using a pre-constructed data driving view tool.
Optionally, the identifying a development file directory address of the front-end project includes:
inquiring the project name file group of the front-end project;
traversing the project name file group, and inquiring a development file suffix name in the project name file group;
and positioning the physical address of the suffix name of the development file to obtain the directory address of the development file.
Optionally, the querying a scripting language file in the development file directory address includes:
traversing the development files in the development file directory address;
identifying a programming language type of the development file;
and extracting a script language file in the development file according to the programming language type.
Optionally, the extracting the configuration content in the scripting language file includes:
indexing a configuration file in the scripting language file;
querying configuration items in the configuration file;
and extracting programming content information in the configuration items to obtain the configuration content.
Optionally, before the performing the item compilation operation on the configuration content using the pre-built native component compilation rule, the method further includes:
searching a page element ID in the configuration content;
searching a page template corresponding to the page element ID according to the page element ID;
extracting the template content of the page template, and inquiring whether a preset variable template exists in the template content;
and when the preset variable template exists in the template content, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule.
Optionally, the performing item compilation operations on the configuration content using the pre-built native component compilation rules includes:
configuring a monitoring file with data change in the configuration content according to a pre-constructed native component compiling rule;
configuring a preset monitoring method function in the monitoring file to obtain a monitoring configuration file;
and compiling the data variables in the configuration content into a preset data variable format by using the monitoring configuration file.
Optionally, the rendering the data view by using the pre-constructed data-driven view tool includes:
acquiring a data file transmitted into the configuration content;
loading the data file into a data variable in the configuration content, and inquiring the mapping relation between the data variable and a page element ID;
and rendering a data view by using a pre-constructed data driving view tool according to the mapping relation.
In order to solve the above problem, the present invention further provides an apparatus for implementing a data-driven view, the apparatus comprising:
the system comprises a configuration content acquisition module, a configuration content acquisition module and a configuration content management module, wherein the configuration content acquisition module is used for acquiring a front-end project and identifying a development file directory address of the front-end project; inquiring a script language file in the development file directory address, and extracting configuration contents in the script language file;
the component judgment module is used for judging whether the configuration content is a native language file developed by utilizing a native component grammar according to a preset native component identification rule;
the data driving view realization module is used for judging that the configuration content does not need to execute project compiling operation when the configuration content is not a native language file developed by utilizing a native component grammar; when the configuration content is a native language file developed by using a native component grammar, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule, and rendering a data view by using a pre-constructed data driving view tool.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method for implementing a data-driven view as described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the implementation method of the data-driven view described above.
The embodiment of the invention can obtain specific files of each project component in the front-end project by identifying the development file directory address of the front-end project and inquiring the script language file in the development file directory address, can accurately identify whether the configuration content is the native language file developed by using the native component grammar or not by extracting the configuration content in the script language file and identifying the configuration content according to the preset native component identification rule, can execute project compiling operation on the configuration content by using the pre-constructed native component compiling rule when the configuration content is the native language file developed by using the native component grammar, and can complete the rendering of the data view by using the pre-constructed data driving view tool to complete the optimization of the implementation method of the data driving view.
Drawings
Fig. 1 is a schematic flow chart of a method for implementing a data-driven view according to an embodiment of the present invention;
FIG. 2 is a detailed flowchart illustrating a step in a method for implementing a data-driven view according to an embodiment of the present invention;
FIG. 3 is a functional block diagram of an apparatus for implementing a data-driven view according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device for implementing the method for implementing the data-driven view according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a method for realizing a data-driven view. The execution subject of the implementation method of the data-driven view includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server, a terminal, and the like. In other words, the implementation method of the data-driven view may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flow chart of a method for implementing a data-driven view according to an embodiment of the present invention. In this embodiment, the method for implementing the data-driven view includes the following steps S1-S5:
and S1, acquiring the front-end project and identifying the development file directory address of the front-end project.
In the embodiment of the present invention, the front-end item refers to an item developed by using a syntax of vue framework and exact framework, wherein the front-end item is generally composed of a plurality of front-end components. For example, the front-end item may be a network transaction item, where the network transaction item includes an order confirmation component, an order payment component, an order completion component, and other network transaction components.
In the embodiment of the present invention, the development file directory address refers to a physical address of a development file written in an vue frame with a js suffix under the root directory of the front-end project.
According to the embodiment of the invention, the configuration of the content of the configuration file can be accurately completed in the front-end project by identifying the development file directory address of the front-end project.
As an embodiment of the present invention, the identifying a development file directory address of the front-end project includes: inquiring the project name file group of the front-end project; traversing the project name file group, and inquiring a development file suffix name in the project name file group; and positioning the physical address of the suffix name of the development file to obtain the directory address of the development file.
S2, inquiring the script language file in the development file directory address, and extracting the configuration content in the script language file.
In the embodiment of the present invention, the scripting language file refers to a program file written in a scripting language and capable of being interacted with by a computer, where the scripting language file may be JavaScript, VBscript, or the like.
In the embodiment of the present invention, the configuration file content refers to data content configured for data objects of each component in the front-end project. For example, the preset configuration file content may be content such as a method function of a native component object, a class method function of a native component object, and a front-end project page element ID.
In detail, the querying a scripting language file in the development file directory address includes: traversing the development files in the development file directory address; identifying a programming language type of the development file; and extracting a script language file in the development file according to the programming language type.
Further, the querying the configuration content in the script language file includes: indexing a configuration file in the scripting language file; querying configuration items in the configuration file; and extracting programming content information in the configuration items to obtain the configuration content.
And S3, judging whether the configuration content is a native language file developed by using a native component grammar according to a preset native component identification rule.
In the embodiment of the invention, the preset native component identification rule is a component identification rule for judging whether a development component in a front-end project is a native component grammar to develop, wherein the native component grammar is a native component grammar defined in a web development standard, and the component developed by using the native component grammar can be directly used in a browser without compiling.
According to the embodiment of the invention, whether the configuration content is the native language file defined by the native component grammar is judged according to the preset native component identification rule, so that the native language file in the configuration content can be accurately identified.
As an embodiment of the present invention, the determining whether the configuration content is a native language file developed by using a native component grammar according to a preset native component recognition rule includes: respectively inquiring whether a preset custom element object and a preset native component method function exist in the configuration content; when any one of the preset custom element object and the preset native component class method function does not exist in the configuration content, the configuration content is not a native language file developed by utilizing a native component grammar; and when the preset custom element object and the preset native component class method function exist in the configuration content at the same time, judging that the configuration content is a native language file developed by utilizing native component grammar.
In the embodiment of the present invention, the preset custom element object refers to a customElements object under a browser window object, and a method function define of a native component may be defined by using the preset custom element object, and the definition of a native component is completed by using the method function define.
In an embodiment of the present invention, the preset native component method function refers to a page element method function HTMLElement defined in a native component, where a function format of the page element method function HTMLElement is: class name extensions HTMLElement.
And S4, when the configuration content is not a native language file developed by using a native component grammar, judging that the configuration content does not need to execute project compiling operation.
And S5, when the configuration content is a native language file developed by using a native component grammar, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule, and rendering a data view by using a pre-constructed data driving view tool.
In the embodiment of the present invention, the pre-constructed native component compiling rule refers to a configuration rule for initializing a variable file in a native component file, where the pre-constructed native component compiling rule includes, but is not limited to, a get configuration item rule, a set configuration item rule, a deleteProperty configuration item rule, and the like. For example, the get configuration item rule refers to a get configuration function triggered when a specific monitored data value in a native component file is obtained, and the get configuration function receives three parameters, namely a monitored object, a field name, and an object with a monitoring function after being monitored; the set configuration item rule refers to a set configuration function triggered when specific monitored data is modified, and the set configuration function receives four parameters, namely a monitored object, a field name, a value corresponding to a field to be modified and an object with a monitoring function after monitoring treatment; the deletepity configuration item rule refers to a deletepity configuration function triggered when specific monitored data is deleted, and the deletepity configuration function receives two parameters, namely a monitored object and a field name to be deleted.
In detail, referring to fig. 2, before performing item compilation operations on the configuration content using pre-built native component compilation rules when the configuration content is a native language file developed using native component syntax, the method further includes the following steps S20-S23:
s20, searching a page element ID in the configuration content;
s21, searching a page template corresponding to the page element ID according to the page element ID;
s22, extracting the template content of the page template, and inquiring whether a preset variable template exists in the template content;
and S23, when the preset variable template exists in the template content, executing item compiling operation on the configuration content.
In the embodiment of the present invention, the preset variable template refers to a configuration form of a data variable in a component. For example, the variable template may be { { variable } }, where the variable in the form of double braces indicates that the variable can be modified by a preconfigured mapping function.
In detail, the performing item compilation operations on the configuration content using the pre-built native component compilation rules includes: configuring a monitoring file with data change in the configuration content according to a pre-constructed native component compiling rule; configuring the monitoring files by using a preset monitoring method function to obtain monitoring configuration files; and compiling the data variables in the configuration content into a preset data variable format by using the monitoring configuration file.
In an embodiment of the present invention, the rendering a data view by using a pre-constructed data-driven view tool includes: acquiring a data file transmitted into the configuration content; loading the data file into a data variable in the configuration content, and inquiring the mapping relation between the data variable and a page element ID; and rendering a data view by utilizing a pre-constructed data driving view tool according to the mapping relation.
The embodiment of the invention can obtain specific files of each project component in the front-end project by identifying the development file directory address of the front-end project and inquiring the script language file in the development file directory address, can accurately identify whether the configuration content is the native language file developed by using the native component grammar by extracting the configuration content in the script language file and identifying the configuration content according to the preset native component identification rule, can execute project compiling operation on the configuration content by using the pre-constructed native component compiling rule when the configuration content is the native language file developed by using the native component grammar, and can complete data view rendering by using the pre-constructed data driving view tool to complete optimization of the implementation method of the data driving view.
Fig. 2 is a functional block diagram of an apparatus for implementing a data-driven view according to an embodiment of the present invention.
The data-driven view implementation apparatus 100 of the present invention can be installed in an electronic device. According to the implemented functions, the device 100 for implementing a data-driven view may include a configuration content obtaining module 101, a component determining module 102, and a data-driven view implementing module 103. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the configuration content obtaining module 101 is configured to obtain a front-end project and identify a development file directory address of the front-end project; inquiring a script language file in the development file directory address, and extracting configuration contents in the script language file;
in the embodiment of the present invention, the front-end item refers to an item developed by using a syntax of vue framework and a exact framework, wherein the front-end item is generally composed of a plurality of front-end components. For example, the front-end item may be a network transaction item, where the network transaction item includes an order confirmation component, an order payment component, an order completion component, and other network transaction components.
In the embodiment of the present invention, the development file directory address refers to a physical address of a development file written in an vue frame with a js suffix under the root directory of the front-end project.
According to the embodiment of the invention, the configuration of the content of the configuration file can be accurately completed in the front-end project by identifying the development file directory address of the front-end project.
As an embodiment of the present invention, the identifying a development file directory address of the front-end project includes: inquiring the project name file group of the front-end project; traversing the project name file group, and inquiring a development file suffix name in the project name file group; and positioning the physical address of the suffix name of the development file to obtain the directory address of the development file.
In the embodiment of the present invention, the scripting language file refers to a program file written in a scripting language and capable of being interacted with by a computer, where the scripting language file may be JavaScript, VBscript, or the like.
In the embodiment of the present invention, the configuration file content refers to data content configured for data objects of each component in the front-end project. For example, the preset configuration file content may be content such as a method function of a native component object, a class method function of a native component object, and a front-end project page element ID.
In detail, the querying a scripting language file in the development file directory address includes: traversing the development files in the development file directory address; identifying a programming language type of the development file; and extracting a script language file in the development file according to the programming language type.
Further, the querying the configuration content in the script language file includes: indexing a configuration file in the scripting language file; querying configuration items in the configuration file; and extracting programming content information in the configuration items to obtain the configuration content.
The component judgment module 102 is configured to judge whether the configuration content is a native language file developed by using a native component grammar according to a preset native component recognition rule;
in the embodiment of the invention, the preset native component identification rule is a component identification rule for judging whether a development component in a front-end project is a native component grammar to develop, wherein the native component grammar is a native component grammar defined in a web development standard, and the component developed by using the native component grammar can be directly used in a browser without compiling.
According to the embodiment of the invention, whether the configuration content is the native language file defined by the native component grammar is judged according to the preset native component identification rule, so that the native language file in the configuration content can be accurately identified.
As an embodiment of the present invention, the determining whether the configuration content is a native language file developed by using a native component grammar according to a preset native component recognition rule includes: respectively inquiring whether a preset custom element object and a preset native component method function exist in the configuration content; when any one of the preset custom element object and the preset native component class method function does not exist in the configuration content, the configuration content is not a native language file developed by utilizing a native component grammar; and when the preset custom element object and the preset native component class method function exist in the configuration content at the same time, judging that the configuration content is a native language file developed by utilizing native component grammar.
In the embodiment of the present invention, the preset custom element object refers to a customElements object under a browser window object, and a method function define of a native component may be defined by using the preset custom element object, and the definition of a native component is completed by using the method function define.
In an embodiment of the present invention, the preset native component method function refers to a page element method function HTMLElement defined in a native component, where a function format of the page element method function HTMLElement is: class name extensions HTMLElement.
The data-driven view implementation module 103 is configured to determine that the configuration content does not need to perform a project compiling operation when the configuration content is not a native language file developed by using a native component grammar; and when the configuration content is a native language file developed by using native component grammar, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule, and rendering a data view by using a pre-constructed data driving view tool.
When the configuration content is not a native language file developed using native component syntax, determining that the configuration content does not require execution of a project compilation operation.
In the embodiment of the present invention, before performing a project compiling operation on the configuration content by using the pre-constructed native component compiling rule when the configuration content is a native language file developed by using a native component grammar, the method further includes: searching a page element ID in the configuration content; searching a page template corresponding to the page element ID according to the page element ID; extracting the template content of the page template, and inquiring whether a preset variable template exists in the template content; and when the preset variable template exists in the template content, executing item compiling operation on the configuration content.
In the embodiment of the present invention, the preset variable template refers to a configuration form of a data variable in a component. For example, the variable template may be { { variable } }, where the variable in the form of double braces indicates that the variable can be modified by a preconfigured mapping function.
In detail, the performing item compilation operations on the configuration content using the pre-built native component compilation rules includes: configuring a monitoring file with data change in the configuration content according to a pre-constructed native component compiling rule; configuring the monitoring files by using a preset monitoring method function to obtain monitoring configuration files; and compiling the data variables in the configuration content into a preset data variable format by using the monitoring configuration file.
In an embodiment of the present invention, the rendering a data view by using a pre-constructed data-driven view tool includes: acquiring a data file transmitted into the configuration content; loading the data file into a data variable in the configuration content, and inquiring the mapping relation between the data variable and a page element ID; and rendering a data view by utilizing a pre-constructed data driving view tool according to the mapping relation.
Fig. 3 is a schematic structural diagram of an electronic device for implementing a method for implementing a data-driven view according to an embodiment of the present invention.
The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may further include a computer program, such as an implementation program of a data driven view, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, executes or executes programs or modules (for example, implementation programs for executing data-driven views, and the like) stored in the memory 11, and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of implementation programs of data-driven views, etc., but also to temporarily store data that has been output or is to be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The implementation program of the data-driven view stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, and when running in the processor 10, can implement:
acquiring a front-end project, and identifying a development file directory address of the front-end project;
inquiring a script language file in the development file directory address, and extracting configuration contents in the script language file;
judging whether the configuration content is a native language file developed by using native component grammar according to a preset native component identification rule;
when the configuration content is not a native language file developed by using native component grammar, judging that the configuration content does not need to execute project compiling operation;
and when the configuration content is a native language file developed by using native component grammar, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule, and rendering a data view by using a pre-constructed data driving view tool.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a front-end project, and identifying a development file directory address of the front-end project;
inquiring a script language file in the development file directory address, and extracting configuration contents in the script language file;
judging whether the configuration content is a native language file developed by using native component grammar according to a preset native component identification rule;
when the configuration content is not a native language file developed by using native component grammar, judging that the configuration content does not need to execute project compiling operation;
and when the configuration content is a native language file developed by using native component grammar, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule, and rendering a data view by using a pre-constructed data driving view tool.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims (10)
1. A method for implementing a data-driven view, the method comprising:
acquiring a front-end project, and identifying a development file directory address of the front-end project;
querying a script language file in the development file directory address, and extracting configuration contents in the script language file;
judging whether the configuration content is a native language file developed by using native component grammar according to a preset native component identification rule;
when the configuration content is not a native language file developed using native component syntax, determining that the configuration content does not require execution of a project compilation operation;
and when the configuration content is a native language file developed by using native component grammar, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule, and rendering a data view by using a pre-constructed data driving view tool.
2. The method for implementing a data driven view of claim 1, wherein said identifying a development file directory address for said front-end project comprises:
inquiring the project name file group of the front-end project;
traversing the project name file group, and inquiring a development file suffix name in the project name file group;
and positioning the physical address of the suffix name of the development file to obtain the directory address of the development file.
3. The method for implementing a data driven view according to claim 1, wherein said querying a scripting language file in the development file directory address comprises:
traversing the development files in the development file directory address;
identifying a programming language type of the development file;
and extracting a script language file in the development file according to the programming language type.
4. The method for implementing a data-driven view according to claim 1, wherein the extracting configuration contents in the script language file comprises:
indexing a configuration file in the scripting language file;
querying configuration items in the configuration file;
and extracting programming content information in the configuration items to obtain the configuration content.
5. The method for implementing a data-driven view of claim 1, wherein prior to performing an item compilation operation on the configuration content using the pre-built native component compilation rules, the method further comprises:
searching a page element ID in the configuration content;
searching a page template corresponding to the page element ID according to the page element ID;
extracting the template content of the page template, and inquiring whether a preset variable template exists in the template content or not;
and when the preset variable template exists in the template content, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule.
6. The method for implementing a data-driven view according to claim 1, wherein the performing an item compilation operation on the configuration content using the pre-built native component compilation rules comprises:
configuring a monitoring file with data change in the configuration content according to a pre-constructed native component compiling rule;
configuring a preset monitoring method function in the monitoring file to obtain a monitoring configuration file;
and compiling the data variables in the configuration content into a preset data variable format by using the monitoring configuration file.
7. The method for implementing data-driven view as claimed in claim 1, wherein the rendering the data view by using the pre-constructed data-driven view tool comprises:
acquiring a data file transmitted into the configuration content;
loading the data file into a data variable in the configuration content, and inquiring the mapping relation between the data variable and a page element ID;
and rendering a data view by utilizing a pre-constructed data driving view tool according to the mapping relation.
8. An apparatus for implementing a data-driven view, the apparatus comprising:
the system comprises a configuration content acquisition module, a configuration content acquisition module and a configuration content management module, wherein the configuration content acquisition module is used for acquiring a front-end project and identifying a development file directory address of the front-end project; inquiring a script language file in the development file directory address, and extracting configuration contents in the script language file;
the component judgment module is used for judging whether the configuration content is a native language file developed by utilizing a native component grammar according to a preset native component identification rule;
the data driving view realization module is used for judging that the configuration content does not need to execute project compiling operation when the configuration content is not a native language file developed by utilizing a native component grammar; and when the configuration content is a native language file developed by using native component grammar, performing project compiling operation on the configuration content by using a pre-constructed native component compiling rule, and rendering a data view by using a pre-constructed data driving view tool.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform a method of implementing a data-driven view as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements a method for implementing a data-driven view as claimed in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210439838.5A CN114840210A (en) | 2022-04-25 | 2022-04-25 | Data drive view realization method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210439838.5A CN114840210A (en) | 2022-04-25 | 2022-04-25 | Data drive view realization method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114840210A true CN114840210A (en) | 2022-08-02 |
Family
ID=82566021
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210439838.5A Pending CN114840210A (en) | 2022-04-25 | 2022-04-25 | Data drive view realization method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114840210A (en) |
-
2022
- 2022-04-25 CN CN202210439838.5A patent/CN114840210A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113238929B (en) | Code testing method and device based on Mock data, electronic equipment and storage medium | |
CN112486490B (en) | Front-end code packaging method and device, electronic equipment and storage medium | |
CN114020256A (en) | Front-end page generation method, device and equipment and readable storage medium | |
CN113377661A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN112162748A (en) | Application program home page configuration method and device, electronic equipment and readable storage medium | |
CN115048111A (en) | Code generation method, device, equipment and medium based on metadata | |
CN114489861A (en) | Target component conversion method and device, electronic equipment and readable storage medium | |
CN114385497A (en) | Test environment generation method and device, electronic equipment and storage medium | |
CN114398282A (en) | Test script generation method, device, equipment and storage medium | |
CN113434542A (en) | Data relation identification method and device, electronic equipment and storage medium | |
CN112214256A (en) | Operation control method and device for machine learning, electronic equipment and storage medium | |
CN111625236A (en) | Front-end development method and device based on componentization, electronic equipment and storage medium | |
CN115220740A (en) | Database environment deployment method and device, electronic equipment and storage medium | |
CN114185522A (en) | Page theme customizing method and device, electronic equipment and storage medium | |
CN114896164A (en) | Interface optimization method and device, electronic equipment and storage medium | |
CN114385155A (en) | vue project visualization tool generation method, device, equipment and storage medium | |
CN114510400A (en) | Task execution method and device, electronic equipment and storage medium | |
CN114840210A (en) | Data drive view realization method and device, electronic equipment and storage medium | |
CN114625376A (en) | Data transfer mode conversion method and device, electronic equipment and readable storage medium | |
CN114356379A (en) | Backup-based service upgrading method, device, equipment and storage medium | |
CN113515265A (en) | Site configuration method, device, equipment and computer readable storage medium | |
CN112686759A (en) | Account checking monitoring method, device, equipment and medium | |
CN112527443A (en) | Prompt box display method and device, electronic equipment and computer readable storage medium | |
CN111680204A (en) | Data acquisition method, data acquisition device and computer readable storage medium | |
CN112527282B (en) | Front-end page verification method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |