CN110855555B - Mail sending method, device, equipment and computer readable storage medium - Google Patents

Mail sending method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN110855555B
CN110855555B CN201911103307.3A CN201911103307A CN110855555B CN 110855555 B CN110855555 B CN 110855555B CN 201911103307 A CN201911103307 A CN 201911103307A CN 110855555 B CN110855555 B CN 110855555B
Authority
CN
China
Prior art keywords
mail
result set
value
preset
content
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
CN201911103307.3A
Other languages
Chinese (zh)
Other versions
CN110855555A (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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201911103307.3A priority Critical patent/CN110855555B/en
Publication of CN110855555A publication Critical patent/CN110855555A/en
Priority to PCT/CN2020/126825 priority patent/WO2021093673A1/en
Application granted granted Critical
Publication of CN110855555B publication Critical patent/CN110855555B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/42Mailbox-related aspects, e.g. synchronisation of mailboxes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/06Message adaptation to terminal or network requirements
    • H04L51/066Format adaptation, e.g. format conversion or compression

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to the technical field of financial science and technology, and discloses a mail sending method, device and equipment and a computer readable storage medium. The mail sending method comprises the following steps: when a mail sending request is received, mail content and mail basic information are obtained according to the mail sending request, wherein the mail content comprises metadata information and a result set value; determining a corresponding target content analyzer according to the data type in the metadata information, and analyzing the value of the result set through the target content analyzer to obtain an intermediate object; merging the intermediate objects according to the analysis sequence, and inserting the merged intermediate objects into a preset structure to obtain a mail text; and sending the mail body based on the mail basic information. The invention can solve the problem of lower development efficiency in the existing mail sending function development process.

Description

Mail sending method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of financial technology (Fintech), and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for sending a mail.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), but higher requirements are also put forward on the technologies due to the requirements of the financial industry on safety and real-time performance.
Electronic mail (E-mail for short) is a communication mode for providing information exchange by electronic means, is the most widely used service of internet, and has the characteristics of simplicity and quickness. The e-mail can realize the processing of transmitting, receiving, storing and the like of various information and send the e-mail to all corners of the world. Therefore, mail has become an important communication way in people's daily work and life.
Currently, in the process of sending a mail, an application program acquires application data to be sent first, then converts the application data in the original format into structured data that can be received by a mail client to obtain mail content, and further transmits mail delivery information and the mail content to the mail client through a specified interface in a specified format according to the actual situation of a mail service provider in a deployment environment. Because the data formats receivable by the mail clients are different, when format conversion is performed on application data, although a relatively universal tool for format centralized conversion is provided, considering that the data types really used by an application program are extremely limited, introduction of a universal tool makes the applied logic more complicated, so that the corresponding logic is generally realized by the application program repeatedly at present, thereby causing waste of development labor and low development efficiency.
Disclosure of Invention
The invention mainly aims to provide a mail sending method, a mail sending device, mail sending equipment and a computer readable storage medium, and aims to solve the problem that the existing mail sending function development process is low in development efficiency.
In order to achieve the above object, the present invention provides a method for sending a mail, including:
when a mail sending request is received, mail content and mail basic information are obtained according to the mail sending request, wherein the mail content comprises metadata information and a result set value;
determining a corresponding target content analyzer according to the data type in the metadata information, and analyzing the value of the result set through the target content analyzer to obtain an intermediate object;
merging the intermediate objects according to the analysis sequence, and inserting the merged intermediate objects into a preset structure to obtain a mail text;
and sending the mail body based on the mail basic information.
Optionally, when receiving the mail sending request, the step of obtaining the mail content and the mail basic information according to the mail sending request includes:
when a mail sending request is received, acquiring a job number ID, a user name and basic mail information according to the mail sending request;
and generating a result set path according to the job ID, the user name and a pre-configured root directory, and acquiring mail content according to the result set path.
Optionally, the step of determining a corresponding target content parser according to the data type in the metadata information, and parsing the value of the result set by the target content parser to obtain an intermediate object includes:
if the data type in the metadata information is a picture, determining that a corresponding target content analyzer is a picture content analyzer;
acquiring a picture format from the metadata information through the picture content analyzer, and restoring the value of the result set into picture data corresponding to the picture format;
calling a preset constructor to process the picture data to obtain a processing object;
and generating a corresponding picture label based on the processing object and a preset picture label format, and taking the picture label as an intermediate object.
Optionally, the step of determining a corresponding target content parser according to the data type in the metadata information, and performing parsing processing on the value of the result set through the target content parser to obtain an intermediate object includes:
if the data type in the metadata information is hypertext markup language (HTML), determining that a corresponding target content parser is an HTML content parser;
checking whether the value of the result set conforms to a preset mail HTML specification or not through the HTML content parser;
and if so, extracting the sub HTML in the text body tag from the value of the result set, and taking the sub HTML as an intermediate object.
Optionally, the step of determining a corresponding target content parser according to the data type in the metadata information, and parsing the value of the result set by the target content parser to obtain an intermediate object includes:
if the data type in the metadata information is a table, determining that a corresponding target content analyzer is a table content analyzer;
reading a field name in the metadata information through the table content analyzer, generating a corresponding first cell label based on the field name, and nesting the first cell label in a preset header label;
acquiring the number of table lines and the value of each column in each line of the table according to the value of the result set, and generating line labels with the same number as the number of the table lines;
generating corresponding second cell labels according to values of all columns in all rows of the table, and nesting the second cell labels in the corresponding row labels;
and combining the text in the nested preset header tag and the text in the nested line tag, and nesting the combined text into the preset table tag to obtain an intermediate object.
Optionally, the step of determining a corresponding target content parser according to the data type in the metadata information, and parsing the value of the result set by the target content parser to obtain an intermediate object includes:
if the data type in the metadata information is a file, determining that a corresponding target content analyzer is a file content analyzer;
detecting, by the file content parser, whether the result set has a single line or multiple lines of values;
if the value of the result set is a single line, taking the value of the result set as the content of a preset paragraph label to obtain an intermediate object;
and if the value of the result set is a plurality of lines, performing line division processing on the value of the result set, and obtaining an intermediate object based on a line division processing result, the preset paragraph label and a preset line change label.
Optionally, the step of determining a corresponding target content parser according to the data type in the metadata information, and performing parsing processing on the value of the result set through the target content parser to obtain an intermediate object includes:
if the data type in the metadata information is a link, determining that a corresponding target content analyzer is a link content analyzer;
detecting, by the linked content parser, whether the result set has a single line or multiple lines of values;
if the value of the result set is a single row, converting the value of the result set into a first hyperlink label, and taking the file name of the result set corresponding to the mail content as prompt information of the first hyperlink label to obtain an intermediate object;
if the values of the result set are multiple lines, performing line division processing on the values of the result set, and respectively converting the values of the result set after line division into corresponding second hyperlink labels;
and merging the second hyperlink labels, and taking the file names of the result sets corresponding to the mail contents as prompt information of the merged second hyperlink labels to obtain an intermediate object.
Optionally, the step of sending the mail body based on the basic information includes:
the method comprises the steps of obtaining a mail client type which can be supported by the current environment, and creating a mail object of a corresponding type according to the mail client type which can be supported by the current environment and a preset mapping relation;
and filling the mail text and the basic mail information into the mail object, and submitting the filled mail object to a preset mail client for sending.
Further, to achieve the above object, the present invention provides a mail transmission apparatus including:
the system comprises an acquisition module, a sending module and a sending module, wherein the acquisition module is used for acquiring mail content and mail basic information according to a mail sending request when the mail sending request is received, and the mail content comprises metadata information and a result set value;
the analysis module is used for determining a corresponding target content analyzer according to the data type in the metadata information and analyzing the value of the result set through the target content analyzer to obtain an intermediate object;
the merging module is used for merging the intermediate objects according to the analysis sequence and inserting the merged intermediate objects into a preset structure to obtain a mail text;
and the sending module is used for sending the mail text based on the basic information.
Further, to achieve the above object, the present invention also provides a mail transmission apparatus including: the mail sending method comprises a memory, a processor and a mail sending program which is stored on the memory and can run on the processor, wherein the mail sending program realizes the steps of the mail sending method when being executed by the processor.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a mail transmission program which, when executed by a processor, realizes the steps of the mail transmission method as described above.
The invention provides a mail sending method, a device, equipment and a computer readable storage medium, when a mail sending request is received, mail content and basic mail information can be obtained according to the mail sending request; then, determining a corresponding target content analyzer according to the data type in the metadata information, and analyzing the value of the result set through the target content analyzer to obtain an intermediate object; and then merging the intermediate objects according to the analysis sequence, inserting the merged intermediate objects into a preset structure to obtain a mail body, and sending the mail body based on the mail basic information. In order to adapt to the data formats of various mail clients, the invention defines corresponding standard analysis processing modes aiming at different data types, and can uniformly convert the format of the mail content into a standard intermediate format to obtain the mail content for further transmission, thereby realizing the uniform conversion of the data format without repeatedly realizing corresponding logics by an application program, and further improving the development efficiency in the development process of the mail transmission function.
Drawings
Fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a first embodiment of a method for sending a mail according to the present invention;
fig. 3 is a functional block diagram of a first embodiment of the mail sending apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The mail sending device in the embodiment of the present invention may be a smart phone, or may be a terminal device such as a PC (Personal Computer), a tablet Computer, or a portable Computer.
As shown in fig. 1, the mail sending apparatus may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the mail sending device shown in fig. 1 does not constitute a limitation of the mail sending device and may include more or less components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a mail transmission program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client and performing data communication with the client; and the processor 1001 may be configured to call the mail sending program stored in the memory 1005 and perform the following operations:
when a mail sending request is received, mail content and mail basic information are obtained according to the mail sending request, wherein the mail content comprises metadata information and a result set value;
determining a corresponding target content analyzer according to the data type in the metadata information, and analyzing the value of the result set through the target content analyzer to obtain an intermediate object;
merging the intermediate objects according to the analysis sequence, and inserting the merged intermediate objects into a preset structure to obtain a mail text;
and sending the mail body based on the mail basic information.
Further, the processor 1001 may call the mail transmission program stored in the memory 1005, and also perform the following operations:
when a mail sending request is received, acquiring a job number ID, a user name and basic mail information according to the mail sending request;
and generating a result set path according to the job ID, the user name and a pre-configured root directory, and acquiring mail content according to the result set path.
Further, the processor 1001 may call the mail transmission program stored in the memory 1005, and also perform the following operations:
if the data type in the metadata information is a picture, determining that a corresponding target content analyzer is a picture content analyzer;
acquiring a picture format from the metadata information through the picture content analyzer, and restoring the value of the result set into picture data corresponding to the picture format;
calling a preset construction function to process the picture data to obtain a processed object;
and generating a corresponding picture label based on the processing object and a preset picture label format, and taking the picture label as an intermediate object.
Further, the processor 1001 may call the mail transmission program stored in the memory 1005, and also perform the following operations:
if the data type in the metadata information is hypertext markup language (HTML), determining a corresponding target content parser as an HTML content parser;
checking whether the value of the result set conforms to a preset mail HTML specification or not through the HTML content parser;
and if so, extracting the sub HTML in the text body tag from the value of the result set, and taking the sub HTML as an intermediate object.
Further, the processor 1001 may call the mail transmission program stored in the memory 1005, and also perform the following operations:
if the data type in the metadata information is a table, determining that a corresponding target content analyzer is a table content analyzer;
reading a field name in the metadata information through the table content analyzer, generating a corresponding first cell label based on the field name, and nesting the first cell label in a preset header label;
acquiring the number of table lines and the value of each column in each line of the table according to the value of the result set, and generating line labels with the same number as the number of the table lines;
generating corresponding second cell labels according to values of all columns in all rows of the table, and nesting the second cell labels in the corresponding row labels;
and combining the text in the nested preset header tag and the text in the nested line tag, and nesting the combined text into the preset table tag to obtain an intermediate object.
Further, the processor 1001 may call the mail transmission program stored in the memory 1005, and also perform the following operations:
if the data type in the metadata information is a file, determining a corresponding target content analyzer as a file content analyzer;
detecting, by the file content parser, whether the result set has a single line or multiple lines of values;
if the value of the result set is a single line, taking the value of the result set as the content of a preset paragraph label to obtain an intermediate object;
and if the value of the result set is a plurality of lines, performing line division processing on the value of the result set, and obtaining an intermediate object based on a line division processing result, the preset paragraph label and a preset line change label.
Further, the processor 1001 may call the mail transmission program stored in the memory 1005, and also perform the following operations:
if the data type in the metadata information is a link, determining that a corresponding target content analyzer is a link content analyzer;
detecting, by the linked content parser, whether the result set has a single line or multiple lines of values;
if the value of the result set is a single line, converting the value of the result set into a first hyperlink label, and taking the file name of the result set corresponding to the mail content as the prompt information of the first hyperlink label to obtain an intermediate object;
if the values of the result set are multiple lines, performing line division processing on the values of the result set, and respectively converting the values of the result set after line division into corresponding second hyperlink labels;
and merging the second hyperlink labels, and taking the file names of the result sets corresponding to the mail contents as prompt information of the merged second hyperlink labels to obtain an intermediate object.
Further, the processor 1001 may call the mail transmission program stored in the memory 1005, and also perform the following operations:
the method comprises the steps of obtaining a mail client type which can be supported by a current environment, and creating a mail object of a corresponding type according to the mail client type which can be supported by the current environment and a preset mapping relation;
and filling the mail text and the basic mail information into the mail object, and submitting the filled mail object to a preset mail client for sending.
Based on the above hardware structure, embodiments of the method for sending a mail according to the present invention are provided.
The invention provides a mail sending method.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a method for sending an email according to the present invention.
In this embodiment, the mail sending method includes:
step S10, when a mail sending request is received, mail content and basic mail information are obtained according to the mail sending request, wherein the mail content comprises metadata information and a result set value;
the mail transmission method of the present embodiment is realized by a mail transmission apparatus in which a mail transmitter and various types of content parsers are loaded. In the embodiment, the mail sending is taken as a node to be placed in the workflow, so that the mail sending can be simply and flexibly defined after certain steps in a series of logics, and corresponding specific implementation is not needed for specific situations. Specifically, after a preset node in the workflow executes a task, a corresponding mail sending request may be triggered, and at this time, when the mail sender receives the mail sending request, the mail sender may obtain mail content and mail basic information according to the mail sending request, where the mail content includes metadata information and a value of a result set, and the metadata information includes a data type (such as a picture, a table, a text, a link, and the like) and data basic information (such as a size, a field name, a field type, and the like). Specifically, step S10 includes:
step a1, when a mail sending request is received, acquiring a job number ID, a user name and mail basic information according to the mail sending request;
step a2, generating a result set path according to the job ID, the user name and a pre-configured root directory, and acquiring mail content according to the result set path.
When a mail sending request is received, a job ID (Identity document, number), a user name and basic mail information are obtained through a mail sender according to the mail sending request, wherein the job ID is the job ID of a node which is arranged in front of the node where the mail sender is arranged on a workflow and is also the job ID of the node triggering the mail sending request, and the basic mail information comprises but is not limited to a sender, a receiver, a mail title and the like. And then, generating a result set path according to the job ID, the user name and the preconfigured root directory, wherein the generation mode of the result path can be generated in a preset format, the preset format can be { preconfigured root directory + user name + job ID }, and after the result set path is obtained, acquiring the mail content according to the result set path. The mail content is the result set obtained according to the result set path and is the execution result of the front node. By the method, the preposed nodes in the workflow can be sent as the mail content, and the execution results of the nodes are acquired as the mail content in a unified manner through the context sharing mechanism of the workflow.
Step S20, determining a corresponding target content analyzer according to the data type in the metadata information, and analyzing the value of the result set through the target content analyzer to obtain an intermediate object;
and then, determining a corresponding target content analyzer according to the data type in the metadata information, and analyzing the value of the result set through the target content analyzer to obtain an intermediate object. The data types include, but are not limited to, pictures, HTML (HyperText Markup Language), tables, files, and links, and different data types correspond to different parsing processes, and the specific parsing process may refer to the following second embodiment, which is not described herein again. The format of the mail content can be uniformly converted into a standard intermediate format by defining corresponding standard analysis processing modes aiming at different data types, so that corresponding logic is not required to be repeatedly implemented, the waste of development labor can be avoided, and the development efficiency of the mail sending function is improved.
Step S30, merging the intermediate objects according to the analysis sequence, and inserting the merged intermediate objects into a preset structure to obtain a mail text;
and after the intermediate objects are obtained, merging the intermediate objects according to the analysis sequence, and inserting the merged intermediate objects into a preset structure to obtain the mail text. During merging, the intermediate objects are simply merged into a complete HTML structure (i.e. simple String + String) according to the parsing order, the preset structure, optionally < HTML > < body > </body > </HTML >, and the merged intermediate objects can be inserted between < body > and </body > of the preset structure to obtain a complete structure as the final mail text.
And step S40, sending the mail text based on the mail basic information.
And after the mail body is obtained, sending the mail body based on the basic mail information. Specifically, step S40 includes:
step b1, obtaining a mail client type which can be supported by the current environment, and creating a mail object of a corresponding type according to the mail client type which can be supported by the current environment and a preset mapping relation;
and b2, filling the mail text and the mail basic information into the mail object, and submitting the filled mail object to a preset mail client for sending.
After the Mail text is obtained, obtaining a Mail client type which can be supported by the current environment, and creating a Mail object of a corresponding type according to the Mail client type which can be supported by the current environment and a preset mapping relation, wherein the preset mapping relation comprises the mapping relation between the Mail client type and the Mail object type, for example, when the Mail client type is Spring JavaMail (namely, mail transmission is realized through a JavaMailSender interface provided by Spring), a MIME (Multipurpose Internet Mail Extensions) object can be created; when the mail client type is an HTTP mail client (that is, a mail client that realizes mail transmission based on an HTTP protocol), a Json (JavaScript Object Notation, a lightweight data exchange format) Object may be created. And then, filling the mail text and the basic mail information into the mail object, and submitting the filled mail object to a preset mail client for sending. Of course, it can be understood that the preset mapping relationship may provide support for a plurality of common email clients, and meanwhile, a corresponding expansion space may be reserved for other clients, so as to achieve flexibility in supporting expansion of the email clients. By the method, the adaptation of various client interfaces can be realized.
The embodiment of the invention provides a mail sending method, which can acquire mail content and basic mail information according to a mail sending request when the mail sending request is received; then, determining a corresponding target content analyzer according to the data type in the metadata information, and analyzing the value of the result set through the target content analyzer to obtain an intermediate object; and then merging the intermediate objects according to the analysis sequence, inserting the merged intermediate objects into a preset structure to obtain a mail body, and sending the mail body based on the mail basic information. In order to adapt to the data formats of various mail clients, the embodiment of the invention defines the corresponding standard analysis processing modes aiming at different data types, can uniformly convert the format of the mail content into a standard intermediate format to obtain the mail content, and then transmits the mail content.
Further, based on the first embodiment described above, a second embodiment of the mail sending method of the present invention is proposed.
In this embodiment, step S20 may include:
step c11, if the data type in the metadata information is a picture, determining that a corresponding target content analyzer is a picture content analyzer;
step c12, obtaining a picture format from the metadata information through the picture content analyzer, and restoring the value of the result set into picture data corresponding to the picture format;
step c13, calling a preset construction function to process the picture data to obtain a processed object;
and c14, generating a corresponding picture label based on the processing object and a preset picture label format, and taking the picture label as an intermediate object.
In this embodiment, a process of processing the picture data is described. The specific process is as follows: if the data type in the metadata information is a picture, determining that a corresponding target content analyzer is a picture content analyzer; then, obtaining a picture format (such as png, jpg and the like) from the metadata information through a picture content analyzer, and restoring the value of the result set into picture data corresponding to the picture format; and then calling a preset construction function to process the image data to obtain a processing object, wherein the preset construction function can be selected as a buffered image construction function, and the picture data can be zoomed, processed in gray scale and the like by calling the buffered image construction function. And finally, generating a corresponding picture label based on the processing object and a preset picture label format, and taking the picture label as an intermediate object. The preset picture format tag is a < img > tag, and the format of the finally generated picture tag may be: < img src =' data image/jpeg; base64, { base64 coding of pictures }' > ".
Further, step S20 may further include:
step c21, if the data type in the metadata information is hypertext markup language (HTML), determining that a corresponding target content parser is an HTML content parser;
step c22, checking whether the value of the result set accords with a preset mail HTML specification through the HTML content analyzer;
and c23, if the result set is matched with the result set, extracting the sub HTML in the text body label from the value of the result set, and taking the sub HTML as an intermediate object.
In this embodiment, a process of processing HTML-like data is described. The specific process is as follows: if the data type in the metadata information is HTML (HyperText Markup Language), determining that the corresponding target content parser is an HTML content parser; then, checking whether the value of the result set conforms to a preset mail HTML specification through an HTML content parser, wherein the preset mail HTML specification may include but is not limited to: the method has a complete < HTML > < body > </body > </HTML > structure, all tags have closures, HTML-supported tags are used, javaScript scripts are not used in nesting, and the like. And if the HTML specification of the mail accords with the preset HTML specification of the mail, extracting the sub HTML in the text body tag from the value of the result set, and taking the sub HTML as an intermediate object. Wherein the body tag is a < body > tag.
Further, step S20 may further include:
step c31, if the data type in the metadata information is a table, determining that the corresponding target content analyzer is a table content analyzer;
step c32, reading the field name in the metadata information through the table content analyzer, generating a corresponding first cell label based on the field name, and nesting the first cell label in a preset header label;
step c33, obtaining the table line number and the value of each column in each line of the table according to the value of the result set, and generating line labels with the same number as the table line number;
step c34, generating corresponding second cell labels according to values of columns in each row of the table, and nesting the second cell labels in the corresponding row labels;
and c35, combining the text in the nested preset header tag and the text in the nested line tag, and nesting the combined text in the preset table tag to obtain an intermediate object.
In this embodiment, a process of processing table-type data is described. The specific process is as follows: if the data type in the metadata information is a table, determining that the corresponding target content analyzer is a table content analyzer; then, the field name in the metadata information is read through the table content analyzer, a corresponding first cell label is generated based on the field name, and the first cell label is nested in a preset header label. For example, for the table in table 1 below, the field names of the tables include name and score, corresponding first cell tags may be generated as < td > name and < td > score, and after the first cell tag is nested in the preset cell tag, the following result may be obtained:
Figure BDA0002270336790000131
then, obtaining the number of table rows and the value of each column in each row of the table according to the value of the result set, and generating row labels with the same number as the number of the table rows, wherein the row labels are < tr > labels; generating corresponding second cell labels according to the values of all columns in all rows of the table, and nesting the second cell labels in the corresponding row labels; and finally, combining the text in the nested preset header tag and the text in the nested line tag, and nesting the combined text into the preset table tag to obtain an intermediate object, wherein the preset table tag is a < table > tag. For example, in the above example, the intermediate objects can be obtained as follows:
Figure BDA0002270336790000141
TABLE 1 tabulated results set
name score
xiaoming 90
xiaowang 80
Further, step S20 may further include:
step c41, if the data type in the metadata information is a file, determining that a corresponding target content analyzer is a file content analyzer;
step c42, detecting whether the value of the result set is a single line or a plurality of lines by the file content analyzer;
step c43, if the value of the result set is a single line, taking the value of the result set as the content of a preset paragraph label to obtain an intermediate object;
and c44, if the values of the result set are multiple lines, performing line division processing on the values of the result set, and obtaining an intermediate object based on a line division processing result, the preset paragraph label and a preset line change label.
In this embodiment, a process of processing file class data is described. The specific process is as follows: if the data type in the metadata information is a file, determining that a corresponding target content analyzer is a file content analyzer; then, detecting whether the value of the result set is a single line or a plurality of lines through a file content analyzer; if the value of the result set is a single line, directly using the value of the result set as the content of a preset paragraph tag to obtain an intermediate object, wherein the preset paragraph tag can be a < p > tag; and if the values of the result set are multiple lines, performing line division processing on the values of the result set, and further obtaining an intermediate object based on the line division processing result, the preset paragraph label and the preset line feed label. Specifically, when line division processing is performed, the value of the result set can be divided according to the line break (\ n), so that multiple lines of texts can be obtained through division, the contents of the texts in each line are respectively used as the contents of a preset paragraph tag to obtain multiple paragraph tags, and then the multiple paragraph tags obtained through the processing are combined by using the preset line break tag (< br > tag) as a spacer, so that a corresponding intermediate object can be obtained.
Further, step S20 may further include:
step c51, if the data type in the metadata information is a link, determining that a corresponding target content analyzer is a link content analyzer;
step c52, detecting whether the value of the result set is a single line or a plurality of lines by the linked content parser;
step c53, if the value of the result set is a single line, converting the value of the result set into a first hyperlink label, and taking the file name of the result set corresponding to the mail content as the prompt information of the first hyperlink label to obtain an intermediate object;
step c54, if the values of the result set are multiple lines, performing line division processing on the values of the result set, and converting the values of the result set after line division into corresponding second hyperlink labels respectively;
and c55, merging the second hyperlink labels, and taking the file name of the result set corresponding to the mail content as the prompt information of the merged second hyperlink label to obtain an intermediate object.
In this embodiment, a process of processing link class data is described. The specific process is as follows: if the data type in the metadata information is a link (URL link), determining that the corresponding target content analyzer is a link content analyzer; then, whether the value of the result set is a single line or a plurality of lines is detected by the linked content parser.
And if the value of the result set is a single line, converting the value of the result set into a first hyperlink label, and taking the file name of the result set corresponding to the mail content as the prompt information of the first hyperlink label to obtain an intermediate object. The generation process of the first hyperlink label comprises the following steps: the value of the result set is directly used as the href (Hypertext Reference) attribute of the preset hyperlink label, wherein the preset hyperlink label can be the < a > label.
If the value of the result set is a plurality of lines, performing line division processing on the value of the result set, and converting the value of the result set after line division into corresponding second hyperlink labels, specifically, during line division processing, segmenting the value of the result set according to a line change symbol (\\ n), and segmenting to obtain a plurality of lines of texts, wherein the text content of each line is used as an href attribute of a preset hyperlink label, so as to obtain a plurality of hyperlink labels. And then merging the second hyperlink labels, and taking the file names of the result sets corresponding to the mail contents as the prompt information of the merged second hyperlink labels to obtain an intermediate object.
The invention also provides a mail sending device.
Referring to fig. 3, fig. 3 is a functional block diagram of a first embodiment of the mail sending apparatus according to the present invention.
As shown in fig. 3, the mail transmission apparatus includes:
an obtaining module 10, configured to, when a mail sending request is received, obtain mail content and mail basic information according to the mail sending request, where the mail content includes metadata information and a value of a result set;
the analysis module 20 is configured to determine a corresponding target content analyzer according to the data type in the metadata information, and analyze the value of the result set by the target content analyzer to obtain an intermediate object;
a merging module 30, configured to merge the intermediate objects according to the analysis order, and insert the merged intermediate objects into a preset structure to obtain a mail text;
and the sending module 40 is configured to send the mail body based on the basic information.
Further, the obtaining module 10 includes:
the first acquisition unit is used for acquiring a job number ID, a user name and basic mail information according to a mail sending request when the mail sending request is received;
and the second acquisition unit is used for generating a result set path according to the job ID, the user name and a pre-configured root directory and acquiring the mail content according to the result set path.
Further, the parsing module 20 includes a first parsing unit configured to:
if the data type in the metadata information is a picture, determining that a corresponding target content analyzer is a picture content analyzer;
acquiring a picture format from the metadata information through the picture content analyzer, and restoring the value of the result set into picture data corresponding to the picture format;
calling a preset construction function to process the picture data to obtain a processed object;
and generating a corresponding picture label based on the processing object and a preset picture label format, and taking the picture label as an intermediate object.
Further, the parsing module 20 includes a second parsing unit, configured to:
if the data type in the metadata information is hypertext markup language (HTML), determining a corresponding target content parser as an HTML content parser;
checking whether the value of the result set conforms to a preset mail HTML specification or not through the HTML content parser;
and if so, extracting the sub HTML in the text body tag from the value of the result set, and taking the sub HTML as an intermediate object.
Further, the parsing module 20 includes a third parsing unit configured to:
if the data type in the metadata information is a table, determining that a corresponding target content analyzer is a table content analyzer;
reading a field name in the metadata information through the table content analyzer, generating a corresponding first cell label based on the field name, and nesting the first cell label in a preset header label;
acquiring the number of table lines and the value of each column in each line of the table according to the value of the result set, and generating line labels with the same number as the number of the table lines;
generating corresponding second cell labels according to values of all columns in all rows of the table, and nesting the second cell labels in the corresponding row labels;
and combining the text in the nested preset header tag and the text in the nested line tag, and nesting the combined text into the preset table tag to obtain an intermediate object.
Further, the parsing module 20 includes a fourth parsing unit, configured to:
if the data type in the metadata information is a file, determining that a corresponding target content analyzer is a file content analyzer;
detecting, by the file content parser, whether the result set has a single line or multiple lines of values;
if the value of the result set is a single line, taking the value of the result set as the content of a preset paragraph label to obtain an intermediate object;
and if the value of the result set is a plurality of lines, performing line division processing on the value of the result set, and obtaining an intermediate object based on a line division processing result, the preset paragraph label and a preset line change label.
Further, the parsing module 20 includes a fifth parsing unit, configured to:
if the data type in the metadata information is a link, determining that a corresponding target content analyzer is a link content analyzer;
detecting, by the linked content parser, whether the result set has a single line or multiple lines of values;
if the value of the result set is a single line, converting the value of the result set into a first hyperlink label, and taking the file name of the result set corresponding to the mail content as the prompt information of the first hyperlink label to obtain an intermediate object;
if the values of the result set are multiple lines, performing line division processing on the values of the result set, and respectively converting the values of the result set after line division into corresponding second hyperlink labels;
and merging the second hyperlink labels, and taking the file names of the result sets corresponding to the mail contents as prompt information of the merged second hyperlink labels to obtain an intermediate object.
Further, the sending module 40 includes:
the system comprises a creating unit, a mapping unit and a processing unit, wherein the creating unit is used for acquiring a mail client type which can be supported by the current environment and creating a mail object of a corresponding type according to the mail client type which can be supported by the current environment and a preset mapping relation;
and the sending unit is used for filling the mail text and the basic mail information into the mail object and submitting the filled mail object to a preset mail client for sending.
The function implementation of each module in the above-mentioned mail sending apparatus corresponds to each step in the above-mentioned mail sending method embodiment, and the function and implementation process thereof are not described in detail herein.
The present invention also provides a computer-readable storage medium having stored thereon a mail transmission program which, when executed by a processor, implements the steps of the mail transmission method according to any one of the above embodiments.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the above-mentioned mail sending method, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solution of the present invention or the portions contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A method for sending a mail, the method comprising:
when a mail sending request is received, mail content and basic mail information are obtained according to the mail sending request, wherein the mail content comprises metadata information and a result set value;
determining a corresponding target content analyzer according to the data type in the metadata information, and analyzing the value of the result set through the target content analyzer to obtain an intermediate object, wherein different data types define corresponding standard analysis processing modes, the standard analysis processing modes are used for converting the format of the mail content into a standard intermediate format, and the data types include: pictures, hypertext markup language, tables, files, and links;
merging the intermediate objects according to the analysis sequence, and inserting the merged intermediate objects into a preset structure to obtain a mail text;
and sending the mail body based on the mail basic information.
2. The mail transmission method according to claim 1, wherein the step of acquiring the mail content and the basic mail information according to the mail transmission request upon receiving the mail transmission request comprises:
when a mail sending request is received, acquiring a job number ID, a user name and basic mail information according to the mail sending request;
and generating a result set path according to the job ID, the user name and a pre-configured root directory, and acquiring mail content according to the result set path.
3. The method for sending mails according to claim 1, wherein the step of determining a corresponding target content parser according to the data type in the metadata information, and performing parsing processing on the value of the result set through the target content parser to obtain an intermediate object comprises:
if the data type in the metadata information is a picture, determining that a corresponding target content analyzer is a picture content analyzer;
acquiring a picture format from the metadata information through the picture content analyzer, and restoring the value of the result set into picture data corresponding to the picture format;
calling a preset constructor to process the picture data to obtain a processing object;
and generating a corresponding picture label based on the processing object and a preset picture label format, and taking the picture label as an intermediate object.
4. The method as claimed in claim 1, wherein the step of determining a corresponding target content parser according to the data type in the metadata information, and performing parsing processing on the result set value through the target content parser to obtain an intermediate object includes:
if the data type in the metadata information is hypertext markup language (HTML), determining that a corresponding target content parser is an HTML content parser;
checking whether the value of the result set conforms to a preset mail HTML specification or not through the HTML content parser;
and if so, extracting the sub HTML in the text body tag from the value of the result set, and taking the sub HTML as an intermediate object.
5. The method as claimed in claim 1, wherein the step of determining a corresponding target content parser according to the data type in the metadata information, and performing parsing processing on the result set value through the target content parser to obtain an intermediate object includes:
if the data type in the metadata information is a table, determining that a corresponding target content analyzer is a table content analyzer;
reading a field name in the metadata information through the table content analyzer, generating a corresponding first cell label based on the field name, and nesting the first cell label in a preset header label;
acquiring the number of table lines and the value of each column in each line of the table according to the value of the result set, and generating line labels with the same number as the number of the table lines;
generating corresponding second cell labels according to values of all columns in all rows of the table, and nesting the second cell labels in the corresponding row labels;
and combining the text in the nested preset header tag and the text in the nested line tag, and nesting the combined text into the preset table tag to obtain an intermediate object.
6. The method for sending mails according to claim 1, wherein the step of determining a corresponding target content parser according to the data type in the metadata information, and performing parsing processing on the value of the result set through the target content parser to obtain an intermediate object comprises:
if the data type in the metadata information is a file, determining that a corresponding target content analyzer is a file content analyzer;
detecting, by the file content parser, whether the result set has a single line or multiple lines of values;
if the value of the result set is a single line, taking the value of the result set as the content of a preset paragraph label to obtain an intermediate object;
and if the value of the result set is a plurality of lines, performing line division processing on the value of the result set, and obtaining an intermediate object based on a line division processing result, the preset paragraph label and a preset line change label.
7. The method for sending mails according to claim 1, wherein the step of determining a corresponding target content parser according to the data type in the metadata information, and performing parsing processing on the value of the result set through the target content parser to obtain an intermediate object comprises:
if the data type in the metadata information is a link, determining that a corresponding target content analyzer is a link content analyzer;
detecting, by the linked content parser, whether the result set has a single line or multiple lines of values;
if the value of the result set is a single line, converting the value of the result set into a first hyperlink label, and taking the file name of the result set corresponding to the mail content as the prompt information of the first hyperlink label to obtain an intermediate object;
if the values of the result set are multiple lines, performing line division processing on the values of the result set, and respectively converting the values of the result set after line division into corresponding second hyperlink labels;
and merging the second hyperlink labels, and taking the file names of the result sets corresponding to the mail contents as prompt information of the merged second hyperlink labels to obtain an intermediate object.
8. The mail transmission method according to any one of claims 1 to 7, wherein the step of transmitting the mail body based on the basic information includes:
the method comprises the steps of obtaining a mail client type which can be supported by a current environment, and creating a mail object of a corresponding type according to the mail client type which can be supported by the current environment and a preset mapping relation;
and filling the mail text and the basic mail information into the mail object, and submitting the filled mail object to a preset mail client for sending.
9. A mail transmission apparatus characterized by comprising:
the system comprises an acquisition module, a sending module and a sending module, wherein the acquisition module is used for acquiring mail content and basic mail information according to a mail sending request when the mail sending request is received, and the mail content comprises metadata information and a result set value;
an analysis module, configured to determine a corresponding target content analyzer according to a data type in the metadata information, and perform analysis processing on the value of the result set through the target content analyzer to obtain an intermediate object, where different data types define a corresponding standard analysis processing manner, the standard analysis processing manner is used to convert the format of the mail content into a standard intermediate format, and the data type includes: pictures, hypertext markup language, tables, files, and links;
the merging module is used for merging the intermediate objects according to the analysis sequence and inserting the merged intermediate objects into a preset structure to obtain a mail text;
and the sending module is used for sending the mail text based on the basic information.
10. A mail transmission apparatus characterized by comprising: a memory, a processor and a mailer program stored on the memory and executable on the processor, the mailer program when executed by the processor implementing the steps of the method of mailer according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that a mail transmission program is stored thereon, which when executed by a processor implements the steps of the mail transmission method according to any one of claims 1 to 8.
CN201911103307.3A 2019-11-12 2019-11-12 Mail sending method, device, equipment and computer readable storage medium Active CN110855555B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911103307.3A CN110855555B (en) 2019-11-12 2019-11-12 Mail sending method, device, equipment and computer readable storage medium
PCT/CN2020/126825 WO2021093673A1 (en) 2019-11-12 2020-11-05 E-mail sending method, apparatus and device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911103307.3A CN110855555B (en) 2019-11-12 2019-11-12 Mail sending method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110855555A CN110855555A (en) 2020-02-28
CN110855555B true CN110855555B (en) 2023-04-07

Family

ID=69601484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911103307.3A Active CN110855555B (en) 2019-11-12 2019-11-12 Mail sending method, device, equipment and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN110855555B (en)
WO (1) WO2021093673A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110855555B (en) * 2019-11-12 2023-04-07 深圳前海微众银行股份有限公司 Mail sending method, device, equipment and computer readable storage medium
CN114676124B (en) * 2022-05-27 2022-08-23 航天信息(广东)有限公司 Data field difference solving method, device, equipment and medium based on configuration
CN115499405B (en) * 2022-09-14 2024-04-30 天翼数字生活科技有限公司 Method and system for custom generation of mail
CN116938610B (en) * 2023-09-19 2023-11-17 北京傲星科技有限公司 Mail system based on mimicry architecture
CN117478670B (en) * 2023-12-28 2024-04-26 彩讯科技股份有限公司 Exchange data migration method, system and medium based on pst file protocol analysis

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014170447A (en) * 2013-03-05 2014-09-18 Nec Corp Mail file management device, method, and program
CN106713109A (en) * 2015-11-13 2017-05-24 北京奇虎科技有限公司 Html mail sending and receiving method and device
CN109039876A (en) * 2018-09-19 2018-12-18 天津字节跳动科技有限公司 Email processing method and device
CN109995643A (en) * 2017-12-29 2019-07-09 ***通信集团河南有限公司 Business mail push method and device
CN110223044A (en) * 2019-06-12 2019-09-10 深圳市网心科技有限公司 A kind of mail push method, system and electronic equipment and storage medium
CN110351182A (en) * 2019-05-31 2019-10-18 平安科技(深圳)有限公司 E-mail sending method, device, equipment and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101841514A (en) * 2009-03-17 2010-09-22 联想(北京)有限公司 Mail handing method and device
US9836724B2 (en) * 2010-04-23 2017-12-05 Microsoft Technology Licensing, Llc Email views
CN109902113B (en) * 2019-01-17 2024-04-02 平安科技(深圳)有限公司 Credit feedback report processing method and device, storage medium and computer equipment
CN110855555B (en) * 2019-11-12 2023-04-07 深圳前海微众银行股份有限公司 Mail sending method, device, equipment and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014170447A (en) * 2013-03-05 2014-09-18 Nec Corp Mail file management device, method, and program
CN106713109A (en) * 2015-11-13 2017-05-24 北京奇虎科技有限公司 Html mail sending and receiving method and device
CN109995643A (en) * 2017-12-29 2019-07-09 ***通信集团河南有限公司 Business mail push method and device
CN109039876A (en) * 2018-09-19 2018-12-18 天津字节跳动科技有限公司 Email processing method and device
CN110351182A (en) * 2019-05-31 2019-10-18 平安科技(深圳)有限公司 E-mail sending method, device, equipment and computer readable storage medium
CN110223044A (en) * 2019-06-12 2019-09-10 深圳市网心科技有限公司 A kind of mail push method, system and electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2021093673A1 (en) 2021-05-20
CN110855555A (en) 2020-02-28

Similar Documents

Publication Publication Date Title
CN110855555B (en) Mail sending method, device, equipment and computer readable storage medium
US8185591B1 (en) Systems and methods for viewing email attachments as thumbnails
US8056007B2 (en) System and method for recognizing and storing information and associated context
US8346878B2 (en) Flagging resource pointers depending on user environment
CN110737630B (en) Method and device for processing electronic archive file, computer equipment and storage medium
CN110941950B (en) Interface document generation method, device, server and storage medium
CA3061623C (en) File sending in instant messaging applications
CN112822286B (en) Message pushing method and device
CN111126006A (en) Method and device for exporting Word document with MathType formula, electronic equipment and storage medium
CN112131289A (en) Data processing method and device, electronic equipment and storage medium
CN106453582B (en) Asynchronous message pushing method and system
CN112947900B (en) Web application development method and device, server and development terminal
CN112187622B (en) Instant message display method and device and server
CN102110144B (en) Document access method and terminal equipment
CN115426624B (en) Automatic login method, device, equipment and storage medium
JP3325928B2 (en) Email system
CN101772196A (en) Method and system for processing message sent by mobile terminal and acting server
CN116015777A (en) Document detection method, device, equipment and storage medium
CN106209605B (en) Method and equipment for processing attachment in network information
US9584695B2 (en) Information processing apparatus and information processing system
JP4885678B2 (en) Content creation apparatus and content creation method
CN114239501A (en) Contract generation method, apparatus, device and medium
CN113704486A (en) Map data construction method and device and map data query method and device
CN113656737A (en) Webpage content display method and device, electronic equipment and storage medium
US20140108535A1 (en) System and method for generating a customized singular activity stream

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