CN108712501B - Information sending method and device, computing equipment and storage medium - Google Patents

Information sending method and device, computing equipment and storage medium Download PDF

Info

Publication number
CN108712501B
CN108712501B CN201810522246.3A CN201810522246A CN108712501B CN 108712501 B CN108712501 B CN 108712501B CN 201810522246 A CN201810522246 A CN 201810522246A CN 108712501 B CN108712501 B CN 108712501B
Authority
CN
China
Prior art keywords
message
video
messages
server
service
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.)
Active
Application number
CN201810522246.3A
Other languages
Chinese (zh)
Other versions
CN108712501A (en
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.)
Tencent Technology Beijing Co Ltd
Original Assignee
Tencent Technology Beijing 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 Tencent Technology Beijing Co Ltd filed Critical Tencent Technology Beijing Co Ltd
Priority to CN201810522246.3A priority Critical patent/CN108712501B/en
Publication of CN108712501A publication Critical patent/CN108712501A/en
Application granted granted Critical
Publication of CN108712501B publication Critical patent/CN108712501B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Landscapes

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

Abstract

The application provides a method for sending information, which comprises the following steps: when a main storage area receives a message representing the state of media information, acquiring a plurality of first messages from the main storage area, wherein the messages carry media information identifiers; determining the service type of the first message according to the media information identifier of the first message; storing the plurality of first messages to corresponding service storage areas according to the service types; and acquiring a plurality of second messages from the service storage area, and sending the plurality of second messages to corresponding service servers according to the media information identifiers of the second messages.

Description

Information sending method and device, computing equipment and storage medium
Technical Field
The present application relates to the field of information technologies, and in particular, to a method and an apparatus for sending information, a computing device, and a storage medium.
Background
With the development of information technology and internet, more and more people perform activities on line, for example, watching videos, listening to music, etc., when a user performs activities on line, the user needs to perform information interaction with a corresponding server through a client, such as a web client, APP, etc., and the online activities of the user are realized through the information interaction, so as to provide corresponding activity contents for the user, and simultaneously generate a large amount of activity messages, and process the large amount of activity messages, a large amount of cost is consumed, and how to process the large amount of activity messages, so as to better maintain online activities, which is a key for solving the problems.
Disclosure of Invention
The technical scheme is provided, so that a large number of messages can be conveniently processed, and meanwhile, the cost for processing the messages is reduced.
The embodiment of the application provides a method for sending information, which comprises the following steps: when a main storage area receives a message representing the state of media information, acquiring a plurality of first messages from the main storage area, wherein the messages carry media information identifiers; determining the service type of the first message according to the media information identifier of the first message; storing the plurality of first messages to corresponding service storage areas according to the service types; and acquiring a plurality of second messages from the service storage area, and sending the plurality of second messages to corresponding service servers according to the media information identification of the second messages.
The example of the present application further provides an apparatus for sending information, the apparatus including: the device comprises an acquisition module, a storage module and a processing module, wherein the acquisition module acquires a plurality of first messages from a main storage area when the main storage area receives a message representing the state of media information, and the message carries a media information identifier; the determining module is used for determining the service type of the first message according to the media information identifier of the first message; the storage module is used for storing the plurality of first messages to corresponding service storage areas according to the service types; and the acquisition module acquires the plurality of second messages from the service storage area and sends the plurality of second messages to the corresponding service server according to the media information identification of the second messages.
In some examples, the obtaining module, after obtaining a plurality of second messages from the service storage area, stores the plurality of second messages in a backup storage area; after restarting, acquiring the plurality of second messages in the backup storage area; the apparatus further comprises: and the sending module is used for sending the plurality of second messages to the corresponding service servers according to the media information identifiers of the second messages.
In some examples, after acquiring a plurality of second messages from the service storage area, the acquiring module sends an acquiring request indicating details of a media information state to an information providing server, where the acquiring request carries the media information identifier; the receiving module is used for receiving the media information state details sent by the information providing server in response to the acquisition request; and the sending module sends the media information state details to the corresponding service server according to the media information identifier of the second message.
In some examples, the message indicating the media information status also carries media information status details.
In some examples, the storage module, when it is determined that the second message fails to be sent, stores the second message that failed to be sent into the primary storage area; the apparatus further comprises: and the deleting module deletes the second message which fails to be sent from the backup storage area.
In some examples, the determining module, when determining that the second message failed to be sent, determines a number of times the second message failed to be sent; the apparatus further comprises: and the stopping module stops sending the second message when the times reach a threshold value, and executes the step of deleting the second message which is failed to be sent from the backup storage area.
In some examples, the deletion module deletes the second message in the backup storage area when receiving a message indicating that the second message was successfully sent.
In some examples, when it is determined that the second message fails to be sent, the sending module sends a message indicating that the second message fails to be sent to an alarm system, so that the alarm system alarms a corresponding service party.
In some examples, the primary storage area, the business storage area, and the backup storage area are provided in a Redis storage system.
In some examples, when receiving the message indicating that the second message is successfully sent, the determining module determines a response time for the service server to receive the second message, and sends the response time to an alarm system, so that the alarm system alarms the service party according to the response time.
In some examples, the obtaining module sends the second message to the corresponding service server by calling back a universal network interface of the service server.
In some examples, the obtaining module obtains the performance information of the sending device after obtaining the plurality of second messages from the service storage area; and the sending module selects sending equipment to send the second message according to the performance information.
The examples of this application also provide a computing device comprising a memory, a processor, and a computer program stored on the memory and run on the processor; the processor, when executing the computer program, implements the method described above.
The present examples also provide a storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform the above-described method.
The technical scheme of the invention can conveniently and efficiently process a large number of messages, simultaneously greatly reduces the cost for processing the messages, and stores the plurality of first messages to the corresponding service storage areas according to the service types, isolates different service messages, prevents the influence between different service messages, for example, other service messages can not be sent due to the extrusion of one service message, thereby improving the sending efficiency of the messages.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in 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 only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a system to which a method for sending information according to an example of the present application is applied;
fig. 2 is a flowchart of a method of transmitting information according to an example of the present application;
FIG. 3 is a diagram of an exemplary messaging application architecture;
fig. 4 is a process flow diagram of a method of sending information according to an example of the present application;
FIG. 5 is a flow diagram illustrating an exemplary message backup process;
FIG. 6 is a management interface diagram of an interface configuration in an example of the present application;
fig. 7 is a schematic structural diagram of an information transmitting apparatus according to an example of the present application;
fig. 8 is a schematic diagram of hardware of a computing device according to an example of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
For simplicity and clarity of description, the invention will be described below by describing several representative embodiments. The numerous details of the examples are merely provided to assist in understanding the inventive arrangements. It will be apparent, however, that the invention may be practiced without these specific details. Some embodiments are not described in detail, but rather are merely provided as frameworks, in order to avoid unnecessarily obscuring aspects of the invention. Hereinafter, "comprising" means "including but not limited to", "according to … …" means "according to at least … …, but not according to only … …". When the number of one component is not particularly specified hereinafter, it means that the component may be one or more, or may be understood as at least one.
Fig. 1 is a schematic structural diagram of a system 100 to which a transmission method of information according to an example of the present application is applied. The system 100 comprises at least a first server 101, a second server 102, a third server 103, a fourth server 104 and a network 105; additionally, the system may include a message storage system, such as a Redis storage system, for storing messages.
The first server 101 is a device having a data calculation processing function, and may be a device providing a video service, such as a video server, where the server is installed with software capable of providing the video server, where the video service may include but is not limited to services such as uploading, transcoding, and playing of a video, and in addition, the first server 101 may be replaced by a video server cluster, and servers in the video server cluster may be respectively used to receive an uploaded video, a transcoded video, and store the transcoded video.
The second server 102 refers to a device having a data calculation processing function, and may be a device providing a processing service of a message, such as a message processing server, which is installed with server software for message processing. In addition, the second server 102 may also be replaced by a plurality of server clusters, and the plurality of server clusters are respectively installed with server software for message processing, so as to implement a processing service for providing messages.
The third server 103 refers to a device having a data calculation processing function, and may be a device providing a message transmission service, such as a message transmission server, which is installed with software capable of transmitting a message, or a terminal device, such as a PC terminal, which is installed with an operating system and message transmission software running on the operating system.
The fourth server 104 refers to a device having a data calculation processing function, and may be a device providing a business service, such as a social business server, which is installed with software capable of providing the business service.
The fourth server 104 may upload an original video to the first server 101 through the network 105, when the original video is received by the first server 101, a transcoding operation needs to be performed on the original video, when the transcoding operation of the original video is successful, that is, the first server 101 determines that the state of the original video has changed, and the current state of the original video is "transcoding successful", the first server 101 sends the message that is transcoded successfully to a main storage area of the message storage system through the network 105, the second server 102 obtains the stored messages from the main storage area of the message storage system and stores the messages in different service storage areas of the message storage system according to service types, the second server 102 sends the messages to the third server 103 through the network 105, and the third server 103 sends the messages to the fourth server 104 through the network 105 to inform the fourth server 104 of the current video state of the original video.
The network 105 may be a wired network or a wireless network.
Based on the system 100, the example of the present application proposes a method for sending information, which is applied to a server, such as a message server or a message system (the message system may be a cluster composed of a plurality of servers). Referring to fig. 2 and 4, the method 200 includes the following steps:
step 201: when a main storage area receives a message representing the state of media information, acquiring a plurality of first messages from the main storage area, wherein the messages carry media information identifiers and can also carry message identifiers.
The media information may be, but is not limited to: video, etc.
The media information state may be, but is not limited to: successful video transcoding, unsuccessful video transcoding, passing of manual video review, failing of manual video review and the like.
The message identification may be, but is not limited to: message ID, such as 001.
The media information identification may be, but is not limited to: video ID, such as 001.
The main storage area may be, but is not limited to: a main queue.
For example, according to the foregoing, the video server may provide video services such as video uploading, video transcoding, and video playing for a plurality of service servers (i.e. the fourth server 104), when the video server provides a video uploading interface for the wechat public service server, the wechat public service server uploads the original video to the video server or the video server cluster through the video uploading interface, and the video server may transcode the original video through a transcoding module therein, or the video server cluster may transcode the original video through a transcoding server therein, and when the transcoding is successful, as shown in fig. 4, step 401: the video server can send or insert or store the message that the video transcoding is successful (e.g., the message "001" of the video ID "001" that the transcoding is successful) into a main queue in the Redis storage system by using an LPUSH command through a message sending module therein, or the video server cluster can send the message that the video transcoding is successful into the main queue in the Redis storage system by using the LPUSH command through the message sending server therein; when a message system or a message server detects that a message to be distributed exists in a main queue in the Redis storage system (e.g., the message to be distributed can be periodically obtained from the main queue in the Redis storage system to detect whether the message exists in a current main queue), step 402: the dispatch process of the messaging system or message server utilizes the rpoppause command to extract the batch of messages that line up the front of the queue (i.e., the first message in the batch, e.g., the first 80 messages in the main queue) from the main queue. More specifically, the batch messages arranged in front of the queue are extracted from the main queue by the sub-processes of the distribution thread by using the rpoppause command, that is, each sub-process can independently realize the function of extracting messages from the main queue. Fig. 3 shows a message system or message server application architecture diagram, in which a video service side 301 allows other service sides to access a video service and provides other service sides with services such as uploading, transcoding and playing of videos. After the service side uploads the video to the video service side 301, it is necessary to know the state change condition of the video, and after the state of the video is changed, the video service side 301 sends a state change message of the video to the service side interface 303 through the message system 302.
In some examples, the message indicating the media information status also carries media information status details.
The media information status details may include, but are not limited to: the method comprises the following steps of video transcoding details, video manual review details, a video file list and the like, wherein the video transcoding details can be video transcoding time, video transcoding rate and the like, and the video manual review details can be video manual review time and the like.
When the message indicating the media information state also carries the details of the media information state, the service side can receive the more detailed information of the media information, so that the service side can know the state of the current media information and provide better service for the service side.
It should be understood that when the message also carries the status details of the media information, the video server stores the status details corresponding to the status of the media information to the main storage area in addition to storing the status of the media information, the media information identifier and the message identifier to the main storage area.
It should be noted that the distribution process is a process that is started after the message system or the message server is initialized.
The aforementioned LPUSH and RPOLPUSH are Redis storage system commands.
The main queue can store a plurality of messages, the messages are sorted in the sequence of the storage time of the messages from first to last, and when the messages are extracted, the messages are also extracted according to the principle of first in first out of the messages.
Step 202: and determining the service type of the first message according to the media information identifier of the first message.
The service type may be, but is not limited to: public number video service, mobile qq video and the like.
For example, as described above, the message system 302 or the message server determines a service type corresponding to a message identifier, such as a "public number" service type, according to a video identifier, such as "001", carried by one message in the extracted batch messages, and by searching for a correspondence between the message identifier and the service type.
It should be understood that the message system 302 or the message server should store a corresponding relationship between the media information identifier and the service type, such as a corresponding relationship table, or store a corresponding relationship between the media information identifier and the service type in a database (a database that may have a communication relationship with the video service side 301 and the message system 302), such as a corresponding relationship table, and the message system 302 or the message server searches the service type corresponding to the media information identifier in the corresponding relationship table according to the media information identifier. The corresponding relationship should be updated according to the service of the video service side 301.
It should be noted that, in addition to determining the service type according to the media information identifier, the service type may also be determined according to the message identifier, that is, the message identifier and the service type have a corresponding relationship, at this time, the message system 302 or the message server may have stored the corresponding relationship between the message identifier and the service type, or one database (a database which may have a communication relationship with the video service side 301 and the message system 302) may have stored the corresponding relationship between the message identifier and the service type, so that the message system 302 or the message server determines the corresponding service type according to the message identifier.
Step 203: and storing the plurality of first messages to corresponding service storage areas according to the service types.
The service storage area may be, but is not limited to: and (4) service queues.
For example, according to the foregoing, step 402: a dispatch (dispatch) process of the message system 302 or the message server extracts batch messages from the main queue by using the rpoppause command, and stores the batch messages into a corresponding service queue according to a service type corresponding to each message, for example, if a message carrying the media information identifier 001 corresponds to a public service type, the message carrying the media information identifier 001 is stored into the public service queue, and the public service queue may also have its own identifier, such as the service queue 1, so as to implement storing the batch messages into the corresponding service queue respectively.
It should be noted that multiple service queues may exist in the Redis storage system, and multiple messages of the same service may be stored in one service queue, and the messages are sorted in the order of the storage time of the messages from first to last.
To prevent interference between different services (e.g., interference with the sending of other service messages due to backlog of one of the service messages), the message system 302 or message server supports isolation of different service messages by distributing messages to the service queues via a secondary distribution. In addition, whether the messages are extracted from the main queue or the service queue, the messages are obtained in batch and then are sent out in parallel, so that the message sending delay can be reduced.
Step 204: and acquiring a plurality of second messages from the service storage area, and sending the plurality of second messages to corresponding service servers according to the media information identifiers of the second messages.
The second message may be the same as the first message, may be different from the first message, or may be partially the same as the first message.
In some examples, the sending the plurality of second messages to the corresponding service servers includes: and sending a second message to the corresponding service server by calling back a common network interface (namely a CGI interface) of the service server.
For example, as described above, step 403: the message system 302 or the sending (send) process of the message server extracts batch messages (i.e. second messages, e.g. 80 messages) from the service queue by using the rpoppause command, and determines a service server (i.e. corresponding CGI interface) corresponding to the media information identifier (e.g. a "YY public number" service server) according to the video identifier carried in the second message, e.g. "001", by searching for the corresponding relationship between the media information identifier and the service server, step 405: and calling back a CGI (common gateway interface) of the service server, and sending the second message to the corresponding service server through sending equipment (such as a WEB server) in an HTTP (hyper text transport protocol) communication mode according to the called-back CGI, so as to inform a service party of the state of the video uploaded by the service party, wherein if the second message also carries details of the video state, such as the video transcoding rate, the service party can also know the transcoding rate of the current video.
It should be noted that, when extracting batch messages in a service queue, batch messages may be extracted from one service queue, or multiple messages may be extracted from multiple service queues to form batch messages, and no matter which service queue message is extracted, message extraction needs to be performed according to the principle of message first-in first-out.
The sending process is a process started after the message system or the message server is initialized, and the sending process can extract batch messages arranged in front of the queue from the service queue by using an rpoppause command through each sub-process, namely, each sub-process can independently realize a function of extracting messages from the service queue.
The message system 302 or the message server should have stored therein a corresponding relationship, such as a corresponding relationship table, between the media information identifier and the service server, or a corresponding relationship, such as a corresponding relationship table, between the media information identifier and the service server in a database (a database that may have a communication relationship with the video service side 301 and the message system 302), and the message system 302 or the message server searches for the service server corresponding to the media information identifier in the corresponding relationship table according to the media information identifier. The corresponding relationship should be updated according to the service of the video service side 301.
It should be noted that, in addition to determining the service server according to the media information identifier, the service server may also be determined according to the message identifier, that is, the message identifier and the service server have a corresponding relationship, at this time, the message system 302 or the message server may have stored a corresponding relationship between the message identifier and the service server, or one database (a database which may have a communication relationship with the video service side 301 and the message system 302) may have stored a corresponding relationship between the message identifier and the service server, so that the message system 302 or the message server determines the corresponding service server according to the message identifier; meanwhile, each service server corresponds to a callback CGI interface, namely, the service server and the callback CGI interface have an incidence relation or a corresponding relation, and the service server is determined, namely, the callback CGI interface is determined, so that message sending is realized.
In addition, the CGI interface conforms to the established HTTP protocol, including receiving parameters and returning values. The receiving parameter of the CGI interface is preset and is a message field to be sent to the service side. The call-back CGI interface provided by each service side can be managed by a configuration management system and dynamically issued. Fig. 6 shows a management interface 600, where an ID601 of the callback CGI interface, such as "65", and a name 602 of the callback CGI interface, such as "Zkname: webde … … vidstatus ", message type 603, and callback CGI interface retry number 604, where the message type 603 may be video basic information, video status details, and the like, and the callback CGI interface retry number 604 may be 3. And the message at the service side is notified by adopting a call-back CGI interface mode, so that the cost of accessing the message system 302 at the service side is greatly reduced.
In some examples, the method 200 further comprises: after a plurality of second messages are acquired from the service storage area, the plurality of second messages are stored in a backup storage area; after restarting, acquiring the plurality of second messages in the backup storage area; and sending the plurality of second messages to corresponding service servers according to the identifiers of the second messages.
The backup storage area may be, but is not limited to: and backing up the queue.
For example, as described above, as shown in fig. 5, step 501: after the sending (send) process of the message system 302 or the message server extracts the batch messages from the service queue by using the rpoppause command, the extracted batch messages are stored in the backup queue, and after the message system 302 or the message server is restarted or initialized, the sending (send) process extracts the batch messages from the backup queue by using the rpoppause command and sends the batch messages to the corresponding service server by means of the call-back CGI according to the message identifier of the batch messages. In addition, when a part or even all of the services implementing the method 200 are restarted or quitted midway and recreated, or after a part or even all of the processes are restarted or quitted midway and recreated, the sending (send) process extracts the batch messages from the backup queue by using the rpoppause command, and sends the batch messages to the corresponding service server in a way of calling back the CGI according to the message identifier of the batch messages, which is described in detail in the foregoing, and thus is not described here again.
It should be noted that a plurality of messages may be stored in the backup queue, and the messages are sorted in the order of the storage time of the messages from first to last, and when the messages are extracted, the messages are also extracted according to the principle of first in and first out of the messages.
According to the above mode, the batch messages are extracted from the service queue and then stored in the backup queue, and the batch messages can be extracted from the main queue and then stored in the backup queue, so that the batch messages do not need to be stored in the backup queue after being extracted from the service queue, and the messages can be ensured not to be lost. This operation is atomic when backing up messages to the backup queue after the sending process has retrieved the message from the service queue using the rpoppause command support. When a part or even all of the services implementing the method 200 are restarted or quitted midway and recreated, or a part or even all of the processes are restarted or quitted midway and recreated, the messages are preferentially extracted from the backup queue and retransmitted, and the messages are guaranteed not to be lost.
In some examples, the method 200 further comprises: when the second message is determined to be failed to be sent, storing the second message which is failed to be sent into the main storage area; and deleting the second message of the failed transmission from the backup storage area.
For example, as described above, when the message system 302 or the message server receives a message that the second message sent by the corresponding service server fails to be sent, it is determined that the second message fails to be sent, or when the message system 302 or the message server does not receive a response message returned by the corresponding service server within a threshold time (e.g., 5 minutes), it is determined that the second message fails to be sent, and it is determined that the identity of the second message that fails to be sent is, e.g., 001, the sending process of the message system 302 or the message server may obtain the second message from the backup queue and store the second message in the primary queue to wait for the next sending, and delete the second message in the backup queue to prevent retransmission.
It should be noted that, when it is determined that the second message fails to be sent, the source of the second message may be obtained from the backup storage area after being restarted, or may be directly extracted from the service storage area, and no matter where the source of the second message is, the second message may be stored in the main storage area on the premise that the second message fails to be sent according to the above-mentioned scheme; and deleting the second message which fails to be sent from the backup storage area.
After the second message is stored in the main storage area, in order to avoid the problem of action redundancy caused by that the second message is firstly acquired from the backup storage area for transmission due to restart, the second message with failed transmission needs to be deleted from the backup storage area.
In some examples, the method 200 further comprises: when the second message is determined to be failed to be sent, determining the number of times of failure in sending the second message; and when the times reach a threshold value, stopping sending the second message, and executing the step of deleting the second message which is failed to be sent from the backup storage area.
For example, according to the foregoing, when the message system 302 or the message server receives a message that a second message sent by the corresponding service server fails to be sent, it is determined that the second message fails to be sent, or when the message system 302 or the message server does not receive a response message returned by the corresponding service server within a threshold time (e.g., 5 minutes), it is determined that the second message fails to be sent, after it is determined that the second message fails to be sent, the number of times of failure is determined, and if the number of times of failure is greater than a threshold (e.g., three times), the sending of the second message is stopped, that is, the second message is no longer stored in the primary queue, and the second message in the backup queue is deleted, so as to avoid resending.
It should be noted that, when it is determined that the second message fails to be sent, the source of the second message may be obtained from the backup storage area after being restarted, or may be directly extracted from the service storage area, and no matter where the source of the second message is, the number of times of sending failure of the second message may be determined on the premise that the sending of the second message fails according to the above scheme; and when the times reach a threshold value, stopping sending the second message, and executing the step of deleting the second message which is failed to be sent from the backup storage area.
When the second message is sent for a certain number of times and is not sent, in order to save time and improve the efficiency of sending other messages, the storage space occupied by the second message is released and the system performance is improved, and the second message is stopped being sent.
In some examples, the primary storage area, the service storage area, and the backup storage area are provided in a Redis storage system.
Message queues based on the Redis storage system are used for storing messages, and the messages are inserted and obtained in the Redis storage system only through Redis storage system commands such as LPUSH or RPOPLPUSH and the like, so that the operation is light, and the messages are ensured not to be lost
In some examples, the method 200 further comprises: when receiving the message indicating that the second message is successfully sent, determining the response time of the service server for receiving the second message, and sending the response time to an alarm system so that the alarm system alarms a service party according to the response time.
For example, according to the foregoing, when the message system 302 or the message server receives a response message returned by the corresponding service server in response to the received second message, where the response message may indicate that the second message is received, the second message is successfully sent, at this time, the message system 302 or the message server determines the response time of the service server and sends the response time to the alarm system, where the response time may be sent in a form of a message, and the message may further carry service server information, a video identifier, or information capable of indicating the service party, of which the response time corresponds to the response time, the alarm system may be configured to determine whether the response time exceeds a normal response threshold time, and if the response time exceeds the normal response threshold time, the alarm system may send alarm information to the corresponding service party according to the service server information, such as a service server access address, to determine a contact manner, such as a mail contact manner, a WeChat contact manner, an overlong short message contact manner, and the like, where the alarm information may be indicated as prompt information of the response time of the service server, so that a relevant person on the service side debugs the service server and the service server according to the prompt information.
It should be noted that, when it is determined that the second message is successfully sent, the source of the second message may be obtained from the backup storage area after being restarted, or may be directly extracted from the service storage area, and no matter where the source of the second message is, the response time of the service server receiving the second message may be determined according to the above scheme on the premise that the second message is successfully sent, and the response time is sent to the alarm system, so that the alarm system alarms the service party according to the response time.
The warning system can be composed of at least one server and is used for warning the corresponding service server; after the message system 302 or the message server determines the response time, it may also directly determine whether the response time is overtime, if the response time is overtime, that is, exceeds the normal response threshold time, the response time is sent to the alarm system, and if the response time is not overtime, the response time is not sent to the alarm system.
In some examples, the method 200 further comprises: and deleting the second message in the backup storage area when receiving a message indicating that the second message is successfully sent.
For example, according to the foregoing description, when the message system 302 or the message server receives a response message returned by the corresponding service server in response to the received second message, where the response message may indicate that the second message is received, the second message is successfully sent, and the second message in the backup queue is deleted, so as to avoid repeated sending of messages.
It should be noted that, when it is determined that the second message is failed to be sent, the source of the second message may be obtained from the backup storage area after being restarted, or may be directly extracted from the service storage area, and no matter where the source of the second message is, the second message in the backup storage area may be deleted on the premise that the second message is successfully sent according to the above scheme.
In some examples, the method 200 further comprises: and when the second message is determined to be failed to be sent, sending a message indicating that the second message is failed to be sent to an alarm system so that the alarm system can alarm a corresponding service party.
For example, according to the foregoing, after the message system 302 or the message server determines that the second message fails to be sent according to the foregoing manner, the message indicating that the second message fails to be sent is sent to the alarm system, where the message may carry a video identifier or service server information corresponding to the video identifier or information capable of indicating the service party, and after the alarm system receives the message, the alarm system may determine a contact manner, such as a mail contact manner, a WeChat contact manner, a short message contact manner, and the like, of the service party corresponding to or bound to the service server according to the service server information, such as a service server access address, and send alarm information to the corresponding service party, where the alarm information may be represented as prompt information indicating that response time of receiving the message is too long, so that relevant personnel at the service side debug and maintain the service server according to the prompt information.
It should be noted that, when it is determined that the second message fails to be sent, the source of the second message may be obtained from the backup storage area after being restarted, or may be directly extracted from the service storage area, and no matter where the source of the second message is, the message indicating that the second message fails to be sent may be sent to the alarm system according to the above scheme on the premise that the second message fails to be sent, so that the alarm system alarms the corresponding service party.
In some examples, the method 200 further comprises: after a plurality of second messages are acquired from the service storage area, an acquisition request for representing the state details of the media information is sent to an information providing server, and the acquisition request carries the media information identifier; receiving the state details of the media information sent by the information providing server in response to the acquisition request; and sending the media information state details to a corresponding service server according to the identifier of the second message.
For example, as described above, when the message indicating the media information status does not carry the media information status details, and only carries the media information status, then after the message system 302 or the message server extracts the batch message from the service queue, step 404: the method includes the steps of obtaining video status details from an information providing server, for example, sending an obtaining request for representing the video status details to the information providing server, for example, a video information server, wherein the obtaining request carries a video ID, receiving the video status details sent by the information providing server in response to the obtaining request, for example, a video transcoding rate, and then sending the video status details to a corresponding service server along with a corresponding second message.
In some examples, the method 200 further comprises: after acquiring a plurality of second messages from the service storage area, acquiring the performance information of the sending equipment; and selecting sending equipment to send the second message according to the performance information.
For example, as described above, after the message system 302 or the message server extracts the batch messages from the service queue, the performance information of each sending device (e.g., the WEB server) is obtained, such as the CPU utilization, the memory utilization, the IO consumption, and the like, according to the performance information, the request success rate and the request delay of the sending device are determined, and the sending device with high request success rate and low request delay is selected to send the messages, so that the load of the sending device is balanced, and the stability of receiving the messages at the service side is ensured.
It should be noted that, in the above example, the step of acquiring the performance information of the sending device by the L5 component (which may include a name service and a load balancing function) and selecting the sending device to send the second message according to the performance information may be implemented.
The message system can support more than 80 different services, and the message system can support 5000/second message volume processing when running on a single C1 machine (1 4-core CPU,16G memory, 1 × 500G SATA).
The technical scheme provides that the messages are landed in a message queue (namely a main queue) in a Redis storage system, then the message system 302 or a message server extracts batch messages from the message queue by using an RPOPLPUSH command of the Redis storage system, and simultaneously sends the extracted batch messages, so that the messages can not be lost no matter the messages are failed in processing, or the message system 302 or the message server is restarted. In addition, the message system 302 or the message server further includes functions of message retransmission, supporting load balancing of the CGI interface, message failure monitoring and warning, and the like. While messaging system 302 or a message server has high processing performance, it is deployed to support horizontal extensions. The message system 302 or the message server can be used for decoupling the service message notification process, so that the cost of accessing the message notification at the service side is reduced, and the design is simple and easy to understand.
Existing message transit systems, such as Hippo, kafka, etc., are highly available message systems. Although the supported functions are rich, the use is more complicated, and the cost for building the whole message system is high. The key point is that the service side access mode has high cost, and the service side needs to know the message access mode and develop a message access program by itself. Meanwhile, the failure processing and monitoring alarm of the message sending are carried out, and the service side needs to be ensured. The overall use is not light enough.
Furthermore, a similar approach has not been seen for notifying messages based on the callback interface approach. Although the hippo or kafka can implement landing on the message, there are many disadvantages, for example, when the hippo or kafka is used as message relay, the burden of deployment and maintenance of this method is heavier than that of the method of using the Redis storage system to store the message; in addition, the message transfer is performed by using the sequence, but the current version is not mature enough, and the message is notified by using the callback interface mode based on the sequence, which is not lighter than the message queue operated by using the rpoplphsh.
Based on the above example, the present application also provides an information sending apparatus, which is applied to a server, such as a message server or a message system (the message system may be a cluster composed of a plurality of servers); as shown in fig. 7, the apparatus 700 includes: an obtaining module 701, a determining module 702, and a storing module 703: and the functions of the modules are as follows:
an obtaining module 701, configured to obtain, when the main storage area receives a message indicating a state of media information, a plurality of first messages from the main storage area, where the messages carry media information identifiers.
The determining module 702 determines the service type of the first message according to the media information identifier of the first message.
The storage module 703 stores the plurality of first messages to corresponding service storage areas according to the service type.
The obtaining module 701 obtains a plurality of second messages from the service storage area, and sends the plurality of second messages to corresponding service servers according to the media information identifier of the second messages.
In some examples, the obtaining module 701, after obtaining a plurality of second messages from the service storage area, stores the plurality of second messages to a backup storage area; after restarting, acquiring the plurality of second messages in the backup storage area; the apparatus 700 further comprises: and the sending module is used for sending the plurality of second messages to the corresponding service servers according to the media information identifiers of the second messages.
In some examples, the obtaining module 701, after obtaining a plurality of second messages from the service storage area, sends an obtaining request indicating details of a media information state to an information providing server, where the obtaining request carries the media information identifier; the receiving module is used for receiving the media information state details sent by the information providing server in response to the acquisition request; and the sending module sends the media information state details to the corresponding service server according to the media information identifier of the second message.
In some examples, the message indicating the media information status also carries media information status details.
In some examples, the storing module 703, when it is determined that the second message fails to be sent, stores the second message that failed to be sent into the primary storage area; the apparatus 700 further comprises: and the deleting module deletes the second message which fails to be sent from the backup storage area.
In some examples, the determining module 702, when determining that the second message failed to be sent, determines a number of times the second message failed to be sent; the apparatus 700 further comprises: and the stopping module stops sending the second message when the times reach a threshold value, and executes the step of deleting the second message which is failed to be sent from the backup storage area.
In some examples, the deletion module deletes the second message in the backup storage area when receiving a message indicating that the second message was successfully sent.
In some examples, when it is determined that the second message fails to be sent, the sending module sends a message indicating that the second message fails to be sent to an alarm system, so that the alarm system alarms the corresponding service party.
In some examples, the primary storage area, the business storage area, and the backup storage area are provided in a Redis storage system.
In some examples, the determining module 702 determines, when receiving the message indicating that the second message is successfully sent, a response time for the service server to receive the second message, and sends the response time to an alarm system, so that the alarm system alarms the service party according to the response time.
In some examples, the obtaining module 701 sends the second message to the corresponding service server by calling back the universal network interface of the service server.
In some examples, the obtaining module 701 obtains the performance information of the sending device after obtaining the plurality of second messages from the service storage area; and the sending module selects sending equipment to send the second message according to the performance information.
Fig. 8 shows a block diagram of a computing device 800 in which the transmitting apparatus 700 is located. This computing device 800 may be a server. As shown in fig. 8, the computing device includes one or more processors (CPUs) 802, a communication module 804, a memory 806, a user interface 810, and a communication bus 808 for interconnecting these components.
The processor 802 may receive and transmit data via the communication module 804 to enable network communications and/or local communications.
User interface 810 includes one or more output devices 812 including one or more speakers and/or one or more visual displays. The user interface 810 also includes one or more input devices 814, including, for example, a keyboard, a mouse, a voice command input unit or microphone, a touch screen display, a touch sensitive tablet, a gesture capture camera or other input buttons or controls, and the like.
The memory 806 may be high-speed random access memory, such as DRAM, SRAM, DDR RAM, or other random access solid state memory devices; or non-volatile memory, such as one or more magnetic disk storage devices, optical disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
The memory 806 stores a set of instructions executable by the processor 802, including:
an operating system 816, including programs for handling various basic system services and for performing hardware-related tasks;
the application 818 includes various application programs for video playing, which can implement the processing flow in the above examples, for example, the application program may include some or all of the modules in the sending apparatus 700 shown in fig. 7, at least one of the modules 701 to 703 may store machine executable instructions, and the processor 802 can implement the functions of at least one of the modules 701 to 703 by executing the machine executable instructions in at least one of the modules 701 to 703 in the memory 806.
It should be noted that not all steps and modules in the above flows and structures are necessary, and some steps or modules may be omitted according to actual needs. The execution sequence of the steps is not fixed and can be adjusted according to the needs. The division of each module is only for convenience of describing adopted functional division, and in actual implementation, one module may be divided into multiple modules, and the functions of multiple modules may also be implemented by the same module, and these modules may be located in the same device or in different devices.
The hardware modules in the embodiments may be implemented in hardware or a hardware platform plus software. The software includes machine-readable instructions stored on a non-volatile storage medium. Thus, embodiments may also be embodied as a software product.
In various examples, the hardware may be implemented by specialized hardware or hardware executing machine-readable instructions. For example, the hardware may be specially designed permanent circuits or logic devices (e.g., special purpose processors, such as FPGAs or ASICs) for performing the specified operations. The hardware may also include programmable logic devices or circuits temporarily configured by software (e.g., including a general purpose processor or other programmable processor) to perform certain operations.
In addition, each example of the present application can be realized by a data processing program executed by a data processing apparatus such as a computer. It is clear that a data processing program constitutes the present application. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present application, which also provides a non-volatile storage medium in which a data processing program is stored, which data processing program can be used to carry out any one of the above-mentioned method examples of the present application.
Machine-readable instructions corresponding to the modules in fig. 7 may cause an operating system or the like operating on the computer to perform some or all of the operations described herein. The nonvolatile computer-readable storage medium may be a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer. A CPU or the like mounted on the expansion board or the expansion unit may perform part or all of the actual operations according to the instructions.
In addition, the devices and modules in the examples of the present application may be integrated into one processing unit, or each module may exist alone physically, or two or more devices or modules may be integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (15)

1. A method for sending information, which is applied to a message server, the method comprising:
when a main storage area receives a first message representing a video state, acquiring a plurality of first messages from the main storage area, wherein the first messages carry video identifiers, a video server provides a video uploading interface for a social service server, the social service server uploads an original video to the video server through the video uploading interface, and the video server stores the first messages in the main storage area after processing the original video;
determining the service type of the first message according to the video identifier of the first message;
storing the plurality of first messages to corresponding service storage areas according to the service types; and
and for each second message, determining a social service server corresponding to the video identifier according to the video identifier of the second message, calling back a universal network interface of the social service server, and sending the second message to the corresponding social service server according to the called-back universal network interface, wherein each social service server presets receiving parameters of the universal network interface, the receiving parameters comprise message types, and the message types are used for indicating the video state.
2. The method of claim 1, further comprising:
after acquiring a plurality of second messages from the service storage area, storing the plurality of second messages in a backup storage area;
when the message server is restarted, acquiring a plurality of second messages in the backup storage area; and
and sending the plurality of second messages in the backup storage area to corresponding social service servers according to the video identification.
3. The method of claim 1, further comprising:
after a plurality of second messages are acquired from the service storage area, an acquisition request for showing the details of the video state is sent to an information providing server, and the acquisition request carries the video identification;
receiving video state details sent by the information providing server in response to the acquisition request; and
and sending the video state details to a corresponding social service server according to the recalled universal network interface.
4. The method of claim 1, wherein the first message further carries video status details.
5. The method of claim 2, further comprising:
when the second message is determined to be failed to be sent, storing the second message which is failed to be sent into the main storage area; and
deleting the second message of the failed transmission from the backup storage area.
6. The method of claim 5, further comprising:
when determining that the second message fails to be sent, determining the number of times of the second message failure to be sent;
and when the number of times reaches a threshold value, stopping sending the second message, and executing the step of deleting the second message which is failed to be sent from the backup storage area.
7. The method of claim 2, further comprising:
and deleting the second message in the backup storage area when receiving a message indicating that the second message is successfully sent.
8. The method according to claim 1 or 2, characterized in that the method further comprises:
and when the second message is determined to be failed to be sent, sending a message indicating that the second message is failed to be sent to an alarm system so that the alarm system can alarm a corresponding service party.
9. The method of claim 2, wherein the primary storage area, the business storage area, and the backup storage area are provided in a Redis storage system.
10. The method according to claim 1 or 2, characterized in that the method further comprises:
when receiving a message indicating that the second message is successfully sent, determining the response time of the social service server for receiving the second message, and sending the response time to an alarm system so that the alarm system alarms a service party according to the response time.
11. The method of claim 1, wherein the traffic type is used to indicate a social traffic on which the video is based.
12. The method of claim 1, further comprising:
after acquiring a plurality of second messages from the service storage area, acquiring the performance information of the sending equipment;
the sending the second message to the corresponding social service server according to the callback universal network interface comprises:
and according to the performance information, selecting the sending equipment to send the second message according to the callback universal network interface.
13. An apparatus for transmitting information, the apparatus comprising:
the device comprises an acquisition module and a storage module, wherein when a main storage area receives a first message representing a video state, the acquisition module acquires a plurality of first messages from the main storage area, the first messages carry video identifiers, a video server provides a video uploading interface for a social service server, the social service server uploads an original video to the video server through the video uploading interface, and the video server stores the first messages in the main storage area after processing the original video;
the determining module is used for determining the service type of the first message according to the video identifier of the first message;
the storage module is used for storing the plurality of first messages to corresponding service storage areas according to the service types;
the acquisition module acquires a plurality of second messages from the service storage area; and
and the sending module is used for determining a social service server corresponding to the video identifier according to the video identifier of each second message, calling back a universal network interface of the social service server, and sending the second message to the corresponding social service server according to the called-back universal network interface, wherein each social service server presets receiving parameters of the universal network interface, the receiving parameters comprise message types, and the message types are used for indicating the video state.
14. A computing device comprising a memory, a processor, and a computer program stored on the memory and run on the processor; the processor, when executing the computer program, implements the method of any of claims 1-12.
15. A computer readable storage medium, storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform the method of any of claims 1-12.
CN201810522246.3A 2018-05-28 2018-05-28 Information sending method and device, computing equipment and storage medium Active CN108712501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810522246.3A CN108712501B (en) 2018-05-28 2018-05-28 Information sending method and device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810522246.3A CN108712501B (en) 2018-05-28 2018-05-28 Information sending method and device, computing equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108712501A CN108712501A (en) 2018-10-26
CN108712501B true CN108712501B (en) 2023-04-07

