CN114785749A - Message group sending processing method and device - Google Patents

Message group sending processing method and device Download PDF

Info

Publication number
CN114785749A
CN114785749A CN202210391976.0A CN202210391976A CN114785749A CN 114785749 A CN114785749 A CN 114785749A CN 202210391976 A CN202210391976 A CN 202210391976A CN 114785749 A CN114785749 A CN 114785749A
Authority
CN
China
Prior art keywords
sending
message
group
mass
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210391976.0A
Other languages
Chinese (zh)
Inventor
吕泽峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202210391976.0A priority Critical patent/CN114785749A/en
Publication of CN114785749A publication Critical patent/CN114785749A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a message mass sending processing method and device, and relates to the field of internet medical treatment. One embodiment of the method comprises: receiving a mass-sending message request transmitted by a client, constructing a mass-sending message task according to a filtering condition in a request parameter and message content to be mass-sent, and sending the mass-sending message task to a message middleware; executing the mass message sending task through a process of a message consumption middleware to search a sending target meeting the filtering condition and send the message content to the sending target in a mass mode; and updating the message group sending result of the group sending message task according to the message sending result of each sending target, and returning the message group sending result to the client. According to the implementation mode, the client does not directly transmit the sending target information to the server, but transmits the filtering condition to the server, and the server determines the sending target and the snapshot through the post-processing, so that the data consistency, timeliness and execution performance of the mass messaging task are ensured.

Description

Message group sending processing method and device
Technical Field
The invention relates to the technical field of internet medical treatment, in particular to a message mass sending processing method and device.
Background
With the development of internet technology, the application of internet medical treatment is becoming more and more extensive. One of the most important functions in the complete inquiry flow of the Internet hospital is after-treatment management, high follow-up rate can be kept through continuous after-treatment management, and the satisfaction degree of a patient to a doctor is improved, so that a treatment scheme is ensured, and the overall inquiry effect is improved.
The modes of patient education, psychological counseling, health management and the like in the post-treatment management are common scenes, the construction of doctor-patient IM (Instant Messaging) conversation in the post-treatment scenes is an indispensable bridge, and the mass Messaging of doctors to a plurality of patients is a very convenient and efficient communication mode.
However, there are millions of inquiry sheets each day, and a doctor has tens of thousands of inquiry patients in total, and it is not easy to send the post-treatment information to tens of thousands of patients at the same time. At present, there are two main ways of sending messages in a group: the two modes have the problems of inconvenient operation, untimely response, incapability of sending to tens of thousands of patients simultaneously, requirement of re-operation by a user after abnormality, no clear sending result and the like.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for processing a message group transmission, which can at least solve the problems of the prior art, such as inconvenient operation, untimely response, incapability of transmitting to tens of thousands of patients at the same time, requirement of user re-operation after an abnormality, and no clear transmission result.
In order to achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a method for processing a message group, which is applied to a server and includes:
receiving a mass-sending message request transmitted by a client, constructing a mass-sending message task according to a filtering condition in a request parameter and message content to be mass-sent, and sending the mass-sending message task to a message middleware;
executing the mass message sending task through a process of a message consumption middleware to search a sending target meeting the filtering condition and send the message content to the sending target in a mass mode;
and updating the message mass sending result of the mass sending message task according to the message sending result of each sending target, and returning the message mass sending result to the client.
Optionally, the searching for the sending target meeting the filtering condition, and sending the message content to the sending target in a group, includes:
analyzing the message body of the group sending message task to obtain a message batch number and the request parameter, and converting the request parameter into a group sending message object;
inquiring a database according to the message batch number to obtain the sending state of the mass-sending message object, and searching the sending targets meeting the filtering condition under the condition that the sending state is not sent so as to obtain sending target information corresponding to each sending target identifier;
uploading the sending target information to an object storage server as a snapshot, and sending the message content to each sending target based on the snapshot; the snapshot is used for ensuring consistency of the sending target information during the re-consumption processing.
Optionally, the filtering condition includes a filtering field, a selection mode field, and a sending target identifier, where the sending target identifier is a sending target identifier selected in a forward direction or a sending target identifier deselected during full selection;
the searching for the sending target meeting the filtering condition comprises the following steps:
searching all sending targets which accord with the screening field, and judging whether the key value of the selection mode field is a preset value or not;
if so, determining that the selection mode is forward selection, and taking a sending target corresponding to the sending target identification in all sending targets as an object of the current message to be sent in a group manner; or
If not, determining that the selection mode is full selection and reverse selection, and taking the rest sending targets except the sending target identification in all the sending targets as the objects of the current message to be sent in group.
Optionally, the method further includes: determining the storage address of the snapshot in the object storage server, and storing the storage address in the sending record of a database; and
responding to the re-consumption processing operation, and under the condition that the sending state is incomplete, acquiring the storage address from a database according to the message batch number so as to acquire the snapshot from the object storage server based on the storage address.
Optionally, the requesting parameters further include a total number of sending targets, and the sending the message content to the sending targets in a group further includes:
calculating a quotient of the total quantity of the sending targets and the quantity of the sending targets which can be processed by the subtasks, and rounding the quotient upwards to obtain a plurality of rounded subtasks;
executing the plurality of subtasks in parallel using threads in a thread pool to send the message content to each send target based on the snapshot;
the updating the message mass-sending result of the mass-sending message task according to the message sending result of each sending target comprises the following steps:
and updating the message mass sending result of one subtask according to the message sending result of each sending target in the subtask after executing one subtask, and updating the message mass sending result of the mass sending message task after executing all subtasks.
Optionally, the method further includes: storing the message sending record of each sending target in a specified data storage component; the message sending record comprises a message sending result, and the message sending result is successful sending or failed sending; and
and counting the number of the message sending records with the successful message sending result in the data storage assembly, and changing the key value of the sending successful number field of the sending records into the number of the message sending records.
Optionally, the request parameter further includes a user login identifier;
the method for constructing the group sending message task and sending the group sending message task to the message middleware according to the filtering condition in the request parameter and the message content to be group sent comprises the following steps:
according to the user login identification, carrying out anti-re-submission verification on the request parameter;
responding to the verification result that the verification result is passed, generating a sending record aiming at the mass sending message request, and persisting the sending record into a database; wherein, the sending record comprises a sending state and a message mass sending result; and
and constructing the group sending message task according to the filtering condition in the request parameter and the message content to be group sent, and sending the group sending message task to a message middleware.
Optionally, the executing, by the process consuming the message middleware, the group message task further includes:
according to the response mechanism of the message middleware, if the consumption processing fails, executing the re-consumption operation; and
and adding a distributed lock to the group message sending task, executing the group message sending task by the process of the consumption message middleware according to the distributed lock, and releasing the distributed lock after the processing is finished.
Optionally, when the group sending message task is constructed and sent to the message middleware, the method further includes: and returning the message mass-sending request result to the client.
In order to achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a method for processing a message group, which is applied to a client, and includes:
receiving a screening condition and message content input by a user, searching all sending targets meeting the screening condition so as to receive the selection operation of the user on a plurality of sending targets;
responding to the selection operation of the user on the group sending message option, generating a filtering condition according to the screening field, the selection mode field and the sending target identification, and obtaining a request parameter by combining the message content; the sending target identification is a sending target identification selected in the forward direction or a sending target identification deselected when the sending target identification is selected completely;
and generating a group sending message request based on the request parameters, transmitting the group sending message request to the server, and then receiving and displaying a message group sending result fed back by the server.
Optionally, the receiving a selection operation of the user on multiple sending targets includes:
receiving the selection operation of a user on a plurality of sending targets by using a forward selection mode; or
And receiving the deselection operation of one or more sending targets by the user in the full selection state.
Optionally, before receiving and displaying the message group sending result fed back by the server, the method further includes: and receiving and displaying a message group sending request result returned by the server.
In order to achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a message group sending processing apparatus, applied to a server, including:
the receiving module is used for receiving a mass-sending message request transmitted by the client, constructing a mass-sending message task according to the filtering condition in the request parameter and the message content to be mass-sent and sending the mass-sending message task to the message middleware;
the mass-sending module is used for executing the mass-sending message task through the process of the message consumption middleware so as to search a sending target meeting the filtering condition and send the message content to the sending target in a mass way;
and the updating module is used for updating the message mass sending result of the mass sending message task according to the message sending result of each sending target and returning the message mass sending result to the client.
Optionally, the mass sending module is configured to:
analyzing the message body of the group sending message task to obtain a message batch number and the request parameter, and converting the request parameter into a group sending message object;
inquiring a database according to the message batch number to obtain the sending state of the mass-sending message object, and searching the sending targets meeting the filtering condition under the condition that the sending state is not sent so as to obtain sending target information corresponding to each sending target identifier;
uploading the sending target information to an object storage server as a snapshot, and sending the message content to each sending target based on the snapshot; the snapshot is used for ensuring consistency of the sending target information during the re-consumption processing.
Optionally, the filtering condition includes a filtering field, a selection mode field, and a sending target identifier, where the sending target identifier is a sending target identifier selected in a forward direction or a sending target identifier deselected during full selection;
the mass sending module is used for:
searching all sending targets which accord with the screening field, and judging whether the key value of the selection mode field is a preset value or not;
if so, determining that the selection mode is forward selection, and taking a sending target corresponding to the sending target identification in all sending targets as an object of the current message to be sent in a group manner; or
If not, determining that the selection mode is full selection and reverse selection, and taking the rest sending targets except the sending target identification in all the sending targets as the objects of the current message to be sent in group.
Optionally, the mass sending module is further configured to:
determining the storage address of the snapshot in the object storage server, and storing the storage address in the sending record of a database; and
responding to the re-consumption processing operation, and under the condition that the sending state is incomplete, acquiring the storage address from a database according to the message batch number so as to acquire the snapshot from the object storage server based on the storage address.
Optionally, the request parameter further includes a total number of sending targets, and the mass sending module is further configured to: calculating a quotient of the total quantity of the sending targets and the quantity of the sending targets which can be processed by the subtasks, and rounding the quotient upwards to obtain a plurality of rounded subtasks;
executing the plurality of subtasks in parallel using threads in a thread pool to send the message content to each send target based on the snapshot;
the update module is configured to: and updating the message group sending result of the subtask according to the message sending result of each sending target in the subtask after executing one subtask, and updating the message group sending result of the group sending message task after executing all subtasks.
Optionally, the update module is further configured to:
storing the message sending record of each sending target in a specified data storage component; the message sending record comprises a message sending result, and the message sending result is successful sending or failed sending; and
and counting the number of the message sending records with the successful message sending result in the data storage assembly, and changing the key value of the sending successful number field of the sending records into the number of the message sending records.
Optionally, the request parameter further includes a user login identifier;
the receiving module is configured to: according to the user login identification, carrying out anti-re-submission verification on the request parameter;
responding to the verification result that the verification result is passed, generating a sending record aiming at the mass sending message request, and persisting the sending record into a database; wherein, the sending record comprises a sending state and a message mass sending result; and
and constructing the group sending message task according to the filtering condition in the request parameter and the message content to be group sent, and sending the group sending message task to a message middleware.
Optionally, the mass sending module is further configured to: according to the response mechanism of the message middleware, if the consumption processing fails, executing the re-consumption operation; and
and adding a distributed lock to the group message sending task, executing the group message sending task by the process of the consumption message middleware according to the distributed lock, and releasing the distributed lock after the processing is finished.
Optionally, when the group sending message task is constructed and sent to the message middleware, the method further includes: and returning the message mass-sending request result to the client.
In order to achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a message group sending processing apparatus, applied to a client, including:
the operation module is used for receiving the screening conditions and the message contents input by the user, searching all the sending targets which accord with the screening conditions, and receiving the selection operation of the user on a plurality of sending targets;
the generation module is used for responding to the selection operation of the user on the group sending message option, generating a filtering condition according to the screening field, the selection mode field and the sending target identification, and obtaining a request parameter by combining the message content; the sending target identification is a sending target identification selected in the forward direction or a sending target identification deselected in the full selection;
and the transmission module is used for generating a group sending message request based on the request parameters, transmitting the group sending message request to the server, and then receiving and displaying a message group sending result fed back by the server.
Optionally, the operation module is configured to:
receiving the selection operation of a user on a plurality of sending targets by using a forward selection mode; or
And receiving the deselection operation of one or more sending targets by the user in the full selection state.
Optionally, before receiving and displaying the message group sending result fed back by the server, the method further includes: and receiving and displaying a message group sending request result returned by the server.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a message bulk sending processing electronic device. The electronic device of the embodiment of the invention comprises: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, enable the one or more processors to implement any of the message bulk sending processing methods described above.
To achieve the above object, according to a further aspect of the embodiments of the present invention, there is provided a computer readable medium having a computer program stored thereon, the computer program implementing any one of the message group sending processing methods described above when being executed by a processor.
According to the scheme provided by the invention, one embodiment of the invention has the following advantages or beneficial effects: the method is used for solving the problems that the operation is inconvenient, the response is not timely, tens of thousands of patients cannot be sent at the same time, the user needs to operate again after abnormality, the result is not sent clearly and the like in the prior art, and provides a group-sending message service with high efficiency and reliability for the user.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic main flow chart of a message group sending processing method applied to a server according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an alternative message bulk sending processing method applied to a server according to an embodiment of the present invention;
FIG. 3(a) is a diagram of the operation of the forward selection;
FIG. 3(b) is a diagram of the operation of the full selection and the reverse selection;
fig. 4 is a schematic flowchart of another alternative message bulk sending processing method applied to a server according to an embodiment of the present invention;
FIG. 5 is a relational diagram of a database and object storage service:
fig. 6 is a flowchart illustrating another alternative message bulk sending processing method applied to a server according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of heterogeneous storage batch bulk sending records and detail sending records;
fig. 8 is a flowchart illustrating a message bulk sending method applied to a client according to an embodiment of the present invention;
fig. 9 is a schematic block diagram of a message bulk sending processing device applied to a server according to an embodiment of the present invention;
fig. 10 is a schematic diagram of main modules of a message bulk sending processing device applied to a client according to an embodiment of the present invention;
FIG. 11 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 12 is a schematic block diagram of a computer system suitable for use with a mobile device or server implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. According to the technical scheme, the data acquisition, storage, use, processing and the like meet the relevant regulations of national laws and regulations.
The mass texting message of the IM system in the post-diagnosis management scene of the Internet hospital has the following characteristics:
1) support for sending messages to multiple patients simultaneously: most doctors have more patients after cumulative diagnosis, and with the development of internet medical treatment, the number of patients after cumulative diagnosis of a single doctor is increased, so that the concurrence of a single group of patients needs to be increased.
2) The user experience is efficient and convenient: on the one hand, a user (such as a doctor) can easily select a large number of patients, and on the other hand, the operation of the user can be responded quickly.
3) The message sending has good real-time performance: after the server receives the group message request, it needs to submit the sending task as soon as possible and execute the sending logic.
4) There is an explicit transmission result: based on the importance of post-treatment management, each message to be sent to the patient in a mass-sending mode needs to be explicitly aware of the sending result, and the user can see the sending state and the sending result of the mass-sending message at any time.
At present, there are several methods for mass messaging in internet hospitals:
mode 1, limiting a small number of immediate sending modes of sending targets: after a user selects a sending target in a client application, target data to be sent is transmitted to a server through a network, after the server receives a sending request, each sending target is traversed in sequence, a plurality of logics such as session information inquiry, message type judgment, sending parameter construction and the like are completed, and finally the data are sent to a patient. In the back-end processing process, the user can only stay on the sending page to wait for sending the result.
Mode 2, asynchronous transmission mode for limiting more transmission targets: and the client application transmits the target data selected by the user to the server through the network. The server side stores the sending request data into a database and then responds to the client side. At this point, the message has not actually been sent to the patient, and the message sent status is unsent. And subsequently, the rear-end timing task reads the group sending message task with the state of unsent in the database at regular time to start sending, and updates the message sending state into sending. And updating the message to be sent completely after all messages are sent completely.
Technical problems of the current mass messaging mode of internet hospitals include:
1. in the modes 1 and 2, a user needs to manually select one sending target in the operation process, and sometimes needs to manually turn pages to obtain a new sending target and then click to select the new sending target, when the number of the sending targets is large, the selection mode is not friendly to the user, the user is occupied for a long time only by selecting the sending target, and if the number is abnormal, the user needs to reselect, so that the experience is poor;
2. the method 1 depends on network transmission of all the sending targets, the number of the sending targets is limited by the network transmission, and a synchronous method is adopted, the client application blocks the sending result of the waiting server, the waiting time cannot be estimated, and the user cannot obtain a response in time. In addition, the transmission mode has strong limitation and poor performance, is not suitable for sending messages to the tens of thousands of people, and does not meet the characteristic 1).
3. Mode 2 can respond to the user as soon as possible using asynchronous transmission, but still is the transmission target of the network transmission, and consumes network resources. In addition, the use of a database to access a large number of unstructured sending targets occupies relatively large resources, and occupies a long database connection time during read-write operation, which may reduce the overall performance of the database. The manner of using the timed task also causes instability in the server CPU utilization and affects the timeliness of the transmitted message, so that the above-described features 1) and 2) are not satisfied.
4. Some mainstream IM applications support mass-sending only for a limited number of targets, such as 200 people, and in the management scene after internet medical treatment, the number of patients corresponding to doctors is far greater than that, so that the demand cannot be met.
The words involved in the present solution are explained as follows:
1) a database: repositories that organize, store, and manage data in data structures, such as MySQL, and the like.
2) Message middleware: a data structure of "first-in first-out" in an underlying data structure. The method is generally used for solving the problems of application decoupling, asynchronous messages, flow peak clipping and the like, and realizes a high-performance, high-availability, scalable and final consistency framework. Such as JMQ.
3) And (3) object storage: the cloud storage service scheme is massive, safe, low in cost and high in reliability. The scheme mainly uses OSS (Object Storage Service) as an Object Storage server.
4) Distributed lock: and controlling the distributed system to operate the shared resources in order and keeping consistency through mutual exclusion.
Referring to fig. 1, a main flowchart of a method for processing group sending of a message at a server according to an embodiment of the present invention is shown, which includes the following steps:
s101: receiving a mass-sending message request transmitted by a client, constructing a mass-sending message task according to a filtering condition in a request parameter and message content to be mass-sent, and sending the mass-sending message task to a message middleware;
s102: executing the mass message sending task through a process of a message consumption middleware to search a sending target meeting the filtering condition and send the message content to the sending target in a mass mode;
s103: and updating the message mass sending result of the mass sending message task according to the message sending result of each sending target, and returning the message mass sending result to the client.
In the above embodiment, for step S101, the scheme is applicable to all scenes in which a large number of targeted mass texting messages need to be sent, such as the case where a doctor sends post-diagnosis information to a patient in an internet medical scene, an enterprise sends recruitment information and recruitment results to a recruiter, and a teacher sends a score sheet to a student; the messages sent may be the same, or different messages may be generated for different sending targets, for example, a message template containing alternative fields including student names, student scores, and teacher comments is created, and a database containing the three pieces of information is called to generate a message corresponding to each student.
The scheme mainly takes an internet medical scene as an example for explanation, wherein a sending target is a patient, sending target information is patient information, and the patient information comprises an ID, a name, an age, a gender, a label and the like. The purpose of post-treatment management is to maintain doctor-patient relationship, and can send patient articles, questionnaires, holiday blessings and the like, and also can generate different sending information for different patients, such as medication reminding. The scheme can support a doctor to send the information after the diagnosis to tens of thousands of patients in a group at the same time, greatly improves the experience of managing the patients after the doctor diagnoses, and improves the efficiency.
The scheme supports one-time mass sending of tens of thousands of messages, a user selects tens of thousands of sending targets by using a client side and submits a mass sending message request to a server side, wherein the client side is a mobile device used by the user, such as a mobile phone and a Personal Computer (PC), and belongs to the front end. The back end is a concept corresponding to the front end, namely a server, and the server in the scheme comprises foreground service and middle station service, is a hierarchical structure, is convenient to flexibly expand and is easy to maintain. The foreground service is mainly used for receiving the request transmitted by the client and transmitting the request to the downstream service (namely, the middle station service) for processing and processing the personalized service. The midlet service mainly provides general capabilities and data support.
After receiving the mass texting request transmitted by the foreground service, the middle station service firstly analyzes the request parameter in the mass texting request, and performs anti-resubmission check on the request parameter based on the user login ID in the request parameter, for example, the user clicks and submits the 'mass texting request' for many times, so the server receives a plurality of repeated mass texting requests transmitted by the user client, and only one mass texting request is processed by the server through the anti-resubmission check.
And under the condition that the anti-re-submission check result is passed, generating a sending record aiming at the mass-sending message request and persisting the sending record into a database, wherein the sending record comprises the sending state of the mass-sending message request and the message mass-sending result, and the database supports the change of the message sending state and the display of the history record of the mass-sending message. A message batch number is automatically created for the delivery record, e.g. a doctor wants to send a message to 1 ten thousand patients in a group, the 1 ten thousand patients forming a batch. The database fields include:
TABLE 1
Figure BDA0003597299030000121
The data primary key Id does not relate to the service attribute, and is automatically generated for the system, and the scheme does not relate to the data primary key Id. The request parameters include LoginUserId-MsgContent, which will be described in detail later. OssUrl is a storage address of a sending target in the object storage server, and the snapshot can ensure the consistency of sending target information when the process consumes again.
And under the condition that the re-submission prevention verification result is passed, constructing a group message sending task according to the filtering condition and the message content in the request parameter and sending the group message sending task to the message middleware. In addition, the message mass-sending request result is returned to the client, and the user is informed that the mass-sending message request is received and submitted to the message middleware, and the message middleware is similar to the condition that the incoming message is known and the processing is started.
For step S102, the message middleware is an application that exists independently and is used for temporarily storing the mass messaging task. After the group sending message request reaches the server, generating a sending record and storing the record in a database, constructing a group sending message task and sending the group sending message task to a message middleware, wherein the message content is not sent to a sending target group, the logic of the actual group sending message content is a specific process in a middle station service, and the group sending message task is obtained from the message middleware and executed to send the group sending message content to the sending target.
The specific process in the middle station service is not the process of the message middleware, but the process of the message middleware is consumed. Because the receiving of the group sending message request and the actual message sending are not completed by the same process, the message sending is completed by the process consuming the message middleware, and the message middleware is used for performing peak clipping, valley filling and buffering functions.
In addition, in order to ensure the reliability of the whole implementation process, the message middleware starts an ACK (acknowledgement character, in the TCP/IP protocol, if the receiving party successfully receives the data, an ACK data is replied) response mechanism, and if the consumption process fails, the consumption process can be resumed. Under a distributed architecture, in order to solve the problem of message processing concurrency in a multi-thread processing environment, a distributed lock is added to a group message sending task before processing, and in order to ensure that the same task is not processed repeatedly, namely, the idempotent is ensured. Here, to reduce system complexity and improve system performance, a cache (Redis) based distributed lock is preferably employed. And the current process determines a mass messaging task to be executed according to the distributed locks so as to perform the next logic processing, and releases the locks after the processing is completed. In conclusion, the function of retrying sending after the task processing fails is realized, the stability of the system and the timeliness of message processing are considered, and the reliability and the high performance of message group sending can be ensured.
For step S103, the server needs to respond to the user in a limited time: the operation of the user needs to be explicitly responded, which indicates that the service end receives the operation request of the user and processes the operation request, and a processing result is generated. If the user sends the group sending message request, the response is the message group sending result: if the result is successful or failed, the result needs to be instantly returned to the user by the foreground service, and the user cannot wait for a long time.
In the scheme, a heterogeneous message data storage mode is preferably used, the message sending records of each sending target are stored in an ES (elastic search), so that the retrieval efficiency is improved, and the sending records of the whole mass message sending task are stored in a database. And updating the message group sending result of the group sending message task according to the message sending result of each sending target.
Optionally, the server in this scheme may further process a query request for the history transmission record, where the request parameter carries a user login ID, and if the user a logs in the account to query, the query is the transmission record sent by the history group, the query process is also completed by the middle service, all persistent data are operated by the middle service, and the middle service queries the history transmission record and returns the history transmission record to the foreground service, and the foreground service returns the history transmission record to the client.
According to the method provided by the embodiment, the client does not directly transmit the sending target information to the server, but transmits the filtering condition to the server, and the server automatically inquires the filtering condition, so that the network transmission pressure is reduced, and the problem of transmitting big data is solved; the task is transmitted to the message middleware and then the user is responded immediately, the average time consumption of the whole request responding process is short, and the user cannot feel stuck.
Referring to fig. 2, a schematic flow chart of an optional method for processing group sending of a message at a server according to an embodiment of the present invention is shown, which includes the following steps:
s201: acquiring a filtering condition in the request parameter; the filtering condition comprises a screening field, a selection mode field and a sending target identifier, wherein the sending target identifier is a forward selected sending target identifier or a deselected sending target identifier during full selection;
s202: searching all sending targets which accord with the screening field, and judging whether the key values of the selection mode field are preset numerical values or not;
s203: if so, determining that the selection mode is forward selection, and taking a sending target corresponding to the sending target identification in all sending targets as an object of the current message to be sent in a group manner;
s204: if not, determining that the selection mode is full selection and reverse selection, and taking the rest sending targets except the sending target identification in all the sending targets as the objects of the current message to be sent in group.
In the above embodiment, for the steps S201 to S204, in order that the server can support the function of sending messages to tens of thousands or more sending targets at a time, the solution first makes improvements and optimizations based on the traditional selection and transmission of sending targets, so as to solve the problems of high transmission cost and low performance of the existing network.
1. Selection mode of sending target
In the scheme, the user supports full selection and reverse selection in a mode that the client selects the sending targets, namely the user can specifically deselect some sending targets in a full selection state. Referring to fig. 3(a), an operation form diagram of forward selection is assumed that the total number of screened destinations after the user inputs the screening condition is 9848, and the destination 1 and the destination 2 can be selected by clicking. Referring to fig. 3(b) as an operation form diagram of full selection and reverse selection, assuming that the total number of screened sending targets after the user inputs the screening condition is 9848, the user can select 9848 sending targets from sending target 1 to sending target 9848 by clicking the "full selection" option without turning pages, and can further deselect sending target 2 and sending target 3, at this time, only group-sending messages are sent to the remaining 9846 sending targets.
2. Client-side group sending message request message optimization
Since the list of transmission targets is displayed in pages at the client, the user slides up the page to trigger a loading operation, and each page loads a certain number of transmission targets. How can these 9846 destinations be transmitted to the server in the above-mentioned configuration logic of full selection and reverse selection? One way is that the client side acquires data information of all 9848 sending targets at one time, virtual paging is carried out, and information of all 9846 sending targets selected by the user is transmitted to the server side during sending, but the way consumes a large amount of network resources. Taking an internet medical scenario as an example, data information of a patient includes more than ten information such as name, sex, age, disease information, classification label, etc., and is calculated by one data information 200Byte, and 9848 data information has a size of about 2M. Therefore, the one-time all-selective transmission comprises two steps of acquiring the transmission target list and the transmission target information, the consumption network is 4M in total, and obviously, the cost of the method is extremely high.
Aiming at the cost problem existing in the mode, the scheme designs a novel transmission mode, the message transmitted by the sending target in the network is improved, the screening condition of the sending target and the ID of the deselected sending target are transmitted to the server, the server automatically inquires all the sending targets meeting the screening condition, and the deselected sending targets are deselected based on filtering, so that the final sending target is obtained. In this way, the delivery destination list of the client can also acquire data in pages, 10 pieces of data are calculated in one page, the delivery content and the delivery destination screening condition are calculated according to 1K, the network for delivering 9846 objects consumes about 3K, and the delivery cost is greatly reduced compared with the above manner.
Improved request parameter form:
TABLE 2
Field(s) Field type Description of the invention
LoginUserId String Logged-on user id
CheckedTargets Object[] List of selected transmission targets
SendTargetTotal Int Total number of transmission targets
CheckedFlag Int The selection mode is 1: full selection and 0: non-full selection
UncheckedTargetIds String[] Transmit target id deselected at full selection
SearchTargetCondition String Inquiring parameters of transmission targets, i.e. screening conditions
MsgType Int Message type, 1: text, 2: picture, 3: card
MsgContent String Message content
Compared with the existing form, 3 fields of CheckedFlag, UnceckedTargetIds and SearchTargetCondition are added, and the client transmits the request parameters of foreground service to the filter conditions of the transmission targets instead of specific transmission targets. The foreground service can transmit the filtering condition of the sending target received from the client to the middle station service, and the back end middle station service inquires the specific sending target of the mass-sending message according to the filtering condition.
The following example of the request parameters for non-all-round selection forward selection may include a screening condition, or may not include the screening condition, and the specific sending destination is determined directly according to the sending destination ID:
{
"LoginUserId":1,
0 (i.e., a preset value),
"SendTargetTotal":2,
"CheckedTargetIds":[1212087838028,1212087838029],
"MsgType":1,
"MsgContent". Please take medication according to the medical advice and make a follow-up visit! "
}
Examples of request parameters for the full and reverse selections are as follows:
{
"LoginUserId":1,
"CheckedFlag":1,
"SendTargetTotal":9848,
"UncheckedTargetIds":[1212087838028,1212087838029],
"SearchTargetCondition" { \\ "PatientSex \": man \ "}",
"MsgType":1,
"MsgContent". Please take medication according to the medical advice and make a follow-up visit! "
}
According to the method provided by the embodiment, the filtering condition is divided into forward selection and reverse selection after full selection, so that diversity selection is realized, and the problem that one user selects one selection and consumes too long labor time is avoided.
Referring to fig. 4, a schematic flow chart of another optional group sending processing method applied to the server according to the embodiment of the present invention is shown, including the following steps:
s401: analyzing a message body of a group sending message task to obtain a message batch number and a request parameter, and converting the request parameter into a group sending message object; the method comprises the steps that a message batch number of a sending record is established in a database, and the sending record corresponds to a group sending message request and comprises a sending state;
s402: inquiring a database according to the message batch number to obtain the sending state of the mass-sending message object, and searching the sending targets meeting the filtering condition under the condition that the sending state is not sent so as to obtain sending target information corresponding to each sending target identifier;
s403: uploading the sending target information to an object storage server as a snapshot, and sending the message content to each sending target based on the snapshot; the snapshot is used for ensuring consistency of the sending target information during the re-consumption processing.
In the above embodiment, for steps S401 to S402, the server needs to respond quickly after receiving the group-sending message request from the client, and at this time, quick response cannot be achieved for synchronous real-time sending of a large number of sending targets. In order to quickly respond, the sending record of the group sending message request can be stored in a database, then the group sending message task is constructed in the distributed high-performance message middleware, the group sending message task is pulled from the message middleware in real time and is processed asynchronously, and the user can be directly responded at the moment, so that the group sending message task is submitted and started.
From the aforementioned database fields, the subject message body format of the mass messaging task is known as follows (numerical values are merely examples):
{
"Id":1212343568,
"BatchId":"364166e9",
"LoginUserId":1,
"SendTargetTotal":9848,
"CheckedFlag":1,
"UncheckedTargetIds":[],
"SearchTargetCondition" { \\ "PatientSex \": man \ "}",
"MsgType":1,
"MsgContent". Please take medication according to the medical advice and make a follow-up visit! "
}
And monitoring a subject message body of a mass-sending message task in the message middleware by using a specified program process, and continuously pulling a message batch number and a request parameter in the subject message body to convert the request parameter in the JSON format into a mass-sending message object. Inquiring a sending record in a database according to the message batch number:
1. if the query result is not present, the mass-sending message object is invalid and does not need to be processed.
2. If the sending record is found, the sending state of the sending record is checked, if the sending record is sent, the sending record does not need to be processed, and if the sending record is not sent, the subsequent logic processing is carried out, such as finding the invention target meeting the filtering condition.
With step S403, in the aforementioned database table field design, specific transmission target information is not directly stored, because the data size of the specific transmission target information is related to how many transmission targets the user selects, and the data size of selecting a few transmission targets is only several tens of bytes, but the data size reaches the mega level when selecting tens of thousands of transmission targets. Storing this data directly in the database can take up significant valuable resources and severely impact the performance of the database.
In the first operation, the information of each invention target is obtained according to the ID of the invention target, the information of the invention target is stored in the object storage server as a snapshot, so that the consistency of the sent target information during retry processing is ensured, and the database only stores the snapshot address. The database only concerns the message mass sending result, and does not need to concern the mode of selecting a sending target and the transmission mode, so that the storage complexity of the database is reduced, the storage and query performance is improved, and the relationship between the database and the object storage server is shown in figure 5. Wherein, the snapshot is as follows: with respect to a fully available copy of a given data set that includes a shadow of the corresponding data at some point in time (the point in time at which the copy began), the snapshot may be a copy of the data it represents or a replica of the data.
In the step, whether a snapshot storage address (ossUrl field) of sending target information exists in a group sending message object is checked, if not, the operation is represented as the first operation, a specific sending target needs to be searched according to filtering conditions, each piece of sending target information is searched and uploaded to an object storage server as a snapshot, and the storage address is obtained and persisted to a sending record of a database. And if so, directly acquiring the snapshot from the object storage server according to the storage address.
It should be noted that the sending target information is first stored in the object storage server, and the subsequent actual group sending message is sent based on the sending target information stored in the object storage server, and the sending process may be abnormal, and needs to be resent after the abnormality, and the resent sending target information is also based on the snapshot of the object storage server, so as to ensure that the sending target at the time of resending is the original sending target, and achieve consistency.
In the method provided in the foregoing embodiment, the information of all sending targets requested to be sent in a group at this time is stored in one snapshot, and even if the information is reprocessed after an exception, the snapshot is used for processing, so as to ensure consistency of the sending target information.
Referring to fig. 6, a schematic flow chart of another optional method for processing group sending of a message at a server according to an embodiment of the present invention is shown, including the following steps:
s601: acquiring the total quantity of the transmission targets in the request parameters, calculating the quotient of the total quantity of the transmission targets and the quantity of the transmission targets which can be processed by the subtasks, and rounding the quotient upwards to obtain a plurality of rounded subtasks;
s602: executing the plurality of subtasks in parallel using threads in a thread pool to send the message content to each sending target based on the snapshot;
s603: and updating the message group sending result of the subtask according to the message sending result of each sending target in the subtask after executing one subtask, and updating the message group sending result of the group sending message task after executing all subtasks.
In the above embodiment, in steps S601 to S603, the number of sending targets is usually ten thousand, so that the pressure of sending messages to ten thousand sending targets at the same time is too large, and the present solution splits the group sending message task into a plurality of subtasks, and each subtask processes a certain number of sending targets.
If there are 9846 sending targets, each subtask processes 90 sending targets, 9846/90 is 109.4, and the round is rounded up to 110, that is, the mass messaging task needs to be split into 110 subtasks. The 110 subtasks can then be executed in parallel using the threads in the thread pool, and 110 messages can be sent at the same time. Or determining the number of the sub-tasks which can be split according to the number of the threads available in the thread pool, so as to evenly split the sending targets into the sub-tasks.
In order to ensure the performance of message retrieval, the sending records of the whole batch of mass-sending message requests and the message sending records of each sending target are stored in different data storage components, which is shown in fig. 7. The sending record of the group sending message request is stored in the database and corresponds to one piece of data in the database. The message transmission record for each transmission destination is stored in the ES, and as exemplified above, the transmission record of one batch corresponds to 9846 message transmission records in the ES.
When the intermediate station service executes the subtasks in parallel, the message sending record of each sending target is stored in the ES, the message sending record comprises a message sending result, and the message sending result is successful sending or failed sending. And if the execution of the messages of the whole batch is finished, updating the Status field of the sending state of the database to be finished, counting the number of messages with successful message sending results in the ES, and then updating a sending success number (Sendsuccessnum) field in the database. Subsequent users can check specific sending conditions, and if messages are sent to 30000 patients in a group, the number of successful sending is 28000.
In the method provided by the embodiment, in order to reduce the service pressure of the server, one group message sending task is divided into a plurality of subtasks, and the plurality of subtasks are executed in parallel, so that the throughput of sending messages to a plurality of sending targets at the same time is improved; the sending records of the mass messaging tasks are stored in the database, but the sending result of each sending target is stored in the ES, so that the efficiency of subsequent retrieval is improved.
Referring to fig. 8, a schematic flow chart of a message bulk sending processing method applied to a client according to an embodiment of the present invention is shown, including the following steps:
s801: receiving a screening condition and message content input by a user, and searching all sending targets meeting the screening condition;
s802: receiving the selection operation of a user on a plurality of sending targets by using a forward selection mode;
s803: receiving the deselection operation of one or more sending targets by a user in a full selection state;
s804: responding to the selection operation of the user on the group sending message option, generating a filtering condition according to the screening field, the selection mode field and the sending target identification, and obtaining a request parameter by combining the message content; the sending target identification is a sending target identification selected in the forward direction or a sending target identification deselected in the full selection;
s805: and generating a group sending message request based on the request parameters, transmitting the group sending message request to the server, and then receiving and displaying a message group sending result fed back by the server.
In the above embodiment, with respect to steps S801 to S805, referring to fig. 3(a) and 3(b) as well, assuming that the total number of the transmission targets screened after the user inputs the screening condition is 9848, if the method of fig. 3(a) is used, the user can click to select the transmission target 1 and the transmission target 2, if the method of fig. 3(b) is used, the user can click to select 9848 transmission targets, i.e., the transmission target 1 to the transmission target 9848, by clicking the "full selection" option without turning pages, and can also cancel to select the transmission target 2 and the transmission target 3 again, and at this time, only the messages are sent to the remaining 9846 transmission targets in a group manner.
And the subsequent page determines the key value of the selection mode field according to the specific selection mode of the user, wherein 0 or 1 is represented as a forward selection mode, and 1 is represented as a full selection mode and a deselection mode. And determining the key value of the screening field according to the input screening condition, wherein the PatientSex is a male. And generating request parameters according to the invention target ID, the selection mode field, the screening field, the user login ID and the message content (such as text, pictures and the like) to be sent in group selected by the user, and further generating a group message sending request to the server.
The message group sending result finally returned by the server may include the sending status, the number of successful sending, which sending targets failed to send, and the like. In addition, after the server generates the mass message task to the message middleware, the server can generate a message mass request result to the client, and informs the client that the request is received and starts to be processed.
The following examples of the request parameters for forward selection may include a filtering condition or may not include a filtering condition, and the specific transmission destination is determined directly according to the transmission destination ID:
{
"LoginUserId":1,
0 (i.e., a preset value),
"SendTargetTotal":2,
"CheckedTargetIds":[1212087838028,1212087838029],
"MsgType":1,
MsgContent means Please take medicine according to the doctor's advice and make a follow-up visit in time! "
}
Examples of request parameters for full and reverse selection are as follows:
{
"LoginUserId":1,
"CheckedFlag":1,
"SendTargetTotal":9848,
"UncheckedTargetIds":[1212087838028,1212087838029],
"SearchTargetCondition" { \\ "PatientSex \": \ Men \ "),
"MsgType":1,
MsgContent means Please take medicine according to the doctor's advice and make a follow-up visit in time! "
}
Compared with the mode that the existing client directly transmits the sending target list and the sending target information to the server, the method greatly reduces the network transmission cost and solves the problem that the client transmits big data to the server.
Compared with the prior art, the method provided by the embodiment of the invention has at least the following beneficial effects that:
1. improving transmission request parameters: the client does not directly transmit the sending target information to the server, but transmits the filtering condition to the server, and the server automatically inquires and determines the sending target, so that the mass sending message request data transmission mode of the client is simplified, and the network transmission pressure and consumption are reduced;
2. the filtering conditions are forward filtering and reverse filtering after full selection, so that diversity selection is realized, and the problem that a user consumes too long manual time for selecting one filter is avoided;
3. the information of all sending targets requested to be sent in a group at this time is uploaded to an object storage server to be used as a snapshot, and the snapshot is used for processing even if the information is processed again after abnormality, so that the consistency and the searching performance of the information of the sending targets are ensured;
4. one group message sending task is divided into a plurality of subtasks and flexibly scheduled and executed in parallel, so that the throughput of sending the messages to a plurality of sending targets at the same time is improved, and the timeliness of message touch is guaranteed;
5. the heterogeneous storage batch group sending records and the detailed sending records are stored in the database for the group sending message task, but the sending result for each sending target is stored in the ES, so that the message record retrieval performance is improved.
6. A re-submission prevention check mechanism is arranged, and when a user clicks a group sending message button for multiple times, the system passes the re-submission prevention check and only needs to execute once; the server side receives the group sending message request, then makes a persistent request and sends the persistent request to the message middleware, and immediately responds to the user, and the user can obtain a response result in a short time of 100 ms;
7. the message middleware has a response mechanism, so that the consuming operation can be automatically re-executed when the consuming group message sending task fails, and the reliability is good.
Referring to fig. 9, a schematic block diagram illustrating a message bulk sending processing apparatus 900 applied to a server according to an embodiment of the present invention is shown, including:
a receiving module 901, configured to receive a group message request transmitted by a client, construct a group message task according to a filtering condition in a request parameter and a message content to be group-sent, and send the group message task to a message middleware;
a mass-sending module 902, configured to execute the mass-sending message task through a process of consuming message middleware, to search for a sending target meeting the filtering condition, and to send the message content to the sending target in a mass-sending manner;
and the updating module 903 is configured to update the message group sending result of the group sending message task according to the message sending result of each sending target, and return the message group sending result to the client.
In the implementation apparatus of the present invention, the mass sending module 902 is configured to:
analyzing the message body of the group sending message task to obtain a message batch number and the request parameter, and converting the request parameter into a group sending message object;
inquiring a database according to the message batch number to obtain the sending state of the mass-sending message object, and searching the sending targets meeting the filtering condition under the condition that the sending state is not sent so as to obtain sending target information corresponding to each sending target identifier;
uploading the sending target information to an object storage server as a snapshot, and sending the message content to each sending target based on the snapshot; the snapshot is used for ensuring consistency of the sending target information during the re-consumption processing.
In the implementation device of the invention, the filtering condition comprises a screening field, a selection mode field and a sending target identifier, wherein the sending target identifier is a sending target identifier selected in the forward direction or a sending target identifier deselected when the sending target identifier is selected completely;
the mass sending module 902 is configured to:
searching all sending targets which accord with the screening field, and judging whether the key value of the selection mode field is a preset value or not;
if so, determining that the selection mode is forward selection, and taking a sending target corresponding to the sending target identification in all sending targets as an object of the message to be sent in a group; or
If not, determining that the selection mode is full selection and reverse selection, and taking the rest sending targets except the sending target identification in all the sending targets as the objects of the current message to be sent in a group.
In the implementation apparatus of the present invention, the mass sending module 902 is further configured to:
determining the storage address of the snapshot in the object storage server, and storing the storage address in the sending record of a database; and
responding to the re-consumption processing operation, and under the condition that the sending state is incomplete, acquiring the storage address from a database according to the message batch number so as to acquire the snapshot from the object storage server based on the storage address.
In the implementation apparatus of the present invention, the request parameter further includes a total quantity of sending targets, and the mass sending module 902 is further configured to:
calculating a quotient of the total quantity of the sending targets and the quantity of the sending targets which can be processed by the subtasks, and rounding the quotient upwards to obtain a plurality of rounded subtasks;
executing the plurality of subtasks in parallel using threads in a thread pool to send the message content to each send target based on the snapshot;
the update module 903 is configured to:
and updating the message group sending result of the subtask according to the message sending result of each sending target in the subtask after executing one subtask, and updating the message group sending result of the group sending message task after executing all subtasks.
In the apparatus for implementing the present invention, the updating module 903 is further configured to:
storing the message sending record of each sending target in a specified data storage component; the message sending record comprises a message sending result, and the message sending result is successful sending or failed sending; and
and counting the number of the message sending records with the successful message sending result in the data storage assembly, and changing the key value of the sending successful number field of the sending records into the number of the message sending records.
In the device for implementing the invention, the request parameter also comprises a user login identifier;
the receiving module is configured to:
according to the user login identification, carrying out anti-re-submission verification on the request parameter;
responding to the verification result that the message request passes, generating a sending record aiming at the mass sending message request, and persisting the sending record into a database; wherein, the sending record comprises a sending state and a message group sending result; and
and constructing the group sending message task according to the filtering condition in the request parameter and the message content to be group sent, and sending the group sending message task to a message middleware.
In the implementation apparatus of the present invention, the mass sending module 902 is further configured to:
according to the response mechanism of the message middleware, if the consumption processing fails, executing the re-consumption operation; and
and adding a distributed lock to the group message sending task, executing the group message sending task by the process of the message consumption middleware according to the distributed lock, and releasing the distributed lock after the processing is finished.
In the implementation apparatus of the present invention, while constructing the group sending message task and sending it to the message middleware, the implementation apparatus further comprises: and returning the message mass-sending request result to the client.
Referring to fig. 10, a schematic diagram illustrating major modules of a message bulk sending processing apparatus 1000 applied to a client according to an embodiment of the present invention is shown, including:
an operation module 1001, configured to receive a filtering condition and message content input by a user, and search for all sending targets that meet the filtering condition, so as to receive a selection operation of the user on multiple sending targets;
a generating module 1002, configured to respond to a selection operation of a user on a group sending message option, generate a filtering condition according to a screening field, a selection mode field, and a sending target identifier, and obtain a request parameter in combination with the message content; the sending target identification is a sending target identification selected in the forward direction or a sending target identification deselected when the sending target identification is selected completely;
a transmission module 1003, configured to generate a group message request based on the request parameter, transmit the group message request to the server, and then receive and display a message group result fed back by the server.
In the implementation apparatus of the present invention, the operation module 1001 is configured to:
receiving the selection operation of a user on a plurality of sending targets by using a forward selection mode; or
And receiving the deselection operation of one or more sending targets by the user in the full selection state.
In the implementation apparatus of the present invention, before the receiving and displaying the message group sending result fed back by the server, the apparatus further includes: and receiving and displaying a message group sending request result returned by the server.
In addition, the detailed implementation of the apparatus in the embodiment of the present invention has been described in detail in the above method, so that the repeated description is not repeated here.
Fig. 11 shows an exemplary system architecture 1100 to which embodiments of the invention may be applied, comprising terminal devices 1101, 1102, 1103, a network 1104 and a server 1105 (merely an example).
The terminal devices 1101, 1102, 1103 may be various electronic devices having a display screen and supporting web browsing, and installed with various communication client applications, and users may interact with the server 1105 through the network 1104 using the terminal devices 1101, 1102, 1103 to receive or send messages and the like.
The network 1104 is a medium to provide communication links between the terminal devices 1101, 1102, 1103 and the server 1105. Network 1104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The server 1105 may be a server providing various services, and it should be noted that the method provided by the embodiment of the present invention is generally executed by the server 1105, and accordingly, the apparatus is generally disposed in the server 1105.
It should be understood that the number of terminal devices, networks, and servers in fig. 11 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
Referring now to FIG. 12, shown is a block diagram of a computer system 1200 suitable for use with a terminal device implementing embodiments of the present invention. The terminal device shown in fig. 12 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 12, the computer system 1200 includes a Central Processing Unit (CPU)1201, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1202 or a program loaded from a storage section 1208 into a Random Access Memory (RAM) 1203. In the RAM 1203, various programs and data necessary for the operation of the system 1200 are also stored. The CPU 1201, ROM 1202, and RAM 1203 are connected to each other by a bus 1204. An input/output (I/O) interface 1205 is also connected to bus 1204.
The following components are connected to the I/O interface 1205: an input portion 1206 including a keyboard, a mouse, and the like; an output portion 1207 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 1208 including a hard disk and the like; and a communication section 1209 including a network interface card such as a LAN card, a modem, or the like. The communication section 1209 performs communication processing via a network such as the internet. A driver 1210 is also connected to the I/O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is mounted on the drive 1210 as necessary, so that a computer program read out therefrom is mounted into the storage section 1208 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication portion 1209 and/or installed from the removable medium 1211. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 1201.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, 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. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present invention, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a receiving module, a mass-sending module and an updating module. Where the names of these modules do not in some cases constitute a limitation on the modules themselves, for example, a mass-sending module may also be described as a "mass-sending message module".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not assembled into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform any of the message bulk handling methods described above.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (16)

1. A message group sending processing method is applied to a server side and is characterized by comprising the following steps:
receiving a mass-sending message request transmitted by a client, constructing a mass-sending message task according to a filtering condition in a request parameter and message content to be mass-sent, and sending the mass-sending message task to a message middleware;
executing the mass-sending message task through a process of consuming message middleware to search a sending target meeting the filtering condition and mass-sending the message content to the sending target;
and updating the message mass sending result of the mass sending message task according to the message sending result of each sending target, and returning the message mass sending result to the client.
2. The method of claim 1, wherein the searching for the sending target meeting the filtering condition and sending the message content to the sending target in a group comprises:
analyzing the message body of the group sending message task to obtain a message batch number and the request parameter, and converting the request parameter into a group sending message object;
inquiring a database according to the message batch number to obtain the sending state of the mass-sending message object, and searching the sending targets meeting the filtering condition under the condition that the sending state is not sent so as to obtain sending target information corresponding to each sending target identifier;
uploading the sending target information to an object storage server as a snapshot, and sending the message content to each sending target based on the snapshot; the snapshot is used for ensuring consistency of the sending target information during the re-consumption processing.
3. The method according to claim 1 or 2, wherein the filtering condition comprises a screening field, a selection mode field, a sending target identifier, wherein the sending target identifier is a sending target identifier selected in a forward direction or a sending target identifier deselected when selected at all;
the searching for the sending target meeting the filtering condition comprises the following steps:
searching all sending targets which accord with the screening field, and judging whether the key value of the selection mode field is a preset value or not;
if so, determining that the selection mode is forward selection, and taking a sending target corresponding to the sending target identification in all sending targets as an object of the message to be sent in a group; or
If not, determining that the selection mode is full selection and reverse selection, and taking the rest sending targets except the sending target identification in all the sending targets as the objects of the current message to be sent in a group.
4. The method of claim 2, further comprising:
determining the storage address of the snapshot in the object storage server, and storing the storage address in the sending record of a database; and
responding to the re-consumption processing operation, and under the condition that the sending state is incomplete, acquiring the storage address from a database according to the message batch number so as to acquire the snapshot from the object storage server based on the storage address.
5. The method as claimed in claim 2 or 4, wherein the requesting parameters further include a total number of sending targets, and the group sending the message contents to the sending targets further includes:
calculating a quotient of the total quantity of the sending targets and the quantity of the sending targets which can be processed by the subtasks, and rounding the quotient upwards to obtain a plurality of rounded subtasks;
executing the plurality of subtasks in parallel using threads in a thread pool to send the message content to each send target based on the snapshot;
the updating the message mass-sending result of the mass-sending message task according to the message sending result of each sending target comprises the following steps:
and updating the message group sending result of the subtask according to the message sending result of each sending target in the subtask after executing one subtask, and updating the message group sending result of the group sending message task after executing all subtasks.
6. The method of claim 5, further comprising:
storing the message sending record of each sending target in a specified data storage component; the message sending record comprises a message sending result, and the message sending result is successful sending or failed sending; and
and counting the number of the message sending records with the successful message sending result in the data storage assembly, and changing the key value of the sending successful number field of the sending records into the number of the message sending records.
7. The method according to claim 1 or 2, wherein the request parameters further comprise a user login identification;
the method for constructing the group sending message task and sending the group sending message task to the message middleware according to the filtering condition in the request parameter and the message content to be group sent comprises the following steps:
according to the user login identification, carrying out anti-re-submission verification on the request parameter;
responding to the verification result that the verification result is passed, generating a sending record aiming at the mass sending message request, and persisting the sending record into a database; wherein, the sending record comprises a sending state and a message mass sending result; and
and constructing the group sending message task according to the filtering condition in the request parameter and the message content to be group sent, and sending the group sending message task to a message middleware.
8. The method of claim 1 or 2, wherein the performing the bulk messaging task by the process consuming message middleware further comprises:
according to a response mechanism of the message middleware, if the consumption processing fails, executing the re-consumption operation; and
and adding a distributed lock to the group message sending task, executing the group message sending task by the process of the message consumption middleware according to the distributed lock, and releasing the distributed lock after the processing is finished.
9. The method of claim 8, wherein while building and sending a group messaging task into messaging middleware, further comprising: and returning the message mass-sending request result to the client.
10. A message group sending processing method is applied to a client, and is characterized by comprising the following steps:
receiving a screening condition and message content input by a user, searching all sending targets meeting the screening condition so as to receive the selection operation of the user on a plurality of sending targets;
responding to the selection operation of the user on the group sending message option, generating a filtering condition according to the screening field, the selection mode field and the sending target identification, and obtaining a request parameter by combining the message content; the sending target identification is a sending target identification selected in the forward direction or a sending target identification deselected in the full selection;
and generating a group sending message request based on the request parameters, transmitting the group sending message request to the server, and then receiving and displaying a message group sending result fed back by the server.
11. The method of claim 10, wherein receiving a user selection of a plurality of destinations comprises:
receiving the selection operation of a user on a plurality of sending targets by using a forward selection mode; or
And receiving the deselection operation of one or more sending targets by the user in the full selection state.
12. The method according to claim 10 or 11, before receiving and displaying the message mass-sending result fed back by the server, further comprising: and receiving and displaying a message group sending request result returned by the server.
13. A message group sending processing device is applied to a server side and is characterized by comprising:
the receiving module is used for receiving a mass-sending message request transmitted by the client, constructing a mass-sending message task according to the filtering condition in the request parameter and the message content to be mass-sent and sending the mass-sending message task to the message middleware;
the mass-sending module is used for executing the mass-sending message task through a process of consuming message middleware to search a sending target meeting the filtering condition and send the message content to the sending target in a mass-sending mode;
and the updating module is used for updating the message group sending result of the group sending message task according to the message sending result of each sending target and returning the message group sending result to the client.
14. A message mass-sending processing device applied to a client is characterized by comprising:
the operation module is used for receiving the screening conditions and the message contents input by the user, searching all the sending targets which accord with the screening conditions, and receiving the selection operation of the user on a plurality of sending targets;
the generation module is used for responding to the selection operation of the user on the group sending message option, generating a filtering condition according to the screening field, the selection mode field and the sending target identification, and obtaining a request parameter by combining the message content; the sending target identification is a sending target identification selected in the forward direction or a sending target identification deselected in the full selection;
and the transmission module is used for generating a group message request based on the request parameters, transmitting the group message request to the server, and then receiving and displaying a message group sending result fed back by the server.
15. An electronic device, comprising:
one or more processors;
a storage device to store one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-12.
16. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-12.
CN202210391976.0A 2022-04-14 2022-04-14 Message group sending processing method and device Pending CN114785749A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210391976.0A CN114785749A (en) 2022-04-14 2022-04-14 Message group sending processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210391976.0A CN114785749A (en) 2022-04-14 2022-04-14 Message group sending processing method and device

Publications (1)

Publication Number Publication Date
CN114785749A true CN114785749A (en) 2022-07-22

Family

ID=82429409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210391976.0A Pending CN114785749A (en) 2022-04-14 2022-04-14 Message group sending processing method and device

Country Status (1)

Country Link
CN (1) CN114785749A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115334466A (en) * 2022-08-15 2022-11-11 北京泰迪熊移动科技有限公司 Message sending method and device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968442A (en) * 2006-04-14 2007-05-23 华为技术有限公司 Short message group sending system and method
US20070162457A1 (en) * 2006-01-06 2007-07-12 Roland Barcia Apparatus for sending a sequence of asynchronous messages to the same member of a clustered consumer
CN101183377A (en) * 2007-12-10 2008-05-21 华中科技大学 High availability data-base cluster based on message middleware
CN110753129A (en) * 2019-10-29 2020-02-04 深圳前海微众银行股份有限公司 Message transmission method, system, device, equipment and computer readable storage medium
CN111198769A (en) * 2018-11-16 2020-05-26 北京京东金融科技控股有限公司 Information processing method and system, computer system and computer readable medium
CN111666162A (en) * 2020-04-30 2020-09-15 平安科技(深圳)有限公司 Distributed message transmission method, device, computer equipment and storage medium
CN112311868A (en) * 2020-10-27 2021-02-02 上海淇馥信息技术有限公司 Message touch method and device and electronic equipment
CN114124861A (en) * 2020-08-28 2022-03-01 腾讯科技(深圳)有限公司 Message group sending method and device, computer equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070162457A1 (en) * 2006-01-06 2007-07-12 Roland Barcia Apparatus for sending a sequence of asynchronous messages to the same member of a clustered consumer
CN1968442A (en) * 2006-04-14 2007-05-23 华为技术有限公司 Short message group sending system and method
CN101183377A (en) * 2007-12-10 2008-05-21 华中科技大学 High availability data-base cluster based on message middleware
CN111198769A (en) * 2018-11-16 2020-05-26 北京京东金融科技控股有限公司 Information processing method and system, computer system and computer readable medium
CN110753129A (en) * 2019-10-29 2020-02-04 深圳前海微众银行股份有限公司 Message transmission method, system, device, equipment and computer readable storage medium
CN111666162A (en) * 2020-04-30 2020-09-15 平安科技(深圳)有限公司 Distributed message transmission method, device, computer equipment and storage medium
CN114124861A (en) * 2020-08-28 2022-03-01 腾讯科技(深圳)有限公司 Message group sending method and device, computer equipment and storage medium
CN112311868A (en) * 2020-10-27 2021-02-02 上海淇馥信息技术有限公司 Message touch method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115334466A (en) * 2022-08-15 2022-11-11 北京泰迪熊移动科技有限公司 Message sending method and device, electronic equipment and storage medium
CN115334466B (en) * 2022-08-15 2023-08-04 北京泰镝科技股份有限公司 Message sending method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11216430B2 (en) Next generation near real-time indexing
US8983902B2 (en) Transparent caching of configuration data
US8818940B2 (en) Systems and methods for performing record actions in a multi-tenant database and application system
EP3244312A1 (en) A personal digital assistant
US8762408B2 (en) Optimizing software applications
US20160292171A1 (en) Shard aware near real time indexing
US20140032593A1 (en) Systems and methods to process a query with a unified storage interface
US20120158655A1 (en) Non-relational function-based data publication for relational data
CN102449628A (en) Architectural pattern for persistent web application design
US20120224482A1 (en) Credit feedback system for parallel data flow control
US11290551B1 (en) Method and system for implementing circle of trust in a social network
US10755362B2 (en) Escrow personalization system
CN117413289A (en) Controlled display of related message threads
CN114138447A (en) Task processing method, device, equipment and storage medium
CN114785749A (en) Message group sending processing method and device
CN112579897B (en) Information searching method and device
US11269856B2 (en) Methods, apparatuses, and systems for ingesting and consuming data utilizing a trading partner manager
CN113986936A (en) Data processing method and device, electronic equipment and storage medium
CN113127564A (en) Parameter synchronization method and device
CN116701445A (en) Resource matching information generation method, device, equipment and computer readable medium
CN115185787B (en) Method and device for processing transaction log
US20220100740A1 (en) Systems and methods for automatically creating and/or managing electronic data tables
WO2015115035A1 (en) Social network server, screen display method, and recording medium
US20150006690A1 (en) Feature set negotiation framework
EP3369069A1 (en) Escrow personalization system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination