CN103401764A - Method and device for sending mails - Google Patents

Method and device for sending mails Download PDF

Info

Publication number
CN103401764A
CN103401764A CN2013103374416A CN201310337441A CN103401764A CN 103401764 A CN103401764 A CN 103401764A CN 2013103374416 A CN2013103374416 A CN 2013103374416A CN 201310337441 A CN201310337441 A CN 201310337441A CN 103401764 A CN103401764 A CN 103401764A
Authority
CN
China
Prior art keywords
request
message
mail
queue
transmission
Prior art date
Application number
CN2013103374416A
Other languages
Chinese (zh)
Inventor
郭锋
李新虎
Original Assignee
浪潮(北京)电子信息产业有限公司
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 浪潮(北京)电子信息产业有限公司 filed Critical 浪潮(北京)电子信息产业有限公司
Priority to CN2013103374416A priority Critical patent/CN103401764A/en
Publication of CN103401764A publication Critical patent/CN103401764A/en

Links

Abstract

The invention discloses a method for sending mails, wherein the method is applied to a cloud computing operating system. The method comprises the following steps: generating mail sending requests, and determining priority of the mails; caching the newly generated mail sending requests in a request queue, and ordering the mail sending requests in the request queue according to the priority of the mail sending requests; reading the mail sending requests in sequence from the request queue, analyzing the mail sending requests, and sending the mails according to mail data obtained after analysis. The method and the device can ensure that important mails in the cloud computing operating system are sent timely and reliably. The invention further discloses a device for sending the mails.

Description

一种邮件发送方法和装置 One kind of method and apparatus for transmitting messages

技术领域 FIELD

[0001] 本发明涉及云计算操作系统技术领域,尤其涉及的是一种邮件发送方法和装置。 [0001] The present invention relates to the field of cloud computing operating system, more particularly, to a method and apparatus for transmitting messages. 背景技术 Background technique

[0002] 当前,云计算逐渐被行业认可,云计算操作系统,又称云0S(0perating System,操作系统),是云计算后台数据中心的整体管理运营系统,其构架于服务器、存储、网络等基础硬件资源和单机操作系统、中间件、数据库等基础软件资源之上,是管理海量的基础硬件、软件资源的云平台综合管理系统。 [0002] Currently, the cloud gradually recognized by the industry, cloud computing operating system, also known as cloud 0S (0perating System, operating system), cloud computing back-end data center management and operation of the overall system architecture for servers, storage, networks, etc. on top of the underlying hardware resources and stand-alone operating system, middleware, database software and other infrastructure resources, the management of vast amounts of underlying hardware, software resources of the cloud platform integrated management systems.

[0003] 云计算操作系统中,在对云计算资源(比如,硬件服务器、存储服务器、网络设备、虚拟资源、中间件、数据库、web服务器等)进行监控与管理的过程中,会产生大量的告警、提示信息。 [0003] cloud computing operating system, in the process of computing resources (for example, hardware, servers, storage servers, network devices, virtual resources, middleware, database, web server, etc.) for cloud monitoring and management, will produce a large number of alarm, message. 这些告警、提示信息通常由邮件服务器以邮件的方式发送给相应的管理员和用户。 These alarm message is usually sent by the mail server by mail to the appropriate administrators and users. t匕如,服务器宕机,则系统会自动给相应的管理员和用户发送邮件,邮件内容可以包括:月艮务器名称、IP、MAC、告警内容、告警级别、告警时间等。 The dagger t, server failure, the system will automatically send a message to the appropriate user and the administrator, the mail content may include: May that works to name, IP, MAC, the contents of the alarm, the alarm level, the alarm time.

[0004] 相关的云计算操作系统中,向管理员和/或用户通知告警、提醒信息时,大多只是搭建邮件服务器,直接调用邮件发送APKApplication Programming Interface,应用程序编程接口)进行邮件发送,由于云计算数据中心异常事件较多,告警条目过多,因此,邮件量巨大时可能会导致堵塞,不能保证邮件发送成功。 [0004] related to cloud computing operating system, notification alerts administrators and / or users, remind information, mostly just set up a mail server, send e-mail directly call APKApplication Programming Interface, Application Programming Interface) to send mail, because the cloud computing data center more unusual events, excessive alarm entry, therefore, may cause clogging huge volume of mail, send e-mail does not guarantee success. 由于重要的告警信息可能对整个云计算操作系统甚至是整个云数据中心很重要,如果这些重要的告警信息不能得到及时、可靠地发送和处理,将会影响整个云计算数据中心的正常运行使用和用户体验。 Because of the importance of the alarm information that may cloud computing operating system on the whole and even entire cloud data center is very important, if these important alarm information can not be timely, reliable routing and handling, it will affect the normal operation using the entire data center and cloud computing user experience. 因此,需要对云计算操作系统中的邮件发送方法进行改进。 Thus, a need for improvement of the operating system message transmission method cloud.

发明内容 SUMMARY

[0005] 本发明所要解决的技术问题是提供一种邮件发送方法和装置,能够保障云计算操作系统中的重要邮件及时、可靠地送达。 [0005] The present invention solves the technical problem is to provide a method and apparatus for transmitting messages, messages can be important to protect the operating system cloud timely and reliable service.

[0006] 为了解决上述技术问题,本发明提供了一种邮件发送方法,应用于云计算操作系统中,该方法包括: [0006] To solve the above problems, the present invention provides a message transmission method, applied to a cloud computing operating system, the method comprising:

[0007] 生成邮件发送请求,并确定邮件的优先级; [0007] The generated message transmission request, and determines the priority of the message;

[0008] 将新生成的邮件发送请求缓存在请求队列中,根据邮件发送请求的优先级对所述请求队列中的邮件发送请求进行排序; [0008] The newly generated message buffer transmission request in the request queue, and sending a request message according to the message priority queue sorts the request transmission request;

[0009] 从所述请求队列中依次读取邮件发送请求,对所述邮件发送请求进行解析,根据解析后获得的邮件数据进行邮件发送。 [0009] read from the request queue sequentially sending a request message, the parse request mail transmission, mail transmission message according to the data obtained after analyzing.

[0010] 进一步地,上述方法还包括下述特点: [0010] Preferably, the method further comprises the following features:

[0011] 所述对所述请求队列中的邮件发送请求进行排序,包括:根据邮件发送请求的优先级和缓存时间对所述请求队列中的邮件发送请求进行排序: [0011] The sorting of messages in the queue the request transmission request, comprising: transmitting a request message according to the priority of the message queue and the buffer time of the request for ordering requests:

[0012] 对于优先级不同的邮件发送请求,优先级高的邮件发送请求排在优先级低的邮件发送请求的前面;和[0013] 对于优先级相同的邮件发送请求,缓存时间早的邮件发送请求排在缓存时间晚的邮件发送请求的前面。 [0012] transmitted for different message priority request, a high priority message transmission request ahead of a lower priority message transmission request; and [0013] send a request for the same message priority, cache earlier mailing request ahead of time later cache sending a request message.

[0014] 进一步地,上述方法还包括下述特点: [0014] Preferably, the method further comprises the following features:

[0015] 从所述请求队列中依次读取邮件发送请求,对所述邮件发送请求进行解析,根据解析后获得的邮件数据进行邮件发送,包括: [0015] read from the request queue sequentially sending a request message, the parse request mail transmission, mail transmission depending on the mail data obtained by analyzing, comprising:

[0016] 创建邮件发送线程; [0016] create a mailing thread;

[0017] 所述邮件发送线程判断上一次读取邮件发送请求的位置是否为所述请求队列的最末一位,如果是,则返回到所述请求队列的首位进行邮件发送请求的读取,如果不是,则从上一次读取位置的下一位开始邮件发送请求的读取; [0017] The message transmission time is determined on the thread to read the message transmission request to the request queue position is the last one, if so, returns to the head of the queue the request mail transmission request is read, If not, read the next bit from the last start position of reading the mail transmission request;

[0018] 所述邮件发送线程对所述邮件发送请求进行解析,根据解析后获得的邮件数据调用邮件服务器的应用程序编程接口API进行邮件发送。 [0018] The mail sending thread of the transmission request message parsing, message data is parsed in accordance with the obtained application programming interface API calls the mail on the mail server.

[0019] 进一步地,上述方法还包括下述特点: [0019] Preferably, the method further comprises the following features:

[0020] 所述邮件发送线程进行邮件发送后,还包括: After [0020] the message sending thread mail transmission, further comprising:

[0021] 所述邮件发送线程判断所述邮件是否发送成功,如果发送成功,则从所述请求队列中删除该邮件对应的邮件发送请求,如果发送失败,则从所述请求队列中删除该邮件对应的邮件发送请求,然后将该邮件发送请求重新缓存在请求队列中并进行排序。 [0021] The mail sending thread determines whether to transmit the message successfully, if the transmission is successful, is deleted from the queue message corresponding to the request mail transmission request, if the transmission fails, the message is deleted from the queue the request corresponding to the transmission request message, and send the request and the message re-sort cache request queue.

[0022] 进一步地,上述方法还包括下述特点: [0022] Preferably, the method further comprises the following features:

[0023] 所述邮件发送请求,是根据所述云计算操作系统中监控、管理云计算资源产生的告警、提醒信息生成的。 [0023] The mail transmission request, the cloud is monitored according to the operating system, managing a cloud computing resource alarms generated, the generated reminder information.

[0024] 进一步地,上述方法还包括下述特点: [0024] Preferably, the method further comprises the following features:

[0025] 后台运行系统级的邮件监控进程; [0025]-wide mail system running in the background monitoring process;

[0026] 所述邮件监控进程监控邮件发送线程的运行情况,如果检测到邮件发送线程运行异常,则重启该邮件发送线程; [0026] The mail message monitoring process to monitor the operation of the sending thread, the thread sending the message if the detected abnormal operation, the message sending thread is restarted;

[0027] 所述邮件监控进程还定时备份所述请求队列中的数据,如果检测到所述请求队列数据丢失,则根据备份数据自动恢复所述请求队列。 [0027] The monitoring process further messages scheduled backup data queue the request, if the request queue is detected loss of data, automatically restoring the backup data according to a request queue.

[0028] 为了解决上述技术问题,本发明还提供了一种邮件发送装置,应用于云计算操作系统中,该装置包括: [0028] To solve the above problems, the present invention also provides a mail transmission apparatus applied to a cloud computing operating system, the apparatus comprising:

[0029] 请求生成模块,用于生成邮件发送请求,并确定邮件的优先级; [0029] The request generating module for generating a mail transmission request, and determines the priority of the message;

[0030] 请求缓存模块,用于将新生成的邮件发送请求缓存在请求队列中,根据邮件发送请求的优先级对所述请求队列中的邮件发送请求进行排序; [0030] The request cache module, for the newly generated priority message buffer transmission request in the request queue, according to the transmission request message to the message queue of the requests for ordering requests;

[0031] 邮件发送模块,用于从所述请求队列中依次读取邮件发送请求,对所述邮件发送请求进行解析,根据解析后获得的邮件数据进行邮件发送。 [0031] The mail transmission means for transmitting the message read request from the request queue in sequence, the transmission request message parsing, message mail transmission according to the data obtained after analyzing.

[0032] 进一步地,上述装置还包括下述特点: [0032] Further, the apparatus further comprising the following features:

[0033] 所述请求缓存模块,用于通过以下方式对对所述请求队列中的邮件发送请求进行排序:根据邮件发送请求的优先级和缓存时间对所述请求队列中的邮件发送请求进行排序: [0033] The request buffer module configured to send a request for sorting the messages in the queue the request by: sending a request message according to the priority of the message queue and the buffer time of the request for ordering requests :

[0034] 对于优先级不同的邮件发送请求,优先级高的邮件发送请求排在优先级低的邮件发送请求的前面;和 [0034] send a request for messages of different priority, a high priority transmission request mail transmission request ahead of lower priority messages; and

[0035] 对于优先级相同的邮件发送请求,缓存时间早的邮件发送请求排在缓存时间晚的邮件发送请求的前面。 [0035] sends a request for the same message priority, message sent earlier cache request ahead of time later cache sending a request message.

[0036] 进一步地,上述装置还包括下述特点: [0036] Further, the apparatus further comprising the following features:

[0037] 所述邮件发送模块,用于通过以下方式从所述请求队列中依次读取邮件发送请求并进行邮件发送: [0037] The message sending module, configured to read in the following manner from the request queue and sends a request message sequentially mail transmission:

[0038] 创建邮件发送线程; [0038] create a mailing thread;

[0039] 所述邮件发送线程判断上一次读取邮件发送请求的位置是否为所述请求队列的最末一位,如果是,则返回到所述请求队列的首位进行邮件发送请求的读取,如果不是,则从上一次读取位置的下一位开始邮件发送请求的读取; [0039] The message transmission time is determined on the thread to read the message transmission request to the request queue position is the last one, if so, returns to the head of the queue the request mail transmission request is read, If not, read the next bit from the last start position of reading the mail transmission request;

[0040] 所述邮件发送线程对所述邮件发送请求进行解析,根据解析后获得的邮件数据调用邮件服务器的应用程序编程接口API进行邮件发送。 [0040] The mail sending thread of the transmission request message parsing, message data is parsed in accordance with the obtained application programming interface API calls the mail on the mail server.

[0041] 进一步地,上述装置还包括下述特点: [0041] Further, the apparatus further comprising the following features:

[0042] 所述邮件发送模块,用于所述邮件发送线程进行邮件发送后,还判断所述邮件是否发送成功,如果发送成功,则从所述请求队列中删除该邮件对应的邮件发送请求,如果发送失败,则从所述请求队列中删除该邮件对应的邮件发送请求,然后将该邮件发送请求重新缓存在请求队列中并进行排序。 [0042] The message sending module, for sending the e-mail message is sent after the thread, further determines whether to transmit the message successfully, if the transmission is successful, is deleted from the queue message corresponding to the request mail transmission request, If it fails, the request from the message queue deletes the message corresponding to the transmission request, and send the request and the message re-ordering buffer in the request queue.

[0043] 进一步地,上述装置还包括下述特点: [0043] Further, the apparatus further comprising the following features:

[0044] 所述邮件发送请求,是根据所述云计算操作系统中监控、管理云计算资源产生的告警、提醒信息生成的。 [0044] The mail transmission request, the cloud is monitored according to the operating system, managing a cloud computing resource alarms generated, the generated reminder information.

[0045] 进一步地,上述装置还包括下述特点: [0045] Further, the apparatus further comprising the following features:

[0046] 所述装置还包括邮件监控模块; The [0046] apparatus further includes a mail monitoring module;

[0047] 所述邮件监控模块,用于后台运行系统级的邮件监控进程;所述邮件监控进程监控邮件发送线程的运行情况,如果检测到邮件发送线程运行异常,则重启该邮件发送线程;所述邮件监控进程还定时备份所述请求队列中的数据,如果检测到所述请求队列数据丢失,则根据备份数据自动恢复所述请求队列。 [0047] The message monitoring module running in the background for the message monitoring process system level; the mail message monitoring process to monitor the operation of the sending thread, the thread sending the message if the abnormal operation is detected, the message sending thread is restarted; the said message monitoring process also scheduled backup data queue the request, if the request queue is detected loss of data, automatically restoring the backup data according to a request queue.

[0048] 与现有技术相比,本发明提供的一种邮件发送方法和装置,应用于云计算操作系统中,通过为邮件设置优先级并缓存在队列中,按优先级从缓存队列中读取邮件发送请求并进行邮件发送,能够保障云计算操作系统中的重要邮件(告警、提醒)及时、可靠地送达。 [0048] Compared with the prior art A method and apparatus for transmitting messages provided in the present invention, it applied to cloud operating system, by prioritizing the messages in the queue buffer and read from the buffer queue priority take email send a request and mail, can be important messages (alarms, reminders) timely, reliable service to the operating system to protect cloud computing.

附图说明 BRIEF DESCRIPTION

[0049] 图1为本发明实施例的一种邮件发送方法的流程图。 [0049] FIG. 1 is a flowchart of the method for transmitting messages according to an embodiment of the present invention.

[0050] 图2为本发明实施例的一种邮件发送系统结构示意图。 [0050] FIG. 2 is a schematic system configuration of one kind of message transmission according to an embodiment of the present invention.

[0051] 图3为本发明实施例中邮件监控进程的示意图。 [0051] FIG. 3 is a schematic diagram of the message monitoring process embodiment of the invention.

具体实施方式 Detailed ways

[0052] 为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。 [0052] To make the objectives, technical solutions, and advantages of the present invention will become apparent from, the accompanying drawings hereinafter in conjunction with embodiments of the present invention will be described in detail. 需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。 Incidentally, in the case of no conflict, embodiments and features of the embodiments of the present application may be arbitrarily combined with each other.

[0053] 如图1所示,本发明实施例提供了一种邮件发送方法,应用于云操作系统中,该方法包括:[0054] S10,生成邮件发送请求,并确定邮件的优先级; [0053] 1, the embodiment of the present invention provides a message transmission method applied to the cloud operating system, the method comprising: [0054] S10, generates a mail transmission request, and determines the priority of the message;

[0055] S20,将新生成的邮件发送请求缓存在请求队列中,根据邮件发送请求的优先级对所述请求队列中的邮件发送请求进行排序; [0055] S20, the newly generated message buffer transmission request in the request queue, the priority of the request messages in the queue are sorted transmission request based on the mail transmission request;

[0056] S30,从所述请求队列中依次读取邮件发送请求,对所述邮件发送请求进行解析,根据解析后获得的邮件数据进行邮件发送。 [0056] S30, read from the request queue sequentially sending a request message, the parse request mail transmission, mail transmission message according to the data obtained after analyzing.

[0057] 其中,步骤SlO中,所述邮件发送请求是根据所述云计算操作系统中监控、管理云计算资源产生的告警、提醒信息生成的; [0057] wherein, in the step SlO, the mail transmission request is monitored according to the operating system in a cloud computing, cloud computing resource management of alarms generated, the generated reminder information;

[0058] 其中,所述云计算资源包括以下资源的一种或多种:计算资源(比如,硬件服务器)、存储资源、网络资源、云数据中心中其他常用软件(比如,数据库、中间件等)。 [0058] wherein the cloud computing resource includes one or more of the following resources: computing resources (e.g., hardware servers), storage resources, network resources, and other commonly used cloud data center software (e.g., database, and middleware ).

[0059] 其中,所述邮件发送请求可以包括以下信息的一种或多种:请求标识、接收者地址、发送者地址、邮件主题、邮件内容、邮件的优先级; [0059] wherein the transmission request message may include one or more of the following information: a request identifier, receiver address, sender's address, message subject, message priority, message of;

[0060] 其中,所述邮件的优先级可以是:高、中或低; [0060] wherein, the priority of the message may be: high, medium or low;

[0061] 邮件的优先级可以根据邮件内容的重要性、紧急程度进行优先级的划分,越重要的邮件优先级越高,越紧急的邮件优先级越高。 [0061] Priority mail can be based on the importance of the message content, the priority of the urgency of the division, the more important the higher the message priority, the higher the more urgent priority mail. 比如,服务器宕机的邮件的优先级设置为高,物理机CPU负载超过90%的邮件的优先级设置为中,物理机CPU负载超过85%的邮件的优先级设置为低。 For example, priority mail server downtime is high, physical machine CPU load exceeds 90% of the priority setting message priority setting, the physical machine CPU load exceeds 85% of the message is low.

[0062] 其中,步骤S20中,所述对所述请求队列中的邮件发送请求进行排序,包括:根据邮件发送请求的优先级和缓存时间对所述请求队列中的邮件发送请求进行排序: [0062] wherein, in the step S20, the mail queue requests the sort request, comprising: transmitting a request message according to the priority of the message queue and the buffer time of the request for ordering requests:

[0063] 对于优先级不同的邮件发送请求,优先级高的邮件发送请求排在优先级低的邮件发送请求的前面;和 [0063] send a request for messages of different priority, a high priority transmission request mail transmission request ahead of lower priority messages; and

[0064] 对于优先级相同的邮件发送请求,缓存时间早的邮件发送请求排在缓存时间晚的邮件发送请求的前面; [0064] sends a request for the same message priority, message sent earlier cache request ahead of time later message buffer transmission request;

[0065] 其中,步骤S30中,从所述请求队列中依次读取邮件发送请求,对所述邮件发送请求进行解析,根据解析后获得的邮件数据进行邮件发送,包括: [0065] wherein, in the step S30, the request from the queue sequentially read mail transmission request, the transmission request message parsing, message mail transmission according to the data obtained after analyzing, comprising:

[0066] 创建邮件发送线程; [0066] create a mailing thread;

[0067] 所述邮件发送线程判断上一次读取邮件发送请求的位置是否为所述请求队列的最末一位,如果是,则返回到所述请求队列的首位进行邮件发送请求的读取,如果不是,则从上一次读取位置的下一位开始邮件发送请求的读取; [0067] The message transmission time is determined on the thread to read the message transmission request to the request queue position is the last one, if so, returns to the head of the queue the request mail transmission request is read, If not, read the next bit from the last start position of reading the mail transmission request;

[0068] 所述邮件发送线程对所述邮件发送请求进行解析,根据解析后获得的邮件数据调用邮件服务器的应用程序编程接口API (Application Programming Interface)进行邮件发送。 [0068] The mail sending thread of the transmission request message parsing, message data is parsed according to the obtained call the mail server application programming interface API (Application Programming Interface) for mail transmission.

[0069] 优选地,所述邮件发送线程进行邮件发送后,还包括: After [0069] Preferably, the message sending thread mail transmission, further comprising:

[0070] 所述邮件发送线程判断所述邮件是否发送成功,如果发送成功,则从所述请求队列中删除该邮件对应的邮件发送请求,如果发送失败,则从所述请求队列中删除该邮件对应的邮件发送请求,然后将该邮件发送请求重新缓存在请求队列中并进行排序。 [0070] The mail sending thread determines whether to transmit the message successfully, if the transmission is successful, is deleted from the queue message corresponding to the request mail transmission request, if the transmission fails, the message is deleted from the queue the request corresponding to the transmission request message, and send the request and the message re-sort cache request queue.

[0071] 一种邮件发送的示例如下:比如,请求队列中有5个邮件发送请求,分别是:1号邮件发送请求(优先级高)、2号邮件发送请求(优先级高)、3号邮件发送请求(优先级高)、4号邮件发送请求(优先级中)、5号邮件发送请求(优先级低)。 [0071] An example of a message sent by the following: For example, there are five request queue message transmission request, namely: No. 1 transmits a request message (high priority), No. 2 transmits a request message (high priority), No. 3 sending a request message (high priority), 4-mail transmission request (priority level), No. 5 transmits a request message (low priority).

[0072] 第一次轮询请求队列时,读取I号邮件发送请求并进行邮件发送,读取2号邮件发送请求并进行邮件发送;在读取3号邮件发送请求之前,判断出I号邮件发送请求对应的邮件发送成功,因此,从请求队列中删除I号邮件发送请求;然后读取3号邮件发送请求并进行邮件发送;在读取4号邮件发送请求之前,判断出2号邮件发送请求发送失败,因此,从请求队列中删除2号邮件发送请求,重新将2号邮件发送请求缓存在请求队列中,由于重新缓存后的2号邮件发送请求,优先级仍然是高的,因此,重新缓存后的2号邮件发送请求排在4号邮件发送请求之前,然后,比较重新缓存后的2号邮件发送请求与同等优先级的3号邮件发送请求的缓存时间的早晚,重新缓存后的2号邮件发送请求的缓存时间晚于3号邮件发送请求,因此,将重新缓存后的2号邮件发送请求排序在3 [0072] The first time a polling request queue, the mail read number I and transmits a request message is sent, the mail read number 2 and transmits a request mail transmission; No. 3 before reading mail transmission request, it is determined that I, sending a request message corresponding to the message is sent successfully, and therefore, I, delete the message transmission request from the request queue; 3 then read the message and transmits a request mail transmission; No. 4 before reading the mail transmission request, it is determined that the message 2 send request failed, therefore, to delete the 2nd messages from the request queue send a request to re No. 2 email send a request caching in the request queue, because the No. 2 e-mail after the re-cache sends a request, the priority is still high, so after 2 messages after re-cache sends a request ahead of 4-mail transmission request, then comparing again No. 2 message after the cache sends a request with the same priority level 3 messages sent sooner or later cache time request, re-cache No. 2 transmission request message transmission request to the buffer time later message No. 3, and therefore, the No. 2 after the message transmission request re-ordering buffer 3 邮件发送请求之后,该重新缓存后的2号邮件发送请求可以在第二次轮询请求队列时被读取并进行发送,因此提高了邮件发送的可靠性。 After sending the request message, the message 2 after the re-transmission request can be read buffer and transmits polling request in the second queue, thereby improving the reliability of the message transmission.

[0073] 优选地,如图3所示,该方法还包括: [0073] Preferably, as shown in FIG. 3, the method further comprising:

[0074] 后台运行系统级的邮件监控进程; [0074]-wide mail system running in the background monitoring process;

[0075] 所述邮件监控进程监控邮件发送线程的运行情况,如果检测到邮件发送线程运行异常,则重启该邮件发送线程; [0075] The mail message monitoring process to monitor the operation of the sending thread, the thread sending the message if the detected abnormal operation, the message sending thread is restarted;

[0076] 所述邮件监控进程还定时备份所述请求队列中的数据,如果检测到所述请求队列数据丢失,则根据备份数据自动恢复所述请求队列; [0076] The monitoring process further messages scheduled backup data in the request queue, the request queue is detected if data is lost, then the request queue according to automatic recovery backup data;

[0077] 其中,邮件发送线程运行异常,比如:邮件发送线程由于某些原因或者错误,导致自动销毁或中止(不正常工作)。 [0077] where the message sending thread running anomalies, such as: e-mail threads for some reason or error, leading to self-destruct or suspension (not working properly).

[0078] 如图2所示,本发明实施例还提供了一种邮件发送装置,应用于云计算操作系统中,该装置包括: [0078] Figure 2, embodiments of the present invention further provides a mail transmission apparatus applied to a cloud computing operating system, the apparatus comprising:

[0079] 请求生成模块,用于生成邮件发送请求,并确定邮件的优先级; [0079] The request generating module for generating a mail transmission request, and determines the priority of the message;

[0080] 请求缓存模块,用于将新生成的邮件发送请求缓存在请求队列中,根据邮件发送请求的优先级对所述请求队列中的邮件发送请求进行排序; [0080] The request cache module, for the newly generated priority message buffer transmission request in the request queue, according to the transmission request message to the message queue of the requests for ordering requests;

[0081] 邮件发送模块,用于从所述请求队列中依次读取邮件发送请求,对所述邮件发送请求进行解析,根据解析后获得的邮件数据进行邮件发送; [0081] The mail transmission means for transmitting the message read request from the request queue in sequence, the transmission request message parsing, message mail transmission according to the data obtained after analyzing;

[0082] 其中,所述邮件发送请求是根据所述云计算操作系统中监控、管理云计算资源产生的告警、提醒信息生成的; [0082] wherein, the message transmission request is monitored according to the cloud computing operating system, managing a cloud computing resource alarms generated, the generated reminder information;

[0083] 其中,所述邮件发送请求可以包括以下信息的一种或多种:请求标识、接收者地址、发送者地址、邮件主题、邮件内容、邮件的优先级; [0083] wherein the transmission request message may include one or more of the following information: a request identifier, receiver address, sender's address, message subject, message priority, message of;

[0084] 其中,所述邮件的优先级可以是:高、中或低; [0084] wherein, the priority of the message may be: high, medium or low;

[0085] 邮件的优先级可以根据邮件内容的重要性、紧急程度进行优先级的划分,越重要的邮件优先级越高,越紧急的邮件优先级越高。 [0085] Priority mail can be based on the importance of the message content, the priority of the urgency of the division, the more important the higher the message priority, the higher the more urgent priority mail.

[0086] 其中,所述请求缓存模块,用于通过以下方式对对所述请求队列中的邮件发送请求进行排序:根据邮件发送请求的优先级和缓存时间对所述请求队列中的邮件发送请求进行排序: [0086] wherein the request buffer module configured to send a request for sorting the messages in the queue the request by: sending a request message according to the priority and time to send a request for the message buffer in the request queue put in order:

[0087] 对于优先级不同的邮件发送请求,优先级高的邮件发送请求排在优先级低的邮件发送请求的前面;和 [0087] send a request for messages of different priority, a high priority transmission request mail transmission request ahead of lower priority messages; and

[0088] 对于优先级相同的邮件发送请求,缓存时间早的邮件发送请求排在缓存时间晚的邮件发送请求的前面;[0089] 其中,所述邮件发送模块,用于通过以下方式从所述请求队列中依次读取邮件发送请求并进行邮件发送: [0088] The message sent to the same priority requests, the cache sends a request message earlier ahead of late message transmission request buffer duration; [0089] wherein, the message transmission module configured in the following manner from the sequentially read request queue and the message transmission request mail transmission:

[0090] 创建邮件发送线程; [0090] create a mailing thread;

[0091] 所述邮件发送线程判断上一次读取邮件发送请求的位置是否为所述请求队列的最末一位,如果是,则返回到所述请求队列的首位进行邮件发送请求的读取,如果不是,则从上一次读取位置的下一位开始邮件发送请求的读取; [0091] The message transmission time is determined on the thread to read the message transmission request to the request queue position is the last one, if so, returns to the head of the queue the request mail transmission request is read, If not, read the next bit from the last start position of reading the mail transmission request;

[0092] 所述邮件发送线程对所述邮件发送请求进行解析,根据解析后获得的邮件数据调用邮件服务器的应用程序编程接口API进行邮件发送。 [0092] The mail sending thread of the transmission request message parsing, message data is parsed in accordance with the obtained application programming interface API calls the mail on the mail server.

[0093] 优选地,所述邮件发送模块,用于所述邮件发送线程进行邮件发送后,还判断所述邮件是否发送成功,如果发送成功,则从所述请求队列中删除该邮件对应的邮件发送请求,如果发送失败,则从所述请求队列中删除该邮件对应的邮件发送请求,然后将该邮件发送请求重新缓存在请求队列中并进行排序。 After [0093] Preferably, the mail transmission means for transmitting the message thread mail transmission, further determined whether to transmit the message successfully, if the transmission is successful, the message queue deletes the message corresponding to the request from transmission request, if the transmission fails, the request from the message queue deletes the message corresponding to the transmission request, and send the request and the message re-ordering buffer in the request queue.

[0094] 优选地,所述装置还包括邮件监控模块; [0094] Preferably, the apparatus further includes a mail monitoring module;

[0095] 所述邮件监控模块,用于后台运行系统级的邮件监控进程;所述邮件监控进程监控邮件发送线程的运行情况,如果检测到邮件发送线程运行异常,则重启该邮件发送线程;所述邮件监控进程还定时备份所述请求队列中的数据,如果检测到所述请求队列数据丢失,则根据备份数据自动恢复所述请求队列。 [0095] The message monitoring module running in the background for the message monitoring process system level; the mail message monitoring process to monitor the operation of the sending thread, the thread sending the message if the abnormal operation is detected, the message sending thread is restarted; the said message monitoring process also scheduled backup data queue the request, if the request queue is detected loss of data, automatically restoring the backup data according to a request queue.

[0096] 上述实施例提供的一种邮件发送方法和装置,应用于云计算操作系统中,通过为邮件(告警、提醒信息)设置优先级并缓存在队列中,按优先级从缓存队列中读取邮件发送请求并进行邮件发送,能够在大量邮件需要发送时优先保障重要邮件可靠、及时地送达。 [0096] A method and apparatus for transmitting messages provided in the above-described embodiments, applied cloud operating system, by setting the priority for the message (alarm, alert information) in the queue buffer and read from the buffer queue priority take email send a request and mail, can give priority to important messages in the large number of messages required to send reliable and timely delivery. 并且,通过后台运行系统级的邮件监控进程,能够进一步提高邮件发送的可靠性,避免重要告警、提醒信息由于邮件未能送达而影响整个云计算数据中心的正常运行和用户体验。 In addition, operation of the system-wide mail monitoring process through the background, to further improve the reliability of mail sent, avoiding major alarms to alert information because the message could not be delivered to affect the entire cloud computing data center uptime and user experience. 通过采用本发明的邮件发送方法和系统,能够提高云计算操作系统的监控、管理的性能,保障云计算操作系统运行的稳定性和高可用性。 By using e-mail transmission method and system of the present invention, the monitoring operation can be improved cloud computing system, performance management, security and stability of the high-availability computing cloud running operating system.

[0097] 本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。 [0097] Those of ordinary skill in the art will be appreciated that the above-described method may be all or part of the steps by a program instructing relevant hardware is completed, the program may be stored in a computer-readable storage medium, such as read only memory, etc., magnetic or optical disk. 可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现,相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。 Alternatively, all or part of the steps of the above-described embodiments may be implemented using one or more integrated circuits, respectively, each module / unit in the above-described embodiments may be implemented using a form of hardware, software functional modules may also be employed forms. 本发明不限制于任何特定形式的硬件和软件的结合。 The present invention is not limited to any specific combination of hardware and software form.

[0098] 需要说明的是,本发明还可有其他多种实施例,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员可根据本发明作出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。 [0098] Incidentally, the present invention can have a variety of other embodiments, without departing from the spirit and essence of the invention, those skilled in the art may make various corresponding modifications and variations according to the present invention , but the protection scope of these respective modifications and variations of the present invention should belong to the appended claims.

Claims (12)

1.一种邮件发送方法,应用于云计算操作系统中,该方法包括: 生成邮件发送请求,并确定邮件的优先级; 将新生成的邮件发送请求缓存在请求队列中,根据邮件发送请求的优先级对所述请求队列中的邮件发送请求进行排序; 从所述请求队列中依次读取邮件发送请求,对所述邮件发送请求进行解析,根据解析后获得的邮件数据进行邮件发送。 A mail transmission method applied to the cloud computing operating system, the method comprising: generating a mail transmission request, and determines the priority of the message; the newly generated message buffer transmission request in the request queue, according to the mail transmission request priority of the request messages in the queue are sorted transmission request; read mail transmission request from the request queue in sequence, the transmission request message parsing, message mail transmission according to the data obtained after analyzing.
2.如权利要求1所述的方法,其特征在于: 所述对所述请求队列中的邮件发送请求进行排序,包括:根据邮件发送请求的优先级和缓存时间对所述请求队列中的邮件发送请求进行排序: 对于优先级不同的邮件发送请求,优先级高的邮件发送请求排在优先级低的邮件发送请求的前面;和对于优先级相同的邮件发送请求,缓存时间早的邮件发送请求排在缓存时间晚的邮件发送请求的前面。 2. The method according to claim 1, wherein: the mail queue requests the sort request, comprising: a buffer time and priority based on a mail transmission request message to the request queue sending a request to sort: for different message priority transmission request, a high priority message transmission request ahead of a lower priority message transmission request; and the same message for priority transmission request, the cache earlier message transmission request ahead of time later cache sending a request message.
3.如权利要求1所述的方法,其特征在于: 从所述请求队列中依次读取邮件发送请求,对所述邮件发送请求进行解析,根据解析后获得的邮件数据进行邮件发送,包括: 创建邮件发送线程; 所述邮件发送线程判断上一次读取邮件发送请求的位置是否为所述请求队列的最末一位,如果是,则返回到所述请求队列的首位进行邮件发送请求的读取,如果不是,则从上一次读取位置的下一位开始邮件发送请求的读取; 所述邮件发送线程对所述邮件发送请求进行解析,根据解析后获得的邮件数据调用邮件服务器的应用程序编程接口API进行邮件发送。 3. The method according to claim 1, wherein: the read request queue sequentially from said transmission request message, the parse request mail transmission, mail transmission depending on the mail data obtained by analyzing, comprising: Create the message sending thread; a reading position messages sent the request whether the request is a last queue the message sending thread is determined, if yes, returns to the head of the queue request mail transmission request to read take, if not, a start message from the last read position of the read transmission request; transmitting the message thread parses the mail transmission request, the mail data according to the obtained call parsed mail server applications programming interface (API) to send mail.
4.如权利要求3所述的方法,其特征在于: 所述邮件发送线程进行邮件发送后,还包括: 所述邮件发送线程判断所述邮件是否发送成功,如果发送成功,则从所述请求队列中删除该邮件对应的邮件发送请求,如果发送失败,则从所述请求队列中删除该邮件对应的邮件发送请求,然后将该邮件发送请求重新缓存在请求队列中并进行排序。 4. The method according to claim 3, wherein: the message sending thread after the mail transmission, further comprising: transmitting the message thread determines whether to transmit the message successfully, if the transmission is successful, the request from delete the message queue corresponding to the mail transmission request, if the transmission fails, the queue is deleted from the message corresponding to the request mail transmission request, then the transmission request message and re-sorted in the cache request queue.
5.如权利要求1-4中任一项所述的方法,其特征在于: 所述邮件发送请求,是根据所述云计算操作系统中监控、管理云计算资源产生的告警、提醒信息生成的。 5. A method as claimed in any one of claims 1-4, characterized in that: said mail transmission request, the cloud is monitored according to the operating system, managing a cloud computing resource alarms generated, the generated reminder information .
6.如权利要求3或4所述的方法,其特征在于,还包括: 后台运行系统级的邮件监控进程; 所述邮件监控进程监控邮件发送线程的运行情况,如果检测到邮件发送线程运行异常,则重启该邮件发送线程; 所述邮件监控进程还定时备份所述请求队列中的数据,如果检测到所述请求队列数据丢失,则根据备份数据自动恢复所述请求队列。 6. A method as claimed in claim 3 or claim 4, characterized in that, further comprising: a background system-level message monitoring process; the mail message monitoring process to monitor the operation of the sending thread, the thread sending the message if the detected abnormal operation , the message sending thread is restarted; messages to monitor the further progress of scheduled backup data queue the request if the request queue is detected loss of data, automatically restoring the backup data according to a request queue.
7.一种邮件发送装置,应用于云计算操作系统中,该装置包括: 请求生成模块,用于生成邮件发送请求,并确定邮件的优先级; 请求缓存模块,用于将新生成的邮件发送请求缓存在请求队列中,根据邮件发送请求的优先级对所述请求队列中的邮件发送请求进行排序; 邮件发送模块,用于从所述请求队列中依次读取邮件发送请求,对所述邮件发送请求进行解析,根据解析后获得的邮件数据进行邮件发送。 A message transmission apparatus is applied to a cloud computing operating system, the apparatus comprising: a request generating module for generating a mail transmission request, and determines the priority of the message; requesting cache module, configured to send new messages generated request in the request queue cache, sending a request message according to the message priority queue sorts the request transmission request; mail transmission means for transmitting the mail read request from the request queue sequentially, the message parsing transmission request, transmitted in accordance with a mail message parsed data obtained.
8.如权利要求7所述的装置,其特征在于: 所述请求缓存模块,用于通过以下方式对对所述请求队列中的邮件发送请求进行排序:根据邮件发送请求的优先级和缓存时间对所述请求队列中的邮件发送请求进行排序: 对于优先级不同的邮件发送请求,优先级高的邮件发送请求排在优先级低的邮件发送请求的前面;和对于优先级相同的邮件发送请求,缓存时间早的邮件发送请求排在缓存时间晚的邮件发送请求的前面。 8. The apparatus according to claim 7, wherein: said request buffer means for sorting the mail transmission request queue the request by: sending a request message according to the priority and buffer time of messages in the queue the request transmission request sort: different priorities for transmission request message, a high priority message request sent ahead of lower priority transmission request message; and the same priority message for transmission request , the cache sends a request message earlier ahead of time later cache sending a request message.
9.如权利要求7所述的装置,其特征在于: 所述邮件发送模块,用于通过以下方式从所述请求队列中依次读取邮件发送请求并进行邮件发送: 创建邮件发送线程; 所述邮件发送线程判断上一次读取邮件发送请求的位置是否为所述请求队列的最末一位,如果是,则返回到所述请求队列的首位进行邮件发送请求的读取,如果不是,则从上一次读取位置的下一位开始邮件发送请求的读取; 所述邮件发送线程对所述邮件发送请求进行解析,根据解析后获得的邮件数据调用邮件服务器的应用程序编程接口API进行邮件发送。 9. The apparatus according to claim 7, wherein: the message sending module, configured to read in the following manner from the request queue and sends a request message sequentially mail transmission: creating a mail sending thread; the whether a last read messages on a mail transmission request thread determines a position of said transmission request queue, and if so, returns to the head of the queue read request mail transmission request, if not, from the next time the reading start position of the messages on the read transmission request; transmitting the message thread parses the mail transmission request, the mail data according to the obtained call parsed mail server application programming interface (API) for message transmission .
10.如权利要求9所述的装置,其特征在于: 所述邮件发送模块,用于所述邮件发送线程进行邮件发送后,还判断所述邮件是否发送成功,如果发送成功,则从所述请求队列中删除该邮件对应的邮件发送请求,如果发送失败,则从所述请求队列中删除该邮件对应的邮件发送请求,然后将该邮件发送请求重新缓存在请求队列中并进行排序。 10. The apparatus according to claim 9, wherein: after the mail transmission means for transmitting the message thread mail transmission, further determined whether to transmit the message successfully, if the transmission is successful, from the request queue deletes the message corresponding to the message transmission request, if the transmission fails, the queue is deleted from the message corresponding to the request mail transmission request, then the transmission request message and re-sorted in the cache request queue.
11.如权利要求7-10中任一项所述的方法,其特征在于: 所述邮件发送请求,是根据所述云计算操作系统中监控、管理云计算资源产生的告警、提醒信息生成的。 11. The method according to any one of 7-10 claims, characterized in that: said mail transmission request, the cloud is monitored according to the operating system, managing a cloud computing resource alarms generated, the generated reminder information .
12.如权利要求9或10所述的装置,其特征在于: 所述装置还包括邮件监控模块; 所述邮件监控模块,用于后台运行系统级的邮件监控进程;所述邮件监控进程监控邮件发送线程的运行情况,如果检测到邮件发送线程运行异常,则重启该邮件发送线程;所述邮件监控进程还定时备份所述请求队列中的数据,如果检测到所述请求队列数据丢失,则根据备份数据自动恢复所述请求队列。 12. The apparatus of claim 9 or claim 10, wherein: said apparatus further comprises a monitoring module message; the message monitoring module running in the background for the system-level message monitoring process; monitoring process to monitor the mail message the operation of sending thread, the thread sending the message if the detected abnormal operation, the message sending thread is restarted; messages to monitor the further progress of scheduled backup data queue the request if the request queue is detected loss of data, according to the automatically restoring the backup data request queue.
CN2013103374416A 2013-08-05 2013-08-05 Method and device for sending mails CN103401764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2013103374416A CN103401764A (en) 2013-08-05 2013-08-05 Method and device for sending mails

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2013103374416A CN103401764A (en) 2013-08-05 2013-08-05 Method and device for sending mails

Publications (1)

Publication Number Publication Date
CN103401764A true CN103401764A (en) 2013-11-20

Family

ID=49565293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2013103374416A CN103401764A (en) 2013-08-05 2013-08-05 Method and device for sending mails

Country Status (1)

Country Link
CN (1) CN103401764A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104579922A (en) * 2014-12-26 2015-04-29 乐视网信息技术(北京)股份有限公司 Mail sending method and device
CN105991695A (en) * 2015-02-04 2016-10-05 郭潇文 File data processing method and system
CN106973002A (en) * 2016-01-13 2017-07-21 北京京东尚科信息技术有限公司 E-mail sending method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1215275A (en) * 1997-09-24 1999-04-28 夏普公司 E-mail sending/receiving system and method and record medium recording said method
CN1293798A (en) * 1998-02-17 2001-05-02 吉尼塞斯电信实验室公司 Method and apparatus for call distribution and override with priority
US20030120795A1 (en) * 2001-12-20 2003-06-26 Marnetics Ltd. Method for capacity enhancement of packet switched networks
US20090113016A1 (en) * 2007-10-24 2009-04-30 Subhabrata Sen Managing email servers by prioritizing emails
CN101741763A (en) * 2008-11-13 2010-06-16 中国科学院计算机网络信息中心 Method and system for reliably sending alarm mails
CN102137032A (en) * 2011-03-24 2011-07-27 上海云高软件科技有限公司 Cloud message system and cloud message transmitting and receiving method
CN102739452A (en) * 2012-06-28 2012-10-17 浪潮(北京)电子信息产业有限公司 Method and system for monitoring resources

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1215275A (en) * 1997-09-24 1999-04-28 夏普公司 E-mail sending/receiving system and method and record medium recording said method
CN1293798A (en) * 1998-02-17 2001-05-02 吉尼塞斯电信实验室公司 Method and apparatus for call distribution and override with priority
US20030120795A1 (en) * 2001-12-20 2003-06-26 Marnetics Ltd. Method for capacity enhancement of packet switched networks
US20090113016A1 (en) * 2007-10-24 2009-04-30 Subhabrata Sen Managing email servers by prioritizing emails
CN101741763A (en) * 2008-11-13 2010-06-16 中国科学院计算机网络信息中心 Method and system for reliably sending alarm mails
CN102137032A (en) * 2011-03-24 2011-07-27 上海云高软件科技有限公司 Cloud message system and cloud message transmitting and receiving method
CN102739452A (en) * 2012-06-28 2012-10-17 浪潮(北京)电子信息产业有限公司 Method and system for monitoring resources

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104579922A (en) * 2014-12-26 2015-04-29 乐视网信息技术(北京)股份有限公司 Mail sending method and device
CN105991695A (en) * 2015-02-04 2016-10-05 郭潇文 File data processing method and system
CN105991695B (en) * 2015-02-04 2019-02-26 郭潇文 A kind of file data processing method and system
CN106973002A (en) * 2016-01-13 2017-07-21 北京京东尚科信息技术有限公司 E-mail sending method and device

Similar Documents

Publication Publication Date Title
JP5726290B2 (en) Techniques for integrating directory servers
US6986076B1 (en) Proactive method for ensuring availability in a clustered system
US7827199B2 (en) Centralized configuration data management for distributed clients
US7630379B2 (en) Systems and methods for improved network based content inspection
US20100293270A1 (en) Use Tag Clouds to Visualize Components Related to an Event
JP2006190265A (en) Server queuing system and method thereof
US9294338B2 (en) Management computer and method for root cause analysis
US20150120914A1 (en) Service monitoring system and service monitoring method
US7650403B2 (en) System and method for client side monitoring of client server communications
US7096391B2 (en) Error message suppression system and method
US9185179B2 (en) Re-establishing push notification channels via user identifiers
CN105393220B (en) System and method for disposing dotted virtual server in group system
US20030196148A1 (en) System and method for peer-to-peer monitoring within a network
DE112013003180T5 (en) A method, system and apparatus for managing server hardware resources in a cloud scheduling environment
CN102624570B (en) Monitoring system and method for detecting availability of web server
Bailis et al. The network is reliable
US8225011B2 (en) Method of monitoring device forming information processing system, information apparatus and information processing system
CN102981943A (en) Method and system for monitoring application logs
US8260956B2 (en) Data transmission queuing using fault prediction
US20030135735A1 (en) Self-monitoring and trending service system with a cascaded pipeline with enhanced authentication and registration
US7451209B1 (en) Improving reliability and availability of a load balanced server
CN105224445A (en) Distributed Tracking System
US8693310B2 (en) Systems and methods for providing fault detection and management
US20080086561A1 (en) Method for obtaining log information from network element device by network management server, a network element device and a network management server
CN102355426B (en) Method for transmitting off-line file and system

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
RJ01