CN114510916B - Template loading method and device, computer equipment and storage medium - Google Patents

Template loading method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114510916B
CN114510916B CN202210144747.9A CN202210144747A CN114510916B CN 114510916 B CN114510916 B CN 114510916B CN 202210144747 A CN202210144747 A CN 202210144747A CN 114510916 B CN114510916 B CN 114510916B
Authority
CN
China
Prior art keywords
component
template
task
loading
name
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
CN202210144747.9A
Other languages
Chinese (zh)
Other versions
CN114510916A (en
Inventor
郭苗苗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210144747.9A priority Critical patent/CN114510916B/en
Publication of CN114510916A publication Critical patent/CN114510916A/en
Application granted granted Critical
Publication of CN114510916B publication Critical patent/CN114510916B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance
    • 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)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application belongs to the field of big data and relates to a template loading method, which comprises the steps of configuring template components for each template according to the number of templates to form a template component library, wherein each template component has a unique component name; establishing a dynamic component for loading the corresponding template component according to the given component name; establishing a task referencing the dynamic component and selecting a preset loading mode in the task to generate a component name; and loading the template component in the template component library according to the generated component name when the task is triggered. The application also provides a template loading device, computer equipment and a storage medium. According to the method and the device, only one template component can be loaded each time, the page rendering speed is higher when the task is executed, each template is configured with one template component, other templates cannot be affected when the templates are modified, the maintenance cost is reduced, and the maintenance efficiency is improved.

Description