Family

ID=63869733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810522246.3A Active CN108712501B (en) 2018-05-28 2018-05-28 Information sending method and device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108712501B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109951400A (en) * 2019-03-12 2019-06-28 Oppo广东移动通信有限公司 Instruction sending method, device, electronic equipment and the readable storage medium storing program for executing of terminal
CN110413425B (en) * 2019-07-24 2022-01-18 深圳乐信软件技术有限公司 Third-party message callback method, device, server and storage medium
CN110401659B (en) * 2019-07-25 2021-11-05 高新兴科技集团股份有限公司 Equipment access method, equipment access device and system of service system
CN110677394B (en) * 2019-09-12 2022-03-29 视联动力信息技术股份有限公司 Multimedia data transmission method and system
CN111064791B (en) * 2019-12-19 2022-08-23 中国移动通信集团江苏有限公司 Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message
CN111585867B (en) * 2020-03-31 2022-04-19 北京奇艺世纪科技有限公司 Message processing method and device, electronic equipment and readable storage medium
CN114079612B (en) * 2020-08-03 2024-06-04 阿里巴巴集团控股有限公司 Disaster recovery system and management and control method, device, equipment and medium thereof
CN111988391A (en) * 2020-08-14 2020-11-24 网联清算有限公司 Message sending method and device
CN112115120B (en) * 2020-09-01 2022-06-21 南京领行科技股份有限公司 Service data storage method, device and equipment
CN114125054B (en) * 2021-11-29 2024-03-15 百果园技术(新加坡)有限公司 Content auditing system, method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000174801A (en) * 1998-12-07 2000-06-23 Nippon Telegr & Teleph Corp <Ntt> Message communication terminal equipment, message communication method and storage medium with message communication program recorded therein
CN102469033A (en) * 2010-11-01 2012-05-23 阿里巴巴集团控股有限公司 Message subscription system and message sending method
CN104731912A (en) * 2015-03-24 2015-06-24 浪潮集团有限公司 Message transmission method and device for message middleware MQ
CN106487569A (en) * 2015-09-02 2017-03-08 阿里巴巴集团控股有限公司 A kind of service message processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000174801A (en) * 1998-12-07 2000-06-23 Nippon Telegr & Teleph Corp <Ntt> Message communication terminal equipment, message communication method and storage medium with message communication program recorded therein
CN102469033A (en) * 2010-11-01 2012-05-23 阿里巴巴集团控股有限公司 Message subscription system and message sending method
CN104731912A (en) * 2015-03-24 2015-06-24 浪潮集团有限公司 Message transmission method and device for message middleware MQ
CN106487569A (en) * 2015-09-02 2017-03-08 阿里巴巴集团控股有限公司 A kind of service message processing method and device

Also Published As

Publication number Publication date
CN108712501A (en) 2018-10-26

Similar Documents

Publication Publication Date Title
CN108712501B (en) Information sending method and device, computing equipment and storage medium
CN105653425B (en) Monitoring system based on complex event processing engine
WO2020248507A1 (en) Container cloud-based system resource monitoring method and related device
CN113742031B (en) Node state information acquisition method and device, electronic equipment and readable storage medium
US10652080B2 (en) Systems and methods for providing a notification system architecture
CN103067230A (en) Method for achieving hyper text transport protocol (http) service monitoring through embedding monitoring code
CN109361525B (en) Method, device, control terminal and medium for restarting distributed deployment of multiple services
CN107682169B (en) Method and device for sending message by Kafka cluster
CN112799786A (en) Exit method, device, equipment and storage medium of micro-service instance
EP3542272A1 (en) Systems and methods for providing a notification system architecture
WO2012097588A1 (en) Data storage method, apparatus and system
JP2017502414A (en) System and method for supporting asynchronous calls in a distributed data grid
CN112291082B (en) Disaster recovery processing method, terminal and storage medium for machine room
CN107357800A (en) A kind of database High Availabitity zero loses solution method
US9026839B2 (en) Client based high availability method for message delivery
CN110196749B (en) Virtual machine recovery method and device, storage medium and electronic device
CN111865632A (en) Switching method of distributed data storage cluster and switching instruction sending method and device
CN103077034A (en) JAVA application migration method and system for hybrid virtualization platform
CN110138753B (en) Distributed message service system, method, apparatus, and computer-readable storage medium
CN113014608A (en) Flow distribution control method and device, electronic equipment and storage medium
CN113407340A (en) Service control system, gateway service method, service request forwarding method and device
CN111274047A (en) Information processing method, terminal, system, computer device and storage medium
CN113934711B (en) Method for automatically deploying gbase8s cluster
CN113472638B (en) Edge gateway control method, system, device, electronic equipment and storage medium
CN113688111A (en) Cross-region message copying method, system, electronic equipment and readable storage medium

Legal Events

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