CN114615325A - Message pushing method and device, computer equipment and storage medium - Google Patents

Message pushing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114615325A
CN114615325A CN202210237143.9A CN202210237143A CN114615325A CN 114615325 A CN114615325 A CN 114615325A CN 202210237143 A CN202210237143 A CN 202210237143A CN 114615325 A CN114615325 A CN 114615325A
Authority
CN
China
Prior art keywords
assembly information
message pushing
information
sending
message
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
CN202210237143.9A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210237143.9A priority Critical patent/CN114615325A/en
Publication of CN114615325A publication Critical patent/CN114615325A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements

Abstract

The embodiment of the application belongs to the field of big data and relates to a message pushing method which comprises the steps of analyzing a message pushing instruction to obtain a template code when the message pushing instruction is received, and matching a message pushing template of a downstream system according to the template code; acquiring parameter information carried by the message pushing instruction, and filling the parameter information serving as a variable field into the message pushing template to obtain assembly information; acquiring a preset middleware, and sending the assembly information to a target system corresponding to the message pushing instruction according to the preset middleware; and detecting whether the assembly information is successfully sent or not, and feeding back a successful sending identifier to a target display interface when the assembly information is successfully sent. The application also provides a message pushing device, computer equipment and a storage medium. In addition, the present application also relates to a block chain technology, and the assembly information can be stored in the block chain. The message pushing efficiency is improved.

Description

Message pushing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of big data technologies, and in particular, to a message pushing method and apparatus, a computer device, and a storage medium.
Background
When a system pushes a message to another system, if the pushed message has a native template format, the pushed message may have a large amount of redundant data. According to the traditional message pushing system, a downstream system needs to face the full amount of data storage, when a large amount of data is flooded into the downstream system, a large amount of database resources are input into the simple and repeated data storage, and therefore the utilization rate of a database cpu is high, other service responses are influenced, and the operation cost is high. When a downstream user queries data, the experience degree is also affected, and when network fluctuation or maintenance of a message intermediate system occurs, the condition of message sending failure is further caused. Therefore, how to push messages in time and effectively is the problem to be solved.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for pushing a message, a computer device, and a storage medium, so as to solve the technical problem of low message pushing efficiency.
In order to solve the foregoing technical problem, an embodiment of the present application provides a message pushing method, which adopts the following technical solutions:
when a message pushing instruction is received, analyzing the message pushing instruction to obtain a template code, and matching a message pushing template of a downstream system according to the template code;
acquiring parameter information carried by the message pushing instruction, and filling the parameter information serving as a variable field into the message pushing template to obtain assembly information;
acquiring a preset middleware, and sending the assembly information to a target system corresponding to the message pushing instruction according to the preset middleware;
and detecting whether the assembly information is successfully sent or not, and feeding back a successful sending identifier to a target display interface when the assembly information is successfully sent.
Further, the step of sending the assembly information to a target system corresponding to the message pushing instruction according to the preset middleware includes:
acquiring the total data volume of the assembly information, and paging the assembly information when the total data volume of the assembly information is larger than or equal to a preset data volume to obtain multi-component page data;
and acquiring a corresponding number of preset middleware according to the group number of the paging data, and sending the paging data to the target system based on the preset middleware.
Further, after the step of paging the assembly information to obtain multi-component page data, the method includes:
when the total data volume of the assembly information is larger than or equal to the preset data volume and the number of the preset middleware is one, acquiring the paging sequence of the paging data;
and sequentially sending the paging data to the target system through the preset middleware according to the paging sequence.
Further, the step of detecting whether the assembly information is successfully transmitted includes:
acquiring a state identifier returned by the target system, and determining that the assembly information is successfully transmitted when the state identifier is a successful transmission identifier;
and when the state identifier is a primary failure identifier, determining that the initial sending of the assembly information fails, repeatedly sending the assembly information to the target system until the continuous sending failure times of the assembly information reach preset times, and determining that the sending of the assembly information fails.
Further, after the step of detecting whether the assembly information is successfully transmitted, the method further includes:
and when the sending of the assembling information fails, acquiring a target record table, and storing the assembling information into the target record table.
Further, after the step of storing the assembly information in the target record table, the method further includes:
establishing a timing task, and performing timing query on the target record table according to the timing task;
and when the assembling information exists in the target record table, the assembling information is pushed to the target system again.
Further, the step of re-pushing the assembly information to the target system includes:
acquiring target pushing time, and taking the target pushing time as a variable parameter of the assembly information;
and pushing the assembly information to the target system according to the variable parameter.
In order to solve the above technical problem, an embodiment of the present application further provides a message pushing apparatus, which adopts the following technical solutions:
the analysis module is used for analyzing the message pushing instruction to obtain a template code when receiving the message pushing instruction, and matching a message pushing template of a downstream system according to the template code;
the acquisition module is used for acquiring the parameter information carried by the message pushing instruction, and filling the parameter information serving as a variable field into the message pushing template to obtain the assembly information;
the sending module is used for acquiring a preset middleware and sending the assembling information to a target system corresponding to the message pushing instruction according to the preset middleware;
and the detection module is used for detecting whether the assembly information is successfully sent or not, and feeding back a successful sending identifier to a target display interface when the assembly information is successfully sent.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
when a message pushing instruction is received, analyzing the message pushing instruction to obtain a template code, and matching a message pushing template of a downstream system according to the template code;
acquiring parameter information carried by the message pushing instruction, and filling the parameter information serving as a variable field into the message pushing template to obtain assembly information;
acquiring a preset middleware, and sending the assembly information to a target system corresponding to the message pushing instruction according to the preset middleware;
and detecting whether the assembly information is successfully sent or not, and feeding back a successful sending identifier to a target display interface when the assembly information is successfully sent.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
when a message pushing instruction is received, analyzing the message pushing instruction to obtain a template code, and matching a message pushing template of a downstream system according to the template code;
acquiring parameter information carried by the message pushing instruction, and filling the parameter information serving as a variable field into the message pushing template to obtain assembly information;
acquiring a preset middleware, and sending the assembly information to a target system corresponding to the message pushing instruction according to the preset middleware;
and detecting whether the assembly information is successfully sent or not, and feeding back a successful sending identifier to a target display interface when the assembly information is successfully sent.
According to the message pushing method, when a message pushing instruction is received, the message pushing instruction is analyzed to obtain a template code, the message pushing template of a downstream system is matched according to the template code, and the message can be rapidly assembled and pushed through the message pushing template; then, acquiring parameter information carried by the message pushing instruction, and filling the parameter information serving as a variable field into a message pushing template to obtain assembly information; the method comprises the steps of acquiring a preset middleware, and sending assembly information to a target system corresponding to a message pushing instruction according to the preset middleware, so that a message is assembled and then pushed through the middleware, and the message pushing efficiency is improved; and then, whether the assembly information is successfully sent is detected, and when the assembly information is successfully sent, the successful sending identification is fed back to the target display interface, so that the message is efficiently pushed, the resource waste and the pushing delay caused by data backlog are avoided, and the message pushing efficiency and accuracy are improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram to which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a message push method according to the present application;
FIG. 3 is a schematic diagram illustrating an embodiment of a message pushing device according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Reference numerals: the message pushing device 300, the parsing module 301, the obtaining module 302, the sending module 303 and the detecting module 304.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof in the description and claims of this application and the description of the figures above, are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the message pushing method provided in the embodiment of the present application is generally executed by a server/terminal device, and accordingly, the message pushing apparatus is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continuing reference to fig. 2, a flow diagram of one embodiment of a method of message pushing in accordance with the present application is shown. The message pushing method comprises the following steps:
step S201, when receiving a message pushing instruction, analyzing the message pushing instruction to obtain a template code, and matching a message pushing template of a downstream system according to the template code.
In this embodiment, the template code is a template code of a message push template in a downstream system. Before the message is pushed, a complete message pushing template is appointed with a downstream system, and the template code of the message pushing template in the downstream system is determined. When a message pushing instruction is received, analyzing the message pushing instruction to obtain a template code corresponding to the message pushing instruction; and obtaining a message pushing template of a downstream system according to the template code matching.
Step S202, acquiring parameter information carried by the message pushing instruction, and filling the parameter information serving as a variable field into the message pushing template to obtain assembly information.
In this embodiment, the parameter information includes information such as the name and time of the target push object. Filling the parameter information serving as a variable field into the obtained message pushing template, wherein the message pushing template comprises a fixed field and a variable field, the fixed field is fixed message content corresponding to the current template code, and the corresponding fixed message content can be determined according to different template codes; the variable field is a field determined according to the acquired parameter information. And filling the parameter information serving as a variable field into the message pushing template to obtain the assembly information, wherein the assembly information is the message pushing template comprising the parameter information corresponding to the message pushing instruction.
It is emphasized that the assembly information may also be stored in a node of a blockchain in order to further ensure the privacy and security of the assembly information.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Step S203, acquiring a preset middleware, and sending the assembly information to a target system corresponding to the message pushing instruction according to the preset middleware.
In this embodiment, the middleware is a software between the application systems and the system software, and it uses the basic service provided by the system software to link the parts or applications of different application systems, thereby achieving the purpose of resource sharing and function sharing. Therefore, when the assembly information is obtained, a preset middleware is obtained, the preset middleware is a message middleware, such as middleware of ActiveMQ, RabbitMQ, Kafka and the like, and the assembly information is sent to a target system corresponding to the message push instruction based on the preset middleware.
And step S204, detecting whether the assembly information is successfully sent, and feeding back a successful sending identifier to a target display interface when the assembly information is successfully sent.
In this embodiment, after the assembly information is pushed to the target system, whether the assembly information is successfully sent is detected, and if the assembly information is successfully sent, a successful sending identifier is fed back to the target display interface.
The method and the device have the advantages that the high-efficiency pushing of the message is realized, the resource waste and pushing delay caused by data backlog are avoided, and the message pushing efficiency and accuracy are improved.
In some optional implementation manners of this embodiment, the step of sending the assembly information to the target system corresponding to the message push instruction according to the preset middleware includes:
acquiring the total data volume of the assembly information, and paging the assembly information when the total data volume of the assembly information is larger than or equal to a preset data volume to obtain multi-component page data;
and acquiring a corresponding number of preset middleware according to the group number of the paging data, and sending the paging data to the target system based on the preset middleware.
In this embodiment, when a user requests to send a message to a plurality of different clients at a time, there may be a large amount of data to send. Therefore, when the assembly information is sent to the target system according to the preset middleware, the total data volume and the preset data volume of the assembly information are obtained, and whether the total data volume is larger than or equal to the preset data volume or not is determined. When the total data volume of the assembly information is larger than or equal to the preset data volume, paging the assembly information according to the maximum capacity of each page of data to obtain multi-component page data; and then, acquiring preset middleware with the same number according to the group number of the paging data, sending a group of paging data by one preset middleware, and simultaneously sending multi-group paging data to a target system based on the preset middleware with the same number. The group number of the paging data is a ratio of the total data amount of the assembly information to the maximum capacity of each page of data. And when the total data volume of the assembly information is smaller than the preset data volume, sending the assembly information to the target system according to a preset middleware.
The embodiment pages the assembled message according to the total data volume by acquiring the total data volume of the assembled message to obtain paging data, thereby realizing efficient transmission of the message when the data volume is large and avoiding transmission delay.
In some optional implementation manners of this embodiment, after the step of paging the assembly information to obtain multi-component page data, the method includes:
when the total data volume of the assembly information is larger than or equal to the preset data volume and the number of the preset middleware is one, acquiring the paging sequence of the paging data;
and sequentially sending the paging data to the target system through the preset middleware according to the paging sequence.
In this embodiment, when the total data volume of the assembly information is greater than or equal to the preset data volume and the number of the preset middleware is one, the paging sequence of the paging data is obtained; and sequentially sending the paging data to the target system through the preset middleware according to the paging sequence, wherein the paging sequence of the paging data can be determined according to the data priority of the assembly information.
In the embodiment, when the number of the preset middleware is one, the paging data is sequentially sent according to the paging sequence of the paging data, so that the missing of message pushing is avoided, the reliability of concurrent data volume at the same time is increased, the utilization rate of a CPU is reduced, and the response time of a service system is prolonged.
In some optional implementation manners of this embodiment, the step of detecting whether the assembly information is successfully sent includes:
acquiring a state identifier returned by the target system, and determining that the assembly information is successfully transmitted when the state identifier is a successful transmission identifier;
and when the state identifier is a primary failure identifier, determining that the initial sending of the assembly information fails, repeatedly sending the assembly information to the target system until the continuous sending failure times of the assembly information reach preset times, and determining that the sending of the assembly information fails.
In this embodiment, different states correspond to different state identifiers, and the state of the current assembly information may be determined according to the state identifiers, where the state includes an initial transmission failure, a transmission failure, and a transmission success. Acquiring a state identifier returned by the target system, determining that the assembly information is successfully transmitted when the state identifier is a successful transmission identifier, and stopping transmitting the assembly information; when the state identification is a primary failure identification, determining that the primary transmission of the assembly information fails, repeatedly transmitting the assembly information to a target system, and if the secondary transmission of the assembly information succeeds, setting the state identification of the assembly information as a transmission success identification; and if the second sending of the assembly information fails, continuously sending the assembly information to a target system until the continuous sending failure times of the assembly information reach the preset times. The number of continuous transmission failures is the number of continuous transmission failures of the assembly information in a preset interval time period, and the preset interval time period may be the same interval time period or an interval time period which increases in a gradient or exponential manner. For example, the assembly information is sent to the target system at consecutive intervals of 5s, or the assembly information is sent again at interval 5s after the failure of sending the assembly information for the first time, and if the transmission still fails, the assembly information is sent again at interval 25 s. And when the continuous sending failure times of the assembly information reach the preset times, determining that the assembly information fails to be sent, storing the assembly information into a target record table, and feeding back error information of the assembly information which fails to be sent.
In the embodiment, whether the message is successfully pushed is determined through the state identifier, and when the message is unsuccessfully pushed, whether the message is unsuccessfully sent is determined according to the number of times of continuous sending failures of the assembly information, so that the message pushing efficiency is further improved.
In some optional implementation manners of this embodiment, after the step of detecting whether the assembly information is successfully sent, the method further includes:
and when the sending of the assembling information fails, acquiring a target record table, and storing the assembling information into the target record table.
In this embodiment, if the sending of the assembly information fails, a target record table is obtained, and the assembly information is stored in the target record table; the target record table includes the primary key i d of the table, the template code, the message content, the retry number, the status identifier, the push time, the error information of the push failure, and the modification time.
In the embodiment, when the sending of the assembly information fails, the assembly information is stored in the target record table, so that the message can be retransmitted through the target record table, and the loss of the message is avoided.
In some optional implementation manners of this embodiment, after the step of storing the assembly information in the target record table, the method further includes:
establishing a timing task, and performing timing query on the target record table according to the timing task;
and when the assembling information exists in the target record table, the assembling information is pushed to the target system again.
In this embodiment, after the assembly information is stored in the target record table, a timing task is created, and a timing query is performed on the target record table according to the timing task. Specifically, the timing task is a timing query task, preset query time is used as a timing parameter of the timing task, when the timing parameter is triggered, a target record table is queried, and whether the target record table has assembly information or not is determined. And when the assembly information exists in the target record table, the assembly information is pushed to the target system again, and if the assembly information is pushed again successfully, the assembly information is deleted from the target record table.
The embodiment carries out timing query on the target record list through the timing task, realizes timing push on the assembly information in the target record list, and avoids loss of the message.
In some optional implementations of this embodiment, the step of re-pushing the assembly information to the target system includes:
acquiring target pushing time, and taking the target pushing time as a variable parameter of the assembly information;
and pushing the assembly information to the target system according to the variable parameter.
In this embodiment, when the assembly information in the target record table is pushed to the target system, the target pushing time of the assembly information is obtained, the target pushing time is used as a variable parameter of a variable field corresponding to the assembly information, and the assembly information is pushed to the target system according to the variable parameter.
According to the embodiment, the target pushing time is used as the variable parameter of the assembly information, so that the assembly information can be precisely pushed at regular time through the variable parameter, and the pushing error of the assembly information is avoided.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a message pushing apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the message pushing apparatus 300 according to the embodiment includes: the device comprises an analysis module 301, an acquisition module 302, a sending module 303 and a detection module 304. Wherein:
the analysis module 301 is configured to, when receiving a message push instruction, analyze the message push instruction to obtain a template code, and match a message push template of a downstream system according to the template code;
in this embodiment, the template code is a template code of a message push template in a downstream system. Before the message is pushed, a complete message pushing template is appointed with a downstream system, and the template code of the message pushing template in the downstream system is determined. When a message pushing instruction is received, analyzing the message pushing instruction to obtain a template code corresponding to the message pushing instruction; and obtaining a message pushing template of a downstream system according to the template code matching.
An obtaining module 302, configured to obtain parameter information carried by the message pushing instruction, and fill the parameter information into the message pushing template as a variable field to obtain assembly information;
in this embodiment, the parameter information includes information such as the name and time of the target push object. Filling the parameter information serving as a variable field into the obtained message pushing template, wherein the message pushing template comprises a fixed field and a variable field, the fixed field is fixed message content corresponding to the current template code, and the corresponding fixed message content can be determined according to different template codes; the variable field is a field determined according to the acquired parameter information. And filling the parameter information serving as a variable field into the message pushing template to obtain the assembly information, wherein the assembly information is the message pushing template comprising the parameter information corresponding to the message pushing instruction.
It is emphasized that the assembly information may also be stored in a node of a blockchain in order to further ensure the privacy and security of the assembly information.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The sending module 303 is configured to obtain a preset middleware, and send the assembly information to a target system corresponding to the message push instruction according to the preset middleware;
in some optional implementations of this embodiment, the sending module 303 includes:
the paging unit is used for acquiring the total data volume of the assembly information, and paging the assembly information when the total data volume of the assembly information is larger than or equal to a preset data volume to obtain multi-component page data;
and the first sending unit is used for acquiring the preset middleware with the corresponding number according to the group number of the paging data and sending the paging data to the target system based on the preset middleware.
In some optional implementations of this embodiment, the sending module 303 further includes:
a first obtaining unit, configured to obtain a paging sequence of the paging data when a total data amount of the assembly information is greater than or equal to the preset data amount and a number of preset middleware is one;
and the second sending unit is used for sequentially sending the paging data to the target system through the preset middleware according to the paging sequence.
In this embodiment, the middleware is a software between the application systems and the system software, and it uses the basic service provided by the system software to link the parts or applications of different application systems, thereby achieving the purpose of resource sharing and function sharing. Therefore, when the assembly information is obtained, a preset middleware is obtained, the preset middleware is a message middleware, such as middleware of ActiveMQ, RabbitMQ, Kafkka, and the like, and the assembly information is sent to a target system corresponding to the message push instruction based on the preset middleware.
The detection module 304 is configured to detect whether the assembly information is successfully sent, and when the assembly information is successfully sent, feed back a successful sending identifier to the target display interface.
In this embodiment, after the assembly information is pushed to the target system, whether the assembly information is successfully sent is detected, and if the assembly information is successfully sent, a successful sending identifier is fed back to the target display interface.
In some optional implementations of this embodiment, the detecting module 304 includes:
the confirming unit is used for acquiring the state identifier returned by the target system and determining that the assembly information is successfully sent when the state identifier is a successful sending identifier;
and the third sending unit is used for determining that the initial sending of the assembly information fails when the state identifier is the initial failure identifier, repeatedly sending the assembly information to the target system until the continuous sending failure times of the assembly information reach the preset times, and determining that the sending of the assembly information fails.
In this embodiment, different states correspond to different state identifiers, and the state of the current assembly information may be determined according to the state identifiers, where the state includes an initial transmission failure, a transmission failure, and a transmission success. Acquiring a state identifier returned by the target system, determining that the assembly information is successfully transmitted when the state identifier is a successful transmission identifier, and stopping transmitting the assembly information; when the state identifier is a primary failure identifier, determining that the initial sending of the assembly information fails, repeatedly sending the assembly information to a target system, and if the second sending of the assembly information succeeds, setting the state identifier of the assembly information as a sending success identifier; and if the second sending of the assembly information fails, continuously sending the assembly information to a target system until the continuous sending failure times of the assembly information reach the preset times. The number of continuous transmission failures is the number of continuous transmission failures of the assembly information in a preset interval time period, and the preset interval time period may be the same interval time period or an interval time period which increases in a gradient or exponential manner. For example, the assembly information is sent to the target system at consecutive intervals of 5s, or the assembly information is sent again at interval 5s after the failure of sending the assembly information for the first time, and if the transmission still fails, the assembly information is sent again at interval 25 s. And when the continuous sending failure times of the assembly information reach the preset times, determining that the assembly information fails to be sent, storing the assembly information into a target record table, and feeding back error information of the assembly information which fails to be sent.
In some optional implementations of the present embodiment, the message pushing apparatus 300 further includes:
and the storage module is used for acquiring a target record table when the sending of the assembling information fails and storing the assembling information into the target record table.
In this embodiment, if the sending of the assembly information fails, a target record table is obtained, and the assembly information is stored in the target record table; the target record table comprises a main key id of the table, a template code, message content, retry times, a state identifier, pushing time, error information of pushing failure and modification time.
In some optional implementations of the present embodiment, the message pushing apparatus 300 further includes:
the query module is used for creating a timing task and carrying out timing query on the target record table according to the timing task;
and the pushing module is used for re-pushing the assembly information to the target system when the assembly information exists in the target record table.
In some optional implementations of this embodiment, the pushing module includes:
the second acquisition unit is used for acquiring target pushing time, and the target pushing time is used as a variable parameter of the assembly information;
and the pushing unit is used for pushing the assembling information to the target system according to the variable parameter.
In this embodiment, after the assembly information is stored in the target record table, a timing task is created, and a timing query is performed on the target record table according to the timing task. Specifically, the timing task is a timing query task, preset query time is used as a timing parameter of the timing task, when the timing parameter is triggered, a target record table is queried, and whether the target record table has assembly information or not is determined. And when the assembly information exists in the target record table, the assembly information is pushed to the target system again, and if the assembly information is pushed again successfully, the assembly information is deleted from the target record table.
The message pushing device provided by the embodiment realizes efficient pushing of the message, avoids resource waste and pushing delay caused by data backlog, and improves the efficiency and accuracy of message pushing.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only a computer device 6 having components 61-63 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 61 includes at least one type of readable storage medium including 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, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal storage unit of the computer device 6 and an external storage device thereof. In this embodiment, the memory 61 is generally used for storing an operating system installed in the computer device 6 and various application software, such as computer readable instructions of a message pushing method. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute computer readable instructions stored in the memory 61 or process data, for example, execute computer readable instructions of the message push method.
The network interface 63 may comprise a wireless network interface or a wired network interface, and the network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
The computer device provided by the embodiment realizes efficient pushing of the message, avoids resource waste and pushing delay caused by data backlog, and improves the efficiency and accuracy of message pushing.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the message pushing method as described above.
The computer-readable storage medium provided by the embodiment realizes efficient pushing of the message, avoids resource waste and pushing delay caused by data backlog, and improves the efficiency and accuracy of message pushing.
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. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A message pushing method, comprising the steps of:
when a message pushing instruction is received, analyzing the message pushing instruction to obtain a template code, and matching a message pushing template of a downstream system according to the template code;
acquiring parameter information carried by the message pushing instruction, and filling the parameter information serving as a variable field into the message pushing template to obtain assembly information;
acquiring a preset middleware, and sending the assembly information to a target system corresponding to the message pushing instruction according to the preset middleware;
and detecting whether the assembly information is successfully sent or not, and feeding back a successful sending identifier to a target display interface when the assembly information is successfully sent.
2. The message pushing method according to claim 1, wherein the step of sending the assembly information to a target system corresponding to the message pushing instruction according to the preset middleware comprises:
acquiring the total data volume of the assembly information, and paging the assembly information when the total data volume of the assembly information is larger than or equal to a preset data volume to obtain multi-component page data;
and acquiring a corresponding number of preset middleware according to the group number of the paging data, and sending the paging data to the target system based on the preset middleware.
3. The message pushing method according to claim 2, wherein after the step of paging the assembly information to obtain multi-component page data, the method comprises:
when the total data volume of the assembly information is larger than or equal to the preset data volume and the number of the preset middleware is one, acquiring the paging sequence of the paging data;
and sequentially sending the paging data to the target system through the preset middleware according to the paging sequence.
4. The message pushing method according to claim 1, wherein the step of detecting whether the assembly information is successfully transmitted comprises:
acquiring a state identifier returned by the target system, and determining that the assembly information is successfully transmitted when the state identifier is a successful transmission identifier;
and when the state identifier is a primary failure identifier, determining that the initial sending of the assembly information fails, repeatedly sending the assembly information to the target system until the continuous sending failure times of the assembly information reach preset times, and determining that the sending of the assembly information fails.
5. The message pushing method according to claim 1, wherein after the step of detecting whether the transmission of the assembly information is successful, the method further comprises:
and when the sending of the assembling information fails, acquiring a target record table, and storing the assembling information into the target record table.
6. The message pushing method according to claim 5, further comprising, after the step of storing the assembly information in the target record table:
establishing a timing task, and performing timing query on the target record table according to the timing task;
and when the assembling information exists in the target record table, the assembling information is pushed to the target system again.
7. The message pushing method according to claim 6, wherein the step of re-pushing the assembly information to the target system comprises:
acquiring target pushing time, wherein the target pushing time is used as a variable parameter of the assembly information;
and pushing the assembly information to the target system according to the variable parameter.
8. A message push apparatus, comprising:
the analysis module is used for analyzing the message pushing instruction to obtain a template code when receiving the message pushing instruction, and matching a message pushing template of a downstream system according to the template code;
the acquisition module is used for acquiring the parameter information carried by the message pushing instruction, and filling the parameter information serving as a variable field into the message pushing template to obtain the assembly information;
the sending module is used for acquiring a preset middleware and sending the assembling information to a target system corresponding to the message pushing instruction according to the preset middleware;
and the detection module is used for detecting whether the assembly information is successfully sent or not, and feeding back a successful sending identifier to the target display interface when the assembly information is successfully sent.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the message push method of any of claims 1 to 7.
10. A computer-readable storage medium, having computer-readable instructions stored thereon, which, when executed by a processor, implement the steps of the message pushing method according to any one of claims 1 to 7.
CN202210237143.9A 2022-03-11 2022-03-11 Message pushing method and device, computer equipment and storage medium Pending CN114615325A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210237143.9A CN114615325A (en) 2022-03-11 2022-03-11 Message pushing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210237143.9A CN114615325A (en) 2022-03-11 2022-03-11 Message pushing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114615325A true CN114615325A (en) 2022-06-10

Family

ID=81862837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210237143.9A Pending CN114615325A (en) 2022-03-11 2022-03-11 Message pushing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114615325A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115361659A (en) * 2022-09-23 2022-11-18 中信百信银行股份有限公司 Method and device for pre-controlling message sending and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241414A (en) * 2018-08-20 2019-01-18 中国平安人寿保险股份有限公司 System message method for pushing and terminal device based on message template
CN109995879A (en) * 2019-04-15 2019-07-09 深圳壹账通智能科技有限公司 Device, method and the storage medium of message push
CN112822286A (en) * 2021-01-27 2021-05-18 湖南快乐阳光互动娱乐传媒有限公司 Message pushing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241414A (en) * 2018-08-20 2019-01-18 中国平安人寿保险股份有限公司 System message method for pushing and terminal device based on message template
CN109995879A (en) * 2019-04-15 2019-07-09 深圳壹账通智能科技有限公司 Device, method and the storage medium of message push
CN112822286A (en) * 2021-01-27 2021-05-18 湖南快乐阳光互动娱乐传媒有限公司 Message pushing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115361659A (en) * 2022-09-23 2022-11-18 中信百信银行股份有限公司 Method and device for pre-controlling message sending and readable storage medium

Similar Documents

Publication Publication Date Title
CN111414334B (en) File fragment uploading method, device, equipment and storage medium based on cloud technology
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN113536185B (en) Application page loading method, storage medium and related equipment
CN112631911A (en) Automatic testing method and device, computer equipment and storage medium
CN114564294A (en) Intelligent service arranging method and device, computer equipment and storage medium
CN113254445A (en) Real-time data storage method and device, computer equipment and storage medium
CN113010542B (en) Service data processing method, device, computer equipment and storage medium
CN114615325A (en) Message pushing method and device, computer equipment and storage medium
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN113434254A (en) Client deployment method, client deployment apparatus, computer device, and storage medium
CN111475388A (en) Data push test method and device, computer equipment and storage medium
CN111813418A (en) Distributed link tracking method, device, computer equipment and storage medium
CN114968822A (en) Interface testing method and device, computer equipment and storage medium
CN113886332B (en) Large file difference comparison method and device, computer equipment and storage medium
CN114912003A (en) Document searching method and device, computer equipment and storage medium
CN112416875B (en) Log management method, device, computer equipment and storage medium
CN114626352A (en) Report automatic generation method and device, computer equipment and storage medium
CN115328764A (en) Test code optimization method based on automatic test and related equipment thereof
CN114048059A (en) Method and device for adjusting timeout time of interface, computer equipment and storage medium
CN113360172B (en) Application deployment method, device, computer equipment and storage medium
CN109409922A (en) Data aggregate modeling method, device, computer equipment and storage medium
CN109547290B (en) Cloud platform garbage data detection processing method, device, equipment and storage medium
CN116894736A (en) Mail management method, device, computer equipment and storage medium
CN117271635A (en) List export method, device, computer equipment and storage medium
CN113590372A (en) Log-based link tracking method and device, computer equipment and 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