CN113992352A - Message pushing method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN113992352A
CN113992352A CN202111136650.5A CN202111136650A CN113992352A CN 113992352 A CN113992352 A CN 113992352A CN 202111136650 A CN202111136650 A CN 202111136650A CN 113992352 A CN113992352 A CN 113992352A
Authority
CN
China
Prior art keywords
message
target
information
pushing
type
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
CN202111136650.5A
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202111136650.5A priority Critical patent/CN113992352A/en
Publication of CN113992352A publication Critical patent/CN113992352A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0281Proxies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a message pushing method, a message pushing device, electronic equipment and a storage medium, wherein the message pushing method comprises the following steps: acquiring first information written by a front end and coming from target equipment, wherein the target equipment is equipment successfully registered at the front end, and the first information comprises a target message type, interface information corresponding to the target message and encryption information corresponding to the interface information; acquiring a target message corresponding to the target message type from a message middleware based on the target message type in the first information, wherein the message middleware receives and stores messages of various types sent by the data module; encrypting the target message based on the encryption information corresponding to the interface information in the first information to obtain an encrypted target message; and pushing the encrypted target message to the target equipment based on the interface information corresponding to the target message in the first information. The method of the invention can realize the encryption pushing of the message and improve the safety of the message pushing.

Description

Message pushing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method and an apparatus for pushing a message, an electronic device, and a storage medium.
Background
With the rapid development of computer and internet technologies, the demand of all walks of life for message push service across systems is increasing.
Currently, in the prior art, a commonly used Message pushing method is a mode of introducing Message Middleware (MQ) between the system and a counterpart system, the system serves as a producer to send data to MQ in a Message form, and the counterpart system serves as a consumer to consume data from MQ, however, quasi-real-time pushing of messages is performed between systems through the MQ, and there is a problem of low security.
Therefore, how to better implement message pushing across systems has become an urgent problem to be solved in the industry.
Disclosure of Invention
The invention provides a message pushing method, a message pushing device, electronic equipment and a storage medium, which are used for better realizing message pushing between cross systems.
The invention provides a message pushing method, which comprises the following steps:
acquiring first information written by a front end and coming from target equipment, wherein the target equipment is equipment which is successfully registered at the front end, and the first information comprises a target message type, interface information corresponding to the target message and encryption information corresponding to the interface information;
acquiring a target message corresponding to the target message type from a message middleware based on the target message type in the first information, wherein the message middleware receives and stores messages of various types sent by a data module;
encrypting the target message based on the encryption information corresponding to the interface information in the first information to obtain the encrypted target message;
and pushing the encrypted target message to the target equipment based on interface information corresponding to the target message in the first information.
According to a message pushing method provided by the present invention, after pushing the encrypted target message to the target device based on the interface information corresponding to the target message in the first information, the method further includes:
receiving a message pushing result fed back by the target equipment;
when the message pushing result is that the pushing of the first type of target sub-message fails, acquiring the first type of target sub-message from a backup database at a back end, wherein the backup database stores various types of messages acquired from the message middleware, and the first type is one or more types of the target messages;
and the target sub-message of the first type is pushed to the target equipment again.
According to a message pushing method provided by the present invention, after the target sub-message of the first type is pushed to the target device again, the method further includes:
receiving a message re-pushing result fed back by the target equipment;
under the condition that the message re-pushing result is that the re-pushing of the first type of target sub-message fails, sending the message re-pushing result to the data module so that the data module sends the first type of target sub-message to the message middleware according to the message re-pushing result;
acquiring the first type of target sub-message from the message middleware;
and the target sub-message of the first type is pushed to the target equipment again.
According to a message pushing method provided by the present invention, the first information further includes first data format information, and the obtaining of the target message corresponding to the target message type from the message middleware includes:
acquiring an initial message corresponding to the target message type from the message middleware;
and calling a data preprocessing service corresponding to the first data format information, and performing data format processing on the initial message to obtain a target message.
According to a message pushing method provided by the present invention, the encrypting the target message based on the encryption information corresponding to the interface information in the first information to obtain the encrypted target message includes:
determining a signature of the target message based on the signature verification information in the encrypted information;
and encrypting the target message and the signature of the target message based on the key information in the encryption information to obtain the encrypted target message.
According to a message pushing method provided by the present invention, the pushing the encrypted target message to the target device based on interface information corresponding to the target message in the first information includes:
determining a first interface of the target device for receiving the target message based on interface information corresponding to the target message in the first information;
and pushing the encrypted target message to the first interface so that the target device can receive the target message.
According to a message pushing method provided by the present invention, before the obtaining the first information from the target device written by the front end, the method further includes:
acquiring audit information from first network equipment written by a front end;
and analyzing the audit information, and determining that the first network equipment is the target equipment under the condition that the audit information meets a preset audit condition.
The invention also provides a message pushing device, comprising:
a first obtaining unit, configured to obtain first information from a target device written by a front end, where the target device is a device successfully registered at the front end, and the first information includes a target message type, interface information corresponding to the target message, and encryption information corresponding to the interface information;
a second obtaining unit, configured to obtain, from a message middleware, a target message corresponding to a target message type based on the target message type in the first information, where the message middleware receives and stores messages of various types sent by a data module;
the encryption unit is used for encrypting the target message based on encryption information corresponding to the interface information in the first information to obtain the encrypted target message;
and the pushing unit is used for pushing the encrypted target message to the target equipment based on the interface information corresponding to the target message in the first information.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of the message pushing method.
The invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the message push method as described in any of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of the message push method as described in any one of the above.
The invention provides a message pushing method, a device, an electronic device and a storage medium, which avoid exposing to a public network by arranging a message middleware in a local intranet environment, improve the security of message storage, simultaneously, by acquiring first information from a target device written in by a front end, wherein the first information comprises the type of a target message subscribed by the target device, interface information of the target message received by the target device and encryption information corresponding to the interface information, further the target message can be acquired from the message middleware according to the type of the target message, the target message is encrypted by the encryption information corresponding to the interface information, and the encrypted target message is sent to a target device interface corresponding to the interface information according to the interface information, so as to ensure that the target device can symmetrically decrypt the encrypted target message through the interface, thereby acquiring the content of the target message, the encryption pushing of the message is realized, and the safety of the message pushing is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a message pushing method provided by the present invention;
fig. 2 is a schematic diagram of the overall system structure of the message pushing method provided by the present invention;
fig. 3 is a schematic structural diagram of a message pushing apparatus provided in the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present 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.
A message pushing method, apparatus, electronic device and storage medium according to the present invention are described below with reference to fig. 1 to 4.
It should be noted that, in a general way of data push between systems, an interface is provided by an opposite system, and a local system pushes data of the local system to the opposite system in real time through the interface, but this way couples two or more systems together, and a problem occurs in the stability of any system, which will directly affect the stability of the local system.
In order to solve the problem of coupling between systems, one solution is to introduce Message Middleware (MQ) between a local system and an opposite system, so that there is no direct association between the systems to implement decoupling, but this solution needs to expose MQ to the public network, which has a potential safety hazard, and meanwhile, MQ cannot process some scenarios such as data encryption transmission, signature verification, and the like.
For the way of pushing messages between systems through the message middleware MQ, the message pushing security is poor due to the fact that the middleware MQ does not have self-defined encryption and data verification labels and needs to be exposed to public networks and other factors.
Fig. 1 is a schematic flow diagram of a message pushing method provided by the present invention, where an execution subject of the method may be a backend of a local message pushing system, as shown in fig. 1, the method includes:
step S1, acquiring first information from a target device written by a front end, where the target device is a device successfully registered at the front end, and the first information includes a target message type, interface information corresponding to the target message, and encryption information corresponding to the interface information;
specifically, in the embodiment of the present invention, the local system is a system capable of producing messages, which may be an order system, and is used for producing messages such as orders, payments, and returns, or other systems capable of producing messages and implementing message pushing across systems, and the present invention is not limited specifically. The local message pushing system and the local system can be in the same network environment.
The target device described in the present invention refers to a peripheral system network device that is successfully registered at the front end of the local message push system and establishes a message subscription relationship with the local system, and may be a peripheral logistics system network device, a peripheral inventory system network device, or another peripheral system network device capable of consuming local message data.
The first information described in the present invention includes a type of the target message, interface information corresponding to the target message, and encryption information corresponding to the interface information, and may be information generated based on registration information of the target device after the front-end registration is successful, or information generated based on request information sent by the target device after the front-end registration is successful.
The target message type described in the present invention refers to a data type required for the target device to subscribe to, for example, if the target device is a physical distribution network device, the target message type may be one or more types of an order type message, a payment type message, a reverse type message, and the like, where the reverse type message refers to a return type message.
The interface information corresponding to the target message described in the present invention refers to IP address information of an interface used by the target device to receive the target message, and may be interface information conforming to an interface attribute of a HyperText Transfer Protocol (HTTP), specifically, the interface information may be interface information that the target device is specially used to receive order type information, may also be interface information that the target device is specially used to receive payment type information, and may also be the interface information described above. Through the interface information, a hardware interface of the target device for receiving the target message can be locked.
The encryption information corresponding to the interface information described in the present invention refers to information for selecting an interface encryption mode by the target device. In the embodiment of the present invention, the target device may select a default message encryption manner of the local message pushing system, or may select a custom message encryption manner.
Further, after the target device is successfully registered at the front end, the front end of the local message pushing system generates first information, and writes the first information into the back end of the local message pushing system, so that the back end can acquire the first information.
Step S2, based on the target message type in the first information, obtaining a target message corresponding to the target message type from a message middleware, where the message middleware receives and stores messages of various types sent by a data module;
specifically, the Message Middleware (MQ) described in the present invention refers to a supporting software system for providing synchronous or asynchronous and reliable Message transmission for an application system in a network environment based on Queue and Message passing technologies, which may be the most widely used Message middleware in the industry at present, such as a Kafka Message Middleware (MQ), a rabbit Message middleware (RabbitMQ), and a Rocket Message middleware (Rocket MQ), and an appropriate MQ may be selected according to actual needs, which is not particularly limited by the present invention.
In the embodiment of the invention, the MQ is arranged in the local intranet environment, so that the potential safety hazard caused by the fact that the MQ is exposed in a public network in the prior art is avoided, and the corresponding operation is completed by adopting a message middleware mechanism to enable different objects to activate the event of the other party by transmitting the message. The local system is used as a message sender, the messages are produced through the local data module, the messages of various types can be sent to the message server of the MQ from the local data module, and the message server stores the messages of various types in a plurality of queues.
In the embodiment of the invention, the local message pushing system is used as an intermediate medium for message pushing between the local system and the target device, is arranged between the MQ and the target device, acquires the message from the MQ and forwards the message to the target device which is used as a message consumer.
The target message described in the present invention refers to message data corresponding to a target message type required by a target device subscription.
Further, based on the target message type in the first information, the target message corresponding to the target message type may be obtained from the MQ.
Step S3, based on the encryption information corresponding to the interface information in the first information, performing encryption processing on the target message to obtain the encrypted target message;
specifically, after the encryption information corresponding to the interface information in the first information is obtained, the message encryption mode selected by the target device may be determined, and then the target message is encrypted according to the encryption mode information, so as to obtain the encrypted target message.
In the embodiment of the invention, when the target device selects the default message encryption mode of the local message pushing system, the encryption key sent by the local message pushing system is received after the target device is successfully registered, so that the target device can be used for subsequently decrypting the target message; when the target device selects a custom message encryption mode, the target device needs to send a key of the custom encryption mode or an encryption and signature verification mode to the local message pushing system, so that the local message pushing system encrypts the target message according to the custom encryption mode to obtain the encrypted target message.
Step S4, pushing the encrypted target message to the target device based on the interface information corresponding to the target message in the first information.
Specifically, based on interface information corresponding to the target message in the first information, an interface corresponding to the target device for receiving the target message may be determined, and the encrypted target message may be pushed to the target device through the interface.
Illustratively, when the target device is a logistics end network device, the registered target message type is an order type message, interface information corresponding to the registered target message is an interface specially used for receiving the order type message, an interface used by the target device for receiving the order type message can be determined based on the interface information corresponding to the target message, and then the encrypted order type message is pushed to the interface of the target device, the target device can symmetrically decrypt the encrypted order message through the interface, and then the target device can read specific content of the order type message, and finally complete the pushing process of the message.
The message pushing method provided by the embodiment of the invention improves the security of message storage by arranging the message middleware in a local intranet environment to avoid being exposed to a public network, and simultaneously obtains the first information written by a front end from the target equipment, wherein the first information comprises the type of the target message required by the target equipment, the interface information of the target equipment for receiving the target message and the encryption information corresponding to the interface information, so that the target message can be obtained from the message middleware according to the type of the target message, the target message is encrypted by the encryption information corresponding to the interface information, the encrypted target message is sent to the target equipment interface corresponding to the interface information according to the interface information, the target equipment can symmetrically decrypt the encrypted target message through the interface, the content of the target message is obtained, and the encryption pushing of the message is realized, the safety of message pushing is improved.
Optionally, after the pushing the encrypted target message to the target device based on the interface information corresponding to the target message in the first information, the method further includes:
receiving a message pushing result fed back by the target equipment;
when the message pushing result is that the pushing of the first type of target sub-message fails, acquiring the first type of target sub-message from a backup database at a back end, wherein the backup database stores various types of messages acquired from the message middleware, and the first type is one or more types of the target messages;
and the target sub-message of the first type is pushed to the target equipment again.
Specifically, the message pushing result described in the present invention refers to a result of whether the target device successfully receives the target message after the local message pushing system pushes the target message to the target device.
The first type described in the invention refers to one type or multiple types in the target message types, and the target sub-message refers to the first type of message in the target message corresponding to the target message type.
Therefore, in the embodiment of the present invention, the message pushing result may include a target message pushing success, a target message pushing failure, and a certain type or types of target sub-information pushing success or failure.
In the embodiment of the invention, after the target message is acquired from the message middleware, the back end stores the acquired target message into a back-up database of the back end, and backs up and records the target message so as to provide the effects of message query and message push.
The backup database described in the present invention refers to a database provided in the backend of the local message push system, and stores various types of message data acquired from the message middleware.
Therefore, when the message pushing result is that the target message pushing fails or the target sub-message pushing fails, the target message or the target sub-message can be obtained again from the backup database, and the target message or the target sub-message can be pushed to the target device again.
Exemplarily, if the target message corresponding to the type of the target message required by the target device is an order message and a payment message, after the target message is pushed by the local message pushing system, when the target device fails to receive both the order message and the payment message, the target device feeds back a message pushing result that the order message and the payment message are pushed unsuccessfully, and at this time, the target message needs to be pushed again, so that the local message pushing system acquires the order message and the payment message from a backup database at a back end, and further pushes the order message and the payment message to the target device again; when the target device successfully receives the order type message but fails to receive the payment type message, the target device feeds back a message pushing result that the order type message is successfully pushed, the payment type message is unsuccessfully pushed, at this moment, the first type of target sub-message needing to be pushed again is the payment type message, and therefore the local message pushing system obtains the payment type message from a back-up database at the rear end and then pushes the payment type message to the target device again.
According to the method provided by the embodiment of the invention, the backup database and the message pushing result feedback are set, when the message pushing fails, the message of the pushing failure can be obtained from the backup database, and the message of the pushing failure is pushed again, so that the effect of the failed retransmission of the message pushing is realized.
Optionally, after the target sub-message of the first type is pushed to the target device again, the method further includes:
receiving a message re-pushing result fed back by the target equipment;
under the condition that the message re-pushing result is that the re-pushing of the first type of target sub-message fails, sending the message re-pushing result to the data module so that the data module sends the first type of target sub-message to the message middleware according to the message re-pushing result;
acquiring the first type of target sub-message from the message middleware;
and the target sub-message of the first type is pushed to the target equipment again.
Specifically, the message re-pushing result described in the present invention refers to a result that the target device feeds back whether the target sub-message is successfully received or not after the first type of target sub-message is re-pushed to the target device.
In the embodiment of the invention, the local system is provided with a callback interface, and the local message pushing system can send the message re-pushing result to the data module of the local system by calling the callback interface of the local system.
Further, when the message re-pushing result is that the re-pushing of the first type of target sub-message fails, the local message pushing system calls a callback interface of the local system to send the message re-pushing result to the data module, the data module sends the first type of target sub-message to the MQ again according to the message re-pushing result, and the local message pushing system obtains the first type of target sub-message from the MQ again, so that the first type of target sub-message is pushed to the target device again.
In the embodiment of the invention, the local system can perform other operations after receiving the notification of the message re-pushing result through the callback interface. Illustratively, when receiving a notification that the order type message is successfully pushed, the local system may update the record status of the order type message pushing in the local data module, and upload the goods in the order type message; when receiving the notification that the repeated pushing of the payment type message fails, the local system can notify the network manager of the repeated pushing failure of the payment type message in the form of chat information or short messages, and remind the network manager of manual intervention processing and the like.
The method of the embodiment of the invention notifies the local system of the message re-pushing result by utilizing the callback interface of the local system through a message re-pushing mechanism, so that the local system can perform targeted operation according to the notification, and the effect of message pushing result callback is realized.
Optionally, the first information further includes first data format information, and the obtaining of the target message corresponding to the target message type from the message middleware includes:
acquiring an initial message corresponding to the target message type from the message middleware;
and calling a data preprocessing service corresponding to the first data format information, and performing data format processing on the initial message to obtain a target message.
Specifically, the initial message described in the present invention refers to a message corresponding to a target message type obtained from the message middleware, which has not undergone any data processing.
The first data format information described in the present invention refers to data format information of a message required by the target device in the local message push system.
The data preprocessing service described in the present invention refers to a distributed framework service, and specifically may be a Dubbo/HTTP type service in a local system service module, which is used for performing data format conversion on a message.
In the embodiment of the present invention, after acquiring the initial message from the message middleware based on the target message type in the first information, the local message push system may invoke a data preprocessing service corresponding to the first data format information, that is, a Dubbo/HTTP type service in the local service module, according to the first data format information in the first information, and further convert the data format of the initial message into the data format indicated by the first data format information, thereby obtaining the target message.
The method of the embodiment of the invention can further process the initial message data format acquired from the MQ into the data format required by the target equipment through the local data preprocessing service, thereby obtaining the target message, realizing the decoupling of message pushing and message processing logic and being beneficial to improving the message pushing efficiency.
Optionally, the encrypting the target message based on the encryption information corresponding to the interface information in the first information to obtain the encrypted target message includes:
determining a signature of the target message based on the signature verification information in the encrypted information;
and encrypting the target message and the signature of the target message based on the key information in the encryption information to obtain the encrypted target message.
Specifically, in the embodiment of the present invention, for the encryption mode of the message, the target device may select a customized encryption mode.
The signature verification information described in the invention refers to signature verification mode information corresponding to interface information provided by the target equipment, and through the signature verification information, the target equipment can verify the authenticity of a target message signature when decrypting a received encrypted target message so as to ensure the integrity of the target message.
The key information described in the invention refers to key information corresponding to interface information provided by the target device, and the target message is encrypted according to the key information provided by the target device, so that the target device can successfully decrypt the encrypted target message after receiving the encrypted target message to obtain the target message.
In the embodiment of the invention, the message digest of the target message can be extracted through a hash algorithm, and the message digest of the target message is encrypted based on the signature verification information in the encryption information to generate the signature of the target message;
further, the signature of the target message and the target message are encrypted together by using the key information in the encryption information, so as to obtain the encrypted target message.
According to the method provided by the embodiment of the invention, the target message is encrypted and signed by the encrypted information corresponding to the interface information in the first information, so that the target device can symmetrically decrypt the encrypted target message through the interface for receiving the target message, the content of the target message is obtained, the encrypted push of the message is realized, and the security of the message push is improved.
Optionally, the pushing the encrypted target message to the target device based on interface information corresponding to the target message in the first information includes:
determining a first interface of the target device for receiving the target message based on interface information corresponding to the target message in the first information;
and pushing the encrypted target message to the first interface so that the target device can receive the target message.
Specifically, the first interface described in the present invention refers to an interface for the target device to receive the target message, which is determined based on the interface information corresponding to the target message in the first information.
For example, if the target message belongs to the order type message and the target device is configured to receive the order type message through the interface 2 of the message interface module, the interface 2 of the target device may be locked according to the interface IP address information corresponding to the target message, so as to push the order type message to the interface 2 of the target device. If the target message belongs to two types of messages, namely, an order type message and a payment type message, the target device is used for receiving the order type message through the interface 2 of the message interface module, and the target device is used for receiving the payment type message through the interface 3 of the message interface module, the interface 2 and the interface 3 of the target device can be locked simultaneously according to the interface IP address information, so that the order type message and the payment type message are pushed to the interface 2 and the interface 3 of the target device respectively.
Further, the encrypted target message is pushed to the first interface, so that the first interface can symmetrically decrypt the encrypted target message when receiving the target message encrypted according to the interface encryption mode of the first interface, and the target device can acquire the target message more safely.
According to the method provided by the embodiment of the invention, the target message can be encrypted according to the customized encryption mode of the target equipment through the customized encryption mode set at the front end of the target equipment, so that the convenience and the safety for acquiring the target message by the target equipment are improved.
Optionally, before the obtaining the first information from the target device written by the front end, the method further includes:
acquiring audit information from first network equipment written by a front end;
and analyzing the audit information, and determining that the first network equipment is the target equipment under the condition that the audit information meets a preset audit condition.
Specifically, the first network device described in the present invention refers to a peripheral system device that has a need to consume local system message data and registers at the front end of the local message push system.
The auditing information described in the present invention refers to information entered by the first network device when registering information at the front end, and is information that requires a local message push system to perform qualification auditing.
The preset auditing condition described in the invention refers to a preset condition for determining whether the first network device satisfies the qualification of acquiring the push message of the local system.
In the embodiment of the present invention, if the audit information entered by the first network device satisfies the preset audit condition, it indicates that the first network device is qualified to acquire the message pushed by the local system, that is, it can be determined that the first network device is the target device.
Further, by acquiring audit information written by the front end and coming from the first network device, analyzing the audit information, judging whether the audit information meets a preset audit condition, and if so, determining that the first network device is the target device.
The method of the embodiment of the invention checks the qualification of the peripheral network equipment by setting an information auditing mechanism, and is beneficial to further improving the safety of local message pushing.
It should be noted that, for the manner of pushing messages between systems through the message middleware MQ, it also needs to use a communication manner of Transmission Control Protocol (TCP) through a special Software Development Kit (SDK), which is tedious in Development process and low in system stability. Therefore, the invention provides the following embodiments to solve the problems of complicated development process and low system stability of the message pushing system in the prior art.
Fig. 2 is a schematic diagram of an overall system structure of a message pushing method provided by the present invention, as shown in fig. 2, the method includes:
step S210, subscribing: the peripheral system target equipment firstly sends registration information of the front end of the local message pushing system, after the target equipment is successfully registered, the front end generates first information according to the registration information, the first information comprises a target message type which needs to be consumed by the target equipment, the target equipment is used for receiving HTTP protocol interface information of the target message and encryption and signature verification mode information of the interface;
step S220, write: the front end of the local message pushing system writes the first information into a backup database at the back end of the message pushing system, and at the moment, a message subscription relation between the local system and the peripheral system is established;
step S230, sending: the local system sends the message to the corresponding Topic of the message middleware MQ through the data module, the MQ can store the messages of various types in the data module, and then the local system can continue to process other services without waiting;
step S240, consuming: the back end of the local message pushing system consumes the message of the corresponding Topic in the MQ according to the target message type in the first message, and obtains an initial message; after the initial message is processed into a target message, writing the target message into a backup database for backup storage and recording so as to facilitate query and re-push of subsequent messages;
step S250, call: according to the first data format information in the first information, the message pushing system calls a data preprocessing service, namely a Dubbo/HTTP type service, of a local system service module corresponding to the first data format information, and further processes the data format of the initial message to obtain a target message, so that decoupling of message sending and message processing logic can be realized;
step S260, pushing: the back end of the message pushing system encrypts the target message by calling an HTTP (hyper text transport protocol) protocol interface provided by the target equipment of the peripheral system according to the encryption and signature verification mode information selected by the target equipment in the first information, and pushes the encrypted target message to the target equipment of the peripheral system;
step S270, returning the result: after receiving the target message, the peripheral system target device returns a message pushing result, and the rear end of the message pushing system judges whether to re-push the target message or the first type of target sub-message and the times of re-pushing according to the message pushing result;
step S280, calling back: and the message pushing system calls a callback interface provided by the local system to notify the local system whether the target message or the first type target sub-message is pushed successfully or not.
According to the method provided by the embodiment of the invention, clustering deployment can be realized for each part of the whole system, single-point failure does not exist, the message pushing system can process the problems of message pushing record, failure retransmission, historical message re-pushing, custom encryption transmission, data verification and pushing result callback and the like, and the safety and stability of the whole system are improved while the decoupling of the local system and the peripheral system is realized.
According to the method provided by the embodiment of the invention, the peripheral system can subscribe the required message by self, only the HTTP protocol interface for receiving the message is provided, and the local system does not need to process logics such as message pushing failure and retransmission, so that the development process is simplified; providing a callback function, and informing a local system so that the local system can perform subsequent data processing; before the message is pushed, the local system service can be called, the message is further processed into a data format required by a peripheral system, and then the message is pushed, so that the logic decoupling of message sending and message processing by the local system is realized.
The following describes the message pushing apparatus provided by the present invention, and the message pushing apparatus described below and the message pushing method described above may be referred to correspondingly.
Fig. 3 is a schematic structural diagram of a message pushing apparatus provided in the present invention, as shown in fig. 3, including:
a first obtaining unit 310, configured to obtain first information from a target device written by a front end, where the target device is a device successfully registered at the front end, and the first information includes a target message type, interface information corresponding to the target message, and encryption information corresponding to the interface information;
a second obtaining unit 320, configured to obtain, based on a target message type in the first information, a target message corresponding to the target message type from a message middleware, where the message middleware receives and stores messages of various types sent by a data module;
an encrypting unit 330, configured to encrypt the target message based on encryption information corresponding to interface information in the first information, to obtain the encrypted target message;
a pushing unit 340, configured to push the encrypted target message to the target device based on interface information corresponding to the target message in the first information.
The apparatus according to the embodiment of the present invention may be used to implement the above method embodiments, and the principle and technical effects are similar, which are not described herein again.
The message pushing device provided by the invention avoids being exposed to a public network by arranging the message middleware in a local intranet environment, improves the safety of message storage, simultaneously obtains the first information written by the front end from the target equipment, the first information comprises the type of the target message required by the target equipment, the interface information of the target equipment for receiving the target message and the encryption information corresponding to the interface information, further can obtain the target message from the message middleware according to the type of the target message, encrypts the target message through the encryption information corresponding to the interface information, sends the encrypted target message to the target equipment interface corresponding to the interface information according to the interface information so as to ensure that the target equipment can symmetrically decrypt the encrypted target message through the interface, thereby obtaining the content of the target message and realizing the encryption pushing of the message, the safety of message pushing is improved.
Fig. 4 is a schematic structural diagram of an electronic device provided in the present invention, and as shown in fig. 4, the electronic device may include: a processor (processor)410, a communication Interface 420, a memory (memory)430 and a communication bus 440, wherein the processor 410, the communication Interface 420 and the memory 430 are communicated with each other via the communication bus 440. Processor 410 may invoke logic instructions in memory 430 to perform the message push methods provided by the methods described above, including: acquiring first information written by a front end and coming from target equipment, wherein the target equipment is equipment which is successfully registered at the front end, and the first information comprises a target message type, interface information corresponding to the target message and encryption information corresponding to the interface information; acquiring a target message corresponding to the target message type from a message middleware based on the target message type in the first information, wherein the message middleware receives and stores messages of various types sent by a data module; encrypting the target message based on the encryption information corresponding to the interface information in the first information to obtain the encrypted target message; and pushing the encrypted target message to the target equipment based on interface information corresponding to the target message in the first information.
In addition, the logic instructions in the memory 430 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, a computer is capable of executing the message pushing method provided by the above methods, and the method includes: acquiring first information written by a front end and coming from target equipment, wherein the target equipment is equipment which is successfully registered at the front end, and the first information comprises a target message type, interface information corresponding to the target message and encryption information corresponding to the interface information; acquiring a target message corresponding to the target message type from a message middleware based on the target message type in the first information, wherein the message middleware receives and stores messages of various types sent by a data module; encrypting the target message based on the encryption information corresponding to the interface information in the first information to obtain the encrypted target message; and pushing the encrypted target message to the target equipment based on interface information corresponding to the target message in the first information.
In still another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to execute the message pushing method provided by the above methods, the method including: acquiring first information written by a front end and coming from target equipment, wherein the target equipment is equipment which is successfully registered at the front end, and the first information comprises a target message type, interface information corresponding to the target message and encryption information corresponding to the interface information; acquiring a target message corresponding to the target message type from a message middleware based on the target message type in the first information, wherein the message middleware receives and stores messages of various types sent by a data module; encrypting the target message based on the encryption information corresponding to the interface information in the first information to obtain the encrypted target message; and pushing the encrypted target message to the target equipment based on interface information corresponding to the target message in the first information.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A message pushing method, comprising:
acquiring first information written by a front end and coming from target equipment, wherein the target equipment is equipment which is successfully registered at the front end, and the first information comprises a target message type, interface information corresponding to the target message and encryption information corresponding to the interface information;
acquiring a target message corresponding to the target message type from a message middleware based on the target message type in the first information, wherein the message middleware receives and stores messages of various types sent by a data module;
encrypting the target message based on the encryption information corresponding to the interface information in the first information to obtain the encrypted target message;
and pushing the encrypted target message to the target equipment based on interface information corresponding to the target message in the first information.
2. The message pushing method according to claim 1, wherein after pushing the encrypted target message to the target device based on interface information corresponding to the target message in the first information, the method further comprises:
receiving a message pushing result fed back by the target equipment;
when the message pushing result is that the pushing of the first type of target sub-message fails, acquiring the first type of target sub-message from a backup database at a back end, wherein the backup database stores various types of messages acquired from the message middleware, and the first type is one or more types of the target messages;
and the target sub-message of the first type is pushed to the target equipment again.
3. The message pushing method according to claim 2, further comprising, after the target sub-message of the first type is pushed to the target device again:
receiving a message re-pushing result fed back by the target equipment;
under the condition that the message re-pushing result is that the re-pushing of the first type of target sub-message fails, sending the message re-pushing result to the data module so that the data module sends the first type of target sub-message to the message middleware according to the message re-pushing result;
acquiring the first type of target sub-message from the message middleware;
and the target sub-message of the first type is pushed to the target equipment again.
4. The message pushing method according to claim 1, wherein the first information further includes first data format information, and the obtaining the target message corresponding to the target message type from the message middleware includes:
acquiring an initial message corresponding to the target message type from the message middleware;
and calling a data preprocessing service corresponding to the first data format information, and performing data format processing on the initial message to obtain a target message.
5. The message pushing method according to claim 1, wherein the encrypting the target message based on the encryption information corresponding to the interface information in the first information to obtain the encrypted target message includes:
determining a signature of the target message based on the signature verification information in the encrypted information;
and encrypting the target message and the signature of the target message based on the key information in the encryption information to obtain the encrypted target message.
6. The message pushing method according to claim 1, wherein the pushing the encrypted target message to the target device based on interface information corresponding to the target message in the first information comprises:
determining a first interface of the target device for receiving the target message based on interface information corresponding to the target message in the first information;
and pushing the encrypted target message to the first interface so that the target device can receive the target message.
7. The message pushing method according to claim 1, wherein before said obtaining the first information written by the front end from the target device, further comprising:
acquiring audit information from first network equipment written by a front end;
and analyzing the audit information, and determining that the first network equipment is the target equipment under the condition that the audit information meets a preset audit condition.
8. A message push apparatus, comprising:
a first obtaining unit, configured to obtain first information from a target device written by a front end, where the target device is a device successfully registered at the front end, and the first information includes a target message type, interface information corresponding to the target message, and encryption information corresponding to the interface information;
a second obtaining unit, configured to obtain, from a message middleware, a target message corresponding to a target message type based on the target message type in the first information, where the message middleware receives and stores messages of various types sent by a data module;
the encryption unit is used for encrypting the target message based on encryption information corresponding to the interface information in the first information to obtain the encrypted target message;
and the pushing unit is used for pushing the encrypted target message to the target equipment based on the interface information corresponding to the target message in the first information.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the message push method according to any one of claims 1 to 7 when executing the program.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, implements the steps of the message pushing method according to any one of claims 1 to 7.
CN202111136650.5A 2021-09-27 2021-09-27 Message pushing method and device, electronic equipment and storage medium Pending CN113992352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111136650.5A CN113992352A (en) 2021-09-27 2021-09-27 Message pushing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111136650.5A CN113992352A (en) 2021-09-27 2021-09-27 Message pushing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113992352A true CN113992352A (en) 2022-01-28

