CN116996491A - Configurable implementation method for service message notification - Google Patents

Configurable implementation method for service message notification Download PDF

Info

Publication number
CN116996491A
CN116996491A CN202310918179.8A CN202310918179A CN116996491A CN 116996491 A CN116996491 A CN 116996491A CN 202310918179 A CN202310918179 A CN 202310918179A CN 116996491 A CN116996491 A CN 116996491A
Authority
CN
China
Prior art keywords
message
channel
service
sending
code
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
CN202310918179.8A
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.)
Sichuan Qiruike Technology Co Ltd
Original Assignee
Sichuan Qiruike Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Qiruike Technology Co Ltd filed Critical Sichuan Qiruike Technology Co Ltd
Priority to CN202310918179.8A priority Critical patent/CN116996491A/en
Publication of CN116996491A publication Critical patent/CN116996491A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/221Column-oriented storage; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • H04L67/306User profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Abstract

The invention discloses a configurable realization method for service message notification, which is realized by configuring a message sending channel and a service message sending channel in a database; when the service is developed, the configuration parameters stored in the database are obtained through the keywords, the channels for sending the messages are analyzed according to the configuration parameters, then unified message sending service is called, and the messages are sent to the user through the designated message channels according to the predefined mode; by the mode, even if the channel for transmitting the message needs to be modified, the analysis code does not need to be modified, and the purposes of high expansibility and high multiplexing are really achieved.

Description

Configurable implementation method for service message notification
Technical Field
The invention relates to the technical field of software systems, in particular to a configurable implementation method for service message notification.
Background
In a software system, many systems have a function of sending a message alert to a user to alert the user of what important services need to be handled, and in order to facilitate the user to better receive the alert message, the system may send the same alert message through multiple channels, for example, a business trip application requires a lead user to review as soon as possible. Because of the function difference of each system and each module, different services can be sent to the user through different message reminding channels according to the service emergency and the use habit of the user. While most message alerts are fixed, they do not support online adjustment. Thus, the code needs to be modified when the business is slightly changed, and the system is stopped due to updating and upgrading, so that the flexibility of the system is reduced.
Disclosure of Invention
The invention aims to solve the problems and provide a configurable implementation method for service message notification. According to the method, through the configuration parameters of the service message sending channels configured in the database, the number of channels through which the service needs to be pushed to the user is obtained. The emphasis is on this parameter configurable approach, without modifying the code.
The invention realizes the above purpose through the following technical scheme:
a service message notification configurable implementation method, comprising the steps of:
step A, creating a database table for storing configuration parameters;
step B, creating a database table for storing message contents and message sending records;
step C, planning a message channel code according to actual needs;
step D, configuring parameters related to the message and storing the parameters in a parameter database table;
e, developing a transmitting code of a corresponding channel according to actual needs;
step F, defining and transmitting unified message transmission service;
and G, updating the cache while modifying the stored database by the parameters.
In a further aspect, in the step a, the configuration parameter database table reference field includes the following contents:
ID, key, parameter value, status (0: hidden 1: display), remarks.
Further, in the step B, the message content database table reference field includes the following contents:
ID, topic, message content, creation time, creator;
in the step B, the message sending record database table reference field includes the following contents:
ID, service type, service ID, configuration value of service, message channel name, sending time, creation time, sending status (1, to be sent; 2, sending success; 3, sending failure), response result, abnormal information, sending object, message ID.
Further, in the step C, the defined content includes the following contents:
four channels are defined, such as email, sms, phone notification bar phone, site, and redefined or increased or decreased according to the needs in the actual service.
Further, in the step 4, in the step D, the content to be defined and configured includes the following contents:
(1) The channel switch position definition principle, the binary character string occupation principle, and the corresponding position is 1, which indicates that the channel needs to be used and sends information;
(2) Short message switch positions, 4, 1000, mes_chanel_send_code_sms,8; in-station letter switch positions, 3, 0100, mes_chanel_send_code_site,4; a mobile phone notification bar switch position, 2, 0010, mes_chanel_send_code_phone,2; mail switch positions, 1, 0001, mes_chanel_send_code_email,1;
(3) Testing service, biz1; service transmission channel configuration, biz_1_mesg_channel, 13=8+2+1.
Further, in the step E, the example code logic includes the following:
(1) Defining a message entity class, the entity class comprising the following fields: the method comprises the steps of service type, service ID, message ID, service configuration value, theme, short message mobile phone number, mobile phone end message push ID, mailbox address and user ID; the mobile phone number of the short message, the message push ID of the mobile phone end, the mailbox address and the user ID are all of a collection type, are compatible with a single object to send the message, and can also send the message to a plurality of objects; the mobile phone side message pushing ID is an ID used when a message is pushed to an object through a mobile phone notification bar channel; the user ID is a user ID used for pushing a message to an object through an intra-station communication channel;
(2) Code example logic: acquiring mobile phone number set data from a method parameter message entity class object, then processing actual service, namely sending a message to a user through a short message or an in-station message or a mobile phone notification bar or a mail channel, acquiring an actual message pushing result and abnormality, assembling data required by a message sending record, storing the message sending record, and circularly processing until the set data is empty.
Further, in the step F, the example code program includes the following:
(1) The application starts and executes configuration parameter cache;
1) Querying configuration parameters starting with "MES_CHANEL_SEND_CODE";
2) Taking the value of the parameter value as a key, taking the character string after the parameter key is removed from MES_CHANEL_SEND_CODE_ "as a value, and storing the character string into a Map set;
(2) The message channel parameter analysis method is realized;
1) Defining a character string set for storing the matched channel names;
2) Obtaining all channel configuration parameters from the cache;
3) Acquiring a channel configuration parameter;
4) Performing bit and operation by using the service channel configuration parameters and channel parameters;
5) If the result is equal to the channel configuration parameters, the matching is successful, and the channel name is put into the set defined in the step 1;
6) If the matching fails, executing the step 7;
7) Repeating the steps of 3-6;
8) Returning to the set defined in the step 1;
(3) Unified message sending service method is realized;
1) Acquiring a service channel parameter from a method parameter message entity class object, and setting a transmission failure mark as false;
2) Calling an analysis method to analyze the parameters in the step 1 and obtaining a channel name list;
3) If the channel name list is empty, setting a sending failure mark as true, otherwise continuing;
4) Acquiring a channel name;
5) Calling a sending function of a corresponding channel to send a message according to the channel name;
6) Repeating the steps 4-5;
7) If the transmission failure flag is true, a failure exception is thrown.
The invention has the beneficial effects that:
the invention relates to a configurable realization method for service message notification, which is realized by configuring a message sending channel and a service message sending channel in a database; when the service is developed, the configuration parameters stored in the database are obtained through the keywords, the channels for sending the messages are analyzed according to the configuration parameters, then unified message sending service is called, and the messages are sent to the user through the designated message channels according to the predefined mode; by the mode, even if the channel for transmitting the message needs to be modified, the analysis code does not need to be modified, and the purposes of high expansibility and high multiplexing are really achieved.
The invention can acquire which channels the business message is sent from the configuration data on the premise of ensuring the data integrity, and the user can modify the parameters according to the change and adjustment parameters of the business, so as to achieve flexible configuration parameters, send message reminding according to the need, and provide a convenient and efficient customized sending function for the message reminding function of the system.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following description will briefly explain the practical drawings required in the embodiments or the prior art description, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, based on the examples herein, which are within the scope of the invention as defined by the claims, will be within the scope of the invention as defined by the claims.
In any embodiment, as shown in fig. 1, a service message notification configurable implementation method of the present invention includes:
1 background of the implementation
A certain system A, a user operates a service 1 on a system page, the service is configured with message sending, and the configured channels are as follows: short message, mobile phone notification bar, mail; service 1 is changed, and message transmission of a short message channel is reduced.
2 preparation work
A database table is created storing configuration parameters, the table being used to store configuration parameters. The table reference is defined as follows:
creating a database table for storing message contents and message sending records, wherein the database table is used for storing channel message contents and sending record information; the message content table reference is defined as follows:
the messaging record table reference is defined as follows:
the configuration information of the design service 1 and the channel configuration of the transmission is as follows:
channel configuration information: short message switch positions, 4, 1000, mes_chanel_send_code_sms,8; in-station letter switch positions, 3, 0100, mes_chanel_send_code_site,4; a mobile phone notification bar switch position, 2, 0010, mes_chanel_send_code_phone,2; mail switch positions, 1, 0001, mes_chanel_send_code_email,1;
service configuration information: biz1; service transmission channel configuration, biz_1_mesg_channel, 11=8+2+1;
and 3, developing channel message sending service and unified message sending service, modifying business codes to call the unified message sending service, and using codes provided by the patent, realizing message sending according to configuration channels.
3.1 message sending information entity class example implementation:
3.2 channel messaging example implementation:
a) Short message channel:
1) Acquiring mobile phone number set data from a method parameter message entity class object;
2) Setting the state to be 1;
3) The invention is only exemplified by handling the actual business, the actual message pushing result and the exception, and is not realized here;
4) Output "send message to sms";
5) Obtaining a pushing result;
6) Acquiring push abnormality;
7) Setting the state to be 2;
8) Assembling data required by the message sending record;
9) Storing a message sending record;
10 Repeating 2) -9) until the aggregate data is empty;
b) Intra-station communication channel:
1) Acquiring user ID collection data from the method parameter message entity class object;
2) Setting the state to be 1;
3) The invention is only exemplified by handling the actual business, the actual message pushing result and the exception, and is not realized here;
4) Output "send message to site";
5) Obtaining a pushing result;
6) Acquiring push abnormality;
7) Setting the state to be 2;
8) Assembling data required by the message sending record;
9) Storing a message sending record;
10 Repeating 2) -9) until the aggregate data is empty;
c) Cell phone notification bar channel:
1) Acquiring message pushing ID set data from a method parameter message entity class object;
2) Setting the state to be 1;
3) The actual business, the pushing result of the actual message and the abnormality are processed, and the patent is only taken as an example and is not realized here;
4) Output "send message to phone";
5) Obtaining a pushing result;
6) Acquiring push abnormality;
7) Setting the state to be 2;
8) Assembling data required by the message sending record;
9) Storing a message sending record;
10 Repeating 2) -9) until the aggregate data is empty;
d) Mailbox channel:
1) Acquiring mailbox address set data from the method parameter message entity class object;
2) Setting the state to be 1;
3) The actual business, the pushing result of the actual message and the abnormality are processed, and the patent is only taken as an example and is not realized here;
4) Output "send message to email";
5) Obtaining a pushing result;
6) Acquiring push abnormality;
7) Setting the state to be 2;
8) Assembling data required by the message sending record;
9) Storing a message sending record;
10 Repeating 2) -9) until the aggregate data is empty;
channel messaging services, processing logic is: acquiring mailbox address set data from a method parameter message entity class object, setting the set state as 1, processing actual service, an actual message pushing result and abnormality, acquiring a pushing result, acquiring pushing abnormality, setting the set state as 2, assembling data required by a message sending record, storing the message sending record, and circularly executing until the set data is empty.
3.3, the configuration parameters of the cache channel during application loading are realized as follows:
and caching the data into a memory, namely cusCommonUtils.INS.channel_info, through the code implementation for use in service parameter analysis. The cache value is updated when the page modification parameter is configured, so that configuration adjustment can be realized even if the application is not restarted.
3.4 channel configuration numerical analysis is realized as follows:
by the method, parameters of service configuration are analyzed, and a channel list for message transmission is obtained. 3.5 unified message sending is realized as follows:
/>
/>
the send method of the class calls an analysis method according to the message sending parameter value of the service configuration obtained from the entity class object, obtains a message sending list from the analysis method, and sends the messages one by one according to the list;
the service API interface code is modified to realize the following:
inquiring a data configuration table sys_config according to the service coding biz_1_mesg_channel, and obtaining a value of 11 of service configuration; and acquiring the message content which is required to be sent by the service, and storing the message content in a database table tb_message_info. Assigning a value to the messaging entity object and invoking a unified messaging service.
The message is sent to the user through channels such as short messages, mobile phone notification bars, mails and the like; modifying the configuration of the service and canceling the sending of the mail channel; when the service is called for developing an interface again, inquiring a data configuration table sys_config according to a service code biz_1_mesg_channel, and acquiring a value of service configuration as 10; acquiring the message content which is required to be sent by the service, and storing the message content in a database table tb_message_info; assigning a value to the message sending entity object and calling a unified message sending service; the message is sent to the user through a short message, a mobile phone notification bar and other channels.
Through the steps, the channel for sending the message and the channel for sending the business message are both configured in the database; when the service is developed, the configuration parameters stored in the database are obtained through the keywords, the channels for sending the messages are analyzed according to the configuration parameters, then unified message sending service is called, and the messages are sent to the user through the designated message channels according to the predefined mode; by the mode, even if the channel for transmitting the message needs to be modified, the analysis code does not need to be modified, and the purposes of high expansibility and high multiplexing are really achieved.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims. In addition, the specific features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various possible combinations are not described further. Moreover, any combination of the various embodiments of the invention can be made without departing from the spirit of the invention, which should also be considered as disclosed herein.

Claims (7)

1. A method for implementing service message notification, comprising the steps of:
step A, creating a database table for storing configuration parameters;
step B, creating a database table for storing message contents and message sending records;
step C, planning a message channel code according to actual needs;
step D, configuring parameters related to the message and storing the parameters in a parameter database table;
e, developing a transmitting code of a corresponding channel according to actual needs;
step F, defining and transmitting unified message transmission service;
and G, updating the cache while modifying the stored database by the parameters.
2. The method according to claim 1, wherein in the step a, the configuration parameter database table reference field includes the following contents:
ID, key, parameter value, status, remarks.
3. The method of claim 1, wherein in step B, the message content database table reference field includes the following:
ID, topic, message content, creation time, creator;
in the step B, the message sending record database table reference field includes the following contents:
ID, service type, service ID, service configuration value, message channel name, sending time, creation time, sending state, response result, abnormal information, sending object and message ID.
4. The method according to claim 1, wherein in the step C, the defined content includes the following:
four channels are defined, namely email, sms, phone notification bar phone, site, redefined or increased and decreased in actual business.
5. The method according to claim 1, wherein in step 4, the content to be defined and configured in step D includes the following contents:
(1) The channel switch position definition principle, the binary character string occupation principle, and the corresponding position is 1, which indicates that the channel needs to be used and sends information;
(2) Short message switch positions, 4, 1000, mes_chanel_send_code_sms,8; in-station letter switch positions, 3, 0100, mes_chanel_send_code_site,4; a mobile phone notification bar switch position, 2, 0010, mes_chanel_send_code_phone,2; mail switch positions, 1, 0001, mes_chanel_send_code_email,1;
(3) Testing service, biz1; service transmission channel configuration, biz_1_mesg_channel, 13=8+2+1.
6. The method of claim 1, wherein in step E, the example code logic comprises:
(1) Defining a message entity class, the entity class comprising the following fields: the method comprises the steps of service type, service ID, message ID, service configuration value, theme, short message mobile phone number, mobile phone end message push ID, mailbox address and user ID; the mobile phone number of the short message, the message push ID of the mobile phone end, the mailbox address and the user ID are all of a collection type, are compatible with a single object to send the message, and can also send the message to a plurality of objects; the mobile phone side message pushing ID is an ID used when a message is pushed to an object through a mobile phone notification bar channel; the user ID is a user ID used for pushing a message to an object through an intra-station communication channel;
(2) Code example logic: acquiring mobile phone number set data from a method parameter message entity class object, then processing actual service, namely sending a message to a user through a short message or an in-station message or a mobile phone notification bar or a mail channel, acquiring an actual message pushing result and abnormality, assembling data required by a message sending record, storing the message sending record, and circularly processing until the set data is empty.
7. The method of claim 1, wherein in step F, the example code program includes the following:
(1) The application starts and executes configuration parameter cache;
1) Querying configuration parameters starting with "MES_CHANEL_SEND_CODE";
2) Taking the value of the parameter value as a key, taking the character string after the parameter key is removed from MES_CHANEL_SEND_CODE_ "as a value, and storing the character string into a Map set;
(2) The message channel parameter analysis method is realized;
1) Defining a character string set for storing the matched channel names;
2) Obtaining all channel configuration parameters from the cache;
3) Acquiring a channel configuration parameter;
4) Performing bit and operation by using the service channel configuration parameters and channel parameters;
5) If the result is equal to the channel configuration parameters, the matching is successful, and the channel name is put into the set defined in the step 1;
6) If the matching fails, executing the step 7;
7) Repeating the steps of 3-6;
8) Returning to the set defined in the step 1;
(3) Unified message sending service method is realized;
1) Acquiring a service channel parameter from a method parameter message entity class object, and setting a transmission failure mark as false;
2) Calling an analysis method to analyze the parameters in the step 1 and obtaining a channel name list;
3) If the channel name list is empty, setting a sending failure mark as true, otherwise continuing;
4) Acquiring a channel name;
5) Calling a sending function of a corresponding channel to send a message according to the channel name;
6) Repeating the steps 4-5;
7) If the transmission failure flag is true, a failure exception is thrown.
CN202310918179.8A 2023-07-25 2023-07-25 Configurable implementation method for service message notification Pending CN116996491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310918179.8A CN116996491A (en) 2023-07-25 2023-07-25 Configurable implementation method for service message notification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310918179.8A CN116996491A (en) 2023-07-25 2023-07-25 Configurable implementation method for service message notification

