Mail sending method and device, mail receiving method and device, equipment, medium and product

By employing shared memory and hybrid protocol communication in a multi-node database cluster, the problems of excessive physical links and bandwidth consumption caused by TCP communication are solved, thus improving communication efficiency.

CN120915757APending Publication Date: 2025-11-07SHANGHAI DAMENG DATABASE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511151574.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

In multi-node database clusters, traditional TCP communication leads to a sharp increase in the number of physical links, affecting communication performance. Especially when communicating between nodes on the same machine, data is copied multiple times through the network card, consuming network bandwidth and severely impacting communication efficiency.

Method used

A hybrid communication approach based on shared memory and protocols is adopted, with physical links between sites and shared memory communication within sites, reducing the creation of physical links and bandwidth consumption, and improving communication performance.

Benefits of technology

By reducing physical links and bandwidth usage, the cost of cluster communication is reduced, and communication performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120915757A_ABST
    Figure CN120915757A_ABST
Patent Text Reader

Abstract

The invention discloses a mail sending method and device, a mail receiving method and device, equipment, a medium and a product. The mail sending method is applied to a client, and comprises the following steps: applying for a current user mailbox identifier from a network service process, and determining a mailbox address in a shared memory of a site where a current user is located according to the current user mailbox identifier; filling an email applied from the shared memory with information to obtain a target email, wherein the target email is associated with the email address through the filling information; and adding the target mail into a mail chain table corresponding to the network service process in the shared memory, and notifying a server corresponding to the network service process to receive the target mail. According to the technical scheme, a hybrid communication mode based on the shared memory and the protocol is adopted, different sites can communicate in a protocol physical link mode, and the sites can communicate in the shared memory, so that physical links created in the communication process are reduced, the bandwidth occupied by mail transmission is reduced, the communication cost of a cluster is reduced, and the communication efficiency is improved. And communication performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer, and in particular, to a mail sending method and device, a mail receiving method and device, equipment, medium and product. BACKGROUND

[0002] In a multi-node database cluster (such as a one-master multi-backup database system, a distributed database, a shared storage cluster, or a multi-tenant cluster), multiple database instance nodes are usually deployed on multiple physical machines, and multiple instances can also be deployed on each machine at the same time, and network communication needs can exist between any nodes. If a traditional Transmission Control Protocol (TCP) communication is used, a socket physical link needs to be created between each node (i.e., each client), the number of links increases sharply, affecting communication performance; at the same time, nodes on the same machine also use TCP communication, data passes through the network card, occupies network bandwidth, and is copied multiple times, which also seriously affects communication performance. SUMMARY

[0003] The present application provides a mail sending method and device, a mail receiving method and device, equipment, medium and product to reduce physical links and improve communication performance.

[0004] In a first aspect, embodiments of the present application provide a mail sending method applied to a client, comprising:

[0005] Applying for a current user mailbox identifier from a network service process and determining a mailbox address in a shared memory of a site where a current user is located according to the current user mailbox identifier;

[0006] Filling information into a mail applied from the shared memory to obtain a target mail, the target mail being associated with the mailbox address through the filled information;

[0007] Adding the target mail into a mail linked list corresponding to the network service process in the shared memory, and notifying a server corresponding to the network service process to receive the target mail.

[0008] In a second aspect, embodiments of the present application also provide a mail receiving method applied to a server, comprising:

[0009] Receiving a target mail in a mail linked list in a shared memory of a current site, the mailbox address corresponding to the target mail being an address in the shared memory;

[0010] Determining a site where a target user is located according to information of the target mail;

[0011] If the site where the target user is located is the current site, the target mail is added into the mail list or mailbox of the target user based on the shared memory;

[0012] If the site where the target user is located is not the current site, the target mail is sent to the target site through the TCP protocol, and the target site adds the target mail into the mail list of the target user in the shared memory of the target site.

[0013] In a third aspect, the embodiments of the present application further provide a mail sending device, comprising:

[0014] an application module, configured to apply for a mailbox identifier of a current user to a network service process and determine a mailbox address in a shared memory of a site where the current user is located according to the mailbox identifier of the current user;

[0015] a filling module, configured to fill information into a mail applied from the shared memory to obtain a target mail, the target mail being associated with the mailbox address through the filled information;

[0016] a sending module, configured to add the target mail into a mail list corresponding to the network service process in the shared memory, and notify a server corresponding to the network service process to receive the target mail.

[0017] In a fourth aspect, the embodiments of the present application further provide a mail receiving device, comprising:

[0018] a receiving module, configured to receive a target mail in a mail list in a shared memory of a current site, the mailbox address corresponding to the target mail being an address in the shared memory;

[0019] a determining module, configured to determine a site where a target user is located according to information of the target mail;

[0020] a first sending module, configured to, if the site where the target user is located is the current site, add the target mail into a mail list or mailbox of the target user based on the shared memory;

[0021] a second sending module, configured to, if the site where the target user is located is not the current site, send the target mail to the target site through the TCP protocol, and add the target mail into a mail list of the target user in a shared memory of the target site by the target site.

[0022] In a fifth aspect, the embodiments of the present application provide an electronic device, comprising:

[0023] one or more processors;

[0024] a storage device, configured to store one or more programs;

[0025] When the one or more programs are executed by the one or more processors, the one or more processors implement the mail sending method as described in the first aspect.

[0026] In a sixth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the mail sending method as described in the first aspect.

[0027] In a seventh aspect, the embodiments of the present application further provide a computer program product, which includes a computer program and / or instructions, and the computer program and / or instructions are executed by a processor to implement the mail sending method as described in any of the above embodiments.

[0028] The embodiments of the present application provide a mail sending method, a receiving method, an apparatus, a device, a medium and a product. The mail sending method is applied to a client and includes: applying for a current user mailbox identifier to a network service process and determining a mailbox address in a shared memory of a site where a current user is located according to the current user mailbox identifier; filling information into a mail applied from the shared memory to obtain a target mail, the target mail being associated with the mailbox address through the filled information; adding the target mail into a mail linked list corresponding to the network service process in the shared memory, and notifying a server corresponding to the network service process to receive the target mail. The above technical solution adopts a hybrid communication mode based on a shared memory and a protocol. Different sites can communicate in a protocol physical link mode, and sites can communicate in a shared memory, so that the physical link created in the communication process is reduced, the bandwidth occupied by the mail transmission is reduced, the communication cost of the cluster is reduced, and the communication performance is improved. BRIEF DESCRIPTION OF DRAWINGS

[0029] The above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, same or similar reference numerals can represent same or similar elements. It should be understood that the drawings are schematic, and the elements and features are not necessarily drawn to scale.

[0030] Figure 1 A flowchart of a mail sending method provided by the embodiments of the present application;

[0031] Figure 2 A flowchart of a mail receiving method provided by the embodiments of the present application;

[0032] Figure 3 An implementation flowchart of sending a mail between different users in a site provided by the embodiments of the present application;

[0033] Figure 4 An implementation flowchart of sending a target mail to other sites provided by the embodiments of the present application;

[0034] Figure 5 A structural schematic diagram of a mail sending device provided in an embodiment of the present application is shown in the figure.

[0035] Figure 6 A structural schematic diagram of a mail receiving device provided in an embodiment of the present application is shown in the figure.

[0036] Figure 7 A structural schematic diagram of an electronic device provided in an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0037] The present application will be further described below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are intended to be merely illustrative of the present application and not in limitation thereof. It should also be noted that, for the purpose of description, only the parts related to the present application are shown in the drawings rather than all the parts.

[0038] Before the exemplary embodiments are described in greater detail, it is noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the processes are described in a particular sequential order, many of the processes can be performed concurrently, in parallel, or simultaneously. In addition, the order of individual processes can be re-arranged. The processes can terminate when their operations are completed, but can also terminate in response to other events not depicted in the flowcharts. The processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0039] It should be noted that the terms "first", "second", and the like in the embodiments of the present application are merely used to distinguish different devices, modules, units, or other objects, and do not imply the order or interdependence of the functions performed by these devices, modules, units, or other objects.

[0040] In addition, the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0041] In the technical solutions of the present application, the acquisition, storage, use, processing, etc. of data all comply with the relevant provisions of national laws and regulations.

[0042] It should be noted that, in the embodiments of the present application, some industry existing solutions, components, models, etc. can be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but does not mean that the applicant has or will necessarily use the relevant content of the solutions.

[0043] Figure 1A flowchart of a mail sending method provided by an embodiment of the present application, which can be applied to the sending and receiving of mails between users. Specifically, the mail sending method can be executed by a mail sending device, which can be implemented in software and / or hardware and integrated in an electronic device. The electronic device mainly refers to the sending end of the mail, for example, a client, which includes but is not limited to a computer or a smart phone and other devices with data processing and transmission functions, and can also be a device deployed or connected to a database.

[0044] As shown in the method specifically includes the following steps: Figure 1

[0045] S110, apply for a current user mailbox identifier to a network service process and determine a mailbox address in a shared memory of a site where a current user is located according to the current user mailbox identifier.

[0046] For example, the network service process (NETSVR) can be understood as a process for managing mails and users in a site or a server, which can be used to create a shared memory (Shared Memory). The shared memory can be accessed by different processors, such as the processor of a client and the processor of a server. The NTSVR can also divide a mailbox area and a mail area, and allocate a corresponding mailbox identifier to each mailbox. The user (NETUSR) on the network service process can be a database instance, a data daemon or a monitor, etc. Generally, there can be one server and one or more clients in a site. The current user can be understood as a user sending mails by using a client, and the target user can be understood as the user of the final mail.

[0047] The NETUSR can apply for a mailbox identifier from the shared memory, so as to determine the mailbox address of the current user for sending and receiving mails according to the mailbox identifier, and can subsequently send and receive associated mails through the mailbox address. The mailbox identifier can be used to uniquely identify the current user for sending and receiving mails with other users. The mailbox (MBOX) can be understood as a virtual container, which is the final destination of mail sending. One NETUSR can have one or more MBOXs, and the ID of the MBOX is addressed to the NTSVR. The mail (MLET) can be used to transmit data between NETUSRs.

[0048] S120, fill information into the mail applied for from the shared memory to obtain a target mail, the target mail being associated with the mailbox address by filling information;

[0049] ​For example, the information for identifying the sender and receiver and the message content to be delivered through the mail are filled in the mail obtained from the shared memory, and the target mail to be sent is obtained, which can be sent to the target user based on the associated mailbox address. The information of the sending end can include the current user identifier and / or the current user mailbox identifier, and can also include the current site identifier and verification information, etc. The information of the receiving end can include the target user identifier and / or the target user mailbox identifier, and can also include the target site identifier, etc.

[0050] In S130, the target mail is added to the mail linked list corresponding to the network service process in the shared memory, and the server corresponding to the network service process is notified to receive the target mail.

[0051] For example, the communication protocol can be the TCP protocol. The mail linked list of the network service process can also be understood as the mail linked list of the server or the mail linked list of the site, denoted as svr_mlet_lst. The svr_mlet_lst linked list is a region in the shared memory. The target site can be referred to as the target site, which can be the current site (i.e., the current site) or any site other than the current site. It can be understood that if the target site is the current site, the target mail is added to the mail linked list (usr_mlet_lst) corresponding to the target user in the shared memory within the site, and waits for the corresponding user to receive it. Specifically, it can be added to the svr_mlet_lst first and then transferred to the mail linked list of the target user by the server of the current site. If the target site is not the current site, the target mail is sent to the target site based on the communication protocol, and the server of the target site adds the target mail to the mail linked list of the target user in the target site and waits for the user of the target site to receive it. The mail linked list of the target site is in the shared memory and can be used to receive the mails sent by other sites or users.

[0052] It should be noted that in the embodiment, only a physical link between different sites, i.e., a socket connection, can be established. Different sites can also be understood as different servers. There is no need to establish a physical link between different nodes (clients) within a site, and the different nodes within the site can communicate using shared memory.

[0053] The mail sending method provided by the embodiment of the present application adopts a hybrid communication mode based on shared memory and protocol. The different sites can communicate using a protocol physical link mode, and the sites can communicate using shared memory, thereby reducing the physical links created in the communication process, reducing the bandwidth occupied by the mail transmission, reducing the communication cost of the cluster, and improving the communication performance.

[0054] In an embodiment, the filled information includes: a current user identifier, a site identifier where the current user is located, a mailbox identifier of the current user, a target user identifier, a site identifier where the target user is located, a mailbox identifier of the target user, verification information, and mail content information.

[0055] The current user can also be referred to as a message source user, and the current user identifier is denoted as src usr id. The site where the current user is located can also be referred to as a message source site, and the site identifier where the current user is located is denoted as src site id. The target user identifier is denoted as dst usr id, and the site where the target user is located can also be referred to as a target site. The site identifier where the target user is located is denoted as dst site id. The mailbox identifier can be denoted as mbox id, and can be further distinguished as the current user mailbox identifier (src mbox id) and the target user mailbox identifier (dst mbox id). The verification information can be denoted as ACKID, and is used to ensure the security and reliability of mail sending and receiving. The mail content information includes message commands and message lengths, etc. The above information can be contained in a message header. The message body is mainly used to deliver the message content that the current user will send to the target user.

[0056] Optionally, the target user mailbox identifier (dst mbox id) can be obtained from a previously received message, or can not be specified. If the target user mailbox identifier is not specified, the mail can be processed by a client control thread (i.e., a thread for processing a mail linked list) of the user after the user receives the mail, and will not be transferred into the mailbox of the user.

[0057] By filling the above information, the target mail can be obtained and the sending and receiving parties of the target mail are determined, and thus mail sending is realized.

[0058] In an embodiment, the method further includes: applying for a mail to the network service process.

[0059] As an example, the flow of the client sending a mail is as follows:

[0060] 1) The client NETUSR applies for a mailbox from the shared memory to the NETSVR by reserving a mail, and in this process, the mailbox identifier (src mbox id) allocated to the current user can be obtained. Through the mailbox identifier, the NETUSR can find the corresponding mailbox address in the shared memory, and can subsequently send and receive mails in the mailbox based on the mailbox address;

[0061] 2) The NETUSR generates an ACKID for message verification;

[0062] 3) The NETUSR applies for a mail from the shared memory to the NETSVR by reserving a mail according to the length of the message content to be sent;

[0063] 4) NETUSR fills information into the applied mail to obtain a target mail, wherein the message header contains current user ID (src usr id), current user site ID (src site id), current user mailbox ID (src mbox id), target user ID (dst usr id), target user site ID (dst site id), target user mailbox identification (dst mbox id), ACK ID, message command and message length and the like, and the message body is the message content that the user will send to other users. The target user mailbox identification (dst mbox id) can be obtained from the received message or can not be specified.

[0064] 5) The target mail is put into the mail list (svr_mlet_lst) of the server in the shared memory, and the server is informed to receive the mail. The server can determine the target site by analyzing the message header, and then determine whether to send the target mail within the site or transfer to other sites;

[0065] 6) Wait for the server response and receive the mail in the mailbox corresponding to the mailbox identification;

[0066] 7) The client control thread processes the mail; specifically, after waiting for the NETSVR notification response, the mail in the mail list (usr_mlet_lst) corresponding to the target user identification is received, and the mail is processed to realize the communication between users;

[0067] 8) Release the mail and the mailbox.

[0068] Figure 2 A flowchart of a mail receiving method provided for the embodiment of the application. The embodiment can be applicable to the case of sending and receiving mail between users. Specifically, the mail receiving method can be executed by a mail receiving device, which can be realized by software and / or hardware and integrated in an electronic device. The electronic device mainly refers to the receiving end or forwarding end of the mail, for example, a server, and can also be a device deployed or connected to a database. It should be noted that the technical details not described in detail in the embodiment can be referred to the above-described any embodiment.

[0069] As shown in the figure, the method specifically includes the following steps: Figure 2

[0070] S210, receiving a target mail in the mail list in the shared memory of the current site, the mailbox address corresponding to the target mail being the address in the shared memory;

[0071] S220, determining the site where the target user is located according to the information of the target mail;

[0072] ​S230, if the target user's site is the current site, adding the target mail into the target user's mailbox or linked list based on the shared memory;

[0073] S240, if the target user's site is not the current site, sending the target mail to the target site through the TCP protocol, and adding the target mail into the target user's mail linked list in the shared memory of the target site.

[0074] In the embodiment, the target mail can be understood as a mail received from the mail linked list in the shared memory of the current site; if the target mail corresponds to the current site, the target mail is received by the corresponding target user in the site; if the target site is not the current site, the target mail is added into the mail linked list of the target site based on the communication protocol and is waited to be received by the server of the target site, and the mail linked list of the target site is in the shared memory and can be used to receive mails sent by other sites or users.

[0075] In an embodiment, the target mail includes the following information: the current user identifier, the site identifier where the current user is located, the mailbox identifier of the current user, the target user identifier, the site identifier where the target user is located, the mailbox identifier of the target user, the verification information, and the mail content information.

[0076] In an embodiment, sending the target mail to the target user based on the shared memory includes:

[0077] If the target user mailbox identifier in the target mail is valid, the target mail is sent to the mailbox corresponding to the target user mailbox identifier; if the target user mailbox identifier in the target mail is invalid, the target mail is added into the mail linked list corresponding to the target user identifier.

[0078] For example, the mail linked list corresponding to the target user identifier is denoted as usr_mlet_lst, which is in the shared memory and is used to receive mails sent by the server. When the mail sent to the NETUSR does not specify the target user mailbox identifier (i.e., the target user mailbox identifier is invalid), the target mail can be saved in the usr_mlet_lst linked list and is processed by the NETUSR client processing thread; otherwise, when the mail sent to the NETUSR specifies the target user mailbox identifier (i.e., the target user mailbox identifier is valid), the server can directly send the target mail to the specified target user mailbox, and the mail is processed by the user module of the receiving mailbox.

[0079] In an embodiment, receiving the target mail in the mail linked list in the shared memory of the current site includes: in response to the notification of receiving the target mail or through the socket blocking mode, the target mail in the mail linked list in the shared memory of the current site is received by using the TCP protocol.

[0080] For example, the server can wait for the notification of NETUSR to receive the target mail in the mail list (svr_mlet_lst) of the server, or receive the target mail through the socket blocking mode. The socket blocking mode can be understood as that if the data receiving or processing is not completed, the function will wait until the data receiving or processing is completed.

[0081] In an embodiment, before receiving the target mail in the mail list in the shared memory of the current site, the method further comprises: in response to the notification of receiving the target mail or through the socket blocking mode, receiving the target mail from the mail list of the network service process and adding the target mail to the mail list in the shared memory of the current site by using the transmission control protocol (TCP).

[0082] As an example, the process flow of the server forwarding the mail is as follows:

[0083] 1) The server waits for the notification of NETUSR in response or receives the mail in the svr_mlet_lst list by using the TCP protocol communication.

[0084] 2) The src_usr_id, src_site_id, dst_usr_id, dst_site_id, mbox_id, ACKID and other information in the mail are obtained.

[0085] 3) If the site of the target user of the mail is another site, the mail is sent to the target site through the socket.

[0086] If the site of the target user of the mail is the current site (obtained by comparing the dst_site_id with the current site), it is further judged whether the dst_mbox_id in the target mail is valid.

[0087] If the dst_mbox_id is a valid id, the corresponding mailbox is found, and the target mail is sent to the mailbox.

[0088] If the target mail does not set the dst_mbox_id, the mail list usr_mlet_lst of the target user dst_usr_id is found, the mail is added to the list, and the target user is notified to receive and process the mail.

[0089] 4) Step 1 is returned, and the server continues to wait for the notification of NETUSR to receive the mail.

[0090] As an example, as Figure 3As shown, the process of sending a mail between different users (such as Netusr1 and Netusr2) in a site mainly includes:

[0091] Netusr1 applies to NETSVR for the mailbox identification of Netusr1;

[0092] Netusr1 generates an ACKID;

[0093] Netusr1 determines the mailbox address according to the mailbox identification;

[0094] Netusr1 applies to NETSVR for the mail and fills the mail to obtain a target mail;

[0095] The target mail is added to svr_mlet_1st and the Netsvr is notified to receive the target mail;

[0096] Netsvr1 is woken up upon receiving the notification and receives the target mail from svr_mlet_1st;

[0097] According to the message header of the mail, it is judged whether the dst_site_id is the current site;

[0098] If the dst_site_id is the current site, it is judged whether the dst_mbox_id is set (i.e. whether the dst_mbox_id is valid), and if yes, the mailbox is delivered according to the dst_mbox_id and the Netusr1 in the site is woken up to receive the mail response; otherwise, the target mail is put into usr_mlet_lst and the corresponding user (Netusr2) is woken up to receive the target mail;

[0099] If the dst_site_id is not the current site, the target mail is sent to other sites (Netsvr2);

[0100] Netusr2 is woken up and receives the target mail from svr_mlet_1st;

[0101] It is judged whether the dst_mbox_id is set (i.e. whether the dst_mbox_id is valid), and if yes, the mailbox is delivered according to the dst_mbox_id; otherwise, the target mail is processed.

[0102] As an example, as shown in Figure 4 the process of sending a mail between different sites (such as sending by NETSVR1 to NETSVR2) is as follows:

[0103] Netsvr 1 sends the target mail through socket;

[0104] Netsvr2 receives the target mail by socket blocking;

[0105] According to the message header of the mail, it is judged whether the dst_mbox_id is set (i.e. whether the dst_mbox_id is valid), if yes, the mailbox is delivered according to the dst_mbox_id; otherwise, the target mail is put into the usr_mlet_lst and the corresponding user is woken up to receive the target mail.

[0106] Figure 5 A structure schematic diagram of a mail sending device provided by an embodiment of the present application is provided. The mail sending device provided by the embodiment comprises:

[0107] The application module 310 is configured to apply for a current user mailbox identifier from the network service process and determine a mailbox address in a shared memory of a site where a current user is located according to the current user mailbox identifier;

[0108] The filling module 320 is configured to add the target mail into a mail linked list corresponding to the network service process in the shared memory and notify a server corresponding to the network service process to receive the target mail;

[0109] The sending module 330 is configured to add the target mail into a mail linked list corresponding to the network service process in the shared memory and notify a server corresponding to the network service process to receive the target mail.

[0110] The device adopts a hybrid communication mode based on shared memory and protocol, different sites can communicate by using a protocol physical link mode, and sites can communicate by using shared memory, thereby reducing a physical link created in a communication process, reducing bandwidth occupied by mail transmission, reducing a communication cost of a cluster, and improving communication performance.

[0111] On the basis of any of the above embodiments, the information comprises: a current user identifier, a site identifier where the current user is located, a current user mailbox identifier, a target user identifier, a site identifier where the target user is located, a target user mailbox identifier, verification information, and mail content information.

[0112] In an embodiment, the application module 310 is further configured to apply for a mail Figure 6 A structure schematic diagram of a mail sending device provided by an embodiment of the present application is provided. The mail sending device provided by the embodiment comprises:

[0113] The receiving module 410 is configured to receive a target mail in a mail linked list in a shared memory of a current site, and a mailbox address corresponding to the target mail is an address in the shared memory;

[0114] The determining module 420 is configured to determine a site where the target user is located according to information of the target mail.

[0115] The first sending module 430 is configured to, if the site where the target user is located is the current site, add the target mail into a mail linked list or a mailbox of the target user based on the shared memory.

[0116] The second sending module 440 is configured to, if the site where the target user is located is not the current site, send the target mail to the target site through a TCP protocol, and add the target mail into a mail linked list of the target user in the shared memory of the target site.

[0117] In an embodiment, the target mail comprises the following information: a current user identifier, a site identifier where the current user is located, a mailbox identifier of the current user, a target user identifier, a site identifier where the target user is located, a mailbox identifier of the target user, verification information, and mail content information.

[0118] In an embodiment, the first sending module 430 is specifically configured to, if the site where the target user is located is the current site:

[0119] If the mailbox identifier of the target user in the target mail is valid, the target mail is sent to a mailbox corresponding to the mailbox identifier of the target user; if the mailbox identifier of the target user in the target mail is invalid, the target mail is added into a mail linked list corresponding to the target user identifier.

[0120] In an embodiment, the receiving module 410 is further configured to, before receiving the target mail in the mail linked list in the shared memory of the current site, receive the target mail from a mail linked list of a network service process and add the target mail into the mail linked list in the shared memory of the current site in a transmission control protocol (TCP) mode in response to a notification of receiving the target mail or through a socket blocking mode.

[0121] The mail sending device provided by the embodiments of the present application can be used to execute the mail sending method provided by any of the above embodiments, and has the corresponding functions and advantages.

[0122] Figure 7A structural diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device 10 is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device 10 can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, user equipment, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.

[0123] As shown in Figure 7 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., connected to the at least one processor 11 in communication, where the memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 12 or loaded into the random access memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0124] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, speakers, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunications networks, wireless networks.

[0125] The processor 11 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above.

[0126] In some embodiments, the methods of the above-described embodiments can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 18. In some embodiments, portions of the computer program, or all of the computer program, can be loaded onto the electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more of the steps of the above-described methods can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform any of the above-described methods by other means, e.g., with the aid of firmware.

[0127] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0128] Computer programs used to implement the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as part of a standalone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0129] In the context of this application, a computer readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium can be a machine readable signal medium. More specific examples of a machine readable storage medium will include a one or more lines of a computer program code, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0130] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device 10 having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device 10. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0131] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0132] The embodiments of the present application further provide a computer program product, comprising a computer program and / or instructions, which, when executed by a processor, implement the mail sending method according to any of the above embodiments.

[0133] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps recited in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the present application are achieved, which is not limited herein.

[0134] The foregoing detailed description has not been limited by a particular embodiment thereof. Rather, a variety of modifications, combinations, sub-combinations, and alternatives have been suggested, for example, in the spirit and principles of the present application. It is therefore intended that the application not be limited to the particular embodiment disclosed, but that the image encompass all such modifications, alternatives, and equivalents that have been set forth above and / or below.

Claims

1. A mail sending method applied to a client, characterized by, The method comprises: applying for a current user mailbox identifier from a network service process and determining a mailbox address in a shared memory of a site where a current user is located according to the current user mailbox identifier; filling information into a mail applied for from the shared memory to obtain a target mail, the target mail being associated with the mailbox address through the filled information; adding the target mail into a mail linked list corresponding to the network service process in the shared memory, and notifying a server corresponding to the network service process to receive the target mail.

2. The method of claim 1, wherein, The information comprises: a current user identifier, a site identifier where the current user is located, a current user mailbox identifier, a target user identifier, a site identifier where the target user is located, a target user mailbox identifier, verification information, and mail content information.

3. A mail receiving method applied to a server, characterized by, The method comprises: receiving a target mail in a mail linked list in a shared memory of a current site, the target mail corresponding to a mailbox address in the shared memory; determining a site where a target user is located according to information of the target mail; if the site where the target user is located is the current site, adding the target mail into a mail linked list or a mailbox of the target user based on the shared memory; if the site where the target user is located is not the current site, sending the target mail to the target site through a TCP protocol, and adding the target mail into a mail linked list of the target user in a shared memory of the target site.

4. The method of claim 3, wherein, The target mail comprises the following information: a current user identifier, a site identifier where the current user is located, a current user mailbox identifier, a target user identifier, a site identifier where the target user is located, a target user mailbox identifier, verification information, and mail content information.

5. The method of claim 4, wherein, Sending the target mail to the target user based on the shared memory comprises: if the target user mailbox identifier in the target mail is valid, sending the target mail to a mailbox corresponding to the target user mailbox identifier; if the target user mailbox identifier in the target mail is invalid, adding the target mail into a mail linked list corresponding to the target user identifier.

6. The method of claim 3, wherein, Before receiving the target mail in the mail linked list in the shared memory of the current site, the method further comprises: in response to a notification of receiving the target mail or in a manner of socket blocking, receiving the target mail from a mail linked list of a network service process and adding the target mail into a mail linked list in a shared memory of a current site by using a transmission control protocol (TCP).

7. A mail transmitting apparatus characterized by comprising: The method comprises: an application module, configured to apply for a current user mailbox identifier from a network service process and determine a mailbox address in a shared memory of a site where a current user is located according to the current user mailbox identifier; a filling module, configured to fill information into a mail applied for from the shared memory to obtain a target mail, the target mail being associated with the mailbox address through the filled information; a sending module, configured to add the target mail into a mail linked list corresponding to the network service process in the shared memory, and notify a server corresponding to the network service process to receive the target mail.

8. A mail receiving method characterized by comprising: The method comprises: a receiving module, configured to receive a target mail in a mail linked list in a shared memory of a current site, the target mail corresponding to a mailbox address in the shared memory; A determining module is configured to determine a site where a target user is located according to information of the target mail; A first sending module is configured to, if the site where the target user is located is a current site, add the target mail into a mail linked list or a mailbox of the target user based on a shared memory; A second sending module is configured to, if the site where the target user is located is not the current site, send the target mail to a target site through a TCP protocol, and add the target mail into a mail linked list of the target user in a shared memory of the target site.

9. An electronic device, comprising: Comprise: at least one processor; a memory connected with the at least one processor in communication; wherein, the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the mail sending method of any one of claims 1-2 or the mail receiving method of any one of claims 3-6.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the mail sending method of any one of claims 1-2 or the mail receiving method of any one of claims 3-6.

11. A computer program product comprising computer programs and / or instructions, characterized in that, The computer program and / or instructions are executed by the processor to implement the mail sending method of any one of claims 1-2 or the mail receiving method of any one of claims 3-6.