CN106354727B - Widget file generation method and device - Google Patents

Widget file generation method and device Download PDF

Info

Publication number
CN106354727B
CN106354727B CN201510419220.2A CN201510419220A CN106354727B CN 106354727 B CN106354727 B CN 106354727B CN 201510419220 A CN201510419220 A CN 201510419220A CN 106354727 B CN106354727 B CN 106354727B
Authority
CN
China
Prior art keywords
file
widget
terminal
database information
configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510419220.2A
Other languages
Chinese (zh)
Other versions
CN106354727A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510419220.2A priority Critical patent/CN106354727B/en
Priority to PCT/CN2016/071234 priority patent/WO2016131360A1/en
Publication of CN106354727A publication Critical patent/CN106354727A/en
Application granted granted Critical
Publication of CN106354727B publication Critical patent/CN106354727B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • 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/248Presentation of query results

Abstract

The invention discloses a widget file generation method, wherein when a configuration file sent by a terminal is received, a server extracts configuration parameters in the configuration file based on the configuration file; according to the mapping relation between the preset configuration parameters and the database information, the server acquires the database information corresponding to the determined configuration parameters; and the server writes the acquired database information into a preset template file to generate a widget file. The invention also discloses a widget file generating device. The method and the device improve the generation efficiency of the widget file.

Description

Widget file generation method and device
Technical Field
The invention relates to the field of computers, in particular to a widget file generation method and device.
Background
With the rapid development of information technology, more and more service information needs to be displayed by various terminal devices, and the complexity of various service information also increases. A service information display platform commonly used in life is a Widget (Dashboard) preset on a terminal device, and the Widget can display various service information according to specific needs.
At present, most software applications need to use more and more business information, such as browser applications and the like, to display various chart information or report information through various widgets, but when new chart information appears in a system or the chart information changes, widget files corresponding to the widgets need to be redesigned and developed, such as manually writing codes, and then generating new widget files according to the written codes, and the mode of manually rewriting the codes to generate the widget files has low generation efficiency of the widget files.
Disclosure of Invention
The invention mainly aims to provide a widget file generation method and device, and aims to solve the technical problem of low generation efficiency due to the mode of manually writing codes to generate widget files.
In order to achieve the above object, the present invention provides a widget file generating method, which includes the following steps:
when a configuration file sent by a terminal is received, a server extracts configuration parameters in the configuration file based on the configuration file;
acquiring database information corresponding to the determined configuration parameters according to a mapping relation between the preset configuration parameters and the database information;
and writing the acquired database information into a preset template file to generate a widget file.
Preferably, the step of writing the acquired database information into a preset template file by the server to generate the widget file includes:
the server acquires a template file corresponding to the configuration parameters from a preset template file library;
and writing the acquired database information into a template file corresponding to the configuration parameters to generate a widget file.
Preferably, after the step of writing the acquired database information into a preset template file by the server to generate a widget file, the widget file generating method further includes:
the server acquires file fragments meeting the display requirements in the widget files;
and sending the file fragment to the terminal so that the terminal can receive the file fragment and display the widget corresponding to the file fragment on a preset interface.
Preferably, when a file segment meeting the display requirement in the widget file includes a plurality of file segments, the step of sending, by the server, the file segment to the terminal, so that the terminal receives the file segment and displays a widget corresponding to the file segment on a preset interface includes:
the server determines the display quantity of the file fragments on the same display interface of the terminal;
and sending the file fragments to the terminal so that the terminal can display the widgets corresponding to the file fragments in the number on the same display interface.
Preferably, after the step of writing the acquired database information into a preset template file by the server to generate a widget file, the widget file generating method further includes:
when a downloading instruction of the widget file is detected, the server sends the generated widget file to the terminal so that the terminal can store the received widget file.
In addition, to achieve the above object, the present invention further provides a widget file generating apparatus, including:
the extraction module is used for extracting configuration parameters in a configuration file based on the configuration file when the configuration file sent by a terminal is received;
the acquisition module is used for acquiring the database information corresponding to the determined configuration parameters according to the mapping relation between the preset configuration parameters and the database information;
and the generating module is used for writing the acquired database information into a preset template file so as to generate a widget file.
Preferably, the generating module comprises:
the acquisition unit is used for acquiring the template file corresponding to the configuration parameter from a preset template file library;
and the generating unit is used for writing the acquired database information into the template file corresponding to the configuration parameters so as to generate the widget file.
Preferably, the widget file generating apparatus further includes:
the acquisition module is further used for acquiring file fragments meeting the display requirements in the widget files;
and the first sending module is used for sending the file fragment to the terminal so that the terminal can receive the file fragment and display the window widget corresponding to the file fragment on a preset interface.
Preferably, when a file segment satisfying the display requirement in the widget file includes a plurality of file segments, the first sending module includes:
the determining unit is used for determining the display quantity of the file fragments on the same display interface of the terminal;
and the sending unit is used for sending the file fragments to the terminal so that the terminal can display the widgets corresponding to the file fragments in the number on the same display interface.
Preferably, the widget file generating apparatus further includes:
and the second sending module is used for sending the generated widget file to the terminal when a download instruction of the widget file is detected, so that the terminal can store the received widget file.
According to the widget file generation method and device, the server extracts the corresponding configuration parameters according to the received configuration file, then acquires the corresponding database information according to the configuration parameters, writes the acquired database information into the preset template file to generate the widget file, and only generates the widget file in a mode of manually writing codes instead of receiving the configuration file sent by the terminal, directly acquires the corresponding database information through the configuration parameters, and writes the acquired database information into the preset template file to generate the widget file, so that the generation efficiency of the widget file is improved.
Drawings
FIG. 1 is a flowchart illustrating a widget file generating method according to a first embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a preferred embodiment of writing the acquired database information into a preset template file by the server according to the present invention;
FIG. 3 is a flowchart illustrating a widget file generating method according to a third embodiment of the present invention;
fig. 4 is a schematic flowchart illustrating an embodiment of sending the file fragment to the terminal by the server in fig. 3;
FIG. 5 is a flowchart illustrating a widget file generating method according to a fifth embodiment of the present invention;
FIG. 6 is a functional block diagram of a widget file generating device according to a first embodiment of the present invention;
FIG. 7 is a schematic diagram of a refinement function module of the generation module of FIG. 6;
FIG. 8 is a functional block diagram of a widget file generating device according to a third embodiment of the present invention;
FIG. 9 is a block diagram illustrating a detailed function of the first sending module of FIG. 8;
fig. 10 is a functional block diagram of a widget file generating device according to a fifth 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 invention provides a widget file generation method.
Referring to fig. 1, fig. 1 is a flowchart illustrating a widget file generating method according to a first embodiment of the present invention.
The embodiment provides a widget file generation method, which includes:
step S10, when receiving the configuration file sent by the terminal, the server extracts the configuration parameters in the configuration file based on the configuration file;
in this embodiment, the configuration file preferably includes configuration parameters, and the configuration parameters are respectively a type identifier corresponding to a widget file to be generated, a size value corresponding to the widget file to be generated, identification information of the database, such as a data source ID number, an inquiry statement corresponding to specific information of the inquiry database, such as an SQL (Structured Query Language) statement, a data field identifier, and the like. Specifically, the type identifier is set according to a specific situation, for example, when the widget to be generated is a chart file, the corresponding type identifier is a, when the widget to be generated is a form file, the corresponding type identifier is B, or when the widget to be generated is a form file, the corresponding type identifier is C, and the like; the data source ID number is a unique identifier of each data source in the total database, and is used to distinguish each different data source, it may be understood that the server may include one or more data sources, and the data source ID number is used to divide different data sources, so that the classification of each data source in the database is more reasonable, and further, the data source ID may further include a data source type identifier, a data source IP address, a data source port, and a user name or password connected to the data source; and the server can acquire the corresponding data field in the data source according to the preset data field identification in the configuration parameters sent by the terminal and through the SQL statement. In this embodiment, the configuration parameters in the configuration file may also be preset to other values according to specific needs.
Step S20, according to the mapping relation between the preset configuration parameters and the database information, the server obtains the database information corresponding to the determined configuration parameters;
in this embodiment, the configuration parameters are set by the user as needed, the configuration parameters are equivalent to index information for establishing a widget file by the user, and specific information of the widget to be generated can be obtained according to the configuration parameters. According to the above embodiments, a database may include one or more data sources, the database information is the data sources, the configuration parameter includes a data source ID number, and according to the configuration parameter, the server may determine the data source ID and the data field identifier first, then determine the SQL statement corresponding to the configuration parameter in the data source, and finally extract the determined data field according to the SQL statement and the data field identifier.
In this embodiment, if the server stores the database information in advance, the corresponding configuration parameters are extracted when the configuration file sent by the terminal is received, and the database pre-stored in the server is queried according to the configuration parameters, so as to obtain the database information corresponding to the configuration parameters in the database. Further, the database information may be sent to the server together when the terminal sends the configuration file, in which case, when the terminal is to generate the widget file, the specific data information of the widget is not stored in the server, and the database information may be configured in advance by the terminal and sent to the server together when the terminal sends the configuration file.
In step S30, the server writes the acquired database information into a preset template file to generate a widget file.
In this embodiment, the template file preferably includes a chart html (Hypertext Markup Language) template file, the chart html template file is pre-stored in the server, each template file defines a type of chart file, and basically includes various main data chart files (such as form files, line drawing files, and the like), and further, a customized chart file can be provided according to specific needs. In this embodiment, the obtained database information may be written into a preset template file, for example, a default template file of the server, or written into a template file corresponding to the configuration parameter, so as to generate a widget file.
It can be understood that the database information in the server is continuously updated, when the information in the database is updated, the database information corresponding to the configuration file is also continuously increased, and when the database information corresponding to the configuration parameter is changed in real time, the server acquires the database information corresponding to the determined configuration parameter in real time and writes the database information acquired in real time into the template file corresponding to the configuration parameter, so as to generate the widget file in real time. And writing the database information acquired in real time into a preset template file, and generating the widget file in real time, so that the generation of the dynamic file is realized, and the generated widget file is more accurate.
According to the widget file generation method provided by the embodiment, the server extracts the corresponding configuration parameters according to the received configuration file, then acquires the corresponding database information according to the configuration parameters, writes the acquired database information into the preset template file to generate the widget file, and when the configuration file sent by the terminal is not received, the widget file can be generated only in a mode of manually writing codes, the corresponding database information is directly acquired through the configuration parameters, and the acquired database information is written into the preset template file to generate the widget file, so that the widget file generation efficiency is improved.
Further, in order to increase the flexibility of widget file generation, a second embodiment of the widget file generation method of the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 2, the step S30 includes:
step S31, the server obtains the template file corresponding to the configuration parameter from a preset template file library;
in this embodiment, the server stores various types of template files, such as form template files, line drawing template files, and other various template files in advance, the various types of template files form a template file library, and a user-defined template file may also be added to the template file library. In this embodiment, preferably, the configuration parameters include type information of the template file and a size value of the template file, and when acquiring the configuration parameters, the server acquires the matched template file in the template file repository according to the information in the configuration parameters. Further, when the configuration parameters do not contain the type information of the template file, preferably acquiring a default template file as the template file of the widget file to be generated; or when the server fails to acquire the template file type information in the configuration parameters (for example, the template file type information included in the configuration parameters is inconsistent with the template file type in the template file library preset by the server), preferably acquiring a default template file as the template file of the widget file to be generated. In this embodiment, the obtained template file format is preferably an xml (Extensible Markup Language) file format.
Step S32, the server writes the acquired database information to the template file corresponding to the configuration parameter to generate a widget file.
In this embodiment, a preferable scheme is that, when receiving a configuration file, a server extracts a template file corresponding to the configuration parameter in the template file library, that is, a type identifier corresponding to the template file included in the configuration parameter, and when obtaining the determined template file, a file format to be generated by the widget file may be determined, at this time, the server writes obtained database information into the template file corresponding to the configuration parameter to generate the widget file, and a preferred mode of writing the obtained database information into the template file corresponding to the configuration parameter is: and the server writes the acquired database information into a corresponding position on the template file according to the mapping relation between the database information and the parameters on the template file. For example, the server first determines identification information of each position of a row and a column of the template file, for example, each identification information corresponding to the row is a name, time or price, etc.; then, corresponding database information is determined according to the row identification information, for example, a data field with an identification containing a name type, a data field with an identification containing a time type and a data field with an identification containing a price type in the database information are determined; and finally, writing the data fields in the determined database information into the positions corresponding to the row identification information to generate the widget file.
Further, in order to increase the flexibility of widget file generation, a third embodiment of the widget file generation method according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 3, after step S30, the widget file generation method further includes:
step S40, the server acquires the file segments which meet the display requirements in the widget files;
step S50, the server sends the file segment to the terminal, so that the terminal can receive the file segment and display the window widget corresponding to the file segment on a preset interface.
In this embodiment, preferably, the server stores the generated widget file in a preset storage space, where the preset storage space includes a directory specified by the server, such as a default folder of the server; or a preset storage space in the template file library, such as a preset folder in the directory of the template file library. It is understood that the storage space may also be a hard disk or a memory card of the server. The server acquires a file segment meeting display requirements in the widget file, wherein the file segment meeting the display requirements is preferably an html code segment or a data segment preset in the widget file, and sends the acquired html code segment or the acquired data segment to the terminal, so that the terminal can display the widget corresponding to the code segment or the data segment on a preset interface.
Further, in order to increase the flexibility of the widget file generation, a fourth embodiment of the widget file generation method according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 4, when the file segment satisfying the display requirement in the widget file includes a plurality of file segments, the step S50 includes:
step S51, the server determines the display quantity of the file fragments on the same display interface of the terminal;
and step S52, the server sends the file fragments to the terminal so that the terminal can display the widgets corresponding to the file fragments in the number on the same display interface.
In this embodiment, a preferred scheme is that the server self-defines the display number of the file segments on the same display interface, for example, a plurality of widgets are displayed on the same display interface at one time by file segments which meet the display requirements in a preset widget file; or when the configuration file is received, if a preset number of widgets are displayed on the same display interface at one time according to a preset instruction in the configuration parameters, the file segments corresponding to the number are obtained, and the file segments are sent to the terminal so that the terminal can display the widgets corresponding to the number of file segments on the same display interface, and the display efficiency of the widgets is effectively improved
Further, in order to increase the flexibility of widget file generation, a fifth embodiment of the widget file generation method according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 5, after step S30, the widget file generation method further includes:
step S60, when detecting a download instruction of the widget file, the server sends the generated widget file to the terminal, so that the terminal stores the received widget file.
In this embodiment, preferably, the server sends the generated widget file to the terminal, so that the terminal stores the received widget file, and when the terminal sends the configuration file to the server for customization, the final server feeds back the widget file generated by customization to the terminal, so that the terminal stores the widget file fed back by the server. Further, the terminal may display a widget corresponding to the widget file in a preset application, or display the widget corresponding to the widget file on a terminal display interface.
The invention further provides a widget file generating device.
Referring to fig. 6, fig. 6 is a functional module diagram of the widget file generating device according to the preferred embodiment of the present invention.
It is emphasized that the functional block diagram of fig. 6 is merely an exemplary diagram of a preferred embodiment, and those skilled in the art can easily add new functional blocks around the functional blocks of the widget file generating apparatus shown in fig. 6; the names of the functional modules are self-defined names which are only used for assisting in understanding the program functional blocks of the widget file generating device and are not used for limiting the technical scheme of the invention, and the core of the technical scheme of the invention is the functions which are achieved by the functional modules with the respective defined names.
The present embodiment provides a widget file generating apparatus, where the widget file generating apparatus includes:
an extraction module 10, configured to, when receiving a configuration file sent by a terminal, extract configuration parameters in the configuration file based on the configuration file;
in this embodiment, the configuration file preferably includes configuration parameters, and the configuration parameters are respectively a type identifier corresponding to a widget file to be generated, a size value corresponding to the widget file to be generated, identification information of the database, such as a data source ID number, an inquiry statement corresponding to specific information of the inquiry database, such as an SQL (Structured Query Language) statement, a data field identifier, and the like. Specifically, the type identifier is set according to a specific situation, for example, when the widget to be generated is a chart file, the corresponding type identifier is a, when the widget to be generated is a form file, the corresponding type identifier is B, or when the widget to be generated is a form file, the corresponding type identifier is C, and the like; the data source ID number is a unique identifier of each data source in the total database, and is used to distinguish each different data source, it can be understood that the widget file generating apparatus may include one or more data sources, and the data source ID number is used to divide different data sources, so that the classification of each data source in the database is more reasonable, and further, the data source ID may further include a data source type identifier, a data source IP address, a data source port, and a user name or password connected to the data source; the extraction module 10 may obtain the corresponding data field in the data source according to the preset data field identifier in the configuration parameter sent by the terminal and through the SQL statement. In this embodiment, the configuration parameters in the configuration file may also be preset to other values according to specific needs.
The obtaining module 20 is configured to obtain, according to a mapping relationship between preset configuration parameters and database information, database information corresponding to the determined configuration parameters; '
In this embodiment, the configuration parameters are set by the user as needed, the configuration parameters are equivalent to index information for establishing a widget file by the user, and specific information of the widget to be generated can be obtained according to the configuration parameters. According to the above embodiments, one database may include one or more data sources, the database information is the data sources, the configuration parameter includes a data source ID number, according to the configuration parameter, the data source ID number and the data field identifier may be determined first, then the SQL statement corresponding to the configuration parameter in the data source is determined, and finally, the extraction module 10 may extract the determined data field according to the SQL statement and the data field identifier.
In this embodiment, database information is stored in advance, the extracting module 10 extracts corresponding configuration parameters when receiving a configuration file sent by a terminal, and queries a database pre-stored in the server according to the configuration parameters, and the obtaining module 20 obtains database information corresponding to the configuration parameters in the database. Further, the database information may be sent to the extraction module 10 together when the terminal sends the configuration file, in this case, when the terminal is to generate the widget file, the specific data information of the widget is not stored in the widget file generation device, and the database information may be sent to the extraction module 10 together when the terminal configures the database information first and sends the configuration file to the extraction module 10.
And the generating module 30 is configured to write the acquired database information into a preset template file to generate a widget file.
In this embodiment, the template file preferably includes a chart html (Hypertext Markup Language) template file, the chart html template file is pre-stored in the server, each template file defines a type of chart file, and basically includes various main data chart files (such as form files, line drawing files, and the like), and further, a customized chart file can be provided according to specific needs. In this embodiment, the obtained database information may be written into a preset template file, for example, a default template file of the widget file generating apparatus, or written into a template file corresponding to the configuration parameter, so as to generate the widget file.
It can be understood that the database information in the widget file generating apparatus is continuously updated, when the information in the database is updated, the database information corresponding to the configuration file is also continuously increased, when the database information corresponding to the configuration parameter is changed in real time, the obtaining module 20 obtains the database information corresponding to the determined configuration parameter in real time, and the generating module 30 writes the database information obtained in real time to the template file corresponding to the configuration parameter to generate the widget file in real time. And writing the database information acquired in real time into a preset template file, and generating the widget file in real time, so that the generation of the dynamic file is realized, and the generated widget file is more accurate.
According to the widget file generation device provided by the embodiment, the server extracts the corresponding configuration parameters according to the received configuration files, then acquires the corresponding database information according to the configuration parameters, writes the acquired database information into the preset template file to generate the widget file, and only generates the widget file in a mode of manually writing codes instead of receiving the configuration file sent by the terminal, directly acquires the corresponding database information through the configuration parameters, and writes the acquired database information into the preset template file to generate the widget file, so that the generation efficiency of the widget file is improved.
Further, in order to increase the flexibility of widget file generation, a second embodiment of the widget file generating apparatus according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 7, the generating module 30 includes:
an obtaining unit 31, configured to obtain a template file corresponding to the configuration parameter from a preset template file library;
in this embodiment, the widget file generating apparatus stores various types of template files in advance, such as form template files, line drawing template files, and other various template files, where the various types of template files form a template file library, and a user-defined template file may also be added to the template file library. In this embodiment, it is preferable that the configuration parameters include type information of the template file and a size value of the template file, and when the obtaining module 20 obtains the configuration parameters, the obtaining module 20 obtains the matched template file in the template file repository according to the information in the configuration parameters. Further, when the configuration parameter does not include the type information of the template file, preferably, the obtaining module 20 obtains a default template file as a template file of the widget file to be generated; or when the obtaining module 20 fails to obtain the template file type information in the configuration parameters (for example, the template file type information included in the configuration parameters is inconsistent with the template file type in the preset template file library), preferably, the obtaining module 20 obtains a default template file as the template file of the widget file to be generated. In this embodiment, the obtained template file format is preferably an xml (Extensible Markup Language) file format.
And the generating unit 32 is configured to write the acquired database information into a template file corresponding to the configuration parameter, so as to generate a widget file.
In this embodiment, preferably, when a configuration file is received, the obtaining unit 31 extracts a template file corresponding to the configuration parameter in the template file library, that is, a type identifier corresponding to the template file included in the configuration parameter, when the obtaining unit 31 obtains a determined template file, a file format to be generated by the widget file may be determined, at this time, the generating unit 32 writes the obtained database information into the template file corresponding to the configuration parameter to generate the widget file, and a mode that the generating unit 32 writes the obtained database information into the template file corresponding to the configuration parameter is preferably: the generating unit 32 writes the acquired database information into a corresponding position on the template file according to the mapping relationship between the database information and the parameters on the template file. For example, the generating unit 32 first determines the identification information of each position of the row and column of the template file, for example, each identification information corresponding to the row is a name, time, or price; then, corresponding database information is determined according to the row identification information, for example, a data field with an identification containing a name type, a data field with an identification containing a time type and a data field with an identification containing a price type in the database information are determined; and finally, writing the data fields in the determined database information into the positions corresponding to the row identification information to generate the widget file.
Further, in order to increase flexibility of widget file generation, a third embodiment of the widget file generating apparatus according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 8, the widget file generating apparatus further includes:
the obtaining module 20 is further configured to obtain a file segment that meets the display requirement in the widget file;
the first sending module 40 is configured to send the file segment to the terminal, so that the terminal receives the file segment and displays a widget corresponding to the file segment on a preset interface.
In this embodiment, it is preferable that the generated widget file is stored in a preset storage space, where the preset storage space includes a directory specified by the server, for example, in a default folder; or a preset storage space in the template file library, such as a preset folder in the directory of the template file library. It is understood that the storage space may also be a hard disk or a memory card, etc. The obtaining module 20 obtains a file segment meeting a display requirement in the widget file, where the file segment meeting the display requirement is preferably an html code segment or a data segment preset in the widget file, and the first sending module 40 sends the obtained html code segment or data segment to the terminal, so that the terminal can display the widget corresponding to the code segment or data segment on a preset interface.
Further, in order to increase the flexibility of generating the widget file, a fourth embodiment of the widget file generating apparatus according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 9, when a file segment satisfying the display requirement in the widget file includes a plurality of file segments, the first sending module 40 includes:
the determining unit 41 is configured to determine the display number of the file segments on the same display interface of the terminal;
and the sending unit 42 is configured to send the file segments to the terminal, so that the terminal displays the widgets corresponding to the file segments in the number on the same display interface.
In this embodiment, a preferable scheme is that the determining unit 41 self-defines the display number of the file segments on the same display interface, for example, a file segment meeting the display requirement in a preset widget file displays a plurality of widgets on the same display interface at one time; or when the configuration file is received, according to a preset instruction in the configuration parameters, for example, a preset number of widgets are displayed at one time on the same display interface, the file segments corresponding to the number are acquired, and the sending unit 42 sends the file segments to the terminal, so that the terminal can display the widgets corresponding to the number of file segments on the same display interface, and the display efficiency of the widgets is effectively improved
Further, in order to increase flexibility of widget file generation, a fifth embodiment of the widget file generating apparatus according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 10, the widget file generating apparatus further includes:
and a second sending module 50, configured to send the generated widget file to the terminal when a download instruction of the widget file is detected, so that the terminal stores the received widget file.
In this embodiment, when a download instruction of a widget file is detected, preferably, the second sending module 50 sends the generated widget file to the terminal, so that the terminal stores the received widget file, and when the terminal sends a configuration file to the server for customization, finally the second sending module 50 feeds back the widget file generated by customization to the terminal, so that the terminal stores the widget file fed back by the server. Further, the terminal may display a widget corresponding to the widget file in a preset application, or display the widget corresponding to the widget file on a terminal display interface.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A widget file generation method is characterized by comprising the following steps:
when a configuration file sent by a terminal is received, a server extracts configuration parameters in the configuration file based on the configuration file;
acquiring database information corresponding to the determined configuration parameters according to a mapping relation between the preset configuration parameters and the database information;
writing the acquired database information into a preset template file to generate a widget file;
the server acquires file fragments meeting the display requirements in the widget files;
and sending the file fragment to the terminal so that the terminal can receive the file fragment and display the widget corresponding to the file fragment on a preset interface.
2. The widget file generating method according to claim 1, wherein the server writes the acquired database information into a preset template file to generate the widget file comprises:
the server acquires a template file corresponding to the configuration parameters from a preset template file library;
and writing the acquired database information into a template file corresponding to the configuration parameters to generate a widget file.
3. The widget file generating method according to claim 1, wherein when the file segment satisfying the display requirement in the widget file includes a plurality of file segments, the server sends the file segment to the terminal, so that the terminal receives the file segment and displays the widget corresponding to the file segment on a preset interface, the step includes:
the server determines the display quantity of the file fragments on the same display interface of the terminal;
and sending the file fragments to the terminal so that the terminal can display the widgets corresponding to the file fragments in the number on the same display interface.
4. The widget file generating method according to claim 1 or 2, wherein after the step of the server writing the acquired database information into a preset template file to generate the widget file, the widget file generating method further comprises:
when a downloading instruction of the widget file is detected, the server sends the generated widget file to the terminal so that the terminal can store the received widget file.
5. A widget file generating apparatus, characterized in that the widget file generating apparatus comprises:
the extraction module is used for extracting configuration parameters in a configuration file based on the configuration file when the configuration file sent by a terminal is received;
the acquisition module is used for acquiring the database information corresponding to the determined configuration parameters according to the mapping relation between the preset configuration parameters and the database information;
the generating module is used for writing the acquired database information into a preset template file so as to generate a widget file;
the acquisition module is further used for acquiring file fragments meeting the display requirements in the widget files;
and the first sending module is used for sending the file fragment to the terminal so that the terminal can receive the file fragment and display the window widget corresponding to the file fragment on a preset interface.
6. The widget file generating apparatus according to claim 5, wherein the generating module comprises:
the acquisition unit is used for acquiring the template file corresponding to the configuration parameter from a preset template file library;
and the generating unit is used for writing the acquired database information into the template file corresponding to the configuration parameters so as to generate the widget file.
7. The widget file generating apparatus according to claim 5, wherein when the file fragment satisfying the display requirement in the widget file includes a plurality of file fragments, the first transmitting module comprises:
the determining unit is used for determining the display quantity of the file fragments on the same display interface of the terminal;
and the sending unit is used for sending the file fragments to the terminal so that the terminal can display the widgets corresponding to the file fragments in the number on the same display interface.
8. The widget file generating apparatus according to claim 5 or 6, wherein the widget file generating apparatus further comprises:
and the second sending module is used for sending the generated widget file to the terminal when a download instruction of the widget file is detected, so that the terminal can store the received widget file.
CN201510419220.2A 2015-07-16 2015-07-16 Widget file generation method and device Active CN106354727B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510419220.2A CN106354727B (en) 2015-07-16 2015-07-16 Widget file generation method and device
PCT/CN2016/071234 WO2016131360A1 (en) 2015-07-16 2016-01-18 Widget file generation method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510419220.2A CN106354727B (en) 2015-07-16 2015-07-16 Widget file generation method and device

