Disclosure of Invention
The invention aims to provide a mail information and instant message interaction method, which has the advantages of intercommunication between the mail content and the instant message content and wide intercommunicated content range.
In order to achieve the purpose, the invention provides the following technical scheme:
a method for interacting mail information with instant messages comprises the following steps:
selecting and marking target content of at least one mail;
numbering and sequencing the target contents, wherein different numbers are distributed to the target contents with different data types, and the types of the numbers correspond to the data types one to one;
importing the target content into a content page according to the serial number sequence;
the content page is imported into an instant address book, and at least one user address in the instant address book is selected;
packaging the user address, the target content and the real-time to construct a sending data packet, and sending the sending data packet to a server;
and the server receives and analyzes the sending data packet into an instant message, and sends the instant message to the user address.
According to the technical scheme, the content is selected in the mail, the selected content is arranged and then is imported into an additional content page, the user address in the instant address book is selected for the selected content in the content page, the user address, the target content and the real-time are packaged into the sending data packet and then are sent to the server, finally the server analyzes the sending data packet into the instant message and sends the instant message to the corresponding user address, the content in the mail can be sent as the instant message without entering the instant message page, the intercommunication between the mail content and the instant message content is realized, the type of the content can be not additionally processed during transmission after the content is packaged, the content can be directly used as the most basic information data for intercommunication, and the interactive content range is wide.
Further, the method also comprises the following steps:
editing the target content within the content page;
adding new content between the target content adjacent in number;
if the data type of the newly added content is the same as that of the target content, writing the newly added content into the tail end of the target content with the former number according to the position sequence, or writing the newly added content into the head end of the target content with the latter number according to the position sequence;
and if the data type of the newly added content is different from the data type of the target content, configuring a new number for the newly added content, wherein the type of the new number corresponds to the data type of the newly added content, and the numerical value of the new number is the sequencing value of the target content of the same type.
By the technical scheme, the target content can be edited in the content page, the flexibility of sending the instant message can be increased, the content with the same data type is increased, the content can be combined into the original number, the data processing amount is reduced, the content with different data types is increased, the number can be newly established, and the content with different data types can be conveniently identified when the data is analyzed.
Further, the method also comprises the following steps:
editing the target content within the content page;
adding new content into the target content, wherein the new content comprises content of a first data type and content of a second data type;
if the newly added content and the target content are both of a first data type, writing the newly added content into the target content according to a position sequence;
if the data type of the new content is the second data type and the target content is the first data type, splitting the content of the target content, writing a start character at the end of the number of the target content as the content of the first half of the split corresponding to the start number, and writing a stop character at the end of the number of the target content as the content of the second half of the split corresponding to the stop number,
and configuring a new number for the newly added content, wherein the type of the new number corresponds to the second data type, and the numerical value of the new number is the sequencing value of the target content of the same type.
By the technical scheme, the target content can be edited in the content page, the flexibility of sending the instant message can be increased, the content with the same data type is increased, the content can be merged into the original number, the data processing amount is reduced, the content with different data types is increased, the original number can be split and the number can be newly established, the insertion position of the newly added content can not be changed, the sequence of the inserted content number can not be disordered, the content with different data types can be identified conveniently during data analysis, the edited content can have hundreds of reduction degrees after transmission, and the editing trace is kept.
Further, the encapsulating the user address, the target content, and the real-time into a transmission data packet includes:
sequentially establishing a start line, a header and a main body to form the sending data packet;
writing a request type into the start row;
writing protocol characteristics and the user address into the header;
and writing the target content and the real-time into the main body.
Through the technical scheme, the start line can enable a receiver sending the data packet to identify the processing type of the sending data packet, the header can enable the receiver sending the data packet to identify a protocol to be followed and an address to which data finally reaches, and the main body records target content and time.
Further, the writing the target content into the main body and the real-time include:
the target content comprises content of a first data type and/or content of a second data type;
generating text type content according to the first data type content, and replacing the first data type content with the text type content;
generating a binary type of content according to the content of the second data type, and replacing the content of the second data type with the binary type of content;
and generating a numbering sequence according to the numbering sequence of the target content, and writing the numbering sequence into the main body.
Through the technical scheme, the content of the first data type is transcoded into the text type, the content of the second data type is transcoded into the binary type, the content data volume of the text type and the binary type is small, and the transmission time for sending the data packet and the occupied bandwidth are reduced.
Further, the step of receiving and parsing the sending data packet into the instant message by the server includes:
acquiring a numbering sequence in the main body;
restoring the content of the main body according to the number in the number sequence and the number sequence, and restoring the content of the binary type into the content of the second data type;
separately holding the content of the second data type, generating a link address linking the content, and replacing the content of the main body corresponding to the link address with the link address;
splicing the contents of the main body into a complete message according to the numbering sequence of the target contents, matching the complete message to the user address in the head part, then creating the instant message, and writing the user address and the complete message into the instant message;
and sending the instant message to the user address.
Through the technical scheme, the content of the second data type is independently stored and the link address of the content is used for replacing the content, so that the content can be automatically downloaded after the link address is received by the user address, and the transmission time of the instant message and the bandwidth occupied by the instant message during transmission are shortened.
Further, the instant message comprises a message sending address, a message receiving address, sending content and sending time;
the writing the user address and the complete message into the instant message includes:
writing a mailbox address into the message sending address or writing a user address corresponding to the mailbox address;
writing the user addresses into the message receiving addresses, wherein one user address corresponds to one instant message;
writing the complete message to the transmission content;
and writing the real-time into the sending time or writing the time of newly creating the instant message.
According to the technical scheme, the message sending address is used for recording the sender, the message receiving address is used for recording the receiver, the sending content is text type content or a link address, the sending time records the time for constructing the sending data packet, and the user address receiving and sending time can calculate the transmission delay between the sending data packet and the instant message according to the time of the user address.
Further, after the user address receives the instant message, the link address is read and the content of the second data type is downloaded according to the link address.
Through the technical scheme, the user address downloads the content of the second data type according to the link address, so that the user side can download the content of the second data type when the user side is idle, and the information processing efficiency of the user side is improved.
Further, after receiving the instant message, the user address reads the content of the text type, identifies the link information in the content, and downloads the corresponding link content according to the link information.
Through the technical scheme, the user address identifies the link address in the text type content to download the data, so that the content recorded in the original mail can be downloaded when the user side is idle, and the information processing efficiency of the user side is improved.
Further, the sending data packet is sent to the server through an HTTP protocol.
Through the technical scheme, the HTTP protocol is a reliable data transmission protocol and is already used for transmitting various multimedia contents on the internet, and a common interaction mode of the protocol is that a user sends an HTTP request to a server, and the server sends back the requested data in an HTTP response.
Compared with the prior art, the invention has the beneficial effects that:
(1) selecting content in the mail, arranging the selected content, importing the arranged content into an additional content page, selecting a user address in an instant address book for the selected content in the content page, packaging the user address, target content and real-time into a sending data packet, sending the sending data packet to a server, finally analyzing the sending data packet by the server to form an instant message, sending the instant message to a corresponding user address, sending the content in the mail as the instant message without entering the instant message page, realizing the intercommunication of the mail content and the instant message content, packaging the content, and then directly communicating the content as the most basic information data without additionally processing the type of the content during transmission, wherein the interactive content has a wide range;
(2) by editing the target content in the content page, the flexibility of sending the instant message can be increased, the content with the same data type is increased, the content can be combined into the original number, the data processing amount is reduced, and the new number can be created when the content with different data types is increased, so that the content with different data types can be conveniently identified when the data is analyzed;
(3) the content with different data types is added, the original number is split and the number is newly built, so that the insertion position of the newly added content is not changed, the sequence of the inserted content number is not disordered, the content with different data types is conveniently identified during data analysis, the edited content can have hundreds of percent of reduction degree after transmission, and meanwhile, the editing trace is also kept.
Detailed Description
In order to better and clearly show the technical scheme of the invention, the invention is described in detail below with reference to the accompanying drawings.
Examples
A method for interacting mail information with instant messages, as shown in fig. 1, includes the following steps:
step S1: the target content of at least one of the mails is selected and marked. The mail system runs in the terminal, the terminal can be a mobile terminal such as a smart phone, a smart tablet or a mobile computer, and the terminal can also be a service platform such as an office computer, a local system platform or a cloud service platform. In this embodiment, for example, the mail system is operated in a mobile terminal, and the mobile terminal has a display screen and supports touch operation. And clicking the corresponding mail to open and browse a content page of the mail, selecting and marking the content by pressing a screen for a long time, wherein the marked content type can be a text or a multimedia file, the representation form of the multimedia file in the mail is a URI (Uniform resource identifier) address, and when the mail system receives the mail, the mail system automatically downloads the content corresponding to the URI address for display.
Step S2: and numbering and sequencing the target contents, wherein different numbers are distributed to the target contents with different data types, and the types of the numbers correspond to the data types one to one. Each time a target content is marked, the mobile terminal records once, different numbers are sequentially allocated to the target content, the numbers are marked as < F1, F2, … … and Fn >, and the numbers are matched with the corresponding target content to be < F1, namely marked text >, < F1, namely marked text >, … … < Fn, namely marked text >.
Step S3: and importing the target content into the content page according to the numbering sequence. In this step, when at least one target content is generated, a completion button appears on the mail page, and the completion button is clicked to perform an import operation.
The target content within the content page may be edited in the content page after the importing is complete. And adding new content between target content adjacent to the code, and writing the new content into the tail end of the target content of the previous code according to the position sequence or writing the new content into the head end of the target content of the next code according to the position sequence if the data type of the new content is the same as that of the target content. And if the data type of the newly added content is different from the data type of the target content, configuring a new number for the newly added content, wherein the type of the new number corresponds to the data type of the newly added content, and the numerical value of the new number is the sequencing value of the target content of the same type. The newly added content can be added or modified content, the modified content is classified into a subsequent first mark Fi when a text is newly added or edited in the content page, and a new target content and a corresponding new code Fn +1 are generated if the text is added at the end of the content page. If multimedia content is added in the text, such as adding pictures, voice and the like in the content page, if the added multimedia content is between the marks Fj, a mark Mi with a data type different from the text is generated, wherein i is the adding sequence value of the newly added multimedia content in all the multimedia content, such as adding the fifth picture, and is marked as M5.
In addition, the newly added content includes content of a first data type and content of a second data type, the first data type may be a text type, the second data type may be a multimedia type, and if the newly added content and the target content are both the first data type, the newly added content is written into the target content according to the position sequence. And if the data type of the newly added content is the second data type and the target content is the first data type, splitting the content of the target content, writing a start character at the tail end of the number of the target content as the content of the first half of the split corresponding to the start number, and writing a stop character at the tail end of the number of the target content as the content of the second half of the split corresponding to the stop number, configuring a new number for the newly added content, wherein the type of the new number corresponds to the second data type, and the numerical value of the new number is the sequencing value of the target content of the same type. If multimedia content is added in the text content, split into < Fj1, Mi, Fj2>, where 1 is the start character and 2 is the terminator. For example, F1, F2, F3, and F4 are text-type target contents, M1 is added between F2 and F3, M2 is added in F4, the original F4 is split into F41 and F42, and after editing is completed, we obtain a tag sequence F in which the numbers of the target contents are sequentially combined: < F1, F2, M1, F3, F41, M2, F42, … … >.
Step S4: and importing an instant address book into the content page, wherein the instant address book is obtained from the instant message system when the content page is called, and at least one user address in the instant address book can be selected from the content page. The representation of the user address may be a network address, a user name, a user code number, or a user terminal type using the user address. After the user address is selected, the content page generates a user list, which is marked as < S1, S2, … …, Sn >.
Step S5: and packaging the user address, the target content and the real-time to form a sending data packet. The method comprises the following steps of encapsulating and constructing a sending data packet in an HTTP (hyper text transport protocol) mode, wherein the encapsulating and constructing steps are as follows: the method comprises the steps of sequentially establishing a start line, a header and a main body to form a sending data packet, writing a request type into the start line, writing a protocol characteristic and a user address into the header, and writing target content and real-time into the main body. The protocol characteristic is a protocol characteristic specified in the HTTP protocol, and the real-time is the current time of the content page co-reading from the mobile terminal.
Wherein the target content comprises content of the first data type and/or content of the second data type. Generating text-type content according to the first data-type content, and replacing the first data-type content with the text-type content. Generating a binary type of content depending on the content of the second data type, replacing the content of the second data type with the content of the binary type. And generating a number sequence according to the number sequence of the target content, and writing the number sequence into the main body. Because the content sequence formed by the target content comprises both text content and multimedia content, in order to reduce network requests, the whole sending process is completed by one time, a multipart mode is adopted here, text type paragraphs are generated for text content marks, binary type paragraphs are generated for multimedia content marks, and meanwhile, the mark sequence F is also sent as a special paragraph, so that a server side can conveniently carry out correct sequential analysis.
Step S6: and the content page sends a data packet to the server through an HTTP protocol.
Step S7: the server receives and transmits the data packet and analyzes the data packet into instant messages, and the instant messages are sent to the user addresses. The numbering sequence in the body, i.e. the above mentioned marker sequence F, is obtained. And restoring the content of the main body according to the number in the number sequence and the number sequence, and restoring the content of the binary type into the content of the second data type. Then, the contents of the second data type are individually held, and a link address linking the contents is generated, and the contents of its corresponding body are replaced with the link address. The in-multimedia use of the Mi-tag is saved to an external storage system, which may be a storage system separate from the mail system, instant messaging system, and content page. The external storage system returns a URI access address which replaces the binary multimedia content (for speed, the original data of the multimedia content is not sent directly, but a URI access address is sent).
And splicing the contents of the main body into a complete message according to the numbering sequence of the target contents. And (4) ordering the target Content according to the analyzed tag sequence < F1, F2, M1, F3, F41, M2, F42, … … and Fn >, splicing the text fragment Content and the multimedia Content (which are replaced by URI access addresses) in the request entity into a complete message in the numbering order in the tag sequence, and marking as Content. And after the complete message is matched with the user address in the header, creating an instant message, and writing the user address and the complete message into the instant message. In more detail, the instant message includes a message transmission address, a message reception address, transmission contents, and a transmission time. Writing the user address and the complete message into the instant message, including writing a mailbox address into the message sending address or writing a user address corresponding to the mailbox address; writing user addresses into the message receiving addresses, wherein one user address corresponds to one instant message; writing a complete message to the sending content; and writing real-time into the sending time or writing the time of newly-built instant messages. The user address in the HTTP request header is analyzed to obtain the user list < S1, S2, S3, …, Sn > which needs to be sent. The constructed instant message is as follows: (S, S1, Content, Time), wherein S is the message sender, Si is the message receiver, namely the user address, Content is the sending Content, and Time is the sending Time or the real-Time of the transmission. The instant message is sent to the user address. The instant message is sent to the user address. And after the user address receives the instant message, reading the link address and downloading the content of the second data type according to the link address. And after the user address receives the instant message, reading the content of the text type, identifying the link information in the content, and downloading the corresponding link content according to the link information.
The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. It should be noted that modifications and embellishments within the scope of the invention may occur to those skilled in the art without departing from the principle of the invention, and are considered to be within the scope of the invention.