CN113505577A - Template engine-based method for dynamically customizing short message - Google Patents
Template engine-based method for dynamically customizing short message Download PDFInfo
- Publication number
- CN113505577A CN113505577A CN202110949096.6A CN202110949096A CN113505577A CN 113505577 A CN113505577 A CN 113505577A CN 202110949096 A CN202110949096 A CN 202110949096A CN 113505577 A CN113505577 A CN 113505577A
- Authority
- CN
- China
- Prior art keywords
- short message
- service
- template
- service system
- scene
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 14
- 238000012423 maintenance Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/186—Templates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/31—Indexing; Data structures therefor; Storage structures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/12—Messaging; Mailboxes; Announcements
- H04W4/14—Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention provides a template engine-based method for dynamically customizing short messages, which comprises the following steps: setting a short message template corresponding to the type of the service system and the service scene based on a freemarker template engine, and storing the short message template; when a service system needs to send a service short message, whether each service scene of the service system needs to send the short message is judged firstly, if not, the short message is not sent, if so, a corresponding short message template is obtained according to the type of the service system and the service scene, if the corresponding short message template can be obtained, service data is edited according to the short message template, and if not, the short message is not sent.
Description
Technical Field
The invention belongs to the technical field of information processing, and particularly relates to a template engine-based method for dynamically customizing short messages.
Background
In a service system, personalized short messages need to be sent for a plurality of specific application scenes, and due to the fact that different application scenes need different objects and different short message contents to be sent, function codes of the same short message sending service need to be repeatedly written for each application scene of the service system, and finally the function codes of the service system look bloated, and great challenges are brought to code maintenance of the system in the future.
Disclosure of Invention
The present invention is made to solve the above problems, and an object of the present invention is to provide a method for dynamically customizing a short message based on a template engine. The invention can dynamically configure the short message template according to the service system type and the service scene on the basis of not increasing the function of developing and sending the short message service, can improve the code development efficiency and the code maintenance cost of the system, and can reduce the development period and the cost investment.
The invention provides a template engine-based method for dynamically customizing short messages, which is characterized by comprising the following steps:
setting a short message template corresponding to the type of a service system and a service scene based on a freemarker template engine, and storing the short message template, wherein the short message template comprises invariable content and parameters needing to be replaced according to service data;
when the service system needs to send the service short message, judging whether each service scene of the service system needs to send the short message one by one, and not sending the short message for the service scene which does not need to send the short message,
and for a service scene needing to send the short message, acquiring a corresponding short message template according to the service system type and the service scene, if the corresponding short message template can be acquired, replacing parameters in the short message template with service data, then sending the edited short message to a corresponding object, and if the corresponding short message template does not exist, not sending the short message.
Further, the method for dynamically customizing the short message based on the template engine provided by the invention can also have the following characteristics: and the short message template is stored in a database in the form of a data dictionary.
Further, the method for dynamically customizing the short message based on the template engine provided by the invention can also have the following characteristics: and storing the service system type as an abbreviation of a service system name in a database, storing each service scene as a character string, and enabling one short message template to correspond to the abbreviation of the service system name and one character string.
The invention has the following advantages:
the method for dynamically customizing the short message based on the template engine can dynamically configure the short message template according to the type of the service system and the service scene on the basis of not increasing the service function of developing and sending the short message, can improve the code development efficiency and the code maintenance cost of the system, and reduces the development period and the cost investment.
Drawings
Fig. 1 is an execution flowchart of processing for each service scenario in the present invention.
Detailed Description
In order to make the technical means, creation features, achievement purposes and effects of the present invention easy to understand, the following embodiments specifically describe the method for dynamically customizing short messages based on the template engine in combination with the accompanying drawings.
The method for dynamically customizing the short message based on the template engine comprises the following steps: and setting a short message template corresponding to the service system type and the service scene based on a freemarker template engine, and storing the short message template. Namely, the service system type and the service scene jointly determine the content form of the short message template. The short message template comprises invariable content and parameters which need to be replaced according to specific service data.
In this embodiment, the short message template is stored in the database in the form of a data dictionary.
When a service system needs to send a service short message, whether each service scene of the service system needs to send the short message is judged one by one. And not sending the short message in the service scene without sending the short message. And for a service scene needing to send the short message, acquiring a corresponding short message template according to the service system type and the service scene, if the corresponding short message template can be acquired, replacing parameters in the short message template with service data, then sending the edited short message to a corresponding object, and if the corresponding short message template does not exist, not sending the short message.
In the present embodiment, in the database, the service system type is stored as an abbreviation of a service system name, and each service scenario is stored as a character string. A short message template corresponds to an abbreviation of a service system name and a character string. When the corresponding short message template is obtained according to the service system type and the service scene, the abbreviation of the corresponding service system name is obtained from the database according to the service system type, the corresponding character string is obtained from the database according to the service scene, and the corresponding short message template is obtained from the database according to the abbreviation and the character string of the service system name.
When a service system needs to send a service short message, whether each service scene of the service system needs to send the short message is judged one by one. As shown in fig. 1, the flow of processing performed on each service scenario is as follows:
and step S1, judging whether the service scene needs to send information, if so, entering step S2, and if not, not sending information and ending.
And step S2, judging whether a short message template corresponding to the service scene and the service system type exists in the database according to the service system type and the service scene, if so, entering step S3, otherwise, not sending the information, and ending.
Step S3, the short message template is taken out from the database.
And step S4, replacing the parameter part in the short message template with the real service data, and then sending the edited short message to the corresponding object.
The above embodiments are preferred examples of the present invention, and are not intended to limit the scope of the present invention.
Claims (3)
1. A method for dynamically customizing short messages based on a template engine is characterized by comprising the following steps:
setting a short message template corresponding to the type of a service system and a service scene based on a freemarker template engine, and storing the short message template, wherein the short message template comprises invariable content and parameters needing to be replaced according to service data;
when the service system needs to send the service short message, judging whether each service scene of the service system needs to send the short message one by one, and not sending the short message for the service scene which does not need to send the short message,
and for a service scene needing to send the short message, acquiring a corresponding short message template according to the service system type and the service scene, if the corresponding short message template can be acquired, replacing parameters in the short message template with service data, then sending the edited short message to a corresponding object, and if the corresponding short message template does not exist, not sending the short message.
2. The template engine-based method for dynamically customizing short messages according to claim 1, wherein:
and the short message template is stored in a database in the form of a data dictionary.
3. The template engine-based method for dynamically customizing short messages according to claim 2, wherein:
and storing the service system type as an abbreviation of a service system name in a database, storing each service scene as a character string, and enabling one short message template to correspond to the abbreviation of the service system name and one character string.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110949096.6A CN113505577A (en) | 2021-08-18 | 2021-08-18 | Template engine-based method for dynamically customizing short message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110949096.6A CN113505577A (en) | 2021-08-18 | 2021-08-18 | Template engine-based method for dynamically customizing short message |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113505577A true CN113505577A (en) | 2021-10-15 |
Family
ID=78016666
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110949096.6A Pending CN113505577A (en) | 2021-08-18 | 2021-08-18 | Template engine-based method for dynamically customizing short message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113505577A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109246000A (en) * | 2018-10-29 | 2019-01-18 | 苏州友教习亦教育科技有限公司 | Message method and message transmission system |
CN109600250A (en) * | 2018-09-29 | 2019-04-09 | 中国平安人寿保险股份有限公司 | Operation system failure notification method, device, electronic device and storage medium |
CN111027298A (en) * | 2019-05-31 | 2020-04-17 | 珠海随变科技有限公司 | Message sending method, system, computer device and storage medium |
CN111507674A (en) * | 2019-01-30 | 2020-08-07 | 阿里巴巴集团控股有限公司 | Task information processing method, device and system |
CN111614718A (en) * | 2020-04-10 | 2020-09-01 | 广州市玄武无线科技股份有限公司 | Enterprise communication channel fusion method, device, equipment and readable storage medium |
-
2021
- 2021-08-18 CN CN202110949096.6A patent/CN113505577A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109600250A (en) * | 2018-09-29 | 2019-04-09 | 中国平安人寿保险股份有限公司 | Operation system failure notification method, device, electronic device and storage medium |
CN109246000A (en) * | 2018-10-29 | 2019-01-18 | 苏州友教习亦教育科技有限公司 | Message method and message transmission system |
CN111507674A (en) * | 2019-01-30 | 2020-08-07 | 阿里巴巴集团控股有限公司 | Task information processing method, device and system |
CN111027298A (en) * | 2019-05-31 | 2020-04-17 | 珠海随变科技有限公司 | Message sending method, system, computer device and storage medium |
CN111614718A (en) * | 2020-04-10 | 2020-09-01 | 广州市玄武无线科技股份有限公司 | Enterprise communication channel fusion method, device, equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111970353B (en) | Data processing method and device for heterogeneous equipment in Internet of things of cloud computing platform | |
CN105590051B (en) | Trusted application for credible performing environment generates and installation method | |
CN103281311A (en) | Internet of Things protocol analysis method adopting Protobuf description | |
CA2530249A1 (en) | Utilizing abstract descriptions to generate, exchange, and configure service and client runtimes | |
WO2020199423A1 (en) | Automated construction method and system for yang model configuration interface | |
CN106713476A (en) | Message transmission implementation method based on message template | |
CN105094824A (en) | Display method for notification messages on intelligent watch and intelligent watch | |
CN113704002A (en) | RPC component realization method based on private protocol and RPC component | |
CN103077066B (en) | A kind of method and system of embedded product key message when compiling | |
CN109783782A (en) | Generation method, equipment, storage medium and the device of electronic contract template | |
CN113342447B (en) | Page generation method, device, equipment and storage medium based on Flutter | |
CN103425469A (en) | Method for generating mobile game codes based on MDA technology | |
CN111258940B (en) | Configuration method, business auditing system, business auditing equipment and storage medium | |
CN113505577A (en) | Template engine-based method for dynamically customizing short message | |
CN116340744A (en) | Standard operation program system establishment method and device | |
CN110839022A (en) | Vehicle-mounted control software communication protocol analysis method based on xml language | |
CN115811513A (en) | Third-party interface request design method, device and storage medium | |
US7769896B2 (en) | Method, apparatus and system for dispatching messages within a system | |
CN114610390A (en) | Dynamic extension method and system of CIL (common information language) instruction | |
CN114265638A (en) | Communication method, device, equipment and storage medium based on plug-in compatibility | |
CN113868479A (en) | Method and device for processing service data | |
CN116069517A (en) | Message and communication control method suitable for multi-mode information identification | |
CN116684437B (en) | Distributed data management method based on natural language analysis | |
CN103929478A (en) | Method and system for storing and downloading video and audio files | |
CN111325009B (en) | Method and device for generating forms |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20211015 |
|
RJ01 | Rejection of invention patent application after publication |