CN111835467A - Message sending method, device, computer equipment and storage medium - Google Patents
Message sending method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN111835467A CN111835467A CN202010740520.1A CN202010740520A CN111835467A CN 111835467 A CN111835467 A CN 111835467A CN 202010740520 A CN202010740520 A CN 202010740520A CN 111835467 A CN111835467 A CN 111835467A
- Authority
- CN
- China
- Prior art keywords
- message
- target
- sent
- sending
- service system
- 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.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/1607—Details of the supervisory signal
- H04L1/1671—Details of the supervisory signal the supervisory signal being transmitted together with control information
- H04L1/1678—Details of the supervisory signal the supervisory signal being transmitted together with control information where the control information is for timing, e.g. time stamps
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/18—Automatic repetition systems, e.g. Van Duuren systems
- H04L1/1809—Selective-repeat protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/18—Automatic repetition systems, e.g. Van Duuren systems
- H04L1/1867—Arrangements specially adapted for the transmitter end
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides a message sending method, which comprises the following steps: recording key parameters and message types of messages to be sent in a preset message recording table; sending a message to be sent to a target downstream service system, wherein the message to be sent carries the current message sending time of the upstream system and the previous message sending time of the upstream system; when a message retransmission request returned by a target downstream service system is received, wherein the message retransmission request comprises the previous message receiving time of the downstream system, searching the message sent to the target downstream service system between the previous message receiving time of the downstream system and the current message sending time of the upstream system, then judging whether the message state of the searched message is failed, if not, taking the searched message as a new message to be sent and returning to the step of sending the message to be sent to the target downstream service system, and meanwhile, adding 1 to the historical sending times of each new message to be sent. The invention can confirm whether the message is lost or not on the premise of not influencing the process performance of the upstream service system.
Description
Technical Field
The present invention relates to the field of message transmission technologies, and in particular, to a message sending method, an apparatus, a computer device, and a storage medium.
Background
When two associated systems interact, in order to decouple or avoid Message flooding, an upstream service system has many scenarios that need to send messages to a downstream service system through an MQ (Message Queue), but the interaction between the systems through the MQ is not 100% reliable, and no matter whether the interaction is activeMq, rabbitMq, rockctmq or Kafka, the messages can not be sent successfully by 100%. Currently, it is common for downstream traffic systems to send a receipt back to upstream traffic systems to confirm that the message was sent successfully. When there are more downstream business systems receiving messages, more receipts can affect the process performance of the upstream business system.
Furthermore, when message transmission fails, it is necessary for the upstream traffic system to support message retransmission. The traditional scheme is that after capturing abnormal messages, the messages are directly retransmitted and retried for a plurality of times, if the retries fail for a plurality of times, the messages are discarded and are not retransmitted, when the downstream service system finds problems, the upstream service system notifies the upstream service system, the upstream service system notifies the artificial message, and the artificial message is retransmitted to the downstream service system. In view of the above, the prior art provides another scheme, in which after a certain message still fails to be retransmitted for many times, the message is stored in a cache system, and then a timer is used to periodically fetch the cache message from the cache system at intervals for retransmission.
Disclosure of Invention
In view of the above deficiencies of the prior art, the present invention provides a message sending method, apparatus, computer device and storage medium, which can determine whether a message is lost without affecting the performance of the upstream service system process, and meanwhile, when the message sending fails, the message does not need to be cached, thereby saving the storage cost.
In order to achieve the above object, the present invention provides a message sending method, including:
recording key parameters and message types of messages to be sent in a preset message recording table;
sending the message to be sent to a target downstream service system, wherein the message to be sent carries the current message sending time of an upstream system and the previous message sending time of the upstream system;
when a message retransmission request returned by the target downstream service system is received, wherein the message retransmission request comprises the previous message receiving time of the downstream system, searching the message sent to the target downstream service system between the previous message receiving time of the downstream system and the current message sending time of the upstream system, then judging whether the message state of the searched message is failed, if not, taking the searched message as a new message to be sent and returning to the step of sending the message to be sent to the target downstream service system, and meanwhile adding 1 to the historical sending times of each new message to be sent;
when the historical sending times of a certain new message to be sent reach a preset first resending time threshold value, setting the message state of the new message to be sent as failure, and simultaneously discarding the new message to be sent;
and scheduling tasks at regular time to acquire key parameters and message types corresponding to the failure message states from the message record table, searching necessary parameters required by generating corresponding target messages from a preset service database according to the acquired key parameters and message types, assembling the necessary parameters according to preset protocol rules to obtain the target messages, and sending the target messages to the target downstream service system.
In an embodiment of the present invention, before recording the key parameter and the message type of the message to be sent in the preset message record table, the method further includes:
and establishing the message record table to record key parameters, message types, message states, historical sending times and sending time of the messages.
In one embodiment of the present invention, the target message carries a receipt request;
after the sending the target message to the target downstream traffic system, the method further comprises:
and when receiving a return receipt returned by the target downstream service system, updating the message state corresponding to the target message to be successful.
In one embodiment of the present invention, after the sending the target message to the target downstream traffic system, the method further includes:
and when the return receipt returned by the target downstream service system is not received, updating the historical retransmission times of the target message.
In one embodiment of the present invention, after the updating the historical number of retransmissions of the target message, the method further comprises: and judging whether the historical retransmission times of the target message reach a preset second retransmission time threshold value or not, and if so, outputting corresponding alarm information.
In one embodiment of the invention, the method further comprises:
receiving key parameters and message types input by a user;
and searching necessary parameters required by generating a corresponding target message from the service database according to key parameters and message types input by a user, assembling the necessary parameters according to a preset protocol rule to obtain the target message, and retransmitting the target message to the target downstream service system.
In one embodiment of the invention, the method further comprises:
receiving a batch retransmission document input by a user, wherein the batch retransmission document comprises key parameters and message types corresponding to a plurality of target messages;
and searching necessary parameters required by generating corresponding target messages from the service database according to the key parameters and the message types corresponding to each target message, assembling the necessary parameters according to a preset protocol rule to obtain a plurality of target messages, and retransmitting the target messages to the target downstream service system.
The present invention also provides a message sending apparatus, including:
the recording module is used for recording key parameters and message types of messages to be sent in a preset message recording table;
the first message sending module is used for sending the message to be sent to a target downstream service system, wherein the message to be sent carries the current message sending time of an upstream system and the previous message sending time of the upstream system;
a retransmission module, configured to, when a message retransmission request returned by the target downstream service system is received and the message retransmission request includes a previous message receiving time of the downstream system, search for a message sent to the target downstream service system between the previous message receiving time of the downstream system and a current message sending time of the upstream system, and then determine whether a message state of the searched message is failed, if not, take the searched message as a new message to be sent and return to the step of sending the message to be sent to the target downstream service system, and add 1 to a historical sending frequency of each new message to be sent;
the retransmission failure processing module is used for setting the message state of a new message to be sent as failure when the historical transmission frequency of the new message to be sent reaches a preset first retransmission frequency threshold value, and simultaneously discarding the new message to be sent;
and the task scheduling module is used for scheduling tasks at regular time so as to acquire key parameters and message types corresponding to the failure message states from the message record table, searching necessary parameters required for generating corresponding target messages from a preset service database according to the acquired key parameters and message types, assembling the necessary parameters according to preset protocol rules to obtain the target messages, and sending the target messages to the target downstream service system.
In one embodiment of the invention, the apparatus further comprises:
and the record table establishing module is used for establishing the message record table so as to record key parameters, message types, message states, historical sending times and sending time of the messages.
In one embodiment of the present invention, the target message carries a receipt request;
the device further comprises:
and the state updating module is used for updating the message state corresponding to the target message to be successful when receiving the return receipt returned by the target downstream service system.
In one embodiment of the invention, the apparatus further comprises:
and the frequency updating module is used for updating the historical retransmission frequency of the target message when the return receipt returned by the target downstream service system is not received.
In one embodiment of the invention, the apparatus further comprises:
and the alarm module is used for judging whether the historical retransmission times of the target message reach a preset second retransmission time threshold value or not, and if so, outputting corresponding alarm information.
In one embodiment of the invention, the apparatus further comprises:
the manual retransmission instruction receiving module is used for receiving key parameters and message types input by a user;
and the manual retransmission processing module is used for searching necessary parameters required by generating the corresponding target message from the service database according to the key parameters and the message types input by the user, assembling the necessary parameters according to a preset protocol rule to obtain the target message, and retransmitting the target message to the target downstream service system.
In one embodiment of the invention, the apparatus further comprises:
the system comprises a batch resending instruction receiving module, a batch resending instruction receiving module and a batch resending instruction receiving module, wherein the batch resending document is input by a user and comprises key parameters and message types corresponding to a plurality of target messages;
and the batch retransmission processing module is used for searching necessary parameters required by generating corresponding target messages from the service database according to the key parameters and the message types corresponding to each target message, assembling the necessary parameters according to a preset protocol rule to obtain a plurality of target messages, and retransmitting the target messages to the target downstream service system.
In order to achieve the above object, the present invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the aforementioned method when executing the computer program.
In order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the aforementioned method.
Through the technical scheme, the invention has the following beneficial effects:
after the scheme of the invention is adopted, the downstream service system does not need to send the receipt to the upstream service system after receiving the message every time, thereby reducing the performance influence of sending the receipt on the upstream service system; meanwhile, when a certain message fails to be retransmitted for many times, setting the message state of the message to be transmitted as failure, and discarding the message to be transmitted; and then, scheduling tasks at regular time to acquire key parameters and message types corresponding to the failure message states from the message record table, searching necessary parameters required by the generation of the corresponding messages from a preset service database according to the acquired key parameters and message types, assembling the necessary parameters according to preset protocol rules to obtain the messages, and issuing the messages. Therefore, the invention does not need to cache the complete content of each sending failure message, reduces the storage cost, does not need to manually construct the message, and avoids the conditions of long time consumption and human errors.
Drawings
FIG. 1 is a flow chart of an embodiment of a messaging method of the present invention;
FIG. 2 is a block diagram of a message sending apparatus according to an embodiment of the present invention;
fig. 3 is a hardware architecture diagram of one embodiment of the computer apparatus of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
Example one
The embodiment provides a message sending method, which is applicable to an upstream service system, and as shown in fig. 1, the method includes the following steps:
and S1, establishing a message record table for recording key parameters, message types, message states, historical sending times and sending time of each message, wherein the message states can be initialized to be empty.
And S2, recording the key parameters and the message type of the message to be sent in the message record table. For example, if a certain message to be sent is a policy message, which includes a policy number, an insured person name, an insured person identity number, an insurance start time, an insurance deadline, a policyholder name, a policyholder identity number, etc., the policy number therein may be recorded as a key parameter of the message to be sent, and the corresponding message type is recorded as a "policy".
S3, sending the message to be sent to a target downstream service system, and recording the current time as the sending time of the message to be sent in a message recording table, where the message to be sent carries the sending time of the message of the upstream system (i.e. the current time) and the sending time of the message of the upstream system (i.e. the last time the message was sent by the upstream service system).
By adding the current message sending time of the upstream system and the previous message sending time of the upstream system to the message to be sent, the target downstream service system can match the previous message sending time of the upstream system in the message with the previous message receiving time of the downstream system (namely the last time when the target downstream service system receives the message sent by the upstream service system), if the current message sending time of the upstream system is inconsistent with the previous message receiving time of the downstream system, the message resending request is sent to the upstream service system to request the upstream service system to resend the lost message as the message to be resent. Therefore, the downstream service system does not need to send the receipt to the upstream service system after receiving the message every time, and the performance influence of the receipt sending on the upstream service system is reduced.
S4, when a message retransmission request returned by a target downstream service system is received, wherein the message retransmission request comprises the previous message receiving time of the downstream system, searching the message sent to the target downstream service system between the previous message receiving time of the downstream system and the current message sending time of the upstream system, then judging whether the message state of the searched message is failed according to the message record table, if not, returning the searched message to the step S3 as a new message to be sent so as to resend the message to the target downstream service system, and meanwhile adding 1 to the historical sending times of each new message to be sent.
Specifically, the embodiment obtains the message sent to the target downstream service system between the previous message receiving time of the downstream system and the current message sending time of the upstream system through the following steps: firstly, acquiring the previous message receiving time of the downstream system according to the message retransmission request; and then searching the message sent to the target downstream service system from the previous message receiving time of the downstream system to the current message sending time of the upstream system from the historical message sending library. Wherein, the history message database stores the complete message sent to the target downstream service in a preset time.
S5, when the historical transmission frequency of a new message to be sent reaches a preset first retransmission frequency threshold (for example, 6 times), setting the message status of the new message to be sent as failure in the message record table, so as to avoid performing multiple invalid retransmissions in a short time, and discarding the new message to be sent, so as to release the storage space occupied by the message.
S6, scheduling tasks at regular time through Quartz to obtain key parameters and message types corresponding to failure message states at regular time from the message record table, searching necessary parameters needed by generating corresponding target messages from a preset service database according to the obtained key parameters and message types, then assembling the necessary parameters according to preset protocol rules to obtain the target messages, and resending the target messages to the target downstream service system, wherein the target messages carry receipt requests.
For example, 2: 00. and scheduling tasks for three times at 12:00 and 20:00, and inquiring key parameters and message types corresponding to all messages with failure message states from the message record table. If the message type corresponding to a certain failure message state is found to be a policy and the key parameter is policy number 1234567, the necessary parameters of the policy message corresponding to the policy number "1234567", such as the name of the insured person, the identification number of the insured person, the start time of insurance, the deadline of insurance, the name of the insurant, the identification number of the insurant, etc. corresponding to the policy number "1234567", are searched from the preset service database. And then, assembling all necessary parameters according to a preset protocol rule to recover the policy information corresponding to the policy number '1234567' as a target message, retransmitting the target message to a target downstream service system, and returning a successfully received receipt after the target downstream service system receives the target message. It should be understood that the key parameters in this application are part of the essential parameters.
Since the number of failed messages is typically much smaller than the total number of messages sent by the upstream traffic system to downstream traffic, the performance impact of the upstream traffic system on handling the receipt of these messages is small.
S7, when receiving the receipt of successfully receiving the target message returned by the target downstream service system, updating the message state corresponding to the target message in the message record table to be successful, deleting the target message, and ending the process. For example, if the policy message corresponding to the policy number "1234567" is retransmitted successfully, the message status corresponding to the message type "policy" 1234567 "and the key parameter" policy number "1234567" is updated in the message log table as successful.
And S8, when the receipt of the target message successfully received returned by the target downstream service system is not received, updating the historical retransmission times of the target message and waiting for the next task scheduling. When the historical retransmission times of the target message reach a predetermined second retransmission times threshold (for example, 20 times), outputting corresponding alarm information, for example, sending an alarm mail to a corresponding developer or operator to notify the manual positioning of the reason and repair the reason.
Therefore, the downstream service system of the invention does not need to send the receipt to the upstream service system after receiving the message each time, and the performance influence of sending the receipt to the upstream service system is reduced. Meanwhile, a message record table is set to record key parameters, message types and message states of the messages, when the messages fail to be retransmitted for many times, the message states of the messages to be transmitted are set to fail in the message record table, and the messages to be transmitted are discarded; and then, scheduling tasks at regular time to acquire key parameters and message types corresponding to the failure message states from the message record table, searching necessary parameters required by the generation of the corresponding messages from a preset service database according to the acquired key parameters and message types, assembling the necessary parameters according to preset protocol rules to obtain the messages, and issuing the messages. Therefore, the invention does not need to cache the complete content of each sending failure message, reduces the storage cost, does not need to manually construct the message, and avoids the conditions of long time consumption and human errors. In addition, the message record table can record the message state of each message, so that the tracing, the message account checking and the data statistical analysis are convenient.
Preferably, the present invention also supports manual triggering if there are urgent messages that need to be retransmitted as soon as possible. In one case, the user inputs the key parameters of the message and the message type, and the method of the present invention may include: receiving key parameters and message types input by a user; and searching and generating necessary parameters required by the corresponding message to be sent from the service database according to key parameters and message types input by a user, assembling the necessary parameters according to a preset protocol rule to obtain the message to be sent, and retransmitting the message to be sent to the target downstream service system. In another case, the user may directly upload the complete message for retransmission, and the method of the present invention may include: receiving a message to be sent input by a user, and retransmitting the message to be sent to the target downstream service system.
In addition, the invention also supports the user to upload the batch retransmission document for batch retransmission. In one case, the key parameters and message types corresponding to a plurality of messages are recorded in the batch retransmission document, and the method of the present invention may include: receiving a batch message retransmission document input by a user, wherein the batch message retransmission document comprises key parameters and message types corresponding to a plurality of messages to be sent; analyzing the message retransmission document to acquire key parameters and message types corresponding to each message to be sent; and searching necessary parameters required by generating corresponding messages to be sent from the service database according to the key parameters and the message types corresponding to the messages to be sent, assembling the necessary parameters according to a preset protocol rule to obtain a plurality of messages to be sent, and retransmitting the messages to be sent to the target downstream service system. In another case, a plurality of complete messages are recorded in the batch retransmission document, and the method of the present invention may further include: receiving a batch message retransmission document input by a user, wherein the batch message retransmission document comprises a plurality of messages to be sent; analyzing the message retransmission document to acquire the plurality of messages to be sent; and retransmitting the plurality of messages to be transmitted to the target downstream service system. In this embodiment, the batch retransmission document may be a CVS (Comma-Separated Values) document, which may be parsed by parallelStream of java 8.
It should be noted that, for the sake of simplicity, the present embodiment is described as a series of acts, but those skilled in the art should understand that the present invention is not limited by the described order of acts, because some steps can be performed in other orders or simultaneously according to the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Example two
The present embodiment provides a message transmission apparatus 10, as shown in fig. 2, the apparatus 10 including:
the recording module 101 is configured to record key parameters and message types of messages to be sent in a preset message recording table;
a first message sending module 102, configured to send the message to be sent to a target downstream service system, where the message to be sent carries current message sending time of an upstream system and previous message sending time of the upstream system;
a retransmission module 103, configured to, when a message retransmission request returned by the target downstream service system is received and the message retransmission request includes a previous message receiving time of the downstream system, search for a message sent to the target downstream service system between the previous message receiving time of the downstream system and a current message sending time of the upstream system, and then determine whether a message state of the searched message is failed, if not, take the searched message as a new message to be sent and return to the step of sending the message to be sent to the target downstream service system, and add 1 to the historical sending times of each new message to be sent;
a retransmission failure processing module 104, configured to set a message state of a new message to be sent as a failure when a historical transmission frequency of the new message to be sent reaches a preset first retransmission frequency threshold, and discard the new message to be sent;
and the task scheduling module 105 is configured to perform task scheduling at regular time, so as to obtain a key parameter and a message type corresponding to a failure message state from the message record table, search a preset service database for necessary parameters required for generating a corresponding target message according to the obtained key parameter and message type, then assemble the necessary parameters according to a preset protocol rule to obtain the target message, and send the target message to the target downstream service system.
In this embodiment, the apparatus 10 further comprises:
a record table establishing module 106, configured to establish the message record table to record key parameters, message types, message states, historical sending times, and sending time of the message.
In this embodiment, the target message carries a receipt request;
the apparatus 10 further comprises:
and a state updating module 107, configured to update the message state corresponding to the target message to be successful when receiving the response returned by the target downstream service system.
In this embodiment, the apparatus 10 further comprises:
and a time updating module 108, configured to update the historical retransmission times of the target message when a response returned by the target downstream service system is not received.
In this embodiment, the apparatus 10 further comprises:
and the alarm module 109 is configured to determine whether the historical retransmission times of the target message reaches a predetermined second retransmission time threshold, and if yes, output corresponding alarm information.
In this embodiment, the apparatus 10 further comprises:
a manual retransmission instruction receiving module 110, configured to receive key parameters and message types input by a user;
and the manual retransmission processing module 111 is configured to search necessary parameters required for generating a corresponding target message from the service database according to the key parameters and the message types input by the user, then assemble the necessary parameters according to preset protocol rules to obtain the target message, and retransmit the target message to the target downstream service system.
In this embodiment, the apparatus 10 further comprises:
a batch resending instruction receiving module 112, configured to receive a batch resending document input by a user, where the batch resending document includes key parameters and message types corresponding to multiple target messages;
and a batch retransmission processing module 113, configured to search necessary parameters required for generating corresponding target messages from the service database according to the key parameters and the message types corresponding to each target message, then assemble the necessary parameters according to preset protocol rules to obtain a plurality of target messages, and retransmit the plurality of target messages to the target downstream service system.
For the embodiment of the apparatus, it is basically similar to the method embodiment of the first embodiment, so the description herein is relatively simple, and for the relevant points, refer to the partial description of the method embodiment. Also, it should be understood by those skilled in the art that the embodiments described in the specification are preferred embodiments and the reference to the module is not necessarily essential to the invention.
EXAMPLE III
The present embodiment provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster composed of multiple servers) capable of executing programs. The computer device 20 of the present embodiment includes at least, but is not limited to: a memory 21, a processor 22, which may be communicatively coupled to each other via a system bus, as shown in FIG. 3. It is noted that fig. 3 only shows the computer device 20 with components 21-22, but it is to be understood that not all shown components are required to be implemented, and that more or fewer components may be implemented instead.
In the present embodiment, the memory 21 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 21 may be an internal storage unit of the computer device 20, such as a hard disk or a memory of the computer device 20. In other embodiments, the memory 21 may also be an external storage device of the computer device 20, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 20. Of course, the memory 21 may also include both internal and external storage devices of the computer device 20. In this embodiment, the memory 21 is generally used for storing an operating system and various application software installed in the computer device 20, such as the program codes of the message sending apparatus 10 of the second embodiment. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 20. In this embodiment, the processor 22 is configured to run the program codes stored in the memory 21 or process data, for example, run the message sending apparatus 10, so as to implement the message sending method according to the first embodiment.
Example four
The present embodiment provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of the present embodiment is used for storing the message sending apparatus 10, and when executed by a processor, implements the message sending method of the first embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A method for sending a message, comprising:
recording key parameters and message types of messages to be sent in a preset message recording table;
sending the message to be sent to a target downstream service system, wherein the message to be sent carries the current message sending time of an upstream system and the previous message sending time of the upstream system;
when a message retransmission request returned by the target downstream service system is received, wherein the message retransmission request comprises the previous message receiving time of the downstream system, searching the message sent to the target downstream service system between the previous message receiving time of the downstream system and the current message sending time of the upstream system, then judging whether the message state of the searched message is failed, if not, taking the searched message as a new message to be sent and returning to the step of sending the message to be sent to the target downstream service system, and meanwhile adding 1 to the historical sending times of each new message to be sent;
when the historical sending times of a certain new message to be sent reach a preset first resending time threshold value, setting the message state of the new message to be sent as failure, and simultaneously discarding the new message to be sent;
and scheduling tasks at regular time to acquire key parameters and message types corresponding to the failure message states from the message record table, searching necessary parameters required by generating corresponding target messages from a preset service database according to the acquired key parameters and message types, assembling the necessary parameters according to preset protocol rules to obtain the target messages, and sending the target messages to the target downstream service system.
2. The method according to claim 1, wherein before recording the key parameters and message types of the message to be sent in a preset message record table, the method further comprises:
and establishing the message record table to record key parameters, message types, message states, historical sending times and sending time of the messages.
3. The message sending method according to claim 1, wherein the target message carries a response piece request;
after the sending the target message to the target downstream traffic system, the method further comprises:
and when receiving a return receipt returned by the target downstream service system, updating the message state corresponding to the target message to be successful.
4. The method of claim 3, wherein after the sending the target message to the target downstream traffic system, the method further comprises:
and when the return receipt returned by the target downstream service system is not received, updating the historical retransmission times of the target message.
5. The method according to claim 4, wherein after said updating the historical number of retransmissions of the target message, the method further comprises: and judging whether the historical retransmission times of the target message reach a preset second retransmission time threshold value or not, and if so, outputting corresponding alarm information.
6. The method according to claim 1, further comprising:
receiving key parameters and message types input by a user;
and searching necessary parameters required by generating a corresponding target message from the service database according to key parameters and message types input by a user, assembling the necessary parameters according to a preset protocol rule to obtain the target message, and retransmitting the target message to the target downstream service system.
7. The method according to claim 1, further comprising:
receiving a batch retransmission document input by a user, wherein the batch retransmission document comprises key parameters and message types corresponding to a plurality of target messages;
and searching necessary parameters required by generating corresponding target messages from the service database according to the key parameters and the message types corresponding to each target message, assembling the necessary parameters according to a preset protocol rule to obtain a plurality of target messages, and retransmitting the target messages to the target downstream service system.
8. A message transmission apparatus, comprising:
the recording module is used for recording key parameters and message types of messages to be sent in a preset message recording table;
the first message sending module is used for sending the message to be sent to a target downstream service system, wherein the message to be sent carries the current message sending time of an upstream system and the previous message sending time of the upstream system;
a retransmission module, configured to, when a message retransmission request returned by the target downstream service system is received and the message retransmission request includes a previous message receiving time of the downstream system, search for a message sent to the target downstream service system between the previous message receiving time of the downstream system and a current message sending time of the upstream system, and then determine whether a message state of the searched message is failed, if not, take the searched message as a new message to be sent and return to the step of sending the message to be sent to the target downstream service system, and add 1 to a historical sending frequency of each new message to be sent;
the retransmission failure processing module is used for setting the message state of a new message to be sent as failure when the historical transmission frequency of the new message to be sent reaches a preset first retransmission frequency threshold value, and simultaneously discarding the new message to be sent;
and the task scheduling module is used for scheduling tasks at regular time so as to acquire key parameters and message types corresponding to the failure message states from the message record table, searching necessary parameters required for generating corresponding target messages from a preset service database according to the acquired key parameters and message types, assembling the necessary parameters according to preset protocol rules to obtain the target messages, and sending the target messages to the target downstream service system.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented by the processor when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010740520.1A CN111835467B (en) | 2020-07-28 | 2020-07-28 | Message sending method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010740520.1A CN111835467B (en) | 2020-07-28 | 2020-07-28 | Message sending method, device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111835467A true CN111835467A (en) | 2020-10-27 |
CN111835467B CN111835467B (en) | 2022-03-29 |
Family
ID=72919832
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010740520.1A Active CN111835467B (en) | 2020-07-28 | 2020-07-28 | Message sending method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111835467B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110941622A (en) * | 2019-10-31 | 2020-03-31 | 京东数字科技控股有限公司 | Data processing method and device |
CN112487056A (en) * | 2020-11-30 | 2021-03-12 | 上海寻梦信息技术有限公司 | Service node control method, system, device and storage medium |
CN113762677A (en) * | 2020-10-29 | 2021-12-07 | 北京京东振世信息技术有限公司 | Service processing method and device |
CN114020488A (en) * | 2021-10-28 | 2022-02-08 | 建信金融科技有限责任公司 | Synchronous processing method, device, equipment and storage medium for upstream and downstream business processes |
CN114205322A (en) * | 2021-12-13 | 2022-03-18 | 中国平安财产保险股份有限公司 | Message sending method and device, electronic equipment and storage medium |
CN114637646A (en) * | 2022-02-28 | 2022-06-17 | 苏宁易购集团股份有限公司 | Data monitoring method and device, computer equipment and storage medium |
CN115544034A (en) * | 2022-09-15 | 2022-12-30 | 中国人民财产保险股份有限公司 | Data consistency method and service system |
CN116450380A (en) * | 2023-06-09 | 2023-07-18 | 北京集度科技有限公司 | Message processing method, electronic equipment and computer readable storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2008146730A1 (en) * | 2007-05-29 | 2008-12-04 | Nec Corporation | Node device, packet transfer method, and packet transfer program |
WO2009008181A1 (en) * | 2007-07-11 | 2009-01-15 | Panasonic Corporation | Data transmitting apparatus and data retransmitting method |
US20090125601A1 (en) * | 2007-11-14 | 2009-05-14 | International Business Machines Corporation | Electronic Messaging Systems Having Time-Critical Messages |
CN108234599A (en) * | 2017-12-06 | 2018-06-29 | 链家网(北京)科技有限公司 | A kind of message repeating method and system |
CN108337296A (en) * | 2018-01-12 | 2018-07-27 | 深圳壹账通智能科技有限公司 | Message push processing method, device, computer equipment and storage medium |
CN109241186A (en) * | 2018-08-29 | 2019-01-18 | 深圳市小牛在线互联网信息咨询有限公司 | Management method, system, computer equipment and the storage medium of distributed transaction |
CA3037733A1 (en) * | 2018-03-29 | 2019-09-29 | Blackberry Limited | Apparatus and method for establishing a connection between nodes of a wireless network |
CN111339200A (en) * | 2020-02-28 | 2020-06-26 | 中国平安人寿保险股份有限公司 | Data verification method and data verification system based on database synchronization |
-
2020
- 2020-07-28 CN CN202010740520.1A patent/CN111835467B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2008146730A1 (en) * | 2007-05-29 | 2008-12-04 | Nec Corporation | Node device, packet transfer method, and packet transfer program |
WO2009008181A1 (en) * | 2007-07-11 | 2009-01-15 | Panasonic Corporation | Data transmitting apparatus and data retransmitting method |
US20090125601A1 (en) * | 2007-11-14 | 2009-05-14 | International Business Machines Corporation | Electronic Messaging Systems Having Time-Critical Messages |
CN108234599A (en) * | 2017-12-06 | 2018-06-29 | 链家网(北京)科技有限公司 | A kind of message repeating method and system |
CN108337296A (en) * | 2018-01-12 | 2018-07-27 | 深圳壹账通智能科技有限公司 | Message push processing method, device, computer equipment and storage medium |
CA3037733A1 (en) * | 2018-03-29 | 2019-09-29 | Blackberry Limited | Apparatus and method for establishing a connection between nodes of a wireless network |
CN109241186A (en) * | 2018-08-29 | 2019-01-18 | 深圳市小牛在线互联网信息咨询有限公司 | Management method, system, computer equipment and the storage medium of distributed transaction |
CN111339200A (en) * | 2020-02-28 | 2020-06-26 | 中国平安人寿保险股份有限公司 | Data verification method and data verification system based on database synchronization |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110941622A (en) * | 2019-10-31 | 2020-03-31 | 京东数字科技控股有限公司 | Data processing method and device |
CN113762677A (en) * | 2020-10-29 | 2021-12-07 | 北京京东振世信息技术有限公司 | Service processing method and device |
CN113762677B (en) * | 2020-10-29 | 2023-11-03 | 北京京东振世信息技术有限公司 | Service processing method and device |
CN112487056A (en) * | 2020-11-30 | 2021-03-12 | 上海寻梦信息技术有限公司 | Service node control method, system, device and storage medium |
CN114020488A (en) * | 2021-10-28 | 2022-02-08 | 建信金融科技有限责任公司 | Synchronous processing method, device, equipment and storage medium for upstream and downstream business processes |
CN114205322A (en) * | 2021-12-13 | 2022-03-18 | 中国平安财产保险股份有限公司 | Message sending method and device, electronic equipment and storage medium |
CN114637646A (en) * | 2022-02-28 | 2022-06-17 | 苏宁易购集团股份有限公司 | Data monitoring method and device, computer equipment and storage medium |
CN115544034A (en) * | 2022-09-15 | 2022-12-30 | 中国人民财产保险股份有限公司 | Data consistency method and service system |
CN116450380A (en) * | 2023-06-09 | 2023-07-18 | 北京集度科技有限公司 | Message processing method, electronic equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111835467B (en) | 2022-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111835467B (en) | Message sending method, device, computer equipment and storage medium | |
CN108536532B (en) | Batch task processing method and system | |
JP4993905B2 (en) | Server queuing system and method | |
CN108491301B (en) | Electronic device, abnormality early warning method based on redis and storage medium | |
CN110222107B (en) | Data transmission method and related equipment | |
CN109714409B (en) | Message management method and system | |
CN111325501B (en) | Logistics state management method, device, equipment and storage medium | |
CN111274052A (en) | Data distribution method, server, and computer-readable storage medium | |
CN109361525B (en) | Method, device, control terminal and medium for restarting distributed deployment of multiple services | |
CN111651284B (en) | Method, device, system and storage medium for processing business data | |
CN111611207B (en) | State data processing method and device and computer equipment | |
CN112527484A (en) | Workflow breakpoint continuous running method and device, computer equipment and readable storage medium | |
CN111694645A (en) | Task processing method and related device in distributed task scheduling system | |
CN108880994B (en) | Method and device for retransmitting mails | |
CN112087475A (en) | Message pushing method and device for cloud platform component application and message server | |
CN112969198A (en) | Data transmission method, terminal and storage medium | |
CN108241616B (en) | Message pushing method and device | |
CN111913804A (en) | Pre-visit report generation method and device, electronic equipment and storage medium | |
CN111652681A (en) | Receipt processing method, server and computer readable storage medium | |
CN116723166A (en) | Message pushing realization method, device and medium | |
CN113645260A (en) | Service retry method, device, storage medium and electronic equipment | |
CN111274047A (en) | Information processing method, terminal, system, computer device and storage medium | |
CN112131180B (en) | Data reporting method, device and storage medium | |
CN114449037A (en) | Asynchronous communication push system | |
CN109669867B (en) | Test apparatus, automated test method, and computer-readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |