CN113687827A - 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 PDF

Info

Publication number
CN113687827A
CN113687827A CN202110972787.8A CN202110972787A CN113687827A CN 113687827 A CN113687827 A CN 113687827A CN 202110972787 A CN202110972787 A CN 202110972787A CN 113687827 A CN113687827 A CN 113687827A
Authority
CN
China
Prior art keywords
configuration
widget
data
data list
rule
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.)
Granted
Application number
CN202110972787.8A
Other languages
Chinese (zh)
Other versions
CN113687827B (en
Inventor
陆海鹏
李欢
纪文武
蓝元坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202110972787.8A priority Critical patent/CN113687827B/en
Publication of CN113687827A publication Critical patent/CN113687827A/en
Application granted granted Critical
Publication of CN113687827B publication Critical patent/CN113687827B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (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 widgets, which comprises the following steps: creating a widget of a data list based on the componentized integration system; querying a data source of a data list by using an SQL statement in a configuration page of the widget; analyzing the configuration information of the configuration page to obtain configuration parameters; carrying out rule matching on the configuration parameters by using the service rules in a preset service rule base to generate a corresponding configuration file; packaging the configuration file into a configuration card; executing 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 block chain technology, and the data list can be stored in the node of the block chain. The invention also provides a data list generating device based on the widget, electronic equipment and a storage medium. The invention can improve the generation efficiency of the data list.

Description

Data list generation method, device and equipment based on widget and storage medium
Technical Field
The invention relates to the technical field of data display, in particular to a data list generation method and device based on widgets, electronic equipment 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 comprises the following aspects: a title area, a search area, a newly added area, a global operation area, a data list display area, a data column operation area and the like. Data lists are frequently used in web pages and mobile phone Applications (APP), and how to efficiently configure the data lists is very necessary.
At present, a data list generation mode is that developers write program codes according to actual service requirements to realize the requirements, and if the data list display elements required by different pages of the same system are different in the actual service, an interface is required to be added for adapting the data list. The existing data list generation method has a large number of code lines and a large workload of service processing, so the data list generation efficiency needs to be improved.
Disclosure of Invention
The invention provides a data list generation method and device based on a widget 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 data list generating method based on widgets, including:
according to a data list generation instruction, creating a widget of a data list based on a componentized integration system, and generating an identification ID of the widget;
acquiring SQL sentences in the configuration page of the widget, querying a data source of the data list by using the SQL sentences, and mapping the identification ID of the widget to the data source;
analyzing the configuration information of the configuration page to obtain configuration parameters;
carrying out rule matching on the configuration parameters by using the service rules in a preset service rule base to generate a configuration file corresponding to the configuration parameters;
packaging the configuration file into a configuration card, and mapping the ID of the widget to the configuration card;
executing 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 creating a widget of the data list based on the componentized integration system according to the data list generation instruction includes:
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 business function component from a 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 business 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 the configuration page of the widget;
extracting code blocks of a configuration page of the widget, and extracting component index function blocks from the code blocks;
and taking the index address of the general basic component and the index address of the business function component as the parameters of the component index function block, and calling the general basic component, the business function component and the configuration page combination of the widget by using the component index function block comprising the index address to obtain the widget of the data list.
Optionally, the 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, carrying out grammar structure analysis and generating an abstract grammar tree;
and traversing the node data in the abstract syntax tree to obtain the configuration parameters of the configuration page.
Optionally, the performing rule matching on the configuration parameters by using the service rules in a preset service rule base to generate the configuration file corresponding to the configuration parameters includes:
searching an adaptive service rule in a preset service rule base according to the configuration parameters, and combining the configuration parameters and the adaptive service rule to generate a configuration rule set;
extracting a rule condition corresponding to one configuration parameter in the configuration rule set, and judging whether the configuration parameter meets the rule condition;
when the configuration parameters do not meet the rule conditions, ignoring action instructions 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;
when the configuration parameters meet the rule conditions, executing action instructions corresponding to the rule conditions, and returning to the step of extracting the rule conditions corresponding to one configuration parameter in the configuration rule set;
when all rule conditions in the configuration rule set are extracted, summarizing and executing configuration parameters of action instructions corresponding to the rule conditions, and generating configuration files meeting business rules.
Optionally, the packaging the configuration file into a configuration card includes:
analyzing the configuration file to obtain a configuration document in an HTML format;
acquiring a card template from a preset template database based on the configuration document;
and loading the configuration document to the card template to generate the configuration card.
Optionally, the performing a logical operation on the data source by using the configuration card to generate target data includes:
searching fields matched with the 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 using the configuration parameters to obtain target data.
Optionally, the obtaining 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 includes:
calling the ID of the widget to acquire target data in the HTML format and a configuration document in the HTML format corresponding to the configuration card;
analyzing the CSS file and constructing a CSS rule tree;
constructing a rendering tree according to the DOM tree and the CSS rule tree;
and traversing the rendering tree to draw the data list.
In order to solve the above problem, the present invention further provides a data list generating apparatus based on widgets, the apparatus including:
the widget generation module is used for creating widgets of the data list based on the componentized integrated system according to the data list generation instruction and generating the identification IDs of the widgets;
a data query module for obtaining SQL statements in the configuration page of the widget, querying the data source of the data list by using the SQL statements, and mapping the ID of the widget to the data source
The configuration card generating module is used for analyzing the configuration information of the configuration page to obtain configuration parameters; carrying out rule matching on the configuration parameters by using the service rules in a preset service rule base to generate a configuration file corresponding to the configuration parameters; packaging the configuration file into a configuration card, and mapping the ID of the widget to the configuration card;
the logical operation module is used for executing logical 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 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 above-described widget-based data list generation method.
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, the at least one computer program being executed by a processor in an electronic device to implement the above-mentioned widget-based data list generation method.
The method comprises the steps that based on the universality of a data list, widgets of the data list are created through a componentized integrated system, basic information configuration is carried out on the widgets through configuration pages of the widgets, and the data list is generated 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, according to preset service rules, the configuration parameters can be subjected to rule matching, multiple different service scenes can be adapted, and development code amount of data lists of different service scenes can be reduced.
Drawings
Fig. 1 is a schematic flowchart of a data list generating method based on widgets according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a detailed implementation of one step in the method for generating a data list based on a widget shown in FIG. 1;
FIG. 3 is a flowchart illustrating a detailed implementation of one step in the method for generating a data list based on a widget shown in FIG. 1;
FIG. 4 is a flowchart illustrating a detailed implementation of one step in the method for generating a data list based on a widget shown in FIG. 1;
FIG. 5 is a flowchart illustrating a detailed implementation of one step in the method for generating a data list based on a widget shown in FIG. 1;
FIG. 6 is a functional block diagram of an apparatus for generating a data list based on widgets according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device implementing the method for generating a data list based on a widget 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 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 electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiments of the present application. In other words, the widget-based data list generation method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain 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 data list generation method based on widgets according to an embodiment of the present invention. In this embodiment, the method for generating a data list based on a widget includes:
s1, creating widgets of the data list based on the componentized integrated system according to the data list generating instruction, and generating identification IDs of the widgets;
the widgets of the data list are a component set integrating the general functions of the data list, and comprise a general basic component, a system configuration component and a business function component. In the embodiment of the invention, the general basic component, the system configuration component and the business function component can be dynamically configured based on the configuration page corresponding to the widget.
The universal basic assembly can define the page layout of the data list and realize the data request transmission of each sub-assembly 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 a newly added area of the data list, a data list display area, a data list operation area and the like.
In detail, referring to fig. 2, the widget for creating a data list based on a componentized integration system according to a data list generation instruction includes:
s11, extracting instruction parameters in the data list generating instruction;
s12, reading the component attribute information in the instruction parameters;
s13, extracting a general basic component, a system configuration component and a business function component from a modular 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 business 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 the configuration page data of the widget to obtain the 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 general basic component and the index address of the business function component as the parameters of the component index function block, calling the general basic component and the business function component by using the component index function block comprising the index address, and combining the general 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 include configuration pages, and each component can be dynamically configured through the configuration pages, so in order to complete the connection between the configuration pages and each component, a component index function block needs to be extracted from a code block of the configuration pages, and the component index address is used as a parameter of the component index function block to complete the connection between the configuration pages and each component.
For example: the keywords of the component index function block are: component-connect (); the component index address is: and/D/Component-connect, using the Component index address as the Component index function block entry parameter to obtain Component-connect (/ D/Component-connect), and completing the connection between each Component and the configuration page.
In order to distinguish different widgets, in the embodiment of the present invention, while generating a widget, an identifier ID having a one-to-one correspondence with the data list widget is also generated. And further, the identification ID of the widget can be utilized to call the configuration information or data included in the data list widget.
S2, acquiring SQL statements in the configuration page of the widget, utilizing the SQL statements to query to obtain a data source of a data list, and mapping the ID of the widget to the data source;
in the embodiment of the present invention, the configuration page of the widget includes 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 content in a preset selection item for configuration operation.
In detail, the obtaining of the data list data source by using the SQL statement query in the embodiment of the present invention includes:
translating the SQL statement into an identifier;
carrying out grammar detection on the identifier and constructing the identifier into a grammar tree;
extracting node information in the syntax 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 present invention, the SQL statement may be translated into the identifier by using a lexical analyzer, where the lexical analyzer is a program that converts a character sequence into a word sequence in computer science, and the program includes a keyword and an identifier.
Further, the identifiers are parsed and constructed as a syntax tree using a parser, which is a program that analyzes an input text composed of a sequence of words according to some specific formal grammar and determines its syntactic structure. Its role is to perform a grammar check and build a grammar tree consisting of the input word sequences. Where each node of the syntax tree represents each operation performed by this query.
In addition, the embodiment of the invention extracts the node information in the syntax 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 by SQL: select id as 'serial number', company as 'business name', city as 'city', dit as 'district town', goods name as 'commodity name', price as 'unit price', and select number as 'sales number' from product sell, and a data list data source containing serial number, business name, city, district town, commodity name, unit price, and sales number is obtained.
Furthermore, the identification ID of the widget is mapped to the data source, and the data source is obtained 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, after the widget of the data list is generated by using the data list generation instruction, the widget needs to be configured first in order to generate the header area, the search area, the newly added 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 header areas, search areas and the like required by different users 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, etc.; the global operation configuration parameters correspond to the contents of the newly added area, the search area and the global operation area, such as: a data column adding function, a searching function, a popup mode, a window size, batch export, a batch deleting function and the like are added; the column field configuration information parameter corresponds to the content of the data list operation area, such as: modified, deleted, etc.
Further, in the column field configuration item, linkage between the logic configuration and the data list is realized by creating a virtual operation column button for the column field, such as: create virtual action column button: and when the data state in the data list is 'under examination', the modification button is not operable. Meanwhile, the virtual operation column button can be used for modifying and deleting the existing data column list row or column data, such as: clicking the created virtual operation column button: the commodity unit price can be modified by the modification button without modifying the code.
Wherein the logic configuration comprises: and/or operation and comparison methods are as follows: equal to, less than, greater than, not equal to, greater than or equal to, less than or equal to, including, not including, etc.
In detail, in the embodiment of the present invention, analyzing the configuration information of the configuration page to obtain the configuration parameter includes:
converting the configuration information into a word sequence;
carrying out grammar logic judgment on the word sequence, carrying out grammar structure analysis and generating an abstract grammar tree;
and traversing the node data in the abstract syntax tree to obtain the configuration parameters of the configuration page.
Specifically, the method comprises the steps of utilizing a lexical analyzer to preprocess the configuration information to filter out blank spaces, skip comments, line breaks and the like, and converting the configuration information into word sequences according to a preset lexical method to prepare for subsequent syntactic analysis.
In the implementation of the invention, 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 using service rules in a preset service rule base to generate configuration files 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 and make a service decision.
In the embodiment of the invention, the service rule is the description of service definition and constraint, is used for maintaining a service structure or controlling and influencing the behavior of the service, is created by service personnel, can be updated in real time, and can be combined with configuration parameters to generate a configuration file conforming to the service rule. For example: the unit price of a commodity cannot exceed the maximum allowable value.
In the embodiment of the present invention, the configuration rule set is a set including configuration parameters and business rules corresponding to the configuration parameters, where each business rule includes a condition filter and a plurality of action instructions, the action is executed when the condition filter is true, and the condition filter can be used as a rule condition to determine whether the configuration parameters satisfy the rule condition.
In detail, referring to fig. 3, the reconstructing the configuration parameter according to the preset service rule to generate the configuration file corresponding to the configuration parameter includes:
s41, searching the adapted service rule in a preset service rule base according to the configuration parameter, and combining the configuration parameter and the adapted service rule to generate a configuration rule set;
s42, 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;
specifically, the embodiment of the present invention uses a conditional filter in the rule as the rule condition, and determines whether the rule condition satisfies a condition according to the true or false condition of the conditional filter value: when the conditional filter value is false, the rule condition does not satisfy a condition; when the conditional 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 the action instruction corresponding to the rule condition and executing S43;
when this rule condition is not the last rule condition in the rule set, return 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 rule conditions, and generating a configuration file meeting the business rules.
In the embodiment of the invention, the configuration parameters can be subjected to rule matching according to different business rules, so that a configuration file conforming to the business rules is generated, and the method and the device are suitable for 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 using 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 can make various display effect variants 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 document 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 the data list newly-added area, the data list searching area, the data list global operation area and the data list operation area correspond to the data list title area.
Furthermore, 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: and carrying out batch export and batch deletion on the data source, or modifying and deleting single data, or screening the data source according to logic configuration, and the like. For example: exporting the display fields in batches is as follows: the data list data source of the serial number, the name of the enterprise, the city, the town, the name of the commodity, the unit price and the sales number comprises data lists with the sales number larger than 2000.
In detail, in the embodiment of the present invention, the executing logic processing on the data source by using the configuration card to generate target data includes:
searching fields matched with the 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 using the configuration parameters to obtain target data.
Further, the target data is the content required by the data list display area of the data list.
S7, recursively rendering the target data and the configuration cards to obtain the data list.
In the embodiment of the invention, the rendering is a process of generating an image from a model by using software, namely a process of displaying contents such as a title area, a search area, a newly added area, a global operation area, a data list display area, a data column operation area and the like in the data list.
In the embodiment of the invention, the target data is an HTML format file and comprises a head and a body, the head can be linked to obtain a CCS file, and the body can be used for obtaining a DOM. 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 change the content, the structure and the style of a layout by using a CCS through the DOM interface.
In detail, referring to fig. 5, the S7 includes:
s71, performing HTML (hypertext markup language) analysis on the target data and the configuration document to obtain a corresponding DOM (document object model) tree and a CSS (cascading style sheet) file;
in the embodiment of the invention, HTML (hypertext markup language) analysis is carried out on the target data and the configuration document by using a preset analyzer to obtain a corresponding DOM tree and a corresponding CSS (cascading style document system) file. Optionally, the parser may be an HTML parsing engine, specifically: the HTML data in the web page data is composed of many tags, which may include < HTML >, < head >, < body >, < div >, < span >, etc. These tags are nested, one layer in another, e.g., < html > set < body >, < body > set < div >, < div > set < span >, etc. When analyzing, each label can be analyzed layer by layer, each label is abstracted into an object in the code, the corresponding DOM can be obtained by analyzing according to the well-defined organizational structure, and the DOM tree is constructed according to the corresponding syntactic structure.
Further, the target data and the html code of the configuration document are loaded by the analyzer, and a < link > tag in the < head > tags is obtained; using the < link > tag to quote an external CSS file, sending a request of the CSS file, and returning to the CSS file; and loading codes of parts < body > in the 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 the Styleshet object, wherein the Styleshet object comprises CSS rules, and then the CSS object is assembled by utilizing 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, the 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.
The method comprises the steps that based on the universality of a data list, widgets of the data list are created through a componentized integrated system, basic information configuration is carried out on the widgets through configuration pages of the widgets, and the data list is generated 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 service rules, so that the method is suitable for various different service scenes, and the development code amount of different service scene data lists 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 data list generating apparatus based on widgets according to an embodiment of the present invention.
The widget-based data list generating apparatus 100 according to the present invention may be installed in an electronic device. According to the implemented functions, the widget-based data list generation apparatus 100 may include a widget generation module 101, a data query module 102, a configuration card generation module 103, a logical operation module 104, and a rendering module 105. 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 widget generating module 101 is configured to create a widget of a data list based on a componentized integration system according to a data list generating instruction, and generate an identifier ID of the widget;
the data query module 102 is configured to obtain an SQL statement in a configuration page of the widget, query a data source of the data list by using the SQL statement, and map an identifier ID of the widget to the data source;
the configuration card generating module 103 is configured to analyze configuration information of the configuration page to obtain configuration parameters; carrying out rule matching on the configuration parameters by using a service rule in a preset service rule to generate a configuration file corresponding to the configuration parameters; packaging the configuration file into a configuration card, and mapping the ID of the widget to the configuration card;
the logical operation module 104 is configured to perform logical operation on the data source by using the configuration card 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, when the modules in the data list generating device 100 based on widgets according to the embodiment of the present invention are used, the same technical means as the data list generating method based on widgets described in fig. 1 to 5 are adopted, and the same technical effect can be produced, which is not described herein again.
Fig. 7 is a schematic structural diagram of an electronic device implementing a data list generation method based on a widget 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, such as a widget-based data list generating program, 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 electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (for example, executing a widget-based data list generation program, etc.) stored in the memory 11 and calling data stored in the memory 11.
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 code of a widget-based data list generation program, 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 or an Extended Industry Standard Architecture (EISA) bus. 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. 7 only shows 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 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 storage 11 in the electronic device 1 stores a widget-based data list generation program which is a combination of a plurality of instructions, and when running in the processor 10, can realize:
according to a data list generation instruction, creating a widget of a data list based on a componentized integration system, and generating an identification ID of the widget;
acquiring SQL sentences in the configuration page of the widget, querying a data source of the data list by using the SQL sentences, and mapping the identification ID of the widget to the data source;
analyzing the configuration information of the configuration page to obtain configuration parameters;
carrying out rule matching on the configuration parameters by using the service rules in a preset service rule base to generate a configuration file corresponding to the configuration parameters;
packaging the configuration file into a configuration card, and mapping the ID of the widget to the configuration card;
executing 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.
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:
according to a data list generation instruction, creating a widget of a data list based on a componentized integration system, and generating an identification ID of the widget;
acquiring SQL sentences in the configuration page of the widget, querying a data source of the data list by using the SQL sentences, and mapping the identification ID of the widget to the data source;
analyzing the configuration information of the configuration page to obtain configuration parameters;
carrying out rule matching on the configuration parameters by using a service rule in a preset service rule to generate a configuration file corresponding to the configuration parameters;
packaging the configuration file into a configuration card, and mapping the ID of the widget to the configuration card;
executing 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 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 widget-based data list generation method, the method comprising:
according to a data list generation instruction, creating a widget of a data list based on a componentized integration system, and generating an identification ID of the widget;
acquiring SQL sentences in the configuration page of the widget, querying a data source of the data list by using the SQL sentences, and mapping the identification ID of the widget to the data source;
analyzing the configuration information of the configuration page to obtain configuration parameters;
carrying out rule matching on the configuration parameters by using the service rules in a preset service rule base to generate a configuration file corresponding to the configuration parameters;
packaging the configuration file into a configuration card, and mapping the ID of the widget to the configuration card;
executing 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.
2. The widget-based data list generating method according to claim 1, wherein the creating a widget of a data list based on a componentized integration system according to a data list generating instruction comprises:
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 business function component from a 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 business 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 the configuration page of the widget;
extracting code blocks of a configuration page of the widget, and extracting component index function blocks from the code blocks;
and taking the index address of the general basic component and the index address of the business function component as the parameters of the component index function block, calling the general basic component and the business function component by using the component index function block comprising the index address, and combining the general basic component and the business function component with the configuration page of the widget to obtain the widget of the data list.
3. The widget-based data list generating method according to claim 1, wherein the 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, carrying out grammar structure analysis and generating an abstract grammar tree;
and traversing the node data in the abstract syntax tree to obtain the configuration parameters of the configuration page.
4. The widget-based data list generating method according to claim 1, wherein the performing rule matching on the configuration parameters by using the service rules in a preset service rule base to generate the configuration file corresponding to the configuration parameters includes:
searching an adaptive service rule in a preset service rule base according to the configuration parameters, and combining the configuration parameters and the adaptive service rule to generate a configuration rule set;
extracting a rule condition corresponding to one configuration parameter in the configuration rule set, and judging whether the configuration parameter meets the rule condition;
when the configuration parameters do not meet the rule conditions, ignoring action instructions 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;
when the configuration parameters meet the rule conditions, executing action instructions corresponding to the rule conditions, and returning to the step of extracting the rule conditions corresponding to one configuration parameter in the configuration rule set;
when all rule conditions in the configuration rule set are extracted, summarizing and executing configuration parameters of action instructions corresponding to the rule conditions, and generating configuration files meeting business rules.
5. The widget-based data list generation method of claim 1, wherein said packaging the configuration file as a configuration card comprises:
analyzing the configuration file to obtain a configuration document in an HTML format;
acquiring a card template from a preset template database based on the configuration document;
and loading the configuration document to the card template to generate the configuration card.
6. The widget-based data list generating method according to claim 1, wherein the performing a logical operation on the data source using the configuration card to generate target data comprises:
searching fields matched with the 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 using the configuration parameters to obtain target data.
7. The widget-based data list generating method according to claim 1, wherein the recursively rendering the target data and the configuration card to obtain the data list comprises:
HTML analysis is carried out on the target data and the configuration document to obtain a corresponding DOM tree and a corresponding CSS file;
analyzing the CSS file and constructing a CSS rule tree;
constructing a rendering tree according to the DOM tree and the CSS rule tree;
and traversing the rendering tree to draw the data list.
8. An apparatus for generating a widget-based data list, the apparatus comprising:
the widget generation module is used for creating widgets of the data list based on the componentized integrated system according to the data list generation instruction and generating the identification IDs of the widgets;
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 using the SQL sentences and mapping the identification ID of the widget to the data source;
the configuration card generating module is used for analyzing the configuration information of the configuration page to obtain configuration parameters; carrying out rule matching on the configuration parameters by using the service rules in a preset service rule base to generate a configuration file corresponding to the configuration parameters; packaging the configuration file into a configuration card, and mapping the ID of the widget to the configuration card;
the logical operation module is used for executing logical operation on the data source by utilizing the configuration card to generate target data;
and 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.
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 the widget-based data list generating method according to 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 the widget-based data list generating method according to any one of claims 1 to 7.
CN202110972787.8A 2021-08-24 2021-08-24 Data list generation method, device and equipment based on widget and storage medium Active CN113687827B (en)

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 true CN113687827A (en) 2021-11-23
CN113687827B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117497159A (en) * 2024-01-02 2024-02-02 智业软件股份有限公司 Method for managing hospital beds by using cards based on automatic SQL loading
CN118034690A (en) * 2024-03-12 2024-05-14 江西数字网联信息安全技术有限公司 Screening item configuration method, system, medium and equipment based on JSON configuration file

Citations (8)

* Cited by examiner, † Cited by third party
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
闫春荣;: "SOA架构下移动通信业务组合及服务封装方式研究", 通信管理与技术, no. 02 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117497159A (en) * 2024-01-02 2024-02-02 智业软件股份有限公司 Method for managing hospital beds by using cards based on automatic SQL loading
CN117497159B (en) * 2024-01-02 2024-04-16 智业软件股份有限公司 Method for managing hospital beds by using cards based on automatic SQL loading
CN118034690A (en) * 2024-03-12 2024-05-14 江西数字网联信息安全技术有限公司 Screening item configuration method, system, medium and equipment based on JSON configuration file

Also Published As

Publication number Publication date
CN113687827B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
CN111813963B (en) Knowledge graph construction method and device, electronic equipment and storage medium
CN115061721A (en) Report generation method and device, computer equipment and storage medium
CN111428451B (en) Text online editing method and device, electronic equipment and storage medium
CN113961584A (en) Method and device for analyzing field blood relationship, electronic equipment and storage medium
CN115408399A (en) Blood relationship analysis method, device, equipment and storage medium based on SQL script
CN115048111A (en) Code generation method, device, equipment and medium based on metadata
US6353884B1 (en) System for describing and storing descriptions of hierachical structures using hardware definition files to specify performance, characteristics, part number and name of hardware components
CN113687827B (en) Data list generation method, device and equipment based on widget and storage medium
CN113434542A (en) Data relation identification method and device, electronic equipment and storage medium
CN115062023A (en) Wide table optimization method and device, electronic equipment and computer readable storage medium
CN111553133B (en) Report generation method and device, electronic equipment and storage medium
CN114385155A (en) vue project visualization tool generation method, device, equipment and storage medium
CN113065086A (en) Webpage text extraction method and device, electronic equipment and storage medium
CN113918576B (en) Metadata management platform and management method
CN116595963B (en) Document generation method, device, equipment and medium based on template configuration
CN114625755A (en) Script checking method and device, electronic equipment and storage medium
CN114969099A (en) SQL script generation method, device, equipment and storage medium based on Java language
CN115905660A (en) Network security data acquisition method, device, 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
CN114968243A (en) Communication unification method, device, equipment and storage medium for VUE parent-child assembly
CN115130673A (en) Map construction method and device, electronic equipment and storage medium
CN115408453A (en) Configured report generation method and device, computer equipment and storage medium
CN115268980A (en) Method, device, equipment and storage medium for judging optimization of act component
CN114969043A (en) Label storage 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