Family

ID=79736871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111136650.5A Pending CN113992352A (en) 2021-09-27 2021-09-27 Message pushing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113992352A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117614751A (en) * 2024-01-24 2024-02-27 上海银基信息安全技术股份有限公司 Intranet access method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141251A (en) * 2006-09-08 2008-03-12 华为技术有限公司 Method, system and equipment of message encryption signature in communication system
CN102143444A (en) * 2010-09-02 2011-08-03 华为技术有限公司 Method, relevant equipment and system for pushing service delivery platform message
CN107026824A (en) * 2016-02-02 2017-08-08 腾讯科技(深圳)有限公司 A kind of message encryption, decryption method and device
CN112491998A (en) * 2020-11-18 2021-03-12 平安消费金融有限公司 Message pushing method and related equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141251A (en) * 2006-09-08 2008-03-12 华为技术有限公司 Method, system and equipment of message encryption signature in communication system
CN102143444A (en) * 2010-09-02 2011-08-03 华为技术有限公司 Method, relevant equipment and system for pushing service delivery platform message
CN107026824A (en) * 2016-02-02 2017-08-08 腾讯科技(深圳)有限公司 A kind of message encryption, decryption method and device
CN112491998A (en) * 2020-11-18 2021-03-12 平安消费金融有限公司 Message pushing method and related equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117614751A (en) * 2024-01-24 2024-02-27 上海银基信息安全技术股份有限公司 Intranet access method and system
CN117614751B (en) * 2024-01-24 2024-04-02 上海银基信息安全技术股份有限公司 Intranet access method and system

Similar Documents

Publication Publication Date Title
US11290555B2 (en) Push notification delivery system
US20220239496A1 (en) Blockchain consensus method, device and system
US20210304201A1 (en) Transaction verification method and apparatus, storage medium, and electronic device
CN110601952A (en) Multi-channel message notification sending method and device
CN106874334B (en) Data processing method and device and information processing system
CN110515965A (en) Business paper processing method, device, computer equipment and storage medium
CN114338793B (en) Message pushing method and device, electronic equipment and readable storage medium
CN107341059B (en) WeChat public number concurrent message processing system
CN114780982A (en) Flow business circulation method, device and system
CN113992352A (en) Message pushing method and device, electronic equipment and storage medium
US20210158301A1 (en) Systems and methods for message transmission and retrieval using blockchain
CN113051086A (en) Data processing method and device, electronic equipment and storage medium
CN115632815A (en) Data updating method and device, electronic equipment and storage medium
CN114390452A (en) Message sending method and related equipment
CN111225117B (en) Reminding message issuing method and device
CN113590243A (en) Energy enterprise project creation method and device, computer equipment and medium
CN112333262A (en) Data updating prompting method and device, computer equipment and readable storage medium
CN111552907A (en) Message processing method, device, equipment and storage medium
CN117811833B (en) Unified network crypto-engine management system and method based on publishing and subscribing mode
CN109889590B (en) Message processing method, device, client and computer readable medium
CN112884437B (en) Asset management method and device
CN110781523B (en) Method and apparatus for processing information
CN115061643A (en) Order printing method, device, equipment and storage medium
CN117350689A (en) Message notification method, device, computer equipment and storage medium
CN116450376A (en) Data synchronization method, apparatus, computer device, storage medium, and program product

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