Template loading method and device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of big data and artificial intelligence technologies, and in particular, to a template loading method, a template loading device, a computer device, and a storage medium.
Background
In the insurance field, flash claims are quick claim settlement services for small claim payment, function propaganda and realization are carried out through a plurality of templates (for example, five types), each template has the corresponding functions of flash claim propaganda and introduction, and when the flash claims are actually used, after one key forwards the plurality of templates, a client can open one of the templates which is randomly displayed.
In the existing flash claim one-key forwarding, all the templates of the flash claim are written in one file, one of the templates is displayed through a random number, the other four templates are hidden, that is, all the templates are rendered each time a page is opened, then only one template is displayed and the other templates are hidden, and the problems are that: the page rendering speed is low, codes of the five templates are all concentrated in one file, the maintenance is inconvenient, the code redundancy is large, and the modification and maintenance efficiency is low.
Disclosure of Invention
The embodiment of the application aims to provide a template loading method, a template loading device, computer equipment and a storage medium, which mainly aim to improve the rendering speed of pages without influencing other templates when the templates are modified.
In order to solve the above technical problems, the embodiments of the present application provide a template loading method, which adopts the following technical schemes:
a template loading method comprising the steps of:
configuring template components for each template according to the number of templates to form a template component library, wherein each template component has a unique component name;
establishing a dynamic component for loading the corresponding template component according to the given component name;
establishing a task referencing the dynamic component and selecting a preset loading mode in the task to generate a component name;
and loading the template component in the template component library according to the generated component name when the task is triggered.
Further, after the step of configuring the template components for each of the templates according to the number of templates to form a template component library, the method further comprises:
and storing a plurality of template components in a preset folder.
Further, the step of creating a dynamic component loading the corresponding template component according to the given component name specifically includes:
establishing a dynamic component;
binding a tag for the dynamic component, wherein the dynamic component is used for loading the template component according to the attribute value of the tag;
defining attribute values of the labels formed by component names of a plurality of template components, and forming the attribute values into a variable library.
Further, the step of creating a task referencing the dynamic component and selecting a preset loading mode in the task to generate a component name specifically includes:
establishing a task and embedding the dynamic component into the task;
configuring a preset loading mode for the task, wherein the preset loading mode comprises random selection and configuration selection;
if the selected preset loading mode is random selection, the component names are randomly selected from the component names of the template components, and if the selected preset loading mode is configuration selection, the component names are selected and generated in a configuration selection table of the configuration selection.
Further, if the selected preset loading mode is random selection, the step of randomly selecting a unique component name from the component names of the plurality of template components specifically includes:
if the selected preset loading mode is random selection, generating a random number for randomly selecting the attribute value of the tag in a variable library;
randomly selecting a component name in the variable library according to the selected random number;
and labeling the state according to the unique component name selected randomly.
Further, if the selected preset loading mode is configuration selection, the step of selecting the unique component name to be generated in the configuration selection table of the configuration selection specifically includes:
selecting and generating a unique component name in a preset configuration selection table, wherein the configuration selection table is internally provided with the unique component name and a corresponding link;
searching the unique component names selected by configuration in the unique component names of a plurality of template components, and outputting a searching result;
and labeling the unique component name selected by the configuration with a state according to the search result.
Further, the step of loading the template component in the template component library according to the generated component name when the task is triggered specifically includes:
when the task is triggered, the state of the component name is identified;
loading the template component according to the state of the component name, loading the template component in the template component library according to the comparison table if the state is existing, downloading the template component according to the template link of the configuration selection table if the state is not existing, updating the downloaded template component and the component name into the template component library, and loading the template component from the template component library.
In order to solve the above technical problems, the embodiment of the present application further provides a template loading device, which adopts the following technical scheme:
a template loading apparatus comprising:
the configuration module is used for configuring template components for each template according to the number of the templates to form a template component library, wherein each template component has a unique component name;
the dynamic component establishing module is used for establishing a dynamic component for loading the corresponding template component according to the given component name;
the task establishing module is used for establishing a task referencing the dynamic component and selecting a preset loading mode in the task to generate a component name;
and the loading module is used for loading the template component in the template component library according to the generated component name when the task is triggered.
In order to solve the above technical problems, the embodiments of the present application further provide a computer device, which adopts the following technical schemes:
a computer device comprising a memory having stored therein computer readable instructions which when executed by a processor implement the steps of a template loading method as described above.
In order to solve the above technical problems, embodiments of the present application further provide a computer readable storage medium, which adopts the following technical solutions:
a computer readable storage medium having stored thereon computer readable instructions which when executed by a processor perform the steps of a template loading method as described above.
Compared with the prior art, the embodiment of the application has the following main beneficial effects: configuring template components for each template according to the number of templates to form a template component library, wherein each template component has a unique component name; establishing a dynamic component for loading the corresponding template component according to the given component name; establishing a task referencing the dynamic component, and selecting a preset loading mode in the task to generate a component name; and when the task is triggered, loading the template component in the template component library according to the generated component name. Only one template component can be loaded at a time, the page rendering speed is higher when the task is executed, each template is configured with one template component, other templates are not affected when the templates are modified, the maintenance cost is reduced, and the maintenance efficiency is improved.
Drawings
For a clearer description of the solution in the present application, a brief description will be given below of the drawings that are needed in the description of the embodiments of the present application, it being obvious that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a template loading method according to the present application;
FIG. 3 is a flow chart of one embodiment of step S202 of FIG. 2;
FIG. 4 is a flow chart of one embodiment of step S203 of FIG. 2;
FIG. 5 is a flow chart of one embodiment of step S204 of FIG. 2;
FIG. 6 is a schematic diagram of one embodiment of a template loading apparatus according to the present application;
FIG. 7 is a schematic diagram of one embodiment of the dynamic component creation module of FIG. 6;
FIG. 8 is a schematic diagram of one embodiment of the task creation module of FIG. 6;
FIG. 9 is a schematic diagram of an embodiment of the load module of FIG. 6;
FIG. 10 is a schematic structural diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description and claims of the present application and in the description of the figures above are intended to cover non-exclusive inclusions. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases 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. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to better understand the technical solutions of the present application, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture ExpertsGroup Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving PictureExperts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the template loading method provided in the embodiments of the present application is generally executed by a server, and accordingly, the template loading device is generally disposed in a terminal device.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow chart of one embodiment of a method of template loading according to the present application is shown. The template loading method comprises the following steps:
step S201, configuring template components for each template according to the number of templates to form a template component library, wherein each template component has a unique component name;
in this embodiment, the electronic device on which the template loading method operates (e.g., as shown in fig. 1Server device) The terminal devices may be connected by wired connection or wireless connection. It should be noted that the wireless connection may include, but is not limited to, 3G/4G connections, wiFi connections, bluetooth connections, wiMAX connections, zigbee connections, UWB (ultra wideband) connections, and other now known or later developed wireless connection means.
Specifically, the template component is mainly used for focusing the content, such as graphics, characters, codes and the like, in the template into one component, and when the template component is called, the template corresponding to the template component can be loaded. The template components with the corresponding number can be established according to the number of the templates, namely, one template is guaranteed to correspond to one template component, each template component has a unique component name, and the template components can be formed by one or any combination of numbers, letters, special symbols, chinese characters and the like.
In this embodiment, 5 templates are set, and 5 template components need to be built, where each template component has a unique component name, and may be called a component 1, a component 2, a component 3, a component 4, and a component 5.
After the step of configuring the template components for each of the templates according to the number of templates to form a template component library, the method further comprises:
and storing a plurality of template components in a preset folder.
Specifically, a folder may be pre-established, and all the template components are placed in the folder, including the codes of the template components, so that only the path in which the folder is located needs to be called when the file is called later.
And a comparison table for corresponding relation between the template components and the unique component names is established in the folder, and each template component can be corresponding to each unique component name by the comparison table so as to facilitate later calling.
Step S202, a dynamic component of the template component corresponding to the given component name is loaded.
In this embodiment, a dynamic component is newly created, and the dynamic component is mainly used to load different template components according to a given component name. For example, the dynamic component set may be based on component names, such as: the component 1, the component 2, the component 3, the component 4 or the component 5 loads the corresponding template 1, the template 2, the template 3, the template 4 or the template 5, respectively.
The step of establishing the dynamic component loading the corresponding template component according to the given component name specifically comprises the following steps:
in step S2021, a dynamic component is built.
The dynamic component is a component capable of performing page switching, and can be established in an asyncc component.
Step S2022 binds a tag to the dynamic component, where the dynamic component is configured to load the template component according to the attribute value of the tag.
The binding of the label is mainly used for conveniently distinguishing the dynamic component, the label can be set according to actual requirements, and the function of the label setting is that when the attribute value of the label changes, the dynamic component can load different template components according to the change value.
Step S2023, defining attribute values of the tag composed of component names of a plurality of the template components, and composing the attribute values into a variable library.
Wherein the attribute value of the tag is a variable, the variable is selected from a variable library, and the variable library is composed of unique component names of a plurality of template components, that is, when the variable value of the tag is component 1, namely, the dynamic component loads the template 1 corresponding to the component 1.
Step S203, a task referencing the dynamic component is established, and a preset loading mode is selected in the task to generate a component name.
In this embodiment, the established task may be a flash one-touch forwarding task or other task that references the dynamic component, i.e., attaches the dynamic component to the task as part of the task display.
The step of creating a task referencing the dynamic component and selecting a preset loading mode in the task to generate a component name specifically includes:
step S2031, a task is established and the dynamic component is embedded within the task.
The task may be an advertisement file, which directly refers to a dynamic component of asynccomponent.
Step S2032, configuring a preset loading mode for the task, where the preset loading mode includes random selection and configuration selection.
The random selection is to generate a random number, and the random number is used for randomly selecting among the component names of the plurality of template components, so that a component name can be generated, and the selection is not influenced by manual control.
The configuration selection is to pre-set a configuration selection table, in which various component names and corresponding template component links are recorded, and the component names may be the component names already existing in the step S1 or may be the component names not existing in the step S1.
Step S2033, if the selected preset loading mode is a random selection, randomly selecting a component name from the component names of the plurality of template components, and if the selected preset loading mode is a configuration selection, selecting a generated component name in a configuration selection table of the configuration selection.
If the selected preset loading mode is random selection, a component name can be randomly selected from the component name comparison table. If the selected preset loading mode is configuration selection, selecting and generating a component name in a configuration selection table of the configuration selection, wherein the component name can be existing or not existing in a component name comparison table.
The configuration selection table may be as shown in table 1 below.
TABLE 1
Sequence number Component name Template linking
1 Component name 1 Link 1
2 Component name 2 Link 2
…… …… ……
n Component name n Link n
Specifically, if the selected preset loading mode is random selection, the step of randomly selecting a unique component name from the component names of the plurality of template components specifically includes:
firstly, if the selected preset loading mode is random selection, generating a random number for randomly selecting the attribute value of the tag in a variable library.
The random number can adopt a general generation mode, and the main purpose of the random number is to randomly select a unique component name in a variable library.
And secondly, randomly selecting a component name in the variable library according to the selected random number.
Wherein the randomly selected unique component name must exist in the component name lookup table.
The states are then annotated according to the unique component names selected at random.
Wherein, since the unique component name selected randomly is necessarily present in the component name comparison table, the unique component name can be directly marked as existing "1".
Specifically, if the selected preset loading mode is configuration selection, the step of selecting the unique component name to be generated in the configuration selection table of the configuration selection specifically includes:
firstly, selecting and generating a unique component name in a preset configuration selection table, wherein the unique component name and a corresponding link are arranged in the configuration selection table;
and secondly, searching the unique component names selected by configuration in the unique component names of a plurality of template components, and outputting a searching result.
The unique component name of the configuration selection can be existing or not in the component name comparison table, so that the state of the unique component name of the configuration selection needs to be clearly resolved, that is, the unique component name of the configuration selection is searched in the component name comparison table, and the output result is the existence or the nonexistence.
And then, marking the state of the unique component name selected by the configuration according to the searching result.
When the output result is that the unique component name of the configuration selection exists, the unique component name of the configuration selection can be marked by a status label of '1', and when the output result is that the output result does not exist, the unique component name of the configuration selection can be marked by a status label of '0'. Status tags "1" and "0" may facilitate identification of the computer.
And step S204, loading the template component in the template component library according to the generated component name when the task is triggered.
When the task is a flash claim one-key forwarding task, the task can be directly forwarded, at the moment, the task loads a template component according to the generated unique component name and completes forwarding, at the moment, only one template needs to be loaded, other templates do not need to be loaded, resources are saved, and as only one template needs to be loaded, only one template needs to be modified when the template is modified, other templates are not affected by any influence, and are not passively modified.
Specifically, the step of loading the template component in the template component library according to the generated component name when the task is triggered specifically includes:
step S2041, when the task is triggered, identifies the state of the component name.
If the status is "1", the loaded template component is the template component configured in step S1. If the state is "0", the loaded template component is the template component in the configuration selection table
Step S2042, loading the template component according to the state of the component name, loading the template component in the template component library according to the comparison table if the state is existing, downloading the template component according to the template link of the configuration selection table if the state is not existing, updating the downloaded template component and the component name into the template component library, and loading the template component from the template component library.
Configuring template components for each template according to the number of templates to form a template component library, wherein each template component has a unique component name; establishing a dynamic component for loading the corresponding template component according to the given component name; establishing a task referencing the dynamic component, and selecting a preset loading mode in the task to generate a component name; and when the task is triggered, loading the template component in the template component library according to the generated component name. Only one template component can be loaded at a time, the page rendering speed is higher when the task is executed, each template is configured with one template component, other templates are not affected when the templates are modified, the maintenance cost is reduced, and the maintenance efficiency is improved.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include 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 other directions. Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by computer readable instructions stored in a computer readable storage medium that, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 6, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a template loading apparatus, where an embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 6, the template loading apparatus 600 according to the present embodiment includes: a configuration module 601, a dynamic component creation module 602, a task creation module 603, and a loading module 604. Wherein:
the configuration module 601 is configured to configure template components to form a template component library for each of the templates according to the number of templates, where each of the template components has a unique component name.
The dynamic component creation module 602 is configured to create a dynamic component that loads the corresponding template component according to a given component name.
The task creation module 603 is configured to create a task referencing the dynamic component and select a preset loading manner in the task to generate a component name.
The loading module 604 is configured to load the template component in the template component library according to the generated component name when the task is triggered.
The application configuration module 601 configures template components for each template according to the number of templates to form a template component library, wherein each template component has a unique component name; the dynamic component establishing module 602 establishes a dynamic component for loading the corresponding template component according to the given component name; the task establishing module 603 establishes a task referencing the dynamic component, and selects a preset loading mode in the task to generate a component name; the loading module 604 loads the template component in the template component library according to the generated component name when the task is triggered. According to the method and the device, only one template component can be loaded each time, the page rendering speed is higher when the task is executed, each template is configured with one template component, other templates cannot be affected when the templates are modified, the maintenance cost is reduced, and the maintenance efficiency is improved.
Referring to fig. 7, for a schematic structural diagram of an embodiment of the dynamic component creation module 602, the dynamic component creation module 602 includes a dynamic component submodule 6021, a tag binding submodule 6022, and a definition submodule 6023. Wherein, the dynamic component sub-module 6021 is used for establishing dynamic components; the tag binding sub-module 6022 binds a tag for the dynamic component, where the dynamic component is configured to load the template component according to an attribute value of the tag; the definition sub-module 6023 is configured to define attribute values of the tag composed of component names of a plurality of the template components, and compose the attribute values into a variable library.
Referring to fig. 8, a schematic structural diagram of an embodiment of the task creation module 603 is shown, where the task creation module 603 includes an embedding sub-module 6031, a configuration default recording sub-module 6032, and a judging sub-module 6033. Wherein: an embedding submodule 6031 for establishing a task and embedding the dynamic component in the task; the configuration preset record submodule 6032 configures a preset loading mode for the task, wherein the preset loading mode comprises random selection and configuration selection. The judging submodule 6033 performs random selection of the component names from the component names of the plurality of template components if the selected preset loading mode is random selection, and selects and generates the component names in a configuration selection table of the configuration selection if the selected preset loading mode is configuration selection.
Referring to fig. 9, in an embodiment of the loading module 604, the loading module 604 includes an identification sub-module 6041 and a status loading sub-module 6042. Wherein: an identification submodule 6041 for identifying the status of the component name when the task is triggered. The status loading submodule 6042 is configured to load the template component according to the status of the component name, load the template component in the template component library if the status is existing, download the template component according to the template link of the configuration selection table if the status is not existing, update the downloaded template component and the component name into the template component library, and load the template component from the template component library.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 10, fig. 10 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 10 comprises a memory 101, a processor 102, and a network interface 103 communicatively coupled to each other via a system bus. It should be noted that only computer device 10 having components 101-103 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (fields-Programmable Gate Array, FPGAs), digital processors (Digital Signal Processor, DSPs), embedded devices, etc.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 101 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 101 may be an internal storage unit of the computer device 10, such as a hard disk or a memory of the computer device 10. In other embodiments, the memory 101 may also be an external storage device of the computer device 10, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 10. Of course, the memory 101 may also include both internal storage units of the computer device 10 and external storage devices. In this embodiment, the memory 101 is typically used to store an operating system and various application software installed on the computer device 10, such as computer readable instructions of a template loading method. Further, the memory 101 may be used to temporarily store various types of data that have been output or are to be output.
The processor 102 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 102 is generally used to control the overall operation of the computer device 10. In this embodiment, the processor 102 is configured to execute computer readable instructions stored in the memory 101 or process data, such as computer readable instructions for executing the template loading method.
The network interface 103 may comprise a wireless network interface or a wired network interface, which network interface 103 is typically used to establish communication connections between the computer device 10 and other electronic devices.
Configuring template components for each template according to the number of templates to form a template component library, wherein each template component has a unique component name; establishing a dynamic component for loading the corresponding template component according to the given component name; establishing a task referencing the dynamic component, and selecting a preset loading mode in the task to generate a component name; and when the task is triggered, loading the template component in the template component library according to the generated component name. Only one template component can be loaded at a time, the page rendering speed is higher when the task is executed, each template is configured with one template component, other templates are not affected when the templates are modified, the maintenance cost is reduced, and the maintenance efficiency is improved.
The present application also provides another embodiment, namely, a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the template loading method as described above.
Configuring template components for each template according to the number of templates to form a template component library, wherein each template component has a unique component name; establishing a dynamic component for loading the corresponding template component according to the given component name; establishing a task referencing the dynamic component, and selecting a preset loading mode in the task to generate a component name; and when the task is triggered, loading the template component in the template component library according to the generated component name. Only one template component can be loaded at a time, the page rendering speed is higher when the task is executed, each template is configured with one template component, other templates are not affected when the templates are modified, the maintenance cost is reduced, and the maintenance efficiency is improved.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
It is apparent that the embodiments described above are only some embodiments of the present application, but not all embodiments, the preferred embodiments of the present application are given in the drawings, but not limiting the patent scope of the present application. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a more thorough understanding of the present disclosure. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing, or equivalents may be substituted for elements thereof. All equivalent structures made by the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the protection scope of the application.

Claims (7)

1. A template loading method, comprising the steps of:
configuring template components for each template according to the number of templates to form a template component library, wherein each template component has a unique component name;
establishing a dynamic component for loading the corresponding template component according to the given component name;
establishing a task referencing the dynamic component and selecting a preset loading mode in the task to generate a component name;
loading the template component in the template component library according to the generated component name when triggering the task;
the step of creating a task referencing the dynamic component and selecting a preset loading mode in the task to generate a component name specifically includes:
establishing a task and embedding the dynamic component into the task;
configuring a preset loading mode for the task, wherein the preset loading mode comprises random selection and configuration selection;
if the selected preset loading mode is random selection, randomly selecting a component name from the component names of a plurality of template components, and if the selected preset loading mode is configuration selection, selecting a generated component name in a configuration selection table of the configuration selection;
if the selected preset loading mode is random selection, the step of randomly selecting a unique component name from the component names of the plurality of template components specifically includes:
if the selected preset loading mode is random selection, generating a random number for randomly selecting the attribute value of the tag in a variable library;
randomly selecting a component name in the variable library according to the selected random number;
labeling a state according to the unique component name selected randomly;
if the selected preset loading mode is configuration selection, the step of selecting the unique component name to be generated in the configuration selection table of the configuration selection specifically includes:
selecting and generating a unique component name in a preset configuration selection table, wherein the configuration selection table is internally provided with the unique component name and a corresponding link;
searching the unique component names selected by configuration in the unique component names of a plurality of template components, and outputting a searching result;
and labeling the unique component name selected by the configuration with a state according to the search result.
2. The template loading method according to claim 1, further comprising, after the step of configuring template components for each of the templates according to the number of templates, the steps of:
storing a plurality of template components in a preset folder;
and establishing a comparison table of the corresponding relation between the template components and the unique component names in the folder.
3. The method for loading a template according to claim 1, wherein the step of creating a dynamic component for loading the corresponding template component according to the given component name specifically comprises:
establishing a dynamic component;
binding a tag for the dynamic component, wherein the dynamic component is used for loading the template component according to the attribute value of the tag;
defining attribute values of the labels formed by component names of a plurality of template components, and forming the attribute values into a variable library.
4. The template loading method according to claim 2, wherein the step of loading the template component in the template component library according to the generated component name when the task is triggered specifically comprises:
when the task is triggered, the state of the component name is identified;
loading the template component according to the state of the component name, loading the template component in the template component library according to the comparison table if the state is existing, downloading the template component according to the template link of the configuration selection table if the state is not existing, updating the downloaded template component and the component name into the template component library, and loading the template component from the template component library.
5. A template loading apparatus, comprising:
the configuration module is used for configuring template components for each template according to the number of the templates to form a template component library, wherein each template component has a unique component name;
the dynamic component establishing module is used for establishing a dynamic component for loading the corresponding template component according to the given component name;
the task establishing module is used for establishing a task referencing the dynamic component and selecting a preset loading mode in the task to generate a component name;
the loading module is used for loading the template component in the template component library according to the generated component name when the task is triggered;
the task building module specifically comprises:
an embedding sub-module for establishing a task and embedding the dynamic component into the task;
the configuration preset recording sub-module is used for configuring a preset loading mode for the task, wherein the preset loading mode comprises random selection and configuration selection;
the judging sub-module is used for randomly selecting the component names from the component names of the template components when the selected preset loading mode is random selection, and selecting the generated component names from a configuration selection table of the configuration selection when the selected preset loading mode is configuration selection;
the judging submodule specifically comprises:
the random number generation unit is used for generating a random number for randomly selecting the attribute value of the tag in the variable library when the selected preset loading mode is random selection;
a random selection unit, configured to randomly select a component name in the variable library according to the selected random number;
the first labeling state unit is used for labeling states according to the unique component names selected randomly;
the if judging sub-module further includes:
the device comprises a component name generating unit, a configuration selection table and a configuration processing unit, wherein the component name generating unit is used for selecting and generating a unique component name in a preset configuration selection table, and the unique component name and a corresponding link are arranged in the configuration selection table;
the component name searching unit is used for searching the unique component names selected by configuration in the unique component names of the template components and outputting a searching result;
and the second labeling state unit is used for labeling the unique component name selected by the configuration according to the search result.
6. A computer device comprising a memory having stored therein computer readable instructions which when executed by a processor implement the steps of the template loading method of any of claims 1 to 4.
7. A computer readable storage medium having stored thereon computer readable instructions which when executed by a processor implement the steps of the template loading method according to any of claims 1 to 4.
CN202210144747.9A 2022-02-17 2022-02-17 Template loading method and device, computer equipment and storage medium Active CN114510916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210144747.9A CN114510916B (en) 2022-02-17 2022-02-17 Template loading method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210144747.9A CN114510916B (en) 2022-02-17 2022-02-17 Template loading method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114510916A CN114510916A (en) 2022-05-17
CN114510916B true CN114510916B (en) 2023-07-07

Family

ID=81552084

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210144747.9A Active CN114510916B (en) 2022-02-17 2022-02-17 Template loading method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114510916B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3048544A1 (en) * 2015-01-23 2016-07-27 ABB Technology AG Method for generating CAD models
CN106066849A (en) * 2016-05-30 2016-11-02 车智互联(北京)科技有限公司 A kind of template page editing system and method
CN108153520A (en) * 2018-03-20 2018-06-12 上海屹通信息科技发展有限公司 Software development methodology and device
CN113568678A (en) * 2021-07-16 2021-10-29 上海淇玥信息技术有限公司 Method and device for dynamically loading resources and electronic equipment
CN113987400A (en) * 2021-10-29 2022-01-28 上海中通吉网络技术有限公司 Design and code generation method of front-end webpage template

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3048544A1 (en) * 2015-01-23 2016-07-27 ABB Technology AG Method for generating CAD models
CN106066849A (en) * 2016-05-30 2016-11-02 车智互联(北京)科技有限公司 A kind of template page editing system and method
CN108153520A (en) * 2018-03-20 2018-06-12 上海屹通信息科技发展有限公司 Software development methodology and device
CN113568678A (en) * 2021-07-16 2021-10-29 上海淇玥信息技术有限公司 Method and device for dynamically loading resources and electronic equipment
CN113987400A (en) * 2021-10-29 2022-01-28 上海中通吉网络技术有限公司 Design and code generation method of front-end webpage template

Also Published As

Publication number Publication date
CN114510916A (en) 2022-05-17

Similar Documents

Publication Publication Date Title
CN112685565B (en) Text classification method based on multi-mode information fusion and related equipment thereof
CN117033249A (en) Test case generation method and device, computer equipment and storage medium
CN117195886A (en) Text data processing method, device, equipment and medium based on artificial intelligence
CN114510916B (en) Template loading method and device, computer equipment and storage medium
CN116661936A (en) Page data processing method and device, computer equipment and storage medium
CN114626352B (en) Report automatic generation method, device, computer equipment and storage medium
CN115756692A (en) Method for automatically combining and displaying pages based on style attributes and related equipment thereof
CN116483425A (en) Micro-service gray level edition issuing method, device, equipment and storage medium thereof
CN115185625A (en) Self-recommendation type interface updating method based on configurable card and related equipment thereof
CN114565316A (en) Task issuing method based on micro-service architecture and related equipment
CN109376554B (en) Multi-terminal electronic document examination and signature method and system based on labels and views
CN114722787B (en) Tag matching method based on Excel cascading and related equipment thereof
CN117591190A (en) Application data loading optimization method, device, equipment and storage medium thereof
CN116206032A (en) Task verification method, device, computer equipment and medium thereof
CN116933733A (en) Text input display method, device, equipment and storage medium thereof
CN115828846A (en) Display page font processing method and related equipment thereof
CN116643884A (en) Data computing method, device, equipment and storage medium based on rule engine
CN117235260A (en) Text labeling method, device, equipment and storage medium based on artificial intelligence
CN116628282A (en) Data scanning method, device, computer equipment and storage medium
CN118012527A (en) Application system function version switching method and device and computer equipment
CN116775649A (en) Data classified storage method and device, computer equipment and storage medium
CN116149665A (en) XAML file modification method, XAML file modification device, computer equipment and storage medium
CN116776838A (en) Text processing method, device, computer equipment and storage medium
CN117785181A (en) Code execution method, device, equipment and storage medium thereof
CN116450948A (en) AI-based intelligent message pushing method, device, setting and storage medium thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant