A mail transmission method, device, equipment, storage medium and program product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2026-08-11
AI Technical Summary
当前用于传输电子邮件的技术方案,通常是将接收到的邮件传输任务无差别地添加至任务队列,再按照固定的并发数依次执行队列中的邮件传输任务,然而,此方式极易导致邮件传输资源的利用率低下,进而影响邮件传输的效率以及邮件传输服务的稳定性
[0052] The main implementation process of this application embodiment is as follows: after obtaining the email to be transmitted, it is added to the email queue associated with the corresponding volume range based on the email volume of the email to be transmitted. Then, an email transmission task is created for the email queue. Based on the principle that the number of coroutine concurrency is negatively correlated with the lower limit of the volume range, at least two coroutines are enabled to execute the email transmission task concurrently. This enables the concurrent transmission of each email in the email queue. This allows smaller emails to be delivered quickly and with low power consumption through a larger number of coroutines, and ensures that when larger emails are transmitted, there will be no sharp consumption or excessive occupation of corresponding resources. This ensures the resource utilization rate of the email transmission system or device, thereby improving the stability and robustness of email transmission performance.
Smart Images

Figure CN122554429A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of email technology and network communication technology, and in particular to an email transmission method, apparatus, device, storage medium and program product. Background Technology
[0002] Email is a common form of information transmission in daily life, specifically used to transmit text, images, audio / video, or other binary files. Current technologies for email transmission typically add received email transmission tasks indiscriminately to a task queue and then execute these tasks sequentially according to a fixed concurrency level. However, this approach easily leads to low utilization of email transmission resources, thus affecting transmission efficiency and service stability. Therefore, this application proposes a novel email transmission scheme that can improve the utilization of email transmission resources, thereby ensuring both transmission efficiency and service stability. Summary of the Invention
[0003] This application provides an email transmission method, apparatus, device, storage medium, and program product, which can be used to improve the utilization rate of email transmission resources, thereby ensuring email transmission efficiency and the stability of email transmission services.
[0004] On one hand, embodiments of this application provide an email transmission method, including:
[0005] Obtain the email to be transmitted and its volume;
[0006] Based on the target volume range to which the email volume belongs, and the preset association between the volume range and the email queue, the email to be transmitted is added to the target email queue associated with the target volume range.
[0007] Based on the lower bound of the target volume range, a mail transmission task for the target mail queue is created, and a reference number of coroutines are started to execute the mail transmission task concurrently. The reference number is negatively correlated with the lower bound of the range.
[0008] Furthermore, embodiments of this application provide an email transmission device, including:
[0009] The acquisition unit is used to acquire the email to be transmitted and the size of the email to be transmitted;
[0010] The queue allocation unit is used to add the email to be transmitted to the target email queue associated with the target volume range based on the target volume range to which the email volume belongs and the preset association relationship between the volume range and the email queue.
[0011] The email transmission unit is used to create an email transmission task for the target email queue based on the lower bound of the target volume range, and to start a reference number of coroutines to execute the email transmission task concurrently, wherein the reference number is negatively correlated with the lower bound of the range.
[0012] In one implementation, each volume range is associated with a mail queue under a different domain type, including external domain types and internal domain types. When the queue allocation unit adds the email to be transmitted to the target mail queue associated with the target volume range based on the target volume range to which the email volume belongs and the preset association relationship between the volume range and the mail queue, it can specifically perform the following:
[0013] Based on the target volume range to which the email volume belongs, and the preset association between the volume range and the email queue, determine the email queue associated with the target volume range.
[0014] Obtain the domain name type of the receiving address of the email to be transmitted;
[0015] The email queue corresponding to the domain name type of the receiving address in the email queue associated with the target volume range is taken as the target email queue, and the email to be transmitted is added to the target email queue.
[0016] In another implementation, when the email transmission unit initiates a reference number of coroutines to concurrently execute the email transmission task, it may specifically perform the following:
[0017] Create the reference number of coroutines, and sequentially allocate the target emails that need to be transmitted to each coroutine from the target email queue;
[0018] When the domain name type corresponding to the target email queue is the external domain type, each coroutine is controlled to transmit the target email based on the email transmission permission associated with the receiving domain name of the assigned target email. The email transmission permission is used to indicate whether it is allowed to transmit emails under the receiving domain name in the current time period.
[0019] When the domain name type corresponding to the target email queue is the internal domain type, control each coroutine to send the assigned target email to the corresponding receiving address.
[0020] In another implementation, when the email transmission unit controls the email transmission permissions associated with the assigned target email's receiving domain name and transmits the target email, it may specifically perform the following:
[0021] If the email transmission permission indicator allows the transmission of emails under the receiving domain name within the current time period, then the target email is sent according to the email transmission rate pre-configured for the receiving domain name;
[0022] If the email transmission permission indicator does not allow the transmission of emails under the receiving domain name within the current time period, then release the coroutine resources.
[0023] In another embodiment, the email transmission unit can also be used to perform:
[0024] Obtain the current load status of the receiving server corresponding to the receiving domain name;
[0025] If the current load status is overloaded, then obtain the resource usage status of the receiving domain name in the email service device;
[0026] Based on the resource occupancy status, determine the email transmission permissions associated with the receiving domain name.
[0027] In another embodiment, when the email transmission unit obtains the resource occupancy status of the receiving domain name in the email service device, it may specifically perform the following:
[0028] Obtain the email delivery volume and email transmission time corresponding to the receiving domain name in the email service device;
[0029] Obtain the total number of emails delivered and the total email transmission time of the email service device;
[0030] The resource occupancy status is determined based on a first ratio between the number of emails delivered and the total number of emails delivered, and a second ratio between the email transmission time and the total email transmission time.
[0031] In another implementation, when the email transmission unit determines the email transmission permissions associated with the receiving domain name based on the resource occupancy status, it may specifically perform the following:
[0032] If the resource occupancy status indicates that the receiving domain name has not exceeded its resource occupancy limit, then the email transmission permission associated with the receiving domain name is configured as the first permission. The first permission is used to indicate that emails under the receiving domain name are allowed to be transmitted within the current time period.
[0033] If the resource occupancy status indicates that the receiving domain name is consuming excessive resources, then the email transmission rate corresponding to the receiving domain name is obtained, and the email transmission permission associated with the receiving domain name is determined based on the email transmission rate and the preset transmission rate.
[0034] Wherein, when the email transmission rate is greater than the preset transmission rate, the email transmission permission is the first permission; when the email transmission rate is less than the preset transmission rate, the email transmission permission is the second permission, which is used to indicate that the transmission of emails under the receiving domain name is not allowed within the current time period.
[0035] In another embodiment, the email transmission unit can also be used to perform:
[0036] Obtain the load status of the receiving server corresponding to the receiving domain name in the current detection period to obtain the current load status, and obtain the load status of the receiving server in the previous detection period to obtain the historical load status.
[0037] Based on the historical load status and the current load status, determine the direction and magnitude of the email transmission rate adjustment;
[0038] The email transmission rate of the receiving domain name is updated according to the adjustment direction and the adjustment range.
[0039] In another implementation, when the email transmission unit determines the adjustment direction and adjustment range of the email transmission rate based on the historical load status and the current load status, it may specifically perform the following:
[0040] When the current load state is overloaded, the adjustment direction of the email transmission rate is determined to be downward.
[0041] If the historical load state is not overloaded, then the adjustment range of the email transmission rate is determined as the first adjustment range.
[0042] If the historical load status is an overload status, then the adjustment range of the email transmission rate is determined as a second adjustment range, which is smaller than the first adjustment range.
[0043] In another implementation, when the email transmission unit determines the adjustment direction and adjustment range of the email transmission rate based on the historical load status and the current load status, it may specifically perform the following:
[0044] When the current load state is not overloaded, the adjustment direction of the email transmission rate is determined to be upward.
[0045] If the historical load state is a non-overload state, then the adjustment range of the email transmission rate is determined as the third adjustment range, which is less than the second adjustment range;
[0046] If the historical load status is an overload status, then the adjustment range of the email transmission rate is determined as the fourth adjustment range, which is smaller than the third adjustment range.
[0047] In another aspect, embodiments of this application provide an email service device, including:
[0048] A memory, wherein a computer program is stored;
[0049] A processor for loading the computer program to implement the method as described in the first aspect.
[0050] In another aspect, embodiments of this application also provide a computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed as described in the first aspect.
[0051] In another aspect, embodiments of this application also provide a computer program product, the computer program product including computer instructions, wherein a processor of a computer device reads the computer instructions and executes the method as described in the first aspect.
[0052] The main implementation process of this application embodiment is as follows: after obtaining the email to be transmitted, it is added to the email queue associated with the corresponding volume range based on the email volume of the email to be transmitted. Then, an email transmission task is created for the email queue. Based on the principle that the number of coroutine concurrency is negatively correlated with the lower limit of the volume range, at least two coroutines are enabled to execute the email transmission task concurrently. This enables the concurrent transmission of each email in the email queue. This allows smaller emails to be delivered quickly and with low power consumption through a larger number of coroutines, and ensures that when larger emails are transmitted, there will be no sharp consumption or excessive occupation of corresponding resources. This ensures the resource utilization rate of the email transmission system or device, thereby improving the stability and robustness of email transmission performance. Attached Figure Description
[0053] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a schematic diagram of an email transmission system provided in an embodiment of this application;
[0055] Figure 2 This is a schematic flowchart of an email transmission method provided in an embodiment of this application;
[0056] Figure 3 This is a schematic flowchart illustrating another email transmission method provided in the embodiments of this application;
[0057] Figure 4 This is a schematic diagram of an email transmission service architecture provided in an embodiment of this application;
[0058] Figure 5 This is a schematic diagram of an intra-domain email transmission process provided in an embodiment of this application;
[0059] Figure 6 This is a schematic diagram of an external domain email transmission process provided in an embodiment of this application;
[0060] Figure 7 This is a schematic diagram of the structure of an email transmission device provided in an embodiment of this application;
[0061] Figure 8 This is a schematic diagram of the structure of an email service device provided in an embodiment of this application. Detailed Implementation
[0062] It should be noted in advance that, in order to enable those skilled in the art to better understand the technical solutions proposed in the embodiments of this application, the embodiments of this application will be described clearly and completely in conjunction with one or more accompanying drawings. Furthermore, the accompanying drawings shown in the embodiments of this application are merely illustrative examples; for instance, the execution order of each step in the drawings can be adaptively adjusted according to the actual application scenario.
[0063] Furthermore, in the embodiments of this application, the block diagrams, modules, and units shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. Each module or unit can be part of a larger module or unit that includes the functionality of that module or unit. That is, the terms "module" or "unit" mentioned in the embodiments of this application refer to a computer program or part of a computer program with a predetermined function, which can work together with other related parts to achieve a predetermined goal. It can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof, or implemented in different network and / or processor devices and / or microcontroller devices. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units.
[0064] Specifically, this application proposes a technical solution for email transmission scenarios. This solution configures the association between email volume ranges and email queues. After acquiring an email to be transmitted, it divides the email into a corresponding email queue (hereinafter referred to as the target email queue) based on the volume range to which the email belongs. Then, following the principle that the number of coroutines is negatively correlated with the lower bound of the volume range, it determines the number of coroutines required to deliver emails to the target email queue based on the lower bound of the volume range. Finally, it uses the corresponding number of coroutines to concurrently deliver emails in the target email queue. Here, a coroutine is a lightweight concurrent programming model that can implement multiple independent execution flows within a single thread, thereby providing more efficient data processing.
[0065] By dividing email queues based on volume ranges and assigning a corresponding number of coroutines to each email queue to concurrently deliver emails, according to the principle that the lower bound of the volume range corresponding to the email queue is negatively correlated with the number of concurrent coroutines, smaller emails can be quickly delivered to their corresponding receiving addresses. This ensures that larger emails are not subjected to a sharp consumption of resources (such as storage and computing resources), thereby guaranteeing the resource utilization of the email transmission system or device and improving the stability and robustness of email transmission performance.
[0066] In one specific embodiment, the above technical solution can be applied to, for example... Figure 1 The email transmission system shown. (For example...) Figure 1 The email transmission system may include at least two receiving servers (as labeled 101), an email service device (as labeled 102), and at least one sending end (as labeled 103). The sending end refers to a client or application used to provide email sending and receiving services to business entities, capable of creating and sending corresponding emails in response to the business entity's email creation operation. The receiving server is used to receive emails under a specific network domain name and forward the emails to the designated receiving address. The email service device is used to execute the above technical solution to achieve email transmission.
[0067] In this context, the sending end and the receiving server can have a corresponding relationship. This relationship indicates that the email service provided by the sending end is provided by the receiving server, and the email service includes, but is not limited to, email delivery and email storage. For example, suppose... Figure 1 In the above, the domain name served by the receiving server 1 is @xx.com. If the sending end 1 is provided with email service by the receiving server 1, then it can be considered that there is a corresponding relationship between the sending end 1 and the receiving server 1. The domain name of the sending address of the sending end should be the same as the domain name served by the receiving server, which is @xx.com.
[0068] Furthermore, it's worth noting that email service equipment can also function as a receiving server. In this case, if both the sending and receiving addresses of the email to be transmitted are addresses under the network domain served by the email service equipment, the email to be transmitted can be considered an internal domain email (referred to as internal domain email); if the domain name of the receiving address of the email to be transmitted (referred to as the receiving domain name) is different from the network domain served by the email service equipment, the email to be transmitted can be considered an external domain email (referred to as external domain email). Similarly, email service equipment can also function as a sending end, which will not be detailed here.
[0069] In practical applications, an email service device may include one or both of a terminal device and a server. When the email service device includes a terminal device, the terminal device may run an application (or client) for providing email sending and receiving services, and may also run a computer program for implementing the embodiments of this application. When the email service device includes a server, the server may act as a receiving server that provides email services to the sending end, and the server may specifically include, but is not limited to, an independent physical server or a cloud server, or a server cluster or distributed system composed of multiple servers, without specific limitations here.
[0070] Based on the principles of the above technical solutions, this application provides an email transmission method, the schematic flowchart of which can be found in [reference needed]. Figure 2 And this can continue to be performed by the aforementioned email service equipment. For example... Figure 2 The method may include steps S201-S203:
[0071] S201. Obtain the email to be transmitted and its size.
[0072] In specific embodiments, the number of emails to be transmitted can be at least one, and each email corresponds to a receiving address. That is, if the received email transmission request instructs that an email be sent to N receiving addresses, then there are considered to be N emails to be transmitted, where N is a positive integer. The email volume of an email to be transmitted refers to the amount of data occupied by the email (including attachments), usually measured in units such as bytes (B), kilobytes (KB), megabytes (MB), gigabytes (GB). In some application scenarios, email volume can be understood as the size of the email under the Multipurpose Internet Mail Extensions (MIME) protocol. For ease of understanding and explanation, unless otherwise specified, the embodiments in this application will use a single email to be transmitted as an example to illustrate the specific technical implementation.
[0073] In one feasible implementation, emails to be delivered can be categorized into two types: internal domain emails and external domain emails. Internal domain emails are those that do not require cross-domain delivery, while external domain emails are those that do require cross-domain delivery. As mentioned earlier, when the receiving domain of the email to be delivered is the same as the network domain served by the email service device, the email to be delivered is considered an internal domain email; when the receiving domain of the email to be delivered is different from the network domain served by the email service device, the email to be delivered is considered an external domain email. For example, if the network domain served by the email service device is @xx.com, the receiving domain of email a to be delivered is @xy.com, and the receiving domain of email b to be delivered is @xx.com, then email a to be delivered is considered an external domain email, and email b to be delivered is an internal domain email.
[0074] In practical applications, the data contained in each email to be transmitted can be simply divided into attachment data and non-attachment data. Non-attachment data can specifically include email header data (such as email title, recipient address, sender address, etc.) and email body data. Attachment data can include one or more of the following: text files, multimedia files, and image files. Optionally, email signatures can also be considered as a type of attachment data.
[0075] Since mailing addresses with the same receiving domain typically share the same mail receiving server's service resources, and attachments are usually quite large, when the email service device can act as a mail receiving server, it can, after receiving the internal domain email to be transmitted, store the attachments separately in a database and create attachment indication information for that attachment. This attachment indication information uniquely identifies the attachment and allows access to it. In this scenario, when transmitting internal domain emails, the email service device can send only the attachment indication information and other email data to the receiving address. This ensures that the total size of the email to be transmitted is only the sum of the attachment indication information and the non-attachment data, reducing the total data volume during transmission and guaranteeing that the business objects corresponding to the receiving address can view the complete email information.
[0076] S202. Based on the target volume range to which the email volume belongs, and the preset association between the volume range and the email queue, add the email to be transmitted to the target email queue associated with the target volume range.
[0077] In a specific embodiment, the email service device can pre-configure the association between volume ranges and email queues. Each email queue is typically associated with a volume range to ensure that the resource consumption when transmitting emails within the same queue is similar. This allows the resource consumption of the email service device to fluctuate relatively smoothly, thereby ensuring the stability of device performance. By dividing email queues into units of volume ranges, the emails contained in different email queues are not of the same size. Therefore, during email transmission, resource allocation for the email service device can be performed at the email queue level, improving resource management efficiency.
[0078] It's worth noting that emails of the same size but different types can be added to different email queues, and the email type of the email to be transferred must be the same as the type of the email queue it belongs to. For example, suppose the email to be transferred is from an external domain, and its size falls within the target size range. Then, the email service should add the email to the external domain email queue corresponding to the target size range. Similarly, suppose the email to be transferred is from an internal domain, and its size falls within the target size range. Then, the email service should add the email to the internal domain email queue corresponding to the target size range.
[0079] In other words, a volume range can be associated with at least two different types of email queues. For example, when the emails to be transmitted include both external domain emails and internal domain emails, each volume range can be associated with one external domain email queue (referred to as the external domain email queue) and one internal domain email queue (referred to as the internal domain email queue).
[0080] In one feasible implementation, the email service device can be configured with only M volume ranges, each representing at least two createable email queues. When the email service device receives an email from an external domain whose volume falls within a certain volume range, but no corresponding external domain email queue exists, it can create the external domain email queue and add the email to it. By combining volume ranges and email type to divide email queues, the resource consumption for email transmission in different queues varies significantly. Therefore, in situations of drastically reduced resource utilization or resource scarcity, resources can be quickly released by pausing email transmission for a specific queue (such as one with high resource consumption), thereby improving resource utilization. Furthermore, since emails in the queues are ordered, even if transmission is interrupted, it can be resumed in an orderly manner, ensuring that email transmission performance is minimally affected by transmission interruptions.
[0081] S203. Based on the lower bound of the target volume range, create a mail transmission task for the target mail queue, and start a reference number of coroutines to execute the mail transmission task concurrently. The reference number and the lower bound of the range are negatively correlated.
[0082] In a specific embodiment, the email service device can create email transmission tasks at the email queue level. These tasks are used to transmit emails in the email queue concurrently using coroutines. In other words, when an email to be transmitted is added to the target email queue, the email transmission task created for that queue can instruct a reference number of coroutines to be enabled for concurrent transmission of emails in the target queue. The reference number is the number of concurrent coroutines, and it is typically an integer greater than 1.
[0083] In one exemplary implementation, the number of coroutine concurrency is negatively correlated with the lower bound of the volume range corresponding to the email queue. That is, the lower bound of the target volume range is negatively correlated with the number of coroutines corresponding to the email transmission tasks of the target email queue. Here, the lower bound refers to the minimum value of the range; for example, for a volume range [1Mb, 10Mb], the lower bound is 1Mb. This avoids a single data transmission task consuming excessive transmission resources, thereby maintaining the stability of the email transmission function.
[0084] In practical applications, at least one email delivery task can be created for each email queue, with each task having the same number of concurrent coroutines. In this case, the number of concurrent coroutines can also be related to the number of tasks to ensure that transmitting emails to a single email queue does not consume excessive transmission resources. As an example, the email service device can configure the relationship between the number of tasks and the number of coroutines for each volume range's lower bound. The number of coroutines corresponding to the same number of tasks at different lower bounds is negatively correlated with the corresponding lower bound.
[0085] Therefore, when an email service device needs to determine the number of concurrent coroutines for a target email queue, it can first obtain the total number of emails in the target email queue, and then determine the number of email transmission tasks corresponding to the target email queue based on the total number of emails and the maximum rated transmission number of a single email transmission task. Then, the number of coroutines associated with the number of tasks below the lower bound of the target volume range is used as the number of concurrent coroutines for a single email transmission task corresponding to the target email queue.
[0086] The main implementation process of this application embodiment is as follows: after obtaining the email to be transmitted, it is added to the email queue associated with the corresponding volume range based on the email volume of the email to be transmitted. Then, an email transmission task is created for the email queue. Based on the principle that the number of coroutine concurrency is negatively correlated with the lower limit of the volume range, at least two coroutines are enabled to execute the email transmission task concurrently. This enables the concurrent transmission of each email in the email queue. This allows smaller emails to be delivered quickly and with low power consumption through a larger number of coroutines, and ensures that when larger emails are transmitted, there will be no sharp consumption or excessive occupation of corresponding resources. This ensures the resource utilization rate of the email transmission system or device, thereby improving the stability and robustness of email transmission performance.
[0087] Based on the above Figure 2 The email transmission method shown in this application embodiment also provides another email transmission method, the schematic flowchart of which can be found in [reference needed]. Figure 3 And it can still be performed by the aforementioned email service equipment. For example... Figure 3 The method may include steps S301-S305:
[0088] S301. Obtain the email to be transmitted and its size.
[0089] In specific embodiments, the relevant implementation methods of step S301 can be referred to the embodiments in step S201 above, and will not be repeated here.
[0090] S302. Based on the target volume range to which the email volume belongs, and the preset association between the volume range and the email queue, determine the email queue associated with the target volume range. Each volume range is associated with email queues under different domain types, including external domain types and internal domain types.
[0091] In a specific embodiment, as described above... Figure 2 As mentioned, emails to be transmitted can be divided into internal domain emails and external domain emails, and email queues can also be divided into external domain email queues and internal domain email queues. Internal domain emails should be added to the internal domain email queue corresponding to the target volume range, while external domain emails should be added to the external domain email queue corresponding to the target volume range.
[0092] S303. Obtain the domain name type of the receiving address of the email to be transmitted.
[0093] In a specific embodiment, the receiving address is the email address of the recipient, and the domain type refers to either an external domain or an internal domain.
[0094] S304. Select the email queue in the email queue associated with the target volume range that corresponds to the domain name type of the receiving address as the target email queue, and add the email to be transmitted to the target email queue.
[0095] In a specific embodiment, the email service device executes steps S302 to S304 to add internal domain emails to the internal domain email queue corresponding to the target volume range and to add external domain emails to the external domain email queue corresponding to the target volume range.
[0096] By dividing email queues based on size range and email type, internal and external domain emails can be isolated in email delivery tasks. Based on this, and following the principle that the lower bound of the size range corresponding to the email queue is negatively correlated with the number of concurrent coroutines, the number of concurrent coroutines for each email queue can be determined. This ensures that when delivering large emails or emails from external domains, there will be no sharp consumption or excessive occupation of corresponding resources, thereby ensuring the resource utilization rate of the email transmission system or equipment and improving the stability of email transmission performance.
[0097] S305. Based on the lower bound of the target volume range, create a mail transmission task for the target mail queue, and start a reference number of coroutines to execute the mail transmission task concurrently. The reference number and the lower bound of the range are negatively correlated.
[0098] In a specific embodiment, when the email service device needs to execute the email transmission task of the target email queue, it can first create a reference number of coroutines, then allocate the target emails to be transmitted to each coroutine in turn from the target email queue, and then control each coroutine to transmit the allocated target emails.
[0099] When the domain type corresponding to the target email queue is an internal domain, each goroutine can directly send the assigned target email to the corresponding receiving address. If a goroutine fails to send an email, the resources occupied by that goroutine can be released (i.e., goroutine resources are released), allowing those resources to be used to transmit other emails, thereby improving resource utilization.
[0100] When the domain type corresponding to the target email queue is an external domain, each goroutine can obtain the email transmission permission associated with the receiving domain before officially transmitting the target email. The email transmission permission indicates whether it is allowed to transmit emails under the receiving domain within the current time period. If the email transmission permission indicates that transmission of emails under the receiving domain is allowed within the current time period, the target email is sent according to the email transmission rate pre-configured for that receiving domain. If the email transmission permission obtained by a goroutine indicates that transmission of emails under the receiving domain is not allowed within the current time period, the email service device can also release the goroutine resources occupied by that goroutine.
[0101] In one exemplary implementation, the email transmission permission associated with a receiving domain can be determined based on the load status of the receiving server corresponding to that domain. Specifically, when the email service device needs to determine the email transmission permission for a particular receiving domain, it first obtains the current load status of the receiving server corresponding to that domain. If the current load status is not overloaded, the email transmission permission for that receiving domain is determined as the first permission, which indicates that emails under that receiving domain are allowed to be transmitted within the current time period. If the current load status is overloaded, the resource occupancy status of that receiving domain in the email service device can be further obtained to determine the email transmission permission associated with that receiving domain based on the resource occupancy status.
[0102] The current load status refers to the load status obtained within the current load detection period. This load status can be determined based on one or more of the following: the GPU utilization rate, CPU utilization rate, and transmission latency or queuing time when sending emails to the receiving server. There are no restrictions here. For example, the receiving server may be considered overloaded when the GPU or CPU utilization rate reaches a certain threshold (e.g., 90%), or when the queuing time for emails under the receiving domain exceeds a certain threshold (e.g., 5 seconds).
[0103] In addition, resource occupancy status indicates whether the receiving domain is over-consuming resources (i.e., whether it is consuming too many resources). The resources occupied by a receiving domain can be understood as the resources consumed in sending emails to the receiving addresses under that domain. In practical applications, resource occupancy status can be determined based on the email delivery volume and email transmission time corresponding to that receiving domain in the email service device.
[0104] Taking the determination of the resource occupancy status of a target receiving domain as an example, the email service device can count the total number of delivered emails (including failed deliveries) and the total time spent on delivering emails, thus obtaining the total number of emails delivered and the total email transmission time of the email service device. In addition, the email service device can also count the number of emails with the target receiving domain among the delivered emails and their transmission time, thus obtaining the email delivery volume and transmission time corresponding to the target receiving domain in the email service device. Then, based on the first ratio between the email delivery volume and the total number of emails delivered, and the second ratio between the email transmission time and the total email transmission time, the resource occupancy status corresponding to the target receiving domain is determined.
[0105] For example, the email service device can determine the resource occupancy status of the target receiving domain name as a first state when either the first ratio or the second ratio is greater than a corresponding threshold, and determine the resource occupancy status of the target receiving domain name as a second state when both the first ratio and the second ratio are less than or equal to the corresponding threshold. The first state indicates that the target receiving domain name is over-consuming resources, and the second state indicates that the target receiving domain name is not over-consuming resources.
[0106] In one implementation, when the resource occupancy status of the receiving domain indicates that the receiving domain is not over-consuming resources, the email transmission permission associated with the receiving domain can be configured as the first permission. This first permission is the same as the previously defined one, indicating that emails under the receiving domain are allowed to be transmitted within the current time period. When the resource occupancy status indicates that the receiving domain is over-consuming resources, the email transmission rate corresponding to the receiving domain can be further obtained, and the email transmission permission associated with the receiving domain can be determined based on the email transmission rate and a preset transmission rate.
[0107] The email transmission rate indicates the rate at which emails are sent to the receiving server corresponding to the receiving domain. When the email transmission rate is greater than the preset transmission rate, the email service device determines the email transmission permission as the first permission; when the email transmission rate is less than the preset transmission rate, the email transmission permission is determined as the second permission, which indicates that the transmission of emails under the receiving domain is not allowed within the current time period.
[0108] In one optional implementation, the email transmission rate corresponding to each receiving domain in the email service device can be dynamically updated periodically according to a "fast rejection, slow recovery" strategy. Taking the target receiving domain as an example, the specific principle of the "fast rejection, slow recovery" strategy applied by the email service device can be as follows: When it is necessary to update the email transmission rate of the target receiving domain, first obtain the load status of the receiving server corresponding to the target receiving domain in the current detection period and the previous detection period, obtaining the current load status and historical load status. Then, based on the historical load status and the current load status, determine the adjustment direction and adjustment range of the email transmission rate, and then update the email transmission rate corresponding to the target receiving domain according to this adjustment direction and adjustment range.
[0109] For example, the email service device can determine the adjustment direction based on the current load state and the adjustment magnitude based on historical load states. Specifically, when the current load state is overloaded, the adjustment direction can be downward. In this case, if the historical load state was not overloaded, the adjustment magnitude is determined as a first adjustment magnitude (e.g., 20%); if the historical load state was also overloaded, the adjustment magnitude is determined as a second adjustment magnitude (e.g., 5%), where the second adjustment magnitude is smaller than the first adjustment magnitude. When the current load state is not overloaded, the adjustment direction can be upward. In this case, if the historical load state was not overloaded, the adjustment magnitude of the email transmission rate is determined as a third adjustment magnitude (e.g., 2%), where the third adjustment magnitude is smaller than the second adjustment magnitude; if the historical load state was overloaded, the adjustment magnitude of the email transmission rate is determined as a fourth adjustment magnitude (e.g., 1%), where the fourth adjustment magnitude is smaller than the third adjustment magnitude.
[0110] By updating the email transmission rate with a significant decrease when the receiving server transitions from an overloaded to an underloaded state (i.e., "fast rejection"), the available resources for that receiving domain in the email service equipment can be quickly reduced, effectively alleviating the load on the receiving server and the email service equipment. In this case, combining this with a strategy of updating the email transmission rate with a smaller decrease when the receiving server remains overloaded can continuously alleviate the load on the receiving server, thereby gradually improving the efficiency of the email service equipment in delivering emails to that server. If the receiving server transitions from an overloaded to an underloaded state or remains underloaded, the email transmission rate can be slightly increased (i.e., "slow recovery") to improve the email transmission efficiency of the email service equipment.
[0111] Since the equipment resources required for delivery to internal and external domains differ, and the receiving servers in different external domains have varying load performance, when an external domain's receiving server becomes overloaded, leading to increased delivery time, adjusting the email transmission rate can effectively reduce the performance impact of this overload on the email service, thereby ensuring the stability and delivery efficiency of the email service. Combining the aforementioned methods for updating the email transmission rate and determining the number of concurrent coroutines allows for flexible adjustment of both the number of concurrent coroutines and the email transmission rate during the email delivery process. Therefore, even if a sudden surge in sending requests occurs, the email service equipment can deliver emails with the highest possible efficiency while ensuring equipment performance.
[0112] The main implementation process of this application embodiment is as follows: after obtaining the email to be transmitted, it is added to the corresponding email queue based on the email size and email type. Then, an email transmission task is created for the email queue. Based on the principle that the number of concurrent coroutines is negatively correlated with the lower bound of the volume range, at least two coroutines are enabled to concurrently execute the email transmission task, thereby achieving concurrent transmission of each email in the email queue. When sending emails to external domains, each coroutine can deliver the email according to the email transmission rate configured for the receiving domain name. The email transmission rate can be dynamically adjusted based on the load changes of the receiving server using a "fast rejection, slow recovery" strategy. This can ensure that the email transmission for each receiving domain name does not suffer from excessively long transmission queuing time or low coroutine resource utilization, which is equivalent to improving resource utilization and email transmission efficiency.
[0113] To facilitate a clearer understanding of the relevant technical implementation process by those skilled in the art, this application also provides an email transmission process in conjunction with specific examples and accompanying drawings. In this example, it is assumed that the emails to be transmitted can be divided into two types: external domain emails and internal domain emails, and their size ranges are two, such as [0, 100MB] and [100MB, ∞), where [0, 100MB] corresponds to a small email queue and [100MB, ∞) corresponds to a large email queue. Therefore, the email transmission service architecture can be exemplarily as follows: Figure 4 The intranet mail transmission process can be exemplified as follows: Figure 5 The external domain mail transfer process can be exemplified as follows: Figure 6 .
[0114] First, please see Figure 4 The email service architecture mainly consists of a sending client, an email service device, and an external domain receiving server. The sending client, which can be a web browser or an email client, is primarily used to send sending requests to the email service device. The email service device, based on the email size and type specified in the sending request, sends the email to the corresponding receiving address. The external domain receiving server provides email services for at least one receiving domain, including email receiving, email storage, and email distribution.
[0115] In one exemplary implementation, the email service device may further include four functional modules: an email storage unit, an internal domain email distributor, an external domain email distributor, and an email resource controller. By coordinating and controlling these modules, it is possible to receive sending requests from senders, write emails from the sending requests into the corresponding email queues according to email size and type, and perform concurrent transmission of emails in the email queues via multiple coroutines. The working principles of each functional module are briefly explained below:
[0116] Email storage is primarily used to store email components such as the email body, attachments, index, and header data.
[0117] An internal domain mail distributor primarily consists of internal domain type mail queues and corresponding delivery clusters for each mail queue. These delivery clusters are used for internal domain delivery of emails from the corresponding mail queues, such as writing emails to the storage space corresponding to the receiving address. The delivery cluster can be understood as a resource cluster composed of at least two coroutines.
[0118] An external domain mail distributor primarily consists of external domain type mail queues and their corresponding delivery clusters. These delivery clusters are used for cross-domain delivery of emails within the respective mail queues. For example, the delivery cluster can deliver emails to the receiving server belonging to the receiving domain using the Simple Mail Transfer Protocol (SMTP). Similarly, a delivery cluster can be understood as a resource cluster composed of at least two coroutines.
[0119] The email resource controller is primarily used to detect whether the mail receiving servers corresponding to each receiving domain are overloaded, and to collect transmission record data between the email service device and each receiving domain within a certain period. This transmission record data can include email transmission duration, number of emails received, total email transmission duration of the email service device, and total number of emails delivered for each receiving domain. Furthermore, the email resource controller can also store transmission configuration information such as email transmission permissions and transmission rates for each receiving domain. Both email transmission rate and email transmission permissions can be determined based on the collected transmission record data, and the email transmission rate can be dynamically updated using a "fast reject, slow recovery" approach by polling and checking the overload status of the mail receiving servers corresponding to each receiving domain.
[0120] For example, the rules for updating email transmission rates could be as follows: when the receiving server changes from a non-overloaded state to an overloaded state, a fast rejection policy is activated, reducing the email transmission rate by 20%; when the receiving server remains overloaded, the email transmission rate is continuously reduced, but the reduction must be less than the initial reduction, such as reducing it by 10% or 2% here if the initial reduction was 20%; when the receiving server is in a non-overloaded state, the email transmission rate can be increased by 1%.
[0121] The configuration rules for email delivery permissions can be as follows: When the mail receiving server of a certain receiving domain is overloaded, based on a first ratio between the number of emails received by that receiving domain and the total number of emails delivered by the mail service device, and a second ratio between the email delivery time of that receiving domain and the total email delivery time of the mail service device, it is determined whether the receiving domain is occupying too many device resources. If it is occupying too many device resources, then it is determined whether delivery delay is needed (i.e., whether to allow delivery of emails under that receiving domain in the current time period) based on the current email delivery rate. For example, if a receiving domain occupies too many device resources, but the email delivery rate is greater than a certain threshold, it indicates that the load on the mail service device can be alleviated by reducing the email delivery rate. Therefore, the email delivery permission for that receiving domain can be configured to not require delivery delay. Conversely, if a receiving domain occupies too many device resources, and the email delivery rate is less than a certain threshold, then the email delivery permission needs to be configured to require delivery delay to quickly alleviate the load on the mail service device.
[0122] Based on the above description, it is not difficult to understand that, Figure 4 Under the illustrated email transmission service architecture, the main process of email transmission can be as follows: the sending end sends an email transmission request to the email service device, the email service device receives the email transmission request and obtains the email to be transmitted in the email transmission request, then determines the email type of the email based on the receiving domain name of the email to be transmitted, and then adds the email to be transmitted to the corresponding email queue according to the email type and email size, and then controls the delivery cluster corresponding to the email queue to deliver the email in the email queue.
[0123] As an example implementation, when transmitting intradomain emails, the email service device can use methods such as... Figure 5 The internal mail delivery process is shown for delivery. For example... Figure 5 In steps S501-S505, after receiving a sending request (S501) indicating the transmission of an internal domain email (the original email), the email service device can store the attachments of the internal domain email in the email storage (S502). Then, based on the non-attachment data of the internal domain email and the attachment indication information obtained after storing the attachments, it generates an email to be transmitted. The email to be transmitted is then added to the corresponding internal domain email queue according to its size (S503). The device then calculates the number of coroutines required for delivery to the email queue and creates a sending task for the email queue based on this number of coroutines (S504). Finally, the task is executed concurrently by enabling a corresponding number of coroutines (S505), and the result of the task execution is that the components of the email to be transmitted are stored in the email storage.
[0124] Similarly, as an example implementation, when transmitting emails to external domains, the email service device can adopt methods such as... Figure 6 The illustrated external domain mail delivery process is used for delivery. For example... Figure 6 In steps S501-S606, after receiving a sending request indicating the transmission of external domain emails (the original emails) (i.e., S601), the email service device can obtain the external domain emails to be transmitted from the discovery request. Then, according to the size of the email to be transmitted, it adds the email to the corresponding external domain email queue (i.e., S602), calculates the number of coroutines required for delivery to the email queue, and creates a sending task for the email queue based on this number of coroutines (i.e., S603). Then, it executes the task concurrently by enabling the appropriate number of coroutines (i.e., S604). During task execution, the coroutines first query the email controller for the email transmission permissions of the receiving domain to determine whether emails can be sent to that receiving domain (i.e., S605). If it is determined that emails under the receiving domain can be sent, the email to be transmitted is sent to the external receiving server corresponding to the receiving domain via the SMTP protocol (i.e., S606).
[0125] In this embodiment, the email service device divides the emails to be transmitted into different email queues according to their size (equivalent to the resource size required to deliver the email). This effectively isolates emails with significantly different sizes. Based on this, sending tasks are created differently for each email queue, ensuring that the number of coroutines used for sending tasks in large email queues differs from that in small email queues. This achieves flexible utilization of bandwidth and device resources. Furthermore, the number of coroutines used in large email queues is lower than that in small email queues, which also minimizes the consumption of excessive device resources by large email delivery tasks, thereby improving resource utilization and the overall stability of the email transmission service.
[0126] Based on the aforementioned method embodiments, this application also provides an email transmission apparatus that can be used to perform the above-described... Figure 2 or Figure 3 The described method embodiments include some or all of the functionalities. Specifically, please refer to section 7. Figure 7 One structure of the device is shown. Figure 7 The device may include an acquisition unit 701, a queue allocation unit 702, and a mail transmission unit 703, wherein:
[0127] The acquisition unit 701 is used to acquire the email to be transmitted and the email volume of the email to be transmitted;
[0128] The queue allocation unit 702 is used to add the email to be transmitted to the target email queue associated with the target volume range based on the target volume range to which the email volume belongs and the preset association relationship between the volume range and the email queue.
[0129] The email transmission unit 703 is used to create an email transmission task for the target email queue based on the lower bound of the target volume range, and to start a reference number of coroutines to execute the email transmission task concurrently, wherein the reference number is negatively correlated with the lower bound of the range.
[0130] In one implementation, each volume range is associated with a mail queue under a different domain type, including external domain types and internal domain types; when the queue allocation unit 701 adds the email to be transmitted to the target mail queue associated with the target volume range based on the target volume range to which the email volume belongs and the preset association relationship between the volume range and the mail queue, it can specifically perform the following:
[0131] Based on the target volume range to which the email volume belongs, and the preset association between the volume range and the email queue, determine the email queue associated with the target volume range.
[0132] Obtain the domain name type of the receiving address of the email to be transmitted;
[0133] The email queue corresponding to the domain name type of the receiving address in the email queue associated with the target volume range is taken as the target email queue, and the email to be transmitted is added to the target email queue.
[0134] In another embodiment, when the email transmission unit 703 initiates a reference number of coroutines to concurrently execute the email transmission task, it may specifically perform the following:
[0135] Create the reference number of coroutines, and sequentially allocate the target emails that need to be transmitted to each coroutine from the target email queue;
[0136] When the domain name type corresponding to the target email queue is the external domain type, each coroutine is controlled to transmit the target email based on the email transmission permission associated with the receiving domain name of the assigned target email. The email transmission permission is used to indicate whether it is allowed to transmit emails under the receiving domain name in the current time period.
[0137] When the domain name type corresponding to the target email queue is the internal domain type, control each coroutine to send the assigned target email to the corresponding receiving address.
[0138] In another embodiment, when the email transmission unit 703 controls the email transmission permissions associated with the assigned target email's receiving domain name to transmit the target email, it may specifically perform the following:
[0139] If the email transmission permission indicator allows the transmission of emails under the receiving domain name within the current time period, then the target email is sent according to the email transmission rate pre-configured for the receiving domain name;
[0140] If the email transmission permission indicator does not allow the transmission of emails under the receiving domain name within the current time period, then release the coroutine resources.
[0141] In yet another embodiment, the email transmission unit 703 can also be used to perform:
[0142] Obtain the current load status of the receiving server corresponding to the receiving domain name;
[0143] If the current load status is overloaded, then obtain the resource usage status of the receiving domain name in the email service device;
[0144] Based on the resource occupancy status, determine the email transmission permissions associated with the receiving domain name.
[0145] In another embodiment, when the email transmission unit 703 obtains the resource occupancy status of the receiving domain name in the email service device, it may specifically perform the following:
[0146] Obtain the email delivery volume and email transmission time corresponding to the receiving domain name in the email service device;
[0147] Obtain the total number of emails delivered and the total email transmission time of the email service device;
[0148] The resource occupancy status is determined based on a first ratio between the number of emails delivered and the total number of emails delivered, and a second ratio between the email transmission time and the total email transmission time.
[0149] In another embodiment, when the email transmission unit 703 determines the email transmission permissions associated with the receiving domain name based on the resource occupancy status, it may specifically perform the following:
[0150] If the resource occupancy status indicates that the receiving domain name has not exceeded its resource occupancy limit, then the email transmission permission associated with the receiving domain name is configured as the first permission. The first permission is used to indicate that emails under the receiving domain name are allowed to be transmitted within the current time period.
[0151] If the resource occupancy status indicates that the receiving domain name is consuming excessive resources, then the email transmission rate corresponding to the receiving domain name is obtained, and the email transmission permission associated with the receiving domain name is determined based on the email transmission rate and the preset transmission rate.
[0152] Wherein, when the email transmission rate is greater than the preset transmission rate, the email transmission permission is the first permission; when the email transmission rate is less than the preset transmission rate, the email transmission permission is the second permission, which is used to indicate that the transmission of emails under the receiving domain name is not allowed within the current time period.
[0153] In yet another embodiment, the email transmission unit 703 can also be used to perform:
[0154] Obtain the load status of the receiving server corresponding to the receiving domain name in the current detection period to obtain the current load status, and obtain the load status of the receiving server in the previous detection period to obtain the historical load status.
[0155] Based on the historical load status and the current load status, determine the direction and magnitude of the email transmission rate adjustment;
[0156] The email transmission rate of the receiving domain name is updated according to the adjustment direction and the adjustment range.
[0157] In another embodiment, when the email transmission unit 703 determines the adjustment direction and adjustment range of the email transmission rate based on the historical load state and the current load state, it may specifically perform the following:
[0158] When the current load state is overloaded, the adjustment direction of the email transmission rate is determined to be downward.
[0159] If the historical load state is not overloaded, then the adjustment range of the email transmission rate is determined as the first adjustment range.
[0160] If the historical load status is an overload status, then the adjustment range of the email transmission rate is determined as a second adjustment range, which is smaller than the first adjustment range.
[0161] In another embodiment, when the email transmission unit 703 determines the adjustment direction and adjustment range of the email transmission rate based on the historical load state and the current load state, it may specifically perform the following:
[0162] When the current load state is not overloaded, the adjustment direction of the email transmission rate is determined to be upward.
[0163] If the historical load state is a non-overload state, then the adjustment range of the email transmission rate is determined as the third adjustment range, which is less than the second adjustment range;
[0164] If the historical load status is an overload status, then the adjustment range of the email transmission rate is determined as the fourth adjustment range, which is smaller than the third adjustment range.
[0165] In one embodiment, Figure 7 Each unit in the illustrated device can be individually or entirely combined into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. In other words, the above units are based on logical functional division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, Figure 7 The device shown may also include other units, and in practical applications, these functions may also be implemented with the assistance of other units, and may be implemented by multiple units working together.
[0166] According to another embodiment of this application, the following can be executed by running on a computing device including processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). Figure 2 or Figure 3 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 7 The apparatus shown. A computer program may be recorded on, for example, a computer-readable storage medium, loaded onto the apparatus via the computer-readable storage medium, and executed therein.
[0167] Based on the descriptions of the above method and device embodiments, this application also provides an email service device (hereinafter referred to as a testing device). This email service device may include a testing process and an interaction process, and the testing process is configured with a process interaction interface. Specifically, please refer to... Figure 8 , Figure 8 This is a schematic diagram of the structure of an email service device provided in an embodiment of this application, as shown below. Figure 8 As shown, the email service device may include a processor 801, a memory 802, and a communication interface 803, and the processor 801, memory 802, and communication interface 803 may be connected by a bus or other means.
[0168] The processor 801 (or Central Processing Unit, CPU) is the computing and control core of the mail service device. It can parse various instructions and process various data within the mail service device. For example, the CPU can parse email transmission requests and control the mail service device to execute corresponding email transmission tasks; the CPU can also transmit program instructions and other information between internal structures of the mail service device, and so on.
[0169] Memory 802 is a memory device in the mail service equipment used to store programs and data. It can be understood that memory 802 here can include both the built-in memory of the mail service equipment and any extended memory supported by the mail service equipment.
[0170] The communication interface 803 may optionally include a standard wired interface or a wireless interface (such as Wi-Fi, mobile communication interface, etc.), and can be used to send and receive data under the control of the processor 801; the communication interface 803 can also be used for the transmission and interaction of data within the email service device.
[0171] In a specific embodiment, the processor 801 may load and execute one or more computer programs stored in the memory 802 to implement the steps in the method described in the above embodiments.
[0172] This application embodiment also provides a computer-readable storage medium (Memory), which is a memory device in an email service device for storing programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the email service device and extended storage media supported by the email service device. The computer-readable storage medium provides storage space that stores the processing system of the email service device. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by the processor 801, which can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM memory or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one readable storage medium located remotely from the aforementioned processor.
[0173] This application also provides a computer program product, which includes computer instructions, and the processor of the mail service device can execute the above-described method embodiments by loading the computer instructions.
[0174] Based on the same inventive concept, the principles and beneficial effects of the devices, email service equipment, computer-readable storage media and computer program products provided in the embodiments of this application are similar to those described in the foregoing corresponding method embodiments. Therefore, the corresponding method implementation principles and beneficial effects can be referred to, which will not be repeated here for the sake of brevity.
[0175] It should be further noted that the steps in the methods of this application embodiment can be adjusted, merged, and deleted according to actual needs, and the modules in the device of this application embodiment can be merged, divided, and deleted according to actual needs. Furthermore, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. It should also be particularly emphasized that when the above embodiments of this application are applied to specific products or technologies, the data acquisition involved in each specific implementation of this application requires the permission or consent of the relevant parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0176] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Those skilled in the art will understand that all or part of the processes for implementing the above embodiments, and equivalent variations made in accordance with the claims of this application, still fall within the scope of this application.
Claims
1. A mail transmission method characterized by comprising: include: Obtain the email to be transmitted and its volume; Based on the target volume range to which the email volume belongs, and the preset association between the volume range and the email queue, the email to be transmitted is added to the target email queue associated with the target volume range. Based on the lower bound of the target volume range, a mail transmission task for the target mail queue is created, and a reference number of coroutines are started to execute the mail transmission task concurrently. The reference number is negatively correlated with the lower bound of the range.
2. The method of claim 1, wherein, Each volume range is associated with a mail queue under a different domain type, including external domain types and internal domain types; adding the email to be transmitted to the target mail queue associated with the target volume range based on the target volume range to which the email volume belongs and the preset association relationship between the volume range and the mail queue includes: Based on the target volume range to which the email volume belongs, and the preset association between the volume range and the email queue, determine the email queue associated with the target volume range. Obtain the domain name type of the receiving address of the email to be transmitted; The email queue corresponding to the domain name type of the receiving address in the email queue associated with the target volume range is taken as the target email queue, and the email to be transmitted is added to the target email queue.
3. The method of claim 2, wherein, The step of initiating a reference number of coroutines to concurrently execute the email transmission task includes: Create the reference number of coroutines, and sequentially allocate the target emails that need to be transmitted to each coroutine from the target email queue; When the domain name type corresponding to the target email queue is the external domain type, each coroutine is controlled to transmit the target email based on the email transmission permission associated with the receiving domain name of the assigned target email. The email transmission permission is used to indicate whether it is allowed to transmit emails under the receiving domain name in the current time period. When the domain name type corresponding to the target email queue is the internal domain type, control each coroutine to send the assigned target email to the corresponding receiving address.
4. The method of claim 3, wherein, The control of each coroutine to transmit the target email based on the email transmission permissions associated with the assigned target email's receiving domain name includes: If the email transmission permission indicator allows the transmission of emails under the receiving domain name within the current time period, then the target email is sent according to the email transmission rate pre-configured for the receiving domain name; If the email transmission permission indicator does not allow the transmission of emails under the receiving domain name within the current time period, then release the coroutine resources.
5. The method of claim 3, wherein, The method is performed by an email service device, and the method further includes: Obtain the current load status of the receiving server corresponding to the receiving domain name; If the current load status is overloaded, then obtain the resource usage status of the receiving domain name in the email service device; Based on the resource occupancy status, determine the email transmission permissions associated with the receiving domain name.
6. The method of claim 5, wherein, The step of obtaining the resource usage status of the receiving domain name in the email service device includes: Obtain the email delivery volume and email transmission time corresponding to the receiving domain name in the email service device; Obtain the total number of emails delivered and the total email transmission time of the email service device; The resource occupancy status is determined based on a first ratio between the number of emails delivered and the total number of emails delivered, and a second ratio between the email transmission time and the total email transmission time.
7. The method according to claim 5 or 6, characterized in that, The step of determining the email transmission permissions associated with the receiving domain name based on the resource occupancy status includes: If the resource occupancy status indicates that the receiving domain name has not exceeded its resource occupancy limit, then the email transmission permission associated with the receiving domain name is configured as the first permission. The first permission is used to indicate that emails under the receiving domain name are allowed to be transmitted within the current time period. If the resource occupancy status indicates that the receiving domain name is consuming excessive resources, then the email transmission rate corresponding to the receiving domain name is obtained, and the email transmission permission associated with the receiving domain name is determined based on the email transmission rate and the preset transmission rate. Wherein, when the email transmission rate is greater than the preset transmission rate, the email transmission permission is the first permission; when the email transmission rate is less than the preset transmission rate, the email transmission permission is the second permission, which is used to indicate that the transmission of emails under the receiving domain name is not allowed within the current time period.
8. The method of claim 4, wherein, The method further includes: Obtain the load status of the receiving server corresponding to the receiving domain name in the current detection period to obtain the current load status, and obtain the load status of the receiving server in the previous detection period to obtain the historical load status. Based on the historical load status and the current load status, determine the direction and magnitude of the email transmission rate adjustment; The email transmission rate of the receiving domain name is updated according to the adjustment direction and the adjustment range.
9. The method of claim 8, wherein, The step of determining the direction and magnitude of email transmission rate adjustment based on the historical load status and the current load status includes: When the current load state is overloaded, the adjustment direction of the email transmission rate is determined to be downward. If the historical load state is not overloaded, then the adjustment range of the email transmission rate is determined as the first adjustment range. If the historical load status is an overload status, then the adjustment range of the email transmission rate is determined as a second adjustment range, which is smaller than the first adjustment range.
10. The method according to claim 8 or 9, characterized in that, The step of determining the direction and magnitude of email transmission rate adjustment based on the historical load status and the current load status includes: When the current load state is not overloaded, the adjustment direction of the email transmission rate is determined to be upward. If the historical load state is a non-overload state, then the adjustment range of the email transmission rate is determined as the third adjustment range, which is less than the second adjustment range; If the historical load status is an overload status, then the adjustment range of the email transmission rate is determined as the fourth adjustment range, which is smaller than the third adjustment range.
11. A mail transport apparatus characterized by comprising: include: The acquisition unit is used to acquire the email to be transmitted and the size of the email to be transmitted; The queue allocation unit is used to add the email to be transmitted to the target email queue associated with the target volume range based on the target volume range to which the email volume belongs and the preset association relationship between the volume range and the email queue. The email transmission unit is used to create an email transmission task for the target email queue based on the lower bound of the target volume range, and to start a reference number of coroutines to execute the email transmission task concurrently, wherein the reference number is negatively correlated with the lower bound of the range.
12. A mail service apparatus characterized by comprising: include: A memory, wherein a computer program is stored; A processor for loading the computer program to implement the method as described in any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The computer storage medium stores a computer program adapted to be loaded by a processor and executed as described in any one of claims 1-10.
14. A computer program product, characterised in that, The computer program product includes computer instructions, and the processor of the computer device reads the computer instructions and executes the method as described in any one of claims 1-10.