CN114995915A - Template configuration method and device, electronic equipment and storage medium - Google Patents

Template configuration method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114995915A
CN114995915A CN202210723424.5A CN202210723424A CN114995915A CN 114995915 A CN114995915 A CN 114995915A CN 202210723424 A CN202210723424 A CN 202210723424A CN 114995915 A CN114995915 A CN 114995915A
Authority
CN
China
Prior art keywords
template
data
dynamic
fixed
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210723424.5A
Other languages
Chinese (zh)
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 Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202210723424.5A priority Critical patent/CN114995915A/en
Publication of CN114995915A publication Critical patent/CN114995915A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a template configuration method and device, electronic equipment and a computer-readable storage medium. The template configuration method provided by the invention comprises the following steps: acquiring template data to be configured, and acquiring fixed data and dynamic data from the template data to be configured; generating a fixed template unit according to the fixed data, and generating a dynamic template unit according to the dynamic data; determining an incidence relation between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit; and splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit to obtain the template to be applied. The template configuration method provided by the invention can realize the configuration of the template, improve the efficiency of template maintenance and reduce the time cost of template maintenance.

Description

Template configuration method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of template maintenance technologies, and in particular, to a template configuration method and apparatus, an electronic device, and a computer-readable storage medium.
Background
At present, a common open source packet for reading templates in Java language has a thymelaf-spring 5, and the template engine of the open source packet can well support reading and parsing of XML and HTML files. Open source packages which can analyze the XML of the database SQL file comprise Mybatis, Mybatis-plus, Hibernate and the like, and the open source packages can well support the XML of the database SQL file, but lack uniform use specifications for the use of an HTML template. In the actual project development process, the mail sending usually integrates the fixed and unchangeable contents into a template, and the dynamic form contents are combined with the fixed template into the final mail contents after being subjected to HTML splicing by a program. The lack of uniform specifications in the section for dynamic table splicing leads to different code styles developed by different developers. The increasing number of mail templates and the code styles of all styles bring great trouble to maintenance work.
In the template maintenance process, a maintainer needs to comb the original logic first and then modify the template, and under the condition of small number of templates, the maintainer may have energy to maintain, but along with the increase of business, under the condition that the number of the templates reaches 10 or more, the maintainer cannot clearly understand the splicing logic of all the templates, and can only comb the logic again and then maintain when maintenance is needed, so that the maintenance time cost is high.
Disclosure of Invention
The invention aims to provide a template configuration method, a template configuration device, electronic equipment and a computer readable storage medium, and aims to solve the technical problems of low template maintenance efficiency and high template maintenance cost in the prior art.
The technical scheme of the invention is as follows, and provides a template configuration method, which comprises the following steps:
acquiring template data to be configured, and acquiring fixed data and dynamic data from the template data to be configured;
generating a fixed template unit according to the fixed data, and generating a dynamic template unit according to the dynamic data;
determining an incidence relation between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit;
and splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit to obtain the template to be applied.
Further, acquiring fixed data and dynamic data from the template data to be configured includes:
and acquiring general data in the template data to be configured, taking the general data as the fixed data, acquiring non-general data in the template data to be configured, and taking the non-general data as dynamic data.
Further, determining an association relationship between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit includes:
and if the fixed data in the fixed template unit is associated with the dynamic data in the dynamic template unit, the fixed template unit has an associated relationship with the dynamic template unit, otherwise, the fixed template unit has no associated relationship with the dynamic template unit.
Further, generating a fixed template unit according to the fixed data, and generating a dynamic template unit according to the dynamic data, including:
and generating a plurality of fixed template units according to the fixed data, and generating a plurality of dynamic template units according to the dynamic data.
Further, according to the association relationship between the fixed template unit and the dynamic template unit, splicing the fixed template unit and the dynamic template unit to obtain a template to be applied, including:
and splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit, the incidence relation between different fixed template units and the incidence relation between different dynamic template units to obtain the template to be applied.
Further, the template configuration method further comprises the step of obtaining association relations among different fixed template units according to fixed data in the different fixed template units; and acquiring the association relation between different dynamic template units according to the dynamic data in different dynamic template units.
Further, the template configuration method further includes, after the template to be applied is obtained, performing data unification on dynamic data in the template to be applied according to a data type of the dynamic data in the template to be applied, filling the dynamic data with unified data into a preset list column in the template to be applied, obtaining the template to be applied after data filling, and calling a mail service to send the template to be applied after data filling to a preset address.
Another technical solution of the present invention is to provide a template configuration apparatus, which includes a data acquisition module, a template unit generation module, a relationship determination module, and a splicing module;
the data acquisition module is used for acquiring template data to be configured and acquiring fixed data and dynamic data from the template data to be configured;
the template unit generating module is used for generating a fixed template unit according to the fixed data and generating a dynamic template unit according to the dynamic data;
the relation determining module is used for determining the incidence relation between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit;
and the splicing module is used for splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit to obtain the template to be applied.
Another aspect of the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program executable by the processor, and the processor implements the template configuration method according to any one of the above aspects when executing the computer program.
Another aspect of the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the template configuration method according to any one of the above aspects.
The invention has the beneficial effects that: acquiring template data to be configured, and acquiring fixed data and dynamic data from the template data to be configured; generating a fixed template unit according to the fixed data, and generating a dynamic template unit according to the dynamic data; determining an incidence relation between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit; splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit to obtain a template to be applied; by the scheme, the template can be configured, the template maintenance efficiency is improved, and the time cost of template maintenance is reduced.
Drawings
Fig. 1 is a schematic flowchart of a template configuration method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a configuration of a template according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a template configuration apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Fig. 1 is a flowchart illustrating a template configuration method according to an embodiment of the present invention. It should be noted that the template configuration method provided by the present invention is not limited to the flow sequence shown in fig. 1 if the same results are obtained. As shown in fig. 1, the template configuration method mainly includes the following steps:
s1, acquiring template data to be configured, and acquiring fixed data and dynamic data from the template data to be configured;
the fixed data is general data in the template data to be configured, and the dynamic data is non-general data in the template data to be configured. The template data to be configured is original data for forming the fixed template and the dynamic template, for example, in one mail sending service, all contents to be sent in the mail body may be used as the original data, and in the specific implementation, the template data to be configured may include contents in a plurality of mail sending services.
S2, generating a fixed template unit according to the fixed data and generating a dynamic template unit according to the dynamic data;
for convenience of splicing the fixed template unit and the dynamic template unit in the subsequent actual service, the fixed data in the fixed template unit is summarized into a uniform format and a uniform conversation as much as possible, and the dynamic data in the dynamic template unit is unified into uniform content as much as possible.
S3, determining the association relationship between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit;
and determining the incidence relation between the fixed template unit and the dynamic template unit according to the logic relation between the fixed data of the fixed template unit and the dynamic data of the dynamic template unit, thereby determining the splicing mode between the fixed template unit and the dynamic template unit.
And S4, splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit to obtain the template to be applied.
In a specific embodiment, if the fixed template unit a and the dynamic template unit B are spliced to obtain the template C to be applied, in the splicing process, sometimes the fixed data in the fixed template unit a and the dynamic data in the dynamic template unit B are not simply spliced together, but a splicing mode may be set according to an actual situation, for example, the variable identifier in the fixed template unit a is replaced with the corresponding data in the dynamic template unit B.
In an optional embodiment, obtaining the fixed data and the dynamic data from the template data to be configured includes:
and acquiring general data in the template data to be configured, taking the general data as the fixed data, acquiring non-general data in the template data to be configured, and taking the non-general data as dynamic data.
In a specific embodiment, the general data may be general words, and if the user needs to send a task hastening mail, the general words may be "hello, you have X tasks to be processed, and the details of the tasks are as follows", and the general data is used as fixed data; the non-general data may be some data that changes with actual data and scenes, and similarly, taking the case that the user needs to send a task-oriented email as an example, after the general data of the task-oriented email, there may also be tables that change with the actual data and scenes, and these tables that change with the actual data and scenes are non-general data, and the non-general data is used as dynamic data.
In an optional embodiment, determining, according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit, an association relationship between the fixed template unit and the dynamic template unit includes:
and if the fixed data in the fixed template unit is associated with the dynamic data in the dynamic template unit, the fixed template unit has an associated relationship with the dynamic template unit, otherwise, the fixed template unit has no associated relationship with the dynamic template unit.
It should be noted that, according to the logical relationship between the fixed data of the fixed template unit and the dynamic data of the dynamic template unit, it is determined whether the fixed data in the fixed template unit and the dynamic data in the dynamic template unit are related; if there is a relationship between a fixed template unit and another dynamic template unit, the fixed template unit and the dynamic template unit may be spliced in a subsequent splicing process, and specifically, whether the fixed template unit and the dynamic template unit are spliced or not is determined according to user requirements.
In an optional embodiment, generating a fixed template unit according to the fixed data, and generating a dynamic template unit according to the dynamic data includes:
and generating a plurality of fixed template units according to the fixed data, and generating a plurality of dynamic template units according to the dynamic data.
It should be noted that, because the template data to be configured may include a large amount of fixed data and dynamic data, in specific implementation, a plurality of fixed template units and a plurality of dynamic template units may be generated according to the template data to be configured.
In an optional embodiment, the splicing the fixed template unit and the dynamic template unit according to the association relationship between the fixed template unit and the dynamic template unit to obtain the template to be applied includes:
and splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit, the incidence relation between different fixed template units and the incidence relation between different dynamic template units to obtain the template to be applied.
In a specific embodiment, the splicing of the fixed template unit and the dynamic template unit may be the splicing of one fixed template unit and one dynamic template unit, or the splicing of one fixed template unit and a plurality of dynamic template units, a plurality of fixed template units and one dynamic template unit, or a plurality of fixed template units and a plurality of dynamic template units; for example, the fixed template unit a and the dynamic template unit B are spliced with the dynamic template unit C, or the fixed template unit D, the fixed template unit E, and the dynamic template unit F are spliced with the dynamic template unit G. According to different service scenes, different splicing modes can be set, and the multiplexing of the fixed template unit and the dynamic template unit can be realized to the greatest extent by splicing the templates.
In an optional embodiment, the template configuration method further includes obtaining an association relationship between different fixed template units according to fixed data in the different fixed template units; and acquiring the association relation between different dynamic template units according to the dynamic data in different dynamic template units.
It should be noted that there may also be an association between different fixed template units, and an association between different dynamic fixed template units; determining whether the fixed data in the two fixed template units are related or not according to the logical relationship between the fixed data of one fixed template unit and the fixed data of the other fixed template unit, thereby determining whether the different fixed template units are related or not; and determining whether the dynamic data in the two dynamic template units are associated according to the logical relationship between the dynamic data of one dynamic template unit and the dynamic data of the other dynamic template unit, thereby determining whether the different dynamic template units are associated.
In an optional embodiment, after the template to be applied is obtained, the template configuration method further includes, according to a data type of dynamic data in the template to be applied, performing data unification on the dynamic data in the template to be applied, filling the dynamic data after the data unification into a preset list column in the template to be applied, obtaining the template to be applied after the data are filled, and calling a mail service to send the template to be applied after the data are filled to a preset address.
In a specific implementation, the dynamic data in the template to be applied is dynamic data to be sent, and in an application scene of sending a mail, the dynamic data to be sent can be specific work content information, personnel information or date information; unifying the data format of the dynamic data to be sent according to the data type of the dynamic data to be sent, for example, when the data type of the dynamic data to be sent is DATE (DATE), specifically 2022-01-0110:25:25, converting 2022-01-0110:25:25 into 2022-01-01, then filling the dynamic data to be sent after the data format is unified into a preset list column in a template to be applied, obtaining the template to be applied after the data is filled, and calling an email service to send the template to be applied after the data is filled to a preset address.
In a specific embodiment, a timing task is started, information such as data to be sent and a receiver is obtained from a database, and the data to be sent is obtained template data to be configured; acquiring a designated fixed template unit and a designated dynamic template unit according to a preset timing task, and splicing the fixed template unit and the dynamic template unit according to actual requirements and association relations among different fixed template units, different dynamic template units and between the fixed template unit and the dynamic template unit; the method comprises the steps of setting respective data types of dynamic data to be sent, converting the dynamic data to be sent into a unified data format, filling the dynamic data to be sent with the unified data format into a specified list, and calling a mail service to send a template to be applied after data filling. In the scene, a general way for implanting the dynamically generated template content into the mail content is established, and in the scene, only the splicing process of the dynamic template content needs to be concerned, and the template content does not need to be repeatedly developed.
Exemplary, a schematic diagram of the steps of the template configuration is shown in fig. 2. In fig. 2, template splicing is performed on a fixed template unit a, a fixed template unit B, a dynamic template unit C and a dynamic template unit D, then template preview and data processing can be performed, and a template to be applied is applied after data processing; the template preview is to display the template to be applied to the front-end display page, the data processing is to unify the data format of the dynamic data, and the application of the template to be applied can be mail sending or other self-defined applications.
In another specific embodiment, the template to be applied can be previewed, after the template splicing mode is determined, the fixed template unit and the dynamic template unit can be actually spliced according to the template splicing mode, the template to be applied is obtained and replaced with the template with strong readability by a user, the template to be applied is displayed on the front-end display page, and the user can more intuitively know the actual condition of the template to be applied by displaying the template to be applied on the front-end display page. For example, a program language such as $ { table }, $ { beginndate }, $ { endDate } and the like, which is convenient for program splicing, is generally set in the template, replacement enumeration can be configured, and at this time, the identifier $ { table } can be replaced by a list header of an actual application, and the identifier $ { beginndate }, $ { endDate } can be replaced by yyyyyy-MM-dd and other languages which are more friendly to the readability of a common user.
In another embodiment, the data display in the dynamic template unit often has various scenes for data conversion, for example, if the data in the dynamic template unit includes the time 2022-01-0110:25:25, some scenes only pay attention to the date and do not need to pay attention to the time, minute and second, at this time, the time format needs to be converted into 2022-01-01; for another example, if the data in the dynamic template unit includes a user id, in an actual service scenario, a symbol "#" needs to be added before the user id to serve as a condition for subsequent page query; for another example, if the data in the dynamic template unit includes a link address, the link pattern needs to be uniformly set. And combing various scenes, setting a uniform data processing mode, and uniformly processing the data format of the dynamic data to be transmitted. After the data formats of the commonly used scenes are unified, developers only need to pay attention to the data types in the development and use process, and do not need to pay attention to data processing logics deeply, so that the template development efficiency is greatly improved, and the template maintenance cost is reduced. Because the data formats of the data of each type are set, if the date type is converted into the date without the hour, minute and second, when the data of the date type exists in the dynamic data to be sent, the corresponding data is converted.
According to the template configuration method provided by the embodiment of the invention, by acquiring template data to be configured, fixed data and dynamic data are acquired from the template data to be configured; generating a fixed template unit according to the fixed data, and generating a dynamic template unit according to the dynamic data; determining an incidence relation between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit; splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit to obtain a template to be applied; the template configuration can be realized, the template maintenance efficiency is improved, and the time cost of template maintenance is reduced.
According to the template configuration method provided by the embodiment of the invention, through template preview, the use convenience of a user is improved, the independent configuration of the fixed template unit and the dynamic template unit can be realized, the business logic is divided into smaller granularity, and developers can concentrate on the realization of specific business; the free collocation between the fixed template unit and the dynamic template unit can be realized, and unnecessary repeated development work is greatly reduced; by means of a unified data processing mode, the attention range of developers is reduced, and the development efficiency is improved; the template configuration mode and the use mode are unified, the template maintenance difficulty is greatly reduced, and the template maintenance efficiency and quality are improved.
The template configuration method provided by the embodiment can be constructed based on artificial intelligence, and related data is acquired and processed based on an artificial intelligence technology, so that unattended artificial intelligence template configuration is realized. 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.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
Fig. 3 is a schematic structural diagram of a template configuration apparatus according to an embodiment of the present invention. As shown in fig. 3, the template configuration apparatus 30 includes a data obtaining module 31, a template unit generating module 32, a relationship determining module 33, and a splicing module 34;
the data acquisition module 31 is configured to acquire template data to be configured, and acquire fixed data and dynamic data from the template data to be configured;
the template data to be configured is original data for forming the fixed template and the dynamic template, for example, in one mail sending service, all contents to be sent in a mail body may be used as the original data, and in specific implementation, the template data to be configured may include contents in a plurality of mail sending services.
The template unit generating module 32 is configured to generate a fixed template unit according to the fixed data, and generate a dynamic template unit according to the dynamic data;
in order to facilitate subsequent splicing of the fixed template unit and the dynamic template unit in actual services, the fixed data in the fixed template unit is summarized into a uniform format and a uniform conversation as much as possible, and the dynamic data in the dynamic template unit is unified with uniform content as much as possible.
The relationship determining module 33 is configured to determine an association relationship between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit;
and determining the incidence relation between the fixed template unit and the dynamic template unit according to the logic relation between the fixed data of the fixed template unit and the dynamic data of the dynamic template unit, thereby determining the splicing mode between the fixed template unit and the dynamic template unit.
The splicing module 34 is configured to splice the fixed template unit and the dynamic template unit according to the association relationship between the fixed template unit and the dynamic template unit, so as to obtain a template to be applied.
In a specific embodiment, if the fixed template unit a and the dynamic template unit B are spliced to obtain the template C to be applied, in the splicing process, sometimes the fixed data in the fixed template unit a and the dynamic data in the dynamic template unit B are not simply spliced together, but a splicing mode may be set according to an actual situation, for example, the variable identifier in the fixed template unit a is replaced with the corresponding data in the dynamic template unit B.
Further, the data obtaining module 31 is further configured to obtain general data in the template data to be configured, obtain non-general data in the template data to be configured by using the general data as the fixed data, and obtain the non-general data as dynamic data.
The general data can be general words, if a user needs to send a task urging mail, the general words can be 'good, X tasks need to be processed, the details of the tasks are as follows', and the general data are used as fixed data; the non-general data may be some data that changes with actual data and scenes, and similarly, taking the case that the user needs to send a task-oriented email as an example, after the general data of the task-oriented email, there may also be tables that change with the actual data and scenes, and these tables that change with the actual data and scenes are non-general data, and the non-general data is used as dynamic data.
Further, the relationship determining module 33 is further configured to determine a related relationship between the fixed template unit and the dynamic template unit when the fixed data in the fixed template unit is related to the dynamic data in the dynamic template unit, and otherwise, determine a non-related relationship between the fixed template unit and the dynamic template unit.
Determining whether the fixed data in the fixed template unit is associated with the dynamic data in the dynamic template unit or not according to the logical relationship between the fixed data in the fixed template unit and the dynamic data in the dynamic template unit; if there is a relationship between a fixed template unit and another dynamic template unit, the fixed template unit and the dynamic template unit may be spliced in the subsequent splicing process, and whether the fixed template unit and the dynamic template unit are spliced specifically is determined according to the user requirement.
Further, the template unit generating module 32 is further configured to generate a plurality of fixed template units according to the fixed data, and generate a plurality of dynamic template units according to the dynamic data.
The template data to be configured may include a large amount of fixed data and dynamic data, and during implementation, a plurality of fixed template units and a plurality of dynamic template units may be generated according to the template data to be configured.
Further, the splicing module 34 is further configured to splice the fixed template unit and the dynamic template unit according to an association relationship between the fixed template unit and the dynamic template unit, an association relationship between different fixed template units, and an association relationship between different dynamic template units, so as to obtain a template to be applied.
In a specific embodiment, the splicing of the fixed template unit and the dynamic template unit may be the splicing of one fixed template unit and one dynamic template unit, or the splicing of one fixed template unit and a plurality of dynamic template units, a plurality of fixed template units and one dynamic template unit, or a plurality of fixed template units and a plurality of dynamic template units; for example, the fixed template unit a and the dynamic template unit B are spliced with the dynamic template unit C, or the fixed template unit D, the fixed template unit E, and the dynamic template unit F are spliced with the dynamic template unit G. Different splicing modes can be set according to different service scenes, and the multiplexing of the fixed template unit and the dynamic template unit can be realized to the greatest extent by splicing the templates.
Further, the relationship determining module 33 is further configured to obtain an association relationship between different fixed template units according to the fixed data in the different fixed template units; and acquiring the association relation between different dynamic template units according to the dynamic data in different dynamic template units.
Wherein, the different fixed template units may have a relation, and the different dynamic fixed template units may have a relation; determining whether the fixed data in two fixed template units are associated according to the logic relationship between the fixed data of one fixed template unit and the fixed data of the other fixed template unit, thereby determining whether the different fixed template units are associated; and determining whether the dynamic data in the two dynamic template units are associated according to the logical relationship between the dynamic data of one dynamic template unit and the dynamic data of the other dynamic template unit, thereby determining whether the different dynamic template units are associated.
Further, the template configuration device 30 further includes a template data processing module, where the template data processing module is configured to perform data unification on dynamic data in the template to be applied according to a data type of the dynamic data in the template to be applied, fill the dynamic data after the data unification into a preset list column in the template to be applied, obtain the template to be applied after the data filling, and call a mail service to send the template to be applied after the data filling to a preset address.
In a specific implementation, the dynamic data in the template to be applied is dynamic data to be sent, and in an email sending application scene, the dynamic data to be sent can be specific work content information, personnel information or date information; and unifying the data formats of the dynamic data to be sent according to the data types of the dynamic data to be sent.
In a specific embodiment, a timing task is started, information such as data to be sent and a receiver is obtained from a database, and the data to be sent is obtained template data to be configured; acquiring a designated fixed template unit and a designated dynamic template unit according to a preset timing task, and splicing the fixed template unit and the dynamic template unit according to actual requirements and association relations among different fixed template units, different dynamic template units and between the fixed template unit and the dynamic template unit; the dynamic data to be sent are converted into a unified data format after respective data types are set, the dynamic data to be sent with the unified data format are filled into a specified list, and a mail service is called to send the template to be applied after the data are filled. In the scene, a general way for implanting the dynamically generated template content into the mail content is established, and in the scene, only the splicing process of the dynamic template content needs to be concerned, and the template content does not need to be repeatedly developed.
In another specific embodiment, the template to be applied can be previewed, after the template splicing mode is determined, the fixed template unit and the dynamic template unit can be actually spliced according to the template splicing mode, the template to be applied is obtained and replaced with the template with strong readability by a user, the template to be applied is displayed on the front-end display page, and the user can more intuitively know the actual condition of the template to be applied by displaying the template to be applied on the front-end display page. For example, a program language such as $ { table }, $ { beginndate }, $ { endDate }, and $ endDate } which is convenient for program splicing is generally set in the template, and replacement enumeration can be configured, at this time, the identifier $ { table } can be replaced by a list header of an actual application, and the identifiers $ { beginndate }, $ { date } are replaced by yyyyy-MM-dd which is a language more friendly to the readability of an ordinary user.
The template configuration device provided by the embodiment of the invention acquires fixed data and dynamic data from the template data to be configured by acquiring the template data to be configured; generating a fixed template unit according to the fixed data, and generating a dynamic template unit according to the dynamic data; determining an incidence relation between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit; splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit to obtain a template to be applied; the template configuration can be realized, the template maintenance efficiency is improved, and the time cost of template maintenance is reduced.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 4, the electronic device 40 includes a processor 41 and a memory 42 communicatively coupled to the processor 41.
The memory 42 stores program instructions for implementing the template configuration method of any of the embodiments described above.
Processor 41 is operative to execute program instructions stored in memory 42 for code testing.
The processor 41 may also be referred to as a CPU (Central Processing Unit). Processor 41 may be an integrated circuit chip having signal processing capabilities. The processor 41 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage medium of the embodiment of the present invention stores program instructions that can implement all the methods described above, and may be nonvolatile or volatile. The program instructions may be stored in the storage medium in the form of a software product, and include several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The above description is only an embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent structures or equivalent processes performed by the present invention or directly or indirectly applied to other related technical fields are also included in the scope of the present invention.
While the foregoing is directed to embodiments of the present invention, it will be understood by those skilled in the art that various changes may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A template configuration method is characterized by comprising the following steps:
acquiring template data to be configured, and acquiring fixed data and dynamic data from the template data to be configured;
generating a fixed template unit according to the fixed data, and generating a dynamic template unit according to the dynamic data;
determining an incidence relation between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit;
and splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit to obtain the template to be applied.
2. The template configuration method according to claim 1, wherein obtaining fixed data and dynamic data from the template data to be configured comprises:
and acquiring general data in the template data to be configured, taking the general data as the fixed data, acquiring non-general data in the template data to be configured, and taking the non-general data as dynamic data.
3. The template configuration method according to claim 1, wherein determining the association relationship between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit comprises:
and if the fixed data in the fixed template unit is associated with the dynamic data in the dynamic template unit, the fixed template unit has an associated relationship with the dynamic template unit, otherwise, the fixed template unit has no associated relationship with the dynamic template unit.
4. The template configuration method according to claim 1, wherein generating a fixed template unit according to the fixed data and generating a dynamic template unit according to the dynamic data comprises:
and generating a plurality of fixed template units according to the fixed data, and generating a plurality of dynamic template units according to the dynamic data.
5. The template configuration method according to claim 4, wherein the step of splicing the fixed template unit and the dynamic template unit according to the association relationship between the fixed template unit and the dynamic template unit to obtain the template to be applied comprises:
and splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit, the incidence relation between different fixed template units and the incidence relation between different dynamic template units to obtain the template to be applied.
6. The template configuration method according to claim 5, further comprising obtaining association relationships between different fixed template units according to fixed data in the different fixed template units; and acquiring the association relation between different dynamic template units according to the dynamic data in different dynamic template units.
7. The template configuration method according to claim 1, further comprising, after obtaining the template to be applied, performing data unification on dynamic data in the template to be applied according to a data type of the dynamic data in the template to be applied, filling the dynamic data after the data unification into a preset list column in the template to be applied, obtaining the template to be applied after the data filling, and calling a mail service to send the template to be applied after the data filling to a preset address.
8. A template configuration device is characterized by comprising a data acquisition module, a template unit generation module, a relation determination module and a splicing module;
the data acquisition module is used for acquiring template data to be configured and acquiring fixed data and dynamic data from the template data to be configured;
the template unit generating module is used for generating a fixed template unit according to the fixed data and generating a dynamic template unit according to the dynamic data;
the relation determining module is used for determining the incidence relation between the fixed template unit and the dynamic template unit according to the fixed data in the fixed template unit and the dynamic data in the dynamic template unit;
and the splicing module is used for splicing the fixed template unit and the dynamic template unit according to the incidence relation between the fixed template unit and the dynamic template unit to obtain the template to be applied.
9. An electronic device comprising a memory, a processor, the memory storing a computer program executable by the processor, wherein the processor implements the template configuration method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the template configuration method according to any one of claims 1 to 7.
CN202210723424.5A 2022-06-24 2022-06-24 Template configuration method and device, electronic equipment and storage medium Pending CN114995915A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210723424.5A CN114995915A (en) 2022-06-24 2022-06-24 Template configuration method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210723424.5A CN114995915A (en) 2022-06-24 2022-06-24 Template configuration method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114995915A true CN114995915A (en) 2022-09-02

Family

ID=83037318

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210723424.5A Pending CN114995915A (en) 2022-06-24 2022-06-24 Template configuration method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114995915A (en)

Similar Documents

Publication Publication Date Title
CN113034095B (en) Man-machine interaction method and device combining RPA and AI, storage medium and electronic equipment
CN108337236A (en) A kind of gRPC call methods and device based on Protobuf and HTTP/1.1
CN108280023B (en) Task execution method and device and server
CN111596902B (en) Method, device, equipment and storage medium for building front-end and back-end development framework
CN111506579B (en) Method, program and equipment for generating intelligent contract code
CN112433722A (en) Modular system code development method, device, equipment and system
CN113641700A (en) Data processing method and device based on Spring boot frame
CN111767229A (en) Performance test method, device and equipment
CN109491802A (en) A kind of method and adapter of the RESTFul network request based on Unity
CN105933396B (en) A kind of each canalization interface of collaboration realizes the method and system of long flow
CN111488144A (en) Data processing method and equipment
CN114745449B (en) Message processing method and device, storage medium and electronic equipment
CN114995915A (en) Template configuration method and device, electronic equipment and storage medium
CN112491943A (en) Data request method, device, storage medium and electronic equipment
CN115934537A (en) Interface test tool generation method, device, equipment, medium and product
CN109816462A (en) A kind of recognition methods of invoice information and device
CN115114321A (en) Dynamic query method and system
CN114443032A (en) Form processing method, device, terminal and storage medium based on JSON schema
CN114064429A (en) Audit log acquisition method and device, storage medium and server
CN112445811A (en) Data service method, device, storage medium and component based on SQL configuration
CN111309319A (en) Inheritable office data dynamic page configuration method and device
CN109086145B (en) Data generation method and device and computer storage medium
CN112380828A (en) PDF document generation method and device, storage medium and electronic equipment
CN116880920A (en) System and method for generating API (application program interface) execution log
CN116400912A (en) Data acquisition method, device, storage medium and computer equipment

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