CN113687827B - Data list generation method, device and equipment based on widget and storage medium - Google Patents
Data list generation method, device and equipment based on widget and storage medium Download PDFInfo
- Publication number
- CN113687827B CN113687827B CN202110972787.8A CN202110972787A CN113687827B CN 113687827 B CN113687827 B CN 113687827B CN 202110972787 A CN202110972787 A CN 202110972787A CN 113687827 B CN113687827 B CN 113687827B
- Authority
- CN
- China
- Prior art keywords
- configuration
- widget
- data
- data list
- component
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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 OR CALCULATING; 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)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a data display technology, and discloses a data list generation method based on widget, which comprises the following steps: creating a widget of a data list based on the componentized integrated system; querying a data source of a data list by utilizing SQL sentences in the configuration page of the widget; analyzing the configuration information of the configuration page to obtain configuration parameters; performing rule matching on the configuration parameters by utilizing service rules in a preset service rule base to generate a corresponding configuration file; packaging the configuration file into a configuration card; performing logic operation on the data source by using the configuration card to generate target data; and recursively rendering the target data and the configuration card to obtain the data list. In addition, the invention also relates to a blockchain technology, and a data list can be stored in a node of the blockchain. The invention further provides a data list generation device based on the widget, electronic equipment and a storage medium. The invention can improve the data list generation efficiency.
Description
Technical Field
The present invention relates to the field of data display technologies, and in particular, to a widget-based data list generating method, a widget-based data list generating device, an electronic device, and a computer-readable storage medium.
Background
The data list is a data display mode which is more commonly used by a software service system. The general design of the data list includes the following aspects: title area, search area, new added area, global operation area, data list display area, data list operation area, etc. The data list can be used at high frequency in web pages and mobile phone Applications (APP), and how to efficiently configure the data list is very necessary.
At present, a data list generation mode is that a developer writes a program code according to actual service requirements to realize the requirements, and if the actual service has different data list display elements required by different pages in the same system, an interface is added to adapt the data list. The current data list generation method has a plurality of code lines and large service processing workload, so that the data list generation efficiency is to be improved.
Disclosure of Invention
The invention provides a data list generation method and device based on widgets and a computer readable storage medium, and mainly aims to solve the problem of low data list generation efficiency.
In order to achieve the above object, the present invention provides a method for generating a data list based on widgets, including:
creating a widget of a data list based on a componentized integrated system according to a data list generation instruction, and generating an identification ID of the widget;
Acquiring an SQL statement in a configuration page of the widget, inquiring a data source of the data list by using the SQL statement, and mapping an identification ID of the widget to the data source;
analyzing the configuration information of the configuration page to obtain configuration parameters;
performing rule matching on the configuration parameters by utilizing service rules in a preset service rule base to generate configuration files corresponding to the configuration parameters;
packaging the configuration file into a configuration card, and mapping the identification ID of the widget to the configuration card;
performing logic operation on the data source by using the configuration card to generate target data;
and recursively rendering the target data and the configuration card to obtain the data list.
Optionally, the generating the instruction according to the data list creates a widget of the data list based on the componentized integrated system, including:
extracting instruction parameters in the data list generation instruction;
reading component attribute information in the instruction parameters;
extracting a general basic component, a system configuration component and a service function component from the componentized integrated system according to the component attribute information, and generating an index address of the general basic component, an index address of the system configuration component and an index address of the service function component;
Selecting the system configuration component according to the index address of the system configuration component, loading data information in a preset database, and obtaining configuration page data of the widget according to the system configuration component and the data information;
rendering the configuration page data of the widget to obtain a configuration page of the widget;
extracting a code block of a configuration page of the widget, and extracting a component index function block from the code block;
and taking the index address of the universal basic component and the index address of the service function component as references of the component index function block, and calling the universal basic component, the service function component and the configuration page combination of the widget by utilizing the component index function block comprising the index address to obtain the widget of the data list.
Optionally, the parsing the configuration information of the configuration page to obtain configuration parameters includes:
converting the configuration information into a word sequence;
carrying out grammar logic judgment on the word sequence, and carrying out grammar structure analysis to generate an abstract grammar tree;
traversing the node data in the abstract syntax tree to obtain the configuration parameters of the configuration page.
Optionally, the rule matching is performed on the configuration parameters by using a service rule in a preset service rule base, and generating a configuration file corresponding to the configuration parameters includes:
searching an adapted business rule in a preset business rule base according to the configuration parameters, and combining the configuration parameters and the adapted business rule to generate a configuration rule set;
extracting a rule condition corresponding to one of the configuration parameters in the configuration rule set, and judging whether the configuration parameters meet the rule condition or not;
when the configuration parameters do not meet the rule conditions, ignoring an action instruction corresponding to the rule conditions, and returning to the step of extracting the rule conditions corresponding to one of the configuration parameters in the configuration rule set;
executing an action instruction corresponding to the rule condition when the configuration parameter meets the rule condition, and returning to the step of extracting the rule condition corresponding to one configuration parameter in the configuration rule set;
and when all rule conditions in the configuration rule set are extracted, summarizing the configuration parameters of the action instructions corresponding to the rule conditions, and generating a configuration file conforming to the business rule.
Optionally, the packaging the configuration file into a configuration card includes:
analyzing the configuration file to obtain a configuration file in an HTML format;
acquiring a card template from a preset template database based on the configuration document;
and loading the configuration document into the card template to generate the configuration card.
Optionally, the performing a logic operation on the data source by using the configuration card to generate target data includes:
searching a field matched with field information in the data source in the configuration card;
acquiring corresponding configuration parameters according to the matched fields;
and carrying out logic processing on the data source by utilizing the configuration parameters to obtain target data.
Optionally, the obtaining the target data and the configuration card through the ID of the widget, recursively rendering the target data and the configuration card to obtain the data list includes:
invoking the identification ID of the widget to acquire the target data in the HTML format and the configuration document in the HTML format corresponding to the configuration card;
analyzing the CSS file to construct a CSS rule tree;
constructing a rendering tree according to the DOM tree and the CSS rule tree;
And traversing a rendering tree to draw the data list.
In order to solve the above problems, the present invention further provides a widget-based data list generating apparatus, which includes:
the widget generation module is used for creating a widget of the data list based on the componentization integrated system according to the data list generation instruction and generating an identification ID of the widget;
the data query module is used for acquiring SQL sentences in the configuration page of the widget, querying the data sources of the data list by utilizing the SQL sentences, and mapping the identification IDs of the widget to the data sources
The configuration card generation module is used for analyzing the configuration information of the configuration page to obtain configuration parameters; performing rule matching on the configuration parameters by utilizing service rules in a preset service rule base to generate configuration files corresponding to the configuration parameters; packaging the configuration file into a configuration card, and mapping the identification ID of the widget to the configuration card;
the logic operation module is used for executing logic operation on the data source by utilizing the configuration card to generate target data;
and the rendering module is used for recursively rendering the target data and the configuration card to obtain the data list.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
at least one processor; the method comprises the steps of,
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 the widget-based data list generation method described above.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the above-mentioned widget-based data list generating method.
Based on the universality of the data list, the embodiment of the invention creates a widget of the data list through the componentized integrated system, configures basic information of the widget through a configuration page of the widget, and generates the data list through global operation configuration and column field configuration; the data list can be flexibly operated through the configuration page of the widget, so that the code development amount is reduced, and the data list generation efficiency is improved; furthermore, the configuration parameters can be subjected to rule matching according to the preset business rules, multiple different business scenes are adapted, and the development code quantity of the data list of the different business scenes is reduced.
Drawings
FIG. 1 is a flowchart of a widget-based data list generation method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a detailed implementation flow of one of the steps in the widget-based data list generating method shown in FIG. 1;
FIG. 3 is a schematic diagram illustrating a detailed implementation flow of one of the steps in the widget-based data list generating method shown in FIG. 1;
FIG. 4 is a schematic diagram illustrating a detailed implementation flow of one of the steps in the widget-based data list generating method shown in FIG. 1;
FIG. 5 is a schematic diagram illustrating a detailed implementation flow of one of the steps in the widget-based data list generating method shown in FIG. 1;
FIG. 6 is a functional block diagram of a widget-based data list generating apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device implementing the widget-based data list generating method according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a data list generation method based on widgets. The execution subject of the widget-based data list generation method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the widget-based data list generation method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end 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 cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flow chart of a widget-based data list generating method according to an embodiment of the present invention is shown. In this embodiment, the method for generating a widget-based data list includes:
s1, creating a widget of a data list based on a componentized integrated system according to a data list generation instruction, and generating an identification ID of the widget;
the widget of the data list is a component set integrating the universality function of the data list and comprises a universal basic component, a system configuration component and a service function component. In the embodiment of the invention, the general basic component, the system configuration component and the service function component can be dynamically configured based on the configuration page corresponding to the widget.
The general basic component can define the page layout of the data list and realize the data request transmission of each sub-component in the data list; the system configuration component can automatically generate a global operation area, a search area, a title area and the like of the data list; the business function component can automatically generate an added area, a data list display area, a data list operation area and the like of the data list.
In detail, referring to fig. 2, the creating, according to the data list generating instruction, a widget for creating a data list based on a componentized integrated system includes:
S11, extracting instruction parameters in the data list generation instruction;
s12, reading component attribute information in the instruction parameters;
s13, extracting a general basic component, a system configuration component and a service function component from the componentized integrated system according to the component attribute information, and generating an index address of the general basic component, an index address of the system configuration component and an index address of the service function component;
s14, selecting the system configuration component according to the index address of the system configuration component, loading data information in a preset database, and obtaining configuration page data of the widget according to the system configuration component and the data information;
s15, rendering configuration page data of the widget to obtain a configuration page of the widget;
s16, extracting code blocks of the configuration page of the widget, and extracting component index function blocks from the code blocks;
s17, taking the index address of the universal basic component and the index address of the business function component as references of the component index function block, calling the universal basic component and the business function component by utilizing the component index function block comprising the index address, and combining the universal basic component and the business function component with the configuration page of the widget to obtain the widget of the data list.
The widgets of the data list comprise configuration pages, and each component can be dynamically configured through the configuration pages, so that in order to complete connection between the configuration pages and each component, component index function blocks need to be extracted from code blocks of the configuration pages, and the component index addresses serve as the component index function blocks to be added into the components, so that connection between the configuration pages and each component is completed.
For example: the key words of the component index function block are as follows: component-connect (); the component index address is: and taking the Component index address as the Component index function block to enter into the Component index function block to obtain Component-connection (/ D/Component-connection) and completing the connection between each Component and the configuration page.
In order to distinguish different widgets, in the embodiment of the invention, while generating the widget, the identification IDs with one-to-one correspondence with the data list widget are also generated. And further, the configuration information or data contained by the data list widget may be invoked with the identification ID of the widget.
S2, acquiring an SQL statement in the configuration page of the widget, inquiring a data source of a data list by using the SQL statement, and mapping the identification ID of the widget to the data source;
In the embodiment of the invention, the configuration page of the widget comprises various configuration items including but not limited to a text box, a selection item and the like, wherein the text information box can input text information for configuration operation, and the selection item can select the content in the preset selection item for configuration operation.
In detail, in the embodiment of the present invention, the query using the SQL statement to obtain the data source of the data list includes:
translating the SQL statement into an identifier;
carrying out grammar detection on the identifier and constructing a grammar tree;
extracting node information in the grammar tree to generate an execution plan;
and querying a preset database by using the execution plan to obtain a data source of the data list.
Specifically, in the embodiment of the invention, the SQL sentence can be translated into the identifier by using a lexical analyzer, wherein the lexical analyzer is a program for converting a character sequence into a word sequence including keywords and identifiers in computer science.
Further, the identifier is grammatically detected and constructed as a grammar tree using a parser, which is a program that parses an input text composed of word sequences according to a certain form of grammar and determines its grammatical structure. Its function is to perform a grammar check and construct a grammar tree consisting of the entered word sequence. Wherein each node of the syntax tree represents each operation performed by this query.
In addition, the embodiment of the invention extracts node information in the grammar tree, generates an execution plan, and queries a preset database by using the execution plan to obtain a data source of a data list. Such as: the execution plan may include a query statement through SQL: the method comprises the steps of selecting id as ' serial number ', company as ' enterprise name ', city as ' city ', direction as ' district town ', good name as ' commodity name ', price as ' unit price ', sell number as ' from product Sell, and acquiring a data list data source comprising serial number, enterprise name, city, district town, commodity name, unit price and sell number.
Further, the identification ID of the widget is mapped to the data source, and the data source is acquired by calling the identification ID of the widget.
S3, analyzing the configuration information of the configuration page to obtain configuration parameters;
as can be seen from the above description, when the widget of the data list is generated by using the data list generating instruction, the widget needs to be configured first in order to generate the title area, the search area, the new area, the global operation area, the data list display area, the data list operation area, and the like of the data list by using the widget.
In the embodiment of the invention, the configuration of the widget is completed by operating the configuration page corresponding to the widget. The configuration page comprises different configuration parameters, and title areas, search areas and the like with different user requirements can be formed through combination of the different configuration parameters.
In detail, the configuration parameters include a basic configuration information parameter, a global operation configuration information parameter, a column field configuration information parameter, and the like. Wherein the basic configuration information parameter corresponds to a header area, such as: information such as the data list title, the virtual list title and the like; the global operation configuration parameters correspond to the content of the newly added area, the search area and the global operation area, such as: a new data column function, a search function, a popup mode, a window size, a batch export function, a batch deletion function and the like; the column field configuration information parameter corresponds to the content of the data list operation area, for example: modification, deletion, etc.
Further, in the column field configuration item, the linkage of the logic configuration and the data list is realized by creating a virtual operation column button for the column field, such as: create virtual operation column buttons: a modification button, when the data state in the data list is "under approval", the modification button is not operable. Meanwhile, the operations of modifying, deleting and the like on the existing data list row or column data can be realized through the virtual operation column button, such as: clicking the virtual operation column button at the creation site: and the modification button can modify commodity unit price without modifying codes.
Wherein the logic configuration comprises: and/or the operation and comparison modes are as follows: equal to, less than, greater than, not equal to, greater than or equal to, less than or equal to, contain, not contain, etc.
In detail, in the embodiment of the present invention, analyzing the configuration information of the configuration page to obtain the configuration parameters includes:
converting the configuration information into a word sequence;
carrying out grammar logic judgment on the word sequence, and carrying out grammar structure analysis to generate an abstract grammar tree;
traversing the node data in the abstract syntax tree to obtain the configuration parameters of the configuration page.
Specifically, the invention is implemented by utilizing a lexical analyzer to preprocess the configuration information to filter spaces, skip notes, line-feed symbols and the like, and then converting the configuration information into word sequences according to a preset lexicon so as to prepare for subsequent grammar analysis.
The method and the device are implemented, the configuration information of the configuration page is analyzed to obtain the configuration parameters, and the configuration parameters comprise basic configuration information parameters, global operation configuration information parameters and column field configuration information parameters.
S4, performing service matching on the configuration parameters by utilizing service rules in a preset service rule base, and generating a configuration file corresponding to the configuration parameters;
The embodiment of the invention can adopt a rule engine (flagleader) to carry out service matching on the service rule and the configuration parameter so as to make service decision.
In the embodiment of the invention, the business rule is a description of business definition and constraint, is used for maintaining a business structure or controlling and influencing the business, is created by business personnel, can be updated in real time, and can be combined with configuration parameters to generate a configuration file conforming to the business rule. For example: the unit price of a commodity cannot exceed the highest allowable value.
In the embodiment of the present invention, the configuration rule set is a set including configuration parameters and service rules corresponding to the configuration parameters, where each service rule includes a condition filter and a plurality of action instructions, where the action is executed if the condition filter is true, and the condition filter can be used as a rule condition to determine whether the configuration parameters meet the rule condition.
In detail, referring to fig. 3, the reorganizing the configuration parameters according to a preset service rule to generate a configuration file corresponding to the configuration parameters includes:
s41, searching an adapted business rule in a preset business rule base according to the configuration parameters, and combining the configuration parameters and the adapted business rule to generate a configuration rule set;
S42, extracting a rule condition corresponding to one configuration parameter in the configuration rule set, and judging whether the configuration parameter meets the rule condition;
specifically, the embodiment of the invention takes a condition filter in the rule as the rule condition, and judges whether the rule condition meets the condition according to the true and false conditions of the condition filter value: when the condition filter value is false, the rule condition does not meet the condition; when the condition filter value is true, the rule condition satisfies a condition.
When the configuration parameters meet the rule conditions, executing S43, and sequentially executing action instructions corresponding to the rule conditions;
s44, judging whether the rule condition is the last rule condition in the configuration rule set;
when the rule condition does not meet the requirement, ignoring an action instruction corresponding to the rule condition, and executing S43;
when the rule condition is not the last rule condition in the rule set, returning to S42
And when all rule conditions in the configuration rule set are extracted, executing S45, summarizing the configuration parameters of the action instructions corresponding to the executed rule conditions, and generating a configuration file conforming to the business rule.
In the embodiment of the invention, the configuration parameters can be subjected to rule matching according to different business rules, so as to generate the configuration file conforming to the business rules, and the configuration file is adapted to various different business scenes. Such as: different business scenes such as a sales data list, an inventory management list and the like can be recombined by utilizing different business rules and configuration parameters to obtain configuration files related to specific businesses.
S5, packaging the configuration file into a configuration card, and mapping the identification ID of the widget to the configuration card;
in the embodiment of the invention, the card is a flexible and extensible content window, and meanwhile, various display effect variants can be made for storing configuration information.
In detail, referring to fig. 4, the packaging the configuration file into a configuration card includes:
s51, analyzing the configuration file to obtain a configuration file in an HTML format;
s52, acquiring a card template from a preset template database based on the configuration document;
s53, loading the configuration document to the card template to generate the configuration card.
The configuration card in the embodiment of the invention comprises a basic configuration information configuration file, a global operation configuration information configuration file and a column field configuration information configuration file, and corresponds to the data list header area, the data list newly-added area, the data list searching area, the data list global operation area and the data list operation area.
Further, in the embodiment of the invention, the identification ID of the widget is mapped to the configuration card, and the configuration card can be called by calling the identification ID of the widget, so that the development efficiency is improved.
S6, performing logic processing on the data source by using the configuration card to generate target data;
in an embodiment of the present invention, the logic processing includes: the data sources are exported in batches, deleted in batches, or single data are modified and deleted, or the data sources are filtered according to logic configuration, etc. For example: the display fields are exported in batches as follows: the number of sales in the data list data sources of serial number, enterprise name, city, town, commodity name, unit price and sales number is more than 2000.
In detail, in the embodiment of the present invention, the performing logic processing on the data source by using the configuration card to generate target data includes:
searching a field matched with field information in the data source in the configuration card;
acquiring corresponding configuration parameters according to the matched fields;
and carrying out logic processing on the data source by utilizing the configuration parameters to obtain target data.
Further, the target data is the content required by a data list display area of the data list.
S7, recursively rendering the target data and the configuration card to obtain the data list.
In the embodiment of the invention, the rendering is a process of generating an image from a model by software, namely a process of displaying contents such as a title area, a search area, an added area, a global operation area, a data list display area, a data list operation area and the like in the data list.
In the embodiment of the invention, the target data is an HTML format file, which comprises a head and a body, and can be linked to obtain a CCS file through the head, and obtain a DOM through the body. The CCS is a cascading style sheet and is mainly used for setting appearance display styles such as text content, picture appearance, layout and the like in an HTML page. The DOM is a document object type and comprises content to be presented of a specific document and a DOM interface, wherein the DOM interface can be utilized to change the content, structure and style of a layout through the DOM interface.
In detail, referring to fig. 5, the step S7 includes:
s71, carrying out HTML analysis on the target data and the configuration card to obtain a corresponding DOM tree and a corresponding CSS file;
In the embodiment of the invention, the target data and the configuration card are subjected to HTML analysis by using a preset analyzer, so as to obtain corresponding DOM tree and CSS file. Alternatively, the parser may be an HTML parsing engine, specifically: the HTML data in the web page data is composed of a number of tags, which may include < HTML >, < head >, < body >, < div >, < span >, etc. These tags are nested, layer by layer, e.g., < html > sleeve < body >, < body > sleeve < div >, < div > sleeve < span >, etc. When resolving, the method can resolve the labels layer by layer, abstract each label into an object in the code, obtain the corresponding DOM according to the resolution of the organization structure with distinct layers, and construct a DOM tree according to the corresponding grammar structure.
Further, loading the target data and the html code of the configuration card by using the parser to obtain a < link > tag in the < head > tag; the < link > label is utilized to reference an external CSS file, a request of the CSS file is sent, and the CSS file is returned; and loading codes of a part < body > in html by using the parser to obtain the CSS file.
S72, analyzing the CSS file to construct a CSS rule tree;
In the embodiment of the invention, the CSS file is analyzed to generate a Stylesheet object, wherein the Stylesheet object contains CSS rules, and then the CSS rules are assembled by using preset grammar rules according to the CSS rules to construct a CSS rule tree.
S73, constructing a rendering tree according to the DOM tree and the CSS rule tree;
in the embodiment of the invention, a rendering tree is constructed according to the DOM tree and the CSS rule tree, each visible node is traversed from the root node of the DOM tree, the adaptive CSS style rule is found and applied according to each visible node, and the rendering tree is generated, wherein each node of the rendering tree is a visible node and contains the content and the style of the corresponding rule.
And S74, traversing the rendering tree to draw the data list.
Based on the universality of the data list, the embodiment of the invention creates a widget of the data list through the componentized integrated system, configures basic information of the widget through a configuration page of the widget, and generates the data list through global operation configuration and column field configuration; the data list can be flexibly operated through the configuration page of the widget, so that the code development amount is reduced, and the data list generation efficiency is improved; furthermore, the configuration parameters can be subjected to rule matching according to preset business rules, multiple different business scenes are adapted, and the development code quantity of the data list of the different business scenes is reduced. Therefore, the data list generation method based on the widget can improve the data list generation efficiency.
Fig. 6 is a functional block diagram of a widget-based data list generating apparatus according to an embodiment of the present invention.
The widget-based data list generating apparatus 100 of the present invention may be installed in an electronic device. Depending on the implementation function, the widget-based data list generating apparatus 100 may include a widget generating module 101, a data querying module 102, a configuration card generating module 103, a logic operation module 104, and a rendering module 105. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the widget generation module 101 is configured to create a widget of a data list based on a componentized integration system according to a data list generation instruction, and generate an identification ID of the widget;
the data query module 102 is configured to obtain an SQL statement in the configuration page of the widget, query a data source of the data list using the SQL statement, and map an identification ID of the widget to the data source;
The configuration card generating module 103 is configured to parse configuration information of the configuration page to obtain configuration parameters; performing rule matching on the configuration parameters by utilizing business rules in preset business rules to generate configuration files corresponding to the configuration parameters; packaging the configuration file into a configuration card, and mapping the identification ID of the widget to the configuration card;
the logic operation module 104 is configured to perform a logic operation on the data source by using the configuration card, so as to generate target data;
the rendering module 105 is configured to recursively render the target data and the configuration card to obtain the data list.
In detail, each module in the widget-based data list generating apparatus 100 in the embodiment of the present invention adopts the same technical means as the widget-based data list generating method described in fig. 1 to 5, and can generate the same technical effects, which are not described herein.
Fig. 7 is a schematic structural diagram of an electronic device for implementing a widget-based data list generating method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program stored in the memory 11 and executable on the processor 10, such as a widget-based data list generation program.
The processor 10 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing unit, CPU), a microprocessor, a digital processing chip, a graphics processor, a combination of various control chips, and so on. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects respective parts of the entire electronic device using various interfaces and lines, executes or executes programs or modules stored in the memory 11 (for example, executes a widget-based data list generation program or the like), and invokes data stored in the memory 11 to perform various functions of the electronic device and process data.
The memory 11 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may in other embodiments also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or 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 for storing application software installed in an electronic device and various types of data, such as codes of a widget-based data list generation program, but also for temporarily storing data that has been output or is to be output.
The communication bus 12 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
The communication interface 13 is used for communication between the electronic device and other devices, including 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.), 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), or alternatively 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, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Fig. 7 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may include fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source 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 implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The widget-based data list generating program stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, may implement:
Creating a widget of a data list based on a componentized integrated system according to a data list generation instruction, and generating an identification ID of the widget;
acquiring an SQL statement in a configuration page of the widget, inquiring a data source of the data list by using the SQL statement, and mapping an identification ID of the widget to the data source;
analyzing the configuration information of the configuration page to obtain configuration parameters;
performing rule matching on the configuration parameters by utilizing service rules in a preset service rule base to generate configuration files corresponding to the configuration parameters;
packaging the configuration file into a configuration card, and mapping the identification ID of the widget to the configuration card;
performing logic operation on the data source by using the configuration card to generate target data;
and recursively rendering the target data and the configuration card to obtain the data list.
In particular, the specific implementation method of the above instructions by the processor 10 may refer to the description of the relevant steps in the corresponding embodiment of the drawings, which is not repeated herein.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a 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, can implement:
creating a widget of a data list based on a componentized integrated system according to a data list generation instruction, and generating an identification ID of the widget;
acquiring an SQL statement in a configuration page of the widget, inquiring a data source of the data list by using the SQL statement, and mapping an identification ID of the widget to the data source;
analyzing the configuration information of the configuration page to obtain configuration parameters;
performing rule matching on the configuration parameters by utilizing business rules in preset business rules to generate configuration files corresponding to the configuration parameters;
packaging the configuration file into a configuration card, and mapping the identification ID of the widget to the configuration card;
performing logic operation on the data source by using the configuration card to generate target data;
and recursively rendering the target data and the configuration card to obtain the data list.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
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 characteristics 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 blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.
Claims (8)
1. A widget-based data list generation method, the method comprising:
creating a widget of a data list based on a componentized integrated system according to a data list generation instruction, and generating an identification ID of the widget;
acquiring an SQL statement in a configuration page of the widget, inquiring a data source of the data list by using the SQL statement, and mapping an identification ID of the widget to the data source;
analyzing the configuration information of the configuration page to obtain configuration parameters;
performing rule matching on the configuration parameters by utilizing service rules in a preset service rule base to generate configuration files corresponding to the configuration parameters;
packaging the configuration file into a configuration card, and mapping the identification ID of the widget to the configuration card;
performing logic operation on the data source by using the configuration card to generate target data;
Recursively rendering the target data and the configuration card to obtain the data list;
the method for creating the widget of the data list based on the componentized integrated system comprises the following steps of:
extracting instruction parameters in the data list generation instruction;
reading component attribute information in the instruction parameters;
extracting a general basic component, a system configuration component and a service function component from the componentized integrated system according to the component attribute information, and generating an index address of the general basic component, an index address of the system configuration component and an index address of the service function component;
selecting the system configuration component according to the index address of the system configuration component, loading data information in a preset database, and obtaining configuration page data of the widget according to the system configuration component and the data information;
rendering the configuration page data of the widget to obtain a configuration page of the widget;
extracting a code block of a configuration page of the widget, and extracting a component index function block from the code block;
taking the index address of the universal basic component and the index address of the service function component as references of the component index function block, calling the universal basic component and the service function component by utilizing the component index function block comprising the index address, and combining the universal basic component and the service function component with a configuration page of the widget to obtain a widget of the data list;
The recursively rendering the target data and the configuration card to obtain the data list comprises the following steps: performing HTML analysis on the target data and the configuration card to obtain a corresponding DOM tree and CSS file; analyzing the CSS file to construct a CSS rule tree; constructing a rendering tree according to the DOM tree and the CSS rule tree; and traversing a rendering tree to draw the data list.
2. The widget-based data list generating method of claim 1, wherein parsing the configuration information of the configuration page to obtain configuration parameters comprises:
converting the configuration information into a word sequence;
carrying out grammar logic judgment on the word sequence, and carrying out grammar structure analysis to generate an abstract grammar tree;
traversing the node data in the abstract syntax tree to obtain the configuration parameters of the configuration page.
3. The method for generating a widget-based data list according to claim 1, wherein the rule matching the configuration parameters by using the service rules in the preset service rule base, and generating the configuration file corresponding to the configuration parameters, includes:
searching an adapted business rule in a preset business rule base according to the configuration parameters, and combining the configuration parameters and the adapted business rule to generate a configuration rule set;
Extracting a rule condition corresponding to one of the configuration parameters in the configuration rule set, and judging whether the configuration parameters meet the rule condition or not;
when the configuration parameters do not meet the rule conditions, ignoring an action instruction corresponding to the rule conditions, and returning to the step of extracting the rule conditions corresponding to one of the configuration parameters in the configuration rule set;
executing an action instruction corresponding to the rule condition when the configuration parameter meets the rule condition, and returning to the step of extracting the rule condition corresponding to one configuration parameter in the configuration rule set;
and when all rule conditions in the configuration rule set are extracted, summarizing the configuration parameters of the action instructions corresponding to the rule conditions, and generating a configuration file conforming to the business rule.
4. The widget-based data list generation method of claim 1, wherein the encapsulating the configuration file into a configuration card comprises:
analyzing the configuration file to obtain a configuration file in an HTML format;
acquiring a card template from a preset template database based on the configuration document;
and loading the configuration document into the card template to generate the configuration card.
5. The widget-based data list generation method of claim 1, wherein the performing a logical operation on the data source using the configuration card to generate target data comprises:
searching a field matched with field information in the data source in the configuration card;
acquiring corresponding configuration parameters according to the matched fields;
and carrying out logic processing on the data source by utilizing the configuration parameters to obtain target data.
6. A widget-based data list generation apparatus, the apparatus comprising:
the widget generation module is used for creating a widget of the data list based on the componentization integrated system according to the data list generation instruction and generating an identification ID of the widget;
the data query module is used for acquiring SQL sentences in the configuration page of the widget, querying a data source of the data list by utilizing the SQL sentences, and mapping the identification ID of the widget to the data source;
the configuration card generation module is used for analyzing the configuration information of the configuration page to obtain configuration parameters; performing rule matching on the configuration parameters by utilizing service rules in a preset service rule base to generate configuration files corresponding to the configuration parameters; packaging the configuration file into a configuration card, and mapping the identification ID of the widget to the configuration card;
The logic operation module is used for executing logic operation on the data source by utilizing the configuration card to generate target data;
the rendering module is used for acquiring the target data and the configuration card through the identification ID of the widget, and recursively rendering the target data and the configuration card to obtain the data list;
the method for creating the widget of the data list based on the componentized integrated system comprises the following steps of:
extracting instruction parameters in the data list generation instruction;
reading component attribute information in the instruction parameters;
extracting a general basic component, a system configuration component and a service function component from the componentized integrated system according to the component attribute information, and generating an index address of the general basic component, an index address of the system configuration component and an index address of the service function component;
selecting the system configuration component according to the index address of the system configuration component, loading data information in a preset database, and obtaining configuration page data of the widget according to the system configuration component and the data information;
rendering the configuration page data of the widget to obtain a configuration page of the widget;
Extracting a code block of a configuration page of the widget, and extracting a component index function block from the code block;
taking the index address of the universal basic component and the index address of the service function component as references of the component index function block, calling the universal basic component and the service function component by utilizing the component index function block comprising the index address, and combining the universal basic component and the service function component with a configuration page of the widget to obtain a widget of the data list;
the recursively rendering the target data and the configuration card to obtain the data list comprises the following steps: performing HTML analysis on the target data and the configuration card to obtain a corresponding DOM tree and CSS file; analyzing the CSS file to construct a CSS rule tree; constructing a rendering tree according to the DOM tree and the CSS rule tree; and traversing a rendering tree to draw the data list.
7. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
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 the widget-based data list generating method of any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the widget-based data list generation method according to any one of claims 1 to 5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110972787.8A CN113687827B (en) | 2021-08-24 | 2021-08-24 | Data list generation method, device and equipment based on widget and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110972787.8A CN113687827B (en) | 2021-08-24 | 2021-08-24 | Data list generation method, device and equipment based on widget and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113687827A CN113687827A (en) | 2021-11-23 |
| CN113687827B true CN113687827B (en) | 2024-03-12 |
Family
ID=78581705
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110972787.8A Active CN113687827B (en) | 2021-08-24 | 2021-08-24 | Data list generation method, device and equipment based on widget and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113687827B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117497159B (en) * | 2024-01-02 | 2024-04-16 | 智业软件股份有限公司 | Method for managing hospital beds by using cards based on automatic SQL loading |
| CN118034690B (en) * | 2024-03-12 | 2024-09-03 | 江西数字网联信息安全技术有限公司 | Screening item configuration method, system, medium and equipment based on JSON configuration file |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102591659A (en) * | 2011-12-28 | 2012-07-18 | 中标软件有限公司 | Implementation method for widget on main interface of mobile terminal and management method for widget |
| KR20140019627A (en) * | 2012-08-06 | 2014-02-17 | 인크로스 주식회사 | An authoring tool for web applications and the authoring method thereof |
| CN107644323A (en) * | 2017-09-30 | 2018-01-30 | 成都莲合软件科技有限公司 | A kind of intelligent checks system of service-oriented stream |
| CN108762646A (en) * | 2018-05-15 | 2018-11-06 | 山东浪潮商用系统有限公司 | A kind of method for information display, device, readable medium and storage control |
| CN110309196A (en) * | 2019-05-22 | 2019-10-08 | 深圳壹账通智能科技有限公司 | Block chain data storage and query method, apparatus, equipment and storage medium |
| CN110673848A (en) * | 2019-09-30 | 2020-01-10 | 厦门荆艺软件有限公司 | Enterprise information management system configuration platform based on JavaWeb |
| CN110688117A (en) * | 2019-09-30 | 2020-01-14 | 厦门荆艺软件有限公司 | Interface designer and platform based on JavaWeb and page configuration method thereof |
| CN113139145A (en) * | 2021-05-12 | 2021-07-20 | 平安国际智慧城市科技股份有限公司 | Page generation method and device, electronic equipment and readable storage medium |
-
2021
- 2021-08-24 CN CN202110972787.8A patent/CN113687827B/en active Active
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102591659A (en) * | 2011-12-28 | 2012-07-18 | 中标软件有限公司 | Implementation method for widget on main interface of mobile terminal and management method for widget |
| KR20140019627A (en) * | 2012-08-06 | 2014-02-17 | 인크로스 주식회사 | An authoring tool for web applications and the authoring method thereof |
| CN107644323A (en) * | 2017-09-30 | 2018-01-30 | 成都莲合软件科技有限公司 | A kind of intelligent checks system of service-oriented stream |
| CN108762646A (en) * | 2018-05-15 | 2018-11-06 | 山东浪潮商用系统有限公司 | A kind of method for information display, device, readable medium and storage control |
| CN110309196A (en) * | 2019-05-22 | 2019-10-08 | 深圳壹账通智能科技有限公司 | Block chain data storage and query method, apparatus, equipment and storage medium |
| CN110673848A (en) * | 2019-09-30 | 2020-01-10 | 厦门荆艺软件有限公司 | Enterprise information management system configuration platform based on JavaWeb |
| CN110688117A (en) * | 2019-09-30 | 2020-01-14 | 厦门荆艺软件有限公司 | Interface designer and platform based on JavaWeb and page configuration method thereof |
| CN113139145A (en) * | 2021-05-12 | 2021-07-20 | 平安国际智慧城市科技股份有限公司 | Page generation method and device, electronic equipment and readable storage medium |
Non-Patent Citations (1)
| Title |
|---|
| SOA架构下移动通信业务组合及服务封装方式研究;闫春荣;;通信管理与技术(02);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113687827A (en) | 2021-11-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113961584B (en) | Field lineage analysis method, device, electronic device and storage medium | |
| CN111813963B (en) | Knowledge graph construction method and device, electronic equipment and storage medium | |
| CN115061721A (en) | A report generation method, device, computer equipment and storage medium | |
| CN115408399A (en) | Blood relationship analysis method, device, equipment and storage medium based on SQL script | |
| CN113918576B (en) | Metadata management platform and management method | |
| CN111428451B (en) | Text online editing method and device, electronic equipment and storage medium | |
| CN115599386A (en) | Code generation method, device, equipment and storage medium | |
| CN111427577A (en) | Code processing method and device and server | |
| US7610548B1 (en) | Method and apparatus for applying locale behaviors to regions of a form | |
| CN113687827B (en) | Data list generation method, device and equipment based on widget and storage medium | |
| CN117170729A (en) | Method, device, equipment and medium for analyzing compatibility among versions of open source component | |
| Koegel et al. | HyOctane: A HyTime engine for an MMIS | |
| CN116226563B (en) | Rich text editing method, rich text editing device, electronic equipment and computer readable storage medium | |
| CN116431481A (en) | Code parameter verification method and device based on multi-code condition | |
| CN114969123A (en) | Engine rule definition method, device, electronic device and storage medium | |
| CN114860252A (en) | Code unified compiling method and device, electronic equipment and readable storage medium | |
| CN114356379A (en) | Backup-based service upgrading method, device, equipment and storage medium | |
| CN114356291A (en) | Method, device, equipment and medium for generating form based on configuration file | |
| CN116595963B (en) | Document generation method, device, equipment and medium based on template configuration | |
| CN118113963A (en) | Dynamic page generation method and device, electronic equipment and storage medium | |
| CN119396377A (en) | Method, device, medium and product for assisting in writing code | |
| CN118012873A (en) | Data table operation method, device, computer equipment and storage medium | |
| CN114998038A (en) | Abnormal policy processing method and system | |
| CN115098514A (en) | Method and device for identifying scene based on annotation, electronic equipment and storage medium | |
| CN114492342A (en) | Form icon filling method, device, 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |