A kind of method and system that message and event are replied under micro-letter development modeTechnical field
The present invention relates to a kind of communication technology about micro-letter, be specifically related to a kind of method and system that message and event are replied under micro-letter development mode.
Background technology
Teng Xun company provides the relevant interface of micro-letter public platform receipt message, defines under developer's pattern, and micro-letter public platform receives the data packet format of common message and the propelling movement of the event of reception, and sends the data packet format of message.
Teng Xun company only defines data packet format and requirement, does not provide data flow and Business Processing, user's applied software development ability, according to business self-developing.Micro-letter public platform user can not complete the application of developer's pattern fast according to demand, uses complexity, adds development difficulty.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of method and system that message and event are replied under micro-letter development mode, the invention solves micro-letter public number developer pattern and uses the technical problem that difficulty is high.
The present invention is achieved through the following technical solutions:
The method that message and event are replied under micro-letter development mode, is characterized in that: comprise the steps:
Step one, keeper, in the correct configuration server of Developer Central of micro-letter public platform, comprise a URL address, token, message encryption and decryption key and message encryption and decryption mode; After having configured, Developer Central generates primary ID, application ID automatically, application key;
Step 2, keeper configure micro-letter public number parameter in micro-letter management system, mainly comprise primary ID, application ID and application key;
Step 3, keeper configuration messages in micro-letter management system is replied and is arranged, and comprises receipt message type, message key, whether matching regular expressions, replys type of message, replys message content, external business interface IP address and whether call external business interface;
Step 4, keeper configure and push event response setting in micro-letter management system;
Step 5, after micro-credit household sends message or trigger event to public number on micro-letter software, in the URL that the event forwarding user message or propelling movement is specified to above-mentioned keeper by micro-letter public platform;
Step 6, micro-fuse tube reason system acceptance is to the event of user message or propelling movement, and the event according to the user message received or propelling movement processes, and returns response results to micro-letter platform:
After step is poly-seven, micro-letter platform receives the response message of micro-letter management system, be sent on micro-letter software of user.
In step 6, response results can be content of text or message packets, and described message packets is text message, picture and text message or template message.
In step 3, receipt message type comprises text message, image information, speech message, video messaging, small video message, geographic location information or link message.
In step 4, event type comprises concern event, cancels concern event, scans Quick Response Code event, reports geographical position event or menu event.
Described external business interface is connected by sending HTTP request with described development platform.
In step 6, when micro-credit household sends text message or triggering click menu pulls message event, first travel through keyword match and travel through matching regular expressions again, find occurrence at first; If call external business interface, then ask external business interface, obtain response results, then result is responded to micro-letter platform; If never call external business interface, then directly the reply message content of configuration is packaged into text message or picture and text message response to micro-letter platform.
In step 6, when micro-credit household sends image information, video messaging, small video message, geographic location information and link message or triggering report geographical position event or trigger click menu skip chain take over a job part time, do not mate keyword, message packets is sent to the process of external business interface, and external business interface response results is packaged into text message response to micro-letter platform.
In step 6, when micro-credit household sends speech message, if micro-letter management system opens speech identifying function, by voice identification result and text message same treatment; Otherwise and image information same treatment.
In step 6, when micro-credit household triggers concern event or scanning strip parameter Quick Response Code event, call external business interface, by the process of external business interface and after returning response results, and response results is packaged into text message response to micro-letter platform.
In step 6, when micro-credit household triggers concern event or scanning strip parameter Quick Response Code event, micro-letter management system is directly packaged into text message or picture and text message response to micro-letter platform the response message of configuration.
In step 6, when micro-credit household triggers cancellation concern event, call external business interface, by the process of external business interface.
The system that message and event are replied under micro-letter development mode, is characterized in that: comprise,
Micro-letter management system, after micro-letter management system receives user message, can carry out matching treatment according to the content that arranges of message back setting unit; When after the event receiving propelling movement, can process according to the content that arranges of event response setting unit;
Whether message back setting unit, for arranging keyword match mode and keyword content, reply content, call external business interface and external business interface IP address;
Whether event response setting unit, for arranging the event reply content according to pushing, call external business interface and external business interface IP address;
External business interface, according to the configuration of message back setting unit and event response setting unit, micro-letter management system can be called external business interface and obtain the response of external business interface, is packaged into different message packets replies to micro-letter platform according to the form of response contents.
In described micro-letter management system, match messages mode is keyword match or matching regular expressions.
Described external business interface is connected by HTTP request with described micro-letter management system.
The present invention compared with prior art, has following obvious advantage:
1) the present invention supports all message and event, supports multiple reply message mechanism, can meet development requirement.
2) the present invention can call external business interface, makes micro-letter platform and external business communication.
3) the present invention can allow micro-letter public platform user complete the application of developer's pattern fast according to demand, easy to use, simple, reduces development difficulty.
Accompanying drawing explanation
Fig. 1 is the flow chart of steps of the present invention's method that message and event are replied under micro-letter development mode;
Fig. 2 is message back processing mode according to an embodiment of the invention;
Fig. 3 is that micro-according to an embodiment of the invention fuse tube reason system acceptance is to parsing during packet and process chart;
Fig. 4 is the flow chart that micro-according to an embodiment of the invention letter management system generates reply content.
Embodiment
As shown in Figure 1, a kind of method that message and event are replied under micro-letter development mode, comprises the steps:
Step one, keeper, in the correct configuration server of Developer Central of micro-letter public platform, comprise a URL address, token, message encryption and decryption key and message encryption and decryption mode; After having configured, Developer Central generates primary ID, application ID automatically, application key;
Step 2, keeper configure micro-letter public number parameter in micro-letter management system, mainly comprise primary ID, application ID and application key;
Step 3, keeper configuration messages in micro-letter management system is replied and is arranged, and comprises receipt message type, message key, whether matching regular expressions, replys type of message, replys message content, external business interface IP address and whether call external business interface;
Step 4, keeper configure and push event response setting in micro-letter management system;
Step 5, after micro-credit household sends message or trigger event to public number on micro-letter software, in the URL that the event forwarding user message or propelling movement is specified to above-mentioned keeper by micro-letter public platform;
Step 6, micro-fuse tube reason system acceptance is to the event of user message or propelling movement, and the event according to the user message received or propelling movement processes, and returns response results to micro-letter platform:
After step is poly-seven, micro-letter platform receives the response message of micro-letter management system, be sent on micro-letter software of user.
As shown in Figure 4, in step 6, response results can be content of text or message packets, and described message packets is text message, picture and text message or template message.
As shown in Figure 3, in step 3, receipt message type comprises text message, image information, speech message, video messaging, small video message, geographic location information or link message; In step 4, event type comprises concern event, cancels concern event, scans Quick Response Code event, reports geographical position event or menu event.
Described external business interface is connected by sending HTTP request with described development platform.
In step 6, when micro-credit household sends text message or triggering click menu pulls message event, first travel through keyword match and travel through matching regular expressions again, find occurrence at first; If call external business interface, then ask external business interface, obtain response results, then result is responded to micro-letter platform; If never call external business interface, then directly the reply message content of configuration is packaged into text message or picture and text message response to micro-letter platform.
In step 6, when micro-credit household sends image information, video messaging, small video message, geographic location information and link message or triggering report geographical position event or trigger click menu skip chain take over a job part time, do not mate keyword, message packets is sent to the process of external business interface, and external business interface response results is packaged into text message response to micro-letter platform.
In step 6, when micro-credit household sends speech message, if micro-letter management system opens speech identifying function, by voice identification result and text message same treatment; Otherwise and image information same treatment.
In step 6, when micro-credit household triggers concern event or scanning strip parameter Quick Response Code event, call external business interface, by the process of external business interface and after returning response results, and response results is packaged into text message response to micro-letter platform.
In step 6, when micro-credit household triggers concern event or scanning strip parameter Quick Response Code event, micro-letter management system is directly packaged into text message or picture and text message response to micro-letter platform the response message of configuration.
In step 6, when micro-credit household triggers cancellation concern event, call external business interface, by the process of external business interface.
The system that message and event are replied under micro-letter development mode, comprising:
Micro-letter management system, after micro-letter management system receives user message, can carry out matching treatment according to the content that arranges of message back setting unit; When after the event receiving propelling movement, can process according to the content that arranges of event response setting unit;
Whether message back setting unit, for arranging keyword match mode and keyword content, reply content, call external business interface and external business interface IP address;
Whether event response setting unit, for arranging the event reply content according to pushing, call external business interface and external business interface IP address;
External business interface, according to the configuration of message back setting unit and event response setting unit, micro-letter management system can be called external business interface and obtain the response of external business interface, is packaged into different message packets replies to micro-letter platform according to the form of response contents.
As shown in Figure 2, in described micro-letter management system, match messages mode is keyword match or matching regular expressions.
As shown in Figure 4, described external business interface is connected by HTTP request with described micro-letter management system.
Technological means disclosed in the present invention program is not limited only to the technological means disclosed in above-mentioned execution mode, also comprises the technical scheme be made up of above technical characteristic combination in any.It should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention, can also make some improvements and modifications, these improvements and modifications are also considered as protection scope of the present invention.