Publications (1)

Publication Number Publication Date
CN116996491A true CN116996491A (en) 2023-11-03

Family

ID=88522633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310918179.8A Pending CN116996491A (en) 2023-07-25 2023-07-25 Configurable implementation method for service message notification

Country Status (1)

Country Link
CN (1) CN116996491A (en)

Similar Documents

Publication Publication Date Title
US7013350B2 (en) System setting flags based on address types in destination address field of a message to indicate different transports to deliver the message
US6721402B2 (en) Apparatus, method, and record medium for automatically categorizing received mail messages
US6125281A (en) Real-time SMS application messaging using an SMSC-linked server
US8131803B2 (en) System and method for integrating an address book with an instant messaging application in a mobile station
CN1192665C (en) Server request including code for customizing service to requesting cellular mobile station
EP0982959B1 (en) Mobile telephone user interface for short messages
CN1130895C (en) Method for announcing message to subscriber
CN1921485B (en) Methods and systems for managing email in a client-server environment
GB2374689A (en) Communications system
US20080270559A1 (en) Mobile Device and Method for Sending a Message from a Mobile Device
JP2005117637A (en) Method and system for web-based event notification
WO2004061583A2 (en) Method and apparatus for providing wireless messaging
CN101316295A (en) Interface updating method and apparatus for message application of mobile terminal
CN100499841C (en) Short message service interface and channel adapting method for the same
US8111819B2 (en) Message server and method for notification of a user about the delivery of an electronic message
EP2448226A1 (en) Mobile phone messages processing method and mobile phone
US6990331B2 (en) Mobile terminal
EP2871823A1 (en) Method and terminal for processing message service
JP2004178294A (en) Mobile terminal displaying related e-mail, method of displaying e-mail, and program
CN104052848A (en) Method, client side and electronic device for processing contact person information
CN116996491A (en) Configurable implementation method for service message notification
CN113595884B (en) Message reminding method and application terminal
US20050182738A1 (en) Message handling device and method for telecommunication terminal and telecommunication terminal provided with such a device
US20030126220A1 (en) Quick reply codes for communication of information between electronic devices
CN113672488A (en) Log text processing method and device

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