Publications (2)

Publication Number Publication Date
CN106354727A CN106354727A (en) 2017-01-25
CN106354727B true CN106354727B (en) 2021-01-26

Family

ID=56692195

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510419220.2A Active CN106354727B (en) 2015-07-16 2015-07-16 Widget file generation method and device

Country Status (2)

Country Link
CN (1) CN106354727B (en)
WO (1) WO2016131360A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704479B (en) 2017-02-08 2020-06-30 深圳壹账通智能科技有限公司 File generation method and device
CN110727469B (en) * 2018-06-29 2022-08-16 珠海市魅族科技有限公司 Terminal device control method and device, application program configuration file packaging method, terminal device and computer readable storage medium
CN109614191A (en) * 2018-12-07 2019-04-12 上海商米科技有限公司 The processing method and processing device of application
CN109766122A (en) * 2018-12-20 2019-05-17 平安信托有限责任公司 Document data transfer generation method, device, computer equipment and storage medium
CN110826080B (en) * 2019-09-18 2024-03-08 平安科技(深圳)有限公司 Method, device, equipment and computer readable storage medium for generating multimedia file

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673199A (en) * 2009-08-10 2010-03-17 厦门敏讯信息技术股份有限公司 Terminal parameter configuration server and automatic generating method of software interface thereof
CN102163188A (en) * 2011-04-07 2011-08-24 北京数码大方科技有限公司 Generation method and device thereof for EXCEL report in application system
CN102262538A (en) * 2011-07-26 2011-11-30 中兴通讯股份有限公司 Method and device for processing widget
CN104317576A (en) * 2014-07-04 2015-01-28 北京思特奇信息技术股份有限公司 Code automatic generation method and system based on eclipse

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8769490B2 (en) * 2008-09-16 2014-07-01 Oracle International Corporation Desktop widget engine emulator component for a rapid application development tool
CN102096581B (en) * 2009-12-10 2015-03-18 华为技术有限公司 Method and device for generating widget
US8458605B2 (en) * 2010-02-26 2013-06-04 Amulet Technologies, Llc Image file as container for widgets in GUI authoring tool
US9665349B2 (en) * 2012-10-05 2017-05-30 Box, Inc. System and method for generating embeddable widgets which enable access to a cloud-based collaboration platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673199A (en) * 2009-08-10 2010-03-17 厦门敏讯信息技术股份有限公司 Terminal parameter configuration server and automatic generating method of software interface thereof
CN102163188A (en) * 2011-04-07 2011-08-24 北京数码大方科技有限公司 Generation method and device thereof for EXCEL report in application system
CN102262538A (en) * 2011-07-26 2011-11-30 中兴通讯股份有限公司 Method and device for processing widget
CN104317576A (en) * 2014-07-04 2015-01-28 北京思特奇信息技术股份有限公司 Code automatic generation method and system based on eclipse

Also Published As

Publication number Publication date
WO2016131360A1 (en) 2016-08-25
CN106354727A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
CN106354727B (en) Widget file generation method and device
CN107545181B (en) Program operating method, terminal, and computer-readable storage medium
CN107798001B (en) Webpage processing method, device and equipment
CN102750152B (en) Method and device of application for generating a plurality of programming languages based on descriptive language
CN107656729B (en) List view updating apparatus, method and computer-readable storage medium
CN110716783A (en) Front-end page generation and deployment method and device, storage medium and equipment
CN107861750B (en) Label management method, label management device and intelligent terminal
CN112988770B (en) Method, device, electronic equipment and storage medium for updating serial number
CN111274263A (en) Visual database change statement generation method and device and storage medium
CN110597896A (en) Data display method, data display device and terminal equipment
CN111198772A (en) Method and system for generating application program interface API
CN114090671A (en) Data import method and device, electronic equipment and storage medium
CN111125220B (en) Information custom export method and device
CN114611481A (en) Template configuration method and device, computer equipment and storage medium
CN104361040A (en) Method and device for customized query
CN110597508A (en) Interface dynamic configuration method, device and storage medium
CN112000692B (en) Page query feedback method and device, computer equipment and readable storage medium
CN105653674B (en) File management method and system of intelligent terminal
CN110688315A (en) Interface code detection report generation method, electronic device, and storage medium
CN111125205A (en) Signboard data display method, terminal and storage medium
CN115809652A (en) Method and device for automatically synthesizing red-header file
CN115455925A (en) Contract generation method and device, electronic equipment and storage medium
CN109446159B (en) Multi-version file management method, server and computer readable storage medium
CN113948164A (en) Clinical medicine management method, device, equipment and computer readable storage medium
CN112988781A (en) Data query method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
C06 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