CN107222555B - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN107222555B
CN107222555B CN201710503210.6A CN201710503210A CN107222555B CN 107222555 B CN107222555 B CN 107222555B CN 201710503210 A CN201710503210 A CN 201710503210A CN 107222555 B CN107222555 B CN 107222555B
Authority
CN
China
Prior art keywords
message
index information
time
processing
determining
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
CN201710503210.6A
Other languages
Chinese (zh)
Other versions
CN107222555A (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.)
Qingdao Hisense Media Network Technology Co Ltd
Original Assignee
Qingdao Hisense Media Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Hisense Media Network Technology Co Ltd filed Critical Qingdao Hisense Media Network Technology Co Ltd
Priority to CN201710503210.6A priority Critical patent/CN107222555B/en
Publication of CN107222555A publication Critical patent/CN107222555A/en
Application granted granted Critical
Publication of CN107222555B publication Critical patent/CN107222555B/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/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • 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/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

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

Abstract

The embodiment of the invention provides a message processing method and a device, wherein the method comprises the following steps: determining a first index information set corresponding to the current moment, wherein the first index information set comprises at least one index information, each index information corresponds to a message set, and each message set comprises at least one message to be processed; determining a first message set according to index information included in the first index information set; acquiring a message to be processed in a first message set, and processing the message to be processed in the first message set; the processing time of the message to be processed in the message set corresponding to each index information in the first index information set is within a first time period corresponding to the current time, and the time length of the first time period is the same as the time length of the processing cycle of the message processor; the processing time of the messages to be processed in one message set is within one sub-period of the first period. The method is used for improving the working efficiency of the business server.

Description

Message processing method and device
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a message processing method and device.
Background
In the internet field, a client can customize a service and a service processing time, so that a service server automatically processes the service customized by a user when the service processing time arrives.
At present, after a client customizes a service, the client sends a service message to a service server, where the service message includes a processing time of the service, and the service server stores unprocessed service messages in a message queue, periodically polls each service message, and determines whether the processing time in the service message arrives, if so, processes a service corresponding to the service message, and moves the service message out of the message queue, and if not, the service server continues to poll the message queue in the next period.
However, in the above process, each message in the message queue needs to be polled in each work cycle of the service server, which results in low work efficiency of the service server.
Disclosure of Invention
The embodiment of the invention provides a message processing method and device, which improve the working efficiency of a service server.
In a first aspect, an embodiment of the present invention provides a message processing method, which is applied to a message processor, and the method includes:
determining a first index information set corresponding to the current moment, wherein the first index information set comprises at least one index information, each index information corresponds to a message set, and each message set comprises at least one message to be processed;
determining a first message set according to index information included in the first index information set;
acquiring a message to be processed in the first message set, and processing the message to be processed;
the processing time of the message to be processed in the message set corresponding to each index information in the first index information set is within a first time period corresponding to the current time, and the time length of the first time period is the same as the time length of the processing cycle of the message processor; the processing time of the message to be processed in one message set is within one sub-period of the first period.
In a possible implementation, determining the first index information set corresponding to the current time includes:
acquiring a first message type identifier corresponding to the message processor;
generating a first time stamp corresponding to the current time according to the processing period of the message processor;
determining an identifier of the first index information set according to the first message type identifier, a preset index information set indicator and the first timestamp;
and determining the first index information set according to the identification of the first index information set.
In another possible implementation manner, the message processor corresponds to a parallel message processor, and correspondingly, determining the first message set according to the index information included in the index information set includes:
determining first index information corresponding to the message processors in the at least one index information according to the number of the parallel message processors;
and determining the first message set according to the first index information.
In another possible embodiment, the method further comprises:
acquiring a message to be stored and a first processing moment of the message to be stored;
determining second index information corresponding to the message to be stored according to the first processing moment;
and storing the message to be stored to a second message set corresponding to the second index information.
In another possible implementation manner, storing the message to be stored in the second message set corresponding to the second index information includes:
judging whether the second message set exists in a storage medium or not according to the second index information;
if yes, storing the message to be stored to the second message set;
if not, creating the second message set in the storage medium according to the second index information, and storing the message to be stored in the second message set.
In another possible implementation, after creating the second set of messages according to the second index information, the method further includes:
determining a second index information set corresponding to the second index information;
and storing the second index information to the second index information set.
In another possible implementation manner, determining, according to the first processing time, second index information corresponding to the message to be stored includes:
acquiring the message type of the message to be stored;
determining a second message type identifier in at least one message type identifier corresponding to the message type of the message to be stored;
generating a second timestamp corresponding to the first processing moment according to the time granularity corresponding to the message type of the message to be stored;
and determining the second index information according to the second message type identifier and the second timestamp.
In another possible implementation manner, determining a second index information set corresponding to the second index information includes:
generating a third timestamp corresponding to the first processing moment according to the time precision corresponding to the message type of the message to be stored; the time precision is N times of the time granularity, N is an integer greater than 1, and the time length corresponding to the time precision is the same as the time length of the processing period of the message processor;
determining the identifier of the second index information set according to the second message type identifier, a preset index information set indicator and the third timestamp;
judging whether the second index information set exists in the storage medium according to the identifier of the second index information set;
if yes, determining the second index information set in the storage medium according to the identification of the second index information set;
and if not, creating a second index information set in the storage medium.
In a second aspect, an embodiment of the present invention provides a message processing apparatus applied to a message processor, including a first determining module, a second determining module, a first obtaining module, and a processing module, where,
the first determining module is configured to determine a first index information set corresponding to a current time, where the first index information set includes at least one index information, each index information corresponds to a message set, and each message set includes at least one message to be processed;
the second determining module is configured to determine a first message set according to index information included in the first index information set;
the first obtaining module is used for obtaining the message to be processed in the first message set;
the processing module is used for processing the message to be processed;
the processing time of the message to be processed in the message set corresponding to each index information in the first index information set is within a first time period corresponding to the current time, and the time length of the first time period is the same as the time length of the processing cycle of the message processor; the processing time of the message to be processed in one message set is within one sub-period of the first period.
In a possible implementation manner, the first determining module is specifically configured to:
acquiring a first message type identifier corresponding to the message processor;
generating a first time stamp corresponding to the current time according to the processing period of the message processor;
determining an identifier of the first index information set according to the first message type identifier, a preset index information set indicator and the first timestamp;
and determining the first index information set according to the identification of the first index information set.
In another possible implementation manner, the message processor corresponds to a parallel message processor, and correspondingly, the second determining module is specifically configured to:
determining first index information corresponding to the message processors in the at least one index information according to the number of the parallel message processors;
and determining the first message set according to the first index information.
In another possible implementation manner, the apparatus further includes a second obtaining module, a third determining module and a storing module, wherein,
the second acquisition module is used for acquiring the message to be stored and the first processing time of the message to be stored;
the third determining module is configured to determine, according to the first processing time, second index information corresponding to the message to be stored;
the storage module is used for storing the message to be stored to a second message set corresponding to the second index information.
In another possible implementation manner, the storage module is specifically configured to:
judging whether the second message set exists in a storage medium or not according to the second index information;
if yes, storing the message to be stored to the second message set;
if not, creating the second message set in the storage medium according to the second index information, and storing the message to be stored in the second message set.
In another possible embodiment, the apparatus further comprises a fourth determining module, wherein,
the fourth determining module is configured to determine, after the storing module creates the second message set according to the second index information, a second index information set corresponding to the second index information;
the storage module is further configured to store the second index information to the second index information set.
In another possible implementation manner, the third determining module is specifically configured to:
acquiring the message type of the message to be stored;
determining a second message type identifier in at least one message type identifier corresponding to the message type of the message to be stored;
generating a second timestamp corresponding to the first processing moment according to the time granularity corresponding to the message type of the message to be stored;
and determining the second index information according to the second message type identifier and the second timestamp.
In another possible implementation manner, the fourth determining module is specifically configured to:
generating a third timestamp corresponding to the first processing moment according to the time precision corresponding to the message type of the message to be stored; the time precision is N times of the time granularity, N is an integer greater than 1, and the time length corresponding to the time precision is the same as the time length of the processing period of the message processor;
determining the identifier of the second index information set according to the second message type identifier, a preset index information set indicator and the third timestamp;
judging whether the second index information set exists in the storage medium according to the identifier of the second index information set;
if yes, determining the second index information set in the storage medium according to the identification of the second index information set;
and if not, creating a second index information set in the storage medium.
The message processing method and device provided by the embodiment of the invention are characterized in that an index information set is arranged in a storage medium, each index information set comprises a plurality of index information, each index information corresponds to one message set, each message set comprises a plurality of messages to be processed, the processing time of the messages to be processed in the message set corresponding to each index information in the index information set is within a first time period corresponding to the current time, the time length of the first time period is the same as the time length of a processing cycle of a message processor, and the processing time of the messages to be processed in one message set is within a sub-time period of the first time period. At the current moment, when the message processor needs to process the message to be processed in the storage medium, a first index information set corresponding to the current moment is obtained first, the first message set is determined according to the index information included in the index information set, and the message to be processed in the first message set is processed. In the process, the processing time of the to-be-processed message in the first message set is near the current time, so that the message processor can conveniently acquire the to-be-processed message to be processed at the current time without traversing the to-be-processed message in the storage medium, the working efficiency of the message processor is improved, and the working efficiency of the service server is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are 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 view of an application scenario of a message processing method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a message storage method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for determining second index information according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for determining a second index information set according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a message processing method according to an embodiment of the present invention;
fig. 6 is a first schematic structural diagram of a message processing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 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.
Fig. 1 is a schematic view of an application scenario of a message processing method according to an embodiment of the present invention. Referring to fig. 1, a client 101 and a service server 102 are included, and a message processor 1021 and a storage medium 1022 are included in the service server 102. Optionally, the client 101 may be a mobile phone, a computer, a television, or other devices.
The storage medium 1022 includes a plurality of index information sets, each index information set includes a plurality of index information, each index information corresponds to one message set, and each message set includes a plurality of messages to be processed; the processing time of the messages to be processed in all the message sets corresponding to the index information in one index information set is located in one time period, and the processing time of the messages to be processed in one message set is located in one sub-time period of the time period. For example, it is assumed that index information set 1 includes 3 pieces of index information, which are respectively denoted as index information 1-index information 3, and message sets corresponding to index information 1-index information 3 are respectively denoted as message set 1-message set 3, where processing time of messages to be processed in message set 1-message set 3 is in period 1(1 point 1 minute 0 second-1 point 1 minute 59 seconds), period 1 may be divided into 3 sub-periods, which are respectively denoted as sub-period 1-sub-period 3, and processing time of messages to be processed in message set 1-message set 3 is respectively located in sub-period 1-sub-period 3. For example, the relationship of the index information set, index information, message set, time period and sub-time period may be as shown in table 1:
TABLE 1
Figure BDA0001334141240000071
Referring to table 1, the sub-periods corresponding to the index information 1-the index information 3 (or the message set 1-the message set 3) are all within the period corresponding to the index information set 1, the processing time of all the messages to be processed in the message set 1 is in the sub-period 1 point 1 minute 0 second-1 point 1 minute 19 seconds, the processing time of all the messages to be processed in the message set 2 is in the sub-period 1 point 1 minute 20 seconds-1 point 1 minute 39 seconds, and the processing time of all the messages to be processed in the message set 3 is in the sub-period 1 point 1 minute 40 seconds-1 point 1 minute 59 seconds.
The index information set and the message set in the storage medium 1022 correspond to different time periods, respectively, and the index information set and the message set in the storage medium 1022 change (are added or deleted) with the passage of time. Specifically, after the to-be-processed message in the message set is processed, the message set is deleted, and after all the message sets corresponding to the index information set are deleted, the index information set is also deleted; when the newly added to-be-processed message in the storage medium 1022 does not belong to any existing message set, a new message set may need to be created in the storage medium 1022, and when the newly created message set does not correspond to any index information set, a new index information set may need to be created in the storage medium 1022.
The client 101 may send the message to be stored to the message processor 1021, and the message memory 1021 stores the message to be stored in the corresponding message set according to the type of the message to be stored and the processing time. The message processor 1021 processes the message to be processed in the storage medium 1022 according to the processing cycle thereof, and in any processing cycle, the message processor 1021 can acquire the index information set corresponding to the current time and process the message to be processed in the message set corresponding to the index information set, wherein the processing time of the message to be processed in the message set corresponding to the index information set is determined to be within the time period corresponding to the current time, so that the message processor 1021 can conveniently acquire the message to be processed at the current time without traversing the message to be processed in the storage medium 1022, thereby improving the working efficiency of the message processor and further improving the working efficiency of the service server.
It should be noted that fig. 1 illustrates one application scenario in an exemplary form, and is not limited to the application scenario, and of course, the technical solution shown in the present application may also be applied to other application scenarios, and this is not specifically limited in the embodiment of the present invention.
The following describes the technical means of the present application in detail by way of specific examples. It should be noted that the following specific embodiments may be combined with each other, and description of the same or similar contents is not repeated in different embodiments.
To facilitate understanding of the present application, a process of storing a message will be first described through the embodiments shown in fig. 2 to 4.
Fig. 2 is a flowchart illustrating a message storage method according to an embodiment of the present invention. Referring to fig. 2, the method may include:
s201, obtaining the message to be stored and the first processing time of the message to be stored.
The execution main body in the embodiment of the present invention may be a message processor, and of course, the execution main body in the embodiment of the present invention may also be a module in the message processor, for example, a message receiving module, a message storing module, and the like. The following takes the execution subject as a message processor for explanation.
In the embodiment of the invention, the message to be stored is a message which needs to be processed by the message processor and is not stored in the storage medium. Each message to be stored corresponds to a first processing time, and the first processing time indicates the message processor to process the message to be stored at the first processing time. Optionally, the first processing time may be carried in the message to be stored.
Optionally, the message to be stored may be sent by the client to the message processor, for example, when the user needs to receive the tv viewing reminder at 10 am, the user may send the tv viewing reminder message to the message processor through the client, so that the message processor stores the tv viewing reminder message first, and processes the tv viewing reminder message at 10 am, so that the message processor sends the tv viewing reminder to the client at 10 am.
Optionally, the message to be processed may also be sent by another module in the service server, for example, after the order module receives the order, the order indicates that the seller delivers the goods within 24 hours, if the seller does not deliver the goods, a delivery reminding message is generated, and the delivery reminding message is sent to the message processor, so that the message processor stores the delivery reminding message first, and processes the delivery reminding message when the order is generated for 24 hours, so that the message processor sends the delivery reminding to the seller client when the order is generated for 24 hours.
S202, according to the first processing time, determining second index information corresponding to the message to be stored.
Optionally, the second index information may be represented by a character string, and the second index information is related to the first processing time, for example, the second index information may include a timestamp corresponding to the first processing time.
The processing time of the to-be-processed message in the message set corresponding to the second index information is within the time period corresponding to the first processing time, for example, assuming that the first processing time is 1 minute 13 seconds at 17: 4/20/2017, and the time period corresponding to the first processing time is 1 minute 0 seconds at 17: 1 minute 0 seconds at 20: 20/2017, and 1 minute 59 seconds at 17: 4/2017, and correspondingly, the processing time of the to-be-processed message in the message set corresponding to the second index information is within the time period of 2017/20/17: 1 minute 0 seconds at 17: 4/20/2017.
It should be noted that, the following describes in detail the process of determining the second index information through the embodiment shown in fig. 3, and details are not repeated here.
S203, judging whether the storage medium has a second message set or not according to the second index information.
If yes, go to step S204.
If not, S205-S207 are executed.
Alternatively, the storage medium may be a database in the service server, a cache medium in the service server, or the like. Optionally, the second index information is an identifier of the second message set, and the second message set may be obtained through querying by the second index information.
Optionally, it may be determined whether the index information set in the storage medium includes the second index information, if yes, it may be determined that the second message set exists in the storage medium, and if not, it may be determined that the storage medium does not include the second message set. Of course, it may also be determined whether the second message set exists in the storage medium according to other possible implementations, and this is not particularly limited in the embodiment of the present invention.
And S204, storing the message to be stored to a second message set.
And if the second message set exists in the storage medium, storing the messages to be stored in the second message set.
S205, creating a second message set in the storage medium according to the second index information, and storing the message to be stored in the second message set.
And if the second message set does not exist in the storage medium, creating the second message set in the storage medium, and storing the messages to be stored in the second message set.
S206, determining a second index information set corresponding to the second index information, and storing the second index information to the second index information set.
As can be seen from the description of S202, the second index information is related to the first processing time, and accordingly, a second index information set corresponding to the second index information may be determined according to the first processing time, and the second index information may be stored in the second index information set.
It should be noted that, the following describes in detail the process of determining the second index information through the embodiment shown in fig. 4, and details are not repeated here.
In the message storage method provided by the embodiment of the invention, when the message to be stored is stored, first, according to the first processing time of the message to be stored, second index information for identifying the message set is determined, and according to the second index information, a second message set corresponding to the message to be stored is determined, and the message to be stored is stored in the second message set, the processing time of each message in the second message set is within the sub-period corresponding to the first processing time, and the first processing time is within the sub-period, so that the processing times of the messages in one message set can be ensured to be closer. If the second message set is a newly created message set, the second index information is stored in the corresponding index information set according to the first processing time, and the sub-time periods corresponding to the index information in the index information set are all in the time period corresponding to the index information set, so that the processing time of the messages to be processed in the message set corresponding to the index information in the index information set can be ensured to be relatively close. By the storage mode, messages with the processing time close to the processing time can be stored in a centralized mode according to the processing time of the messages, so that the message processor can conveniently acquire the messages to be processed corresponding to each time, the working efficiency of the message processor is improved, and the working efficiency of the service server is improved.
On the basis of the embodiment shown in fig. 2, optionally, the second index information corresponding to the message to be stored may be determined through the following feasible implementation manner (S202 in the embodiment shown in fig. 2), specifically, please refer to the embodiment shown in fig. 3.
Fig. 3 is a flowchart illustrating a method for determining second index information according to an embodiment of the present invention. Referring to fig. 3, the method may include:
s301, obtaining the message type of the message to be stored.
Optionally, the type of the message to be stored may be a television viewing notification type, a shipping notification type, a payment notification type, and the like, and in an actual application process, the type of the message to be stored may be set according to actual needs, which is not specifically limited in the embodiment of the present invention.
S302, in at least one message type identifier corresponding to the message type of the message to be stored, a second message type identifier is determined.
A message type may correspond to one or more message type identifiers, for example, a message type identifier corresponding to a tv viewing notification type may include: ProgramWatching0, ProgramWatching1, ProgramWatching2, ProgramWatching 3. Of course, in the actual application process, the number of the message type identifiers corresponding to the message types may be set according to the actual setting.
When the message type of the message to be stored corresponds to one message type identifier, the message type identifier corresponding to the message type may be determined as the second message type identifier.
When the message type of the message to be stored corresponds to the plurality of message type identifiers, one of the plurality of message type identifiers may be determined as the second message type identifier in a cyclic manner. Optionally, the second message type identifier may be determined through at least two possible implementations as follows:
one possible implementation is:
optionally, the first time when the message to be stored is received and the number of the message type identifiers corresponding to the message types of the message to be stored may be obtained, the timestamp of the first time is obtained, and the second target type identifier is determined according to the timestamp of the first time and the number of the message type identifiers.
The timestamp at the first time may be left over the number of the message type identifiers to obtain a remainder a, and an a-th message type identifier of the plurality of message type identifiers is determined as a second message type identifier.
For example, suppose that the tv viewing notification type corresponds to 4 message type identifiers, which are respectively recorded as: ProgramWatching0, ProgramWatching1, ProgramWatching2, ProgramWatching 3. Assuming that the message type of the message 1 received by the message processor at 17 o 1 min 13 sec in 4/20/2017 is the tv viewing notification type, the message processor obtains the timestamp 1492678873 at that time, and divides the value obtained by dividing 1492678872 by 4 into 1, so that the first message type identifier (ProgramWatching0) can be determined as the corresponding second message type identifier of the message 1.
Another possible implementation:
optionally, the number M of received messages of the message type up to the current time (the time when the message to be stored is received) may be obtained, and the identifier of the second target message type may be determined according to the number and the number N of message type identifiers corresponding to the message type. The number M of the messages may be left over by the number N of the message type identifiers to obtain a remainder B, and a B-th message type identifier of the plurality of message type identifiers is determined as a second message type identifier.
For example, suppose that the tv viewing notification type corresponds to 4 message type identifiers, which are respectively recorded as: ProgramWatching0, ProgramWatching1, ProgramWatching2, ProgramWatching 3. Assuming that 12568 messages of tv viewing notification type are received in total by the time when the message to be stored is received, that is, the message to be stored is the received 12570 th tv viewing notification type message, the remainder is obtained by dividing 12570 by 4, and the value is 2, so that the second message type identifier (ProgramWatching1) can be determined as the corresponding second message type identifier of message 1.
S303, generating a second time stamp corresponding to the first processing moment according to the time granularity corresponding to the message type of the message to be stored.
Each message type may correspond to a time granularity, and the time granularity corresponding to each message type may be preconfigured. For example, the time granularity may be 10 milliseconds, 20 milliseconds, 1 second, 10 seconds, 30 seconds, and the like, and in an actual application process, the time granularity corresponding to the message type may be set according to actual needs.
Optionally, a Coordinated Universal Time (UTC) timestamp of the first processing Time may be obtained first, where the UTC timestamp is a timestamp generated by using milliseconds as a Time granularity, and a second timestamp corresponding to the first processing Time is generated according to the UTC timestamp and a Time granularity corresponding to the message type. Optionally, the second timestamp is the UTC timestamp of the first processing time — the time granularity corresponding to the UTC timestamp% message type of the first processing time.
For example, assuming that the first processing time is 22 ms at 20 o 'clock 1 min 11 s at 21 o' clock 20 p/4/2017, the UTC timestamp of the first processing time is 1492776071022, and assuming that the time granularity corresponding to the message type of the message to be stored is 10 ms, the second timestamp is:
1492776071022-1492776071022%10=1492776071022-2=1492776071020。
s304, determining second index information according to the second message type identifier and the second timestamp.
Optionally, a combination of the second message type identifier and the second timestamp may be determined as the second index information, for example, assuming that the second message type identifier is ProgramWatching1, and assuming that the second timestamp is 1492776071020, the second index information may be determined as follows:
ProgramWatching1:1492776071020。
certainly, in an actual application process, the second index information may further include a preset prefix, for example, the preset prefix may be DelayQueue Content, and accordingly, the second index information may be determined as follows:
DelayQueue:Content:ProgramWatching1:1492776071020。
in the embodiment shown in fig. 3, the determined second timestamp of the second index information is related to the time granularity corresponding to the message type of the message to be stored, so that the processing time of the message in the message set corresponding to the second index information can be guaranteed to be within one time granularity. Furthermore, when one message type corresponds to a plurality of message type identifiers, the messages of the same type can be uniformly distributed into a plurality of message sets, so that the messages of the same type can be processed in parallel by a plurality of message processors.
On the basis of any of the above embodiments, optionally, the second index information set corresponding to the second index information may be determined through the following feasible implementation manner (S206 in the embodiment shown in fig. 2), specifically, please refer to the embodiment shown in fig. 4.
Fig. 4 is a flowchart illustrating a method for determining a second index information set according to an embodiment of the present invention. Referring to fig. 4, the method may include:
s401, generating a third time stamp corresponding to the first processing moment according to the time precision corresponding to the message type of the message to be stored.
Each message type corresponds to a time granularity and a time precision, the time precision is N times of the time granularity, N is an integer larger than 1, and the duration corresponding to the time precision is the same as the duration of a processing period of a message processor. The time precision corresponding to the message type may be set according to actual needs, and optionally, the time precision corresponding to the message type may be set according to a processing cycle of a message processor that processes the message of the type.
In the embodiment of the present invention, the time precision corresponding to the message type is N times of the time granularity corresponding to the message type, N may be 2, 5, 10, 100, and the like, and the size of N may be set according to actual needs. For example, assuming that the message type corresponds to a time granularity of 10 ms and N is 100, the time precision corresponding to the message type is 1000 ms.
Optionally, the coordinated universal time UTC timestamp of the first processing time may be obtained first, and the third timestamp corresponding to the first processing time may be generated according to the UTC timestamp and the time precision corresponding to the message type. Optionally, the third timestamp is the UTC timestamp of the first processing time — the time precision corresponding to the UTC timestamp% message type of the first processing time.
For example, assuming that the first processing time is 22 ms at 20 o' clock 1 min 11 s at 21 st/st 20/st 4/s 2017, the UTC timestamp of the first processing time is 1492776071022, and assuming that the time granularity corresponding to the message type of the message to be stored is 1000 ms, the third timestamp is:
1492776071022-1492776071022%1000=1492776071022-22=1492776071000。
s402, determining the identifier of the second index information set according to the second message type identifier, the preset index information set indicator and the third timestamp.
The preset index information set indicator is used to indicate that the character string is an identifier of the second index information set, for example, the preset index information set indicator may be indexset, and of course, in an actual application process, the preset index information set indicator may be set according to actual needs.
Optionally, a combination of the second message type identifier, the preset index information set indicator, and the third timestamp may be determined as the identifier of the second index information set, for example, assuming that the second message type identifier is ProgramWatching1, the preset index information set indicator is indexset, and the third timestamp is 1492776071000, the identifier of the second index information set may be determined as follows:
ProgramWatching1:indexset:1492776071000。
certainly, in an actual application process, the identifier of the second index information set may further include a preset prefix, for example, the preset prefix may be DelayQueue Content, and accordingly, the identifier of the second index information set may be determined as follows:
DelayQueue:Content:ProgramWatching1:indexset:1492776071000。
s403, judging whether the second index information set exists in the storage medium according to the identification of the second index information set.
If yes, go to S404.
If not, go to S405.
S404, determining a second index information set in the storage medium according to the identification of the second index information set.
And if the second index information set exists in the storage medium, determining the second index information set in the storage medium according to the identification of the second index information set.
S405, creating a second index information set in the storage medium.
And if the second index information set does not exist in the storage medium, creating the second index information set in the storage medium.
Through the embodiment shown in fig. 4, the second index information set corresponding to the second index information can be conveniently and accurately determined.
The technical solutions shown in the above method embodiments are described in detail below by specific examples.
Illustratively, assuming that the user needs to be prompted to watch the tv series 1 at 20 o ' clock 1 min 11 sec 22 ms in 4/21/2017, the user sends a message 1 of the tv watching notification type to the message processor through the client at 17 o ' clock 1 min 13 sec in 4/20/2017, and carries the processing time 2017, 20 o ' clock 1 min 11 sec 22 ms, the tv series 1 and the message type (tv watching notification type) in the message 1.
After receiving the message 1, the message processor acquires the processing time (20 o ' clock, 1 min, 11 sec, 22 ms, 21 o ' clock, 20 o ' clock, 1 min, 11 sec, 22 ms, 4/21/2017) and the message type (tv viewing notification type) in the message 1, and acquires the message type identifier corresponding to the tv viewing notification type as follows:
ProgramWatching0,ProgramWatching1,ProgramWatching2,ProgramWatching3
the message processor obtains the timestamp 1492678873 of 1 minute 13 seconds at the time of receiving the message 1, 2017, 4, 20, 17, and the remainder is obtained by dividing 1492678872 by 4 to obtain a value of 1, so that the first message type identifier (ProgramWatching0) can be determined as the corresponding message type identifier of the message 1.
The UTC timestamp of the message processor at the time of processing of message 1 (20: 1 min 11 sec 22 ms at 21 st/4/2017) is: 1492776071022, the message processor obtains the television viewing notification type at a time granularity of: 10 ms, and according to the UTC timestamp 1492776071022 and the time granularity of 10 ms, generating a second timestamp corresponding to the processing time of the message 1 as:
1492776071022-1492776071022%10=1492776071022-2=1492776071020。
the message processor generates index information 1 of the message 1 according to the message type identifier (ProgramWatching0), the second timestamp (1492776071020) and the preset prefix (DelayQueue: Content) corresponding to the message 1, wherein the index information 1 is as follows:
DelayQueue:Content:ProgramWatching1:1492776071020。
the index information 1 of the message 1 is an identifier of the message set to which the message 1 belongs.
Assuming that the storage medium includes the message set 1 corresponding to the index information 1, the message 1 is directly stored in the message set 1. Wherein, the types of all the messages in the message set 1 are tv viewing notification types, and the second timestamps corresponding to the processing times of all the messages in the message set 1 are 1492776071020, and correspondingly, the UTC timestamps corresponding to the processing times of all the messages in the message set 1 are between 1492776071020 and 1492776071029.
The time precision of the message processor for acquiring the television watching notification type is as follows: 1000 ms, and according to the UTC timestamp 1492776071022 and the time precision of 1000 ms, a third timestamp corresponding to the processing time of the message 1 is generated as follows:
1492776071022-1492776071022%1000=1492776071022-22=1492776071000。
the message processor generates an identifier of an index information set 1 corresponding to the message 1 according to a message type identifier (ProgramWatching0), a preset index information set indicator (indexset), a third timestamp (1492776071000) and a preset prefix (delay queue: Content) corresponding to the message 1.
DelayQueue:Content:ProgramWatching1:indexset:1492776071000。
If the storage medium includes an index information set 1 corresponding to the index information 1, the index information 1 is directly stored in the index information set 1. The UTC timestamps of the processing time of the messages in the message set corresponding to all the index information in the index information set 1 are all between 1492776071001 and 1492776071999.
On the basis of any of the above embodiments, the message processor may process the message in the cache medium through the following feasible implementation manners, specifically, please refer to the embodiment shown in fig. 5.
Fig. 5 is a flowchart illustrating a message processing method according to an embodiment of the present invention. Referring to fig. 5, the method may include:
s501, determining a first index information set corresponding to the current time.
The message processor usually periodically processes the message to be processed in the cache medium, and the process of processing the message to be processed by the message processor in each processing cycle is the same.
When the message processor needs to process the message to be processed in the cache medium at the current time, the message processor determines the first index information set corresponding to the current time, and optionally, the message processor may determine the first index information set corresponding to the current time according to the following feasible implementation manners:
the method comprises the steps that a message processor obtains a first message type identifier corresponding to the message processor; generating a first time stamp corresponding to the current time according to the processing period of the message processor; determining an identifier of a first index information set according to the type of the first target message, a preset index information set indicator and a first timestamp; and determining the first index information set according to the identification of the first index information set.
Optionally, a corresponding relationship between the message processor and the first message type identifier may be preset, so that the message processor may obtain the first message type identifier according to the corresponding relationship.
The duration of the processing cycle of the message processor is the same as the duration of the time precision of the message type corresponding to the first message type identifier, and optionally, the process of obtaining the first timestamp may refer to the process of obtaining the third timestamp in the embodiment shown in fig. 4, which is not described herein again.
Optionally, the process of determining the identifier of the first index information set may refer to the process of determining the identifier of the second index information set in the embodiment shown in fig. 4, which is not described herein again.
Of course, the identifier of the first index information set may further include a preset prefix, for example, the preset prefix may be DelayQueue Content.
S502, determining a first message set according to the index information included in the first index information set.
The message processor may correspond to a parallel message processor, and the parallel message processor and the message processor jointly process the message to be processed in the message set corresponding to the index information in the index information set; correspondingly: the message processor can acquire the number of the parallel message processors, and determines first index information corresponding to the message processor in the at least one index information according to the number of the parallel message processors; and determining a first message set according to the first index information.
For example, it is assumed that the index information set includes 100 index information, and correspondingly, the index information set corresponds to 100 message sets and is respectively recorded as message set 1-message set 100, and if the message processor corresponds to 4 parallel message processors and is respectively recorded as parallel message processor 1-parallel message processor 4, the message processor and the parallel message processor may respectively process messages to be processed in 20 message sets, and the corresponding relationship between the message processor and the message set may be as shown in table 2:
TABLE 2
Identification of message processors Identification of message sets
Message processor Message set 1-message set 20
Parallel message processor 1 Message set 21-message set 40
Parallel message processor 2 Message set 41-message set 60
Parallel message processor 3 Message set 61-message set 80
Parallel message processor 4 Message set 81-message set 100
In an actual application process, it is also possible to allocate a message set to the message processor and the parallel message processor according to the processing efficiency of each message processor and the parallel message processor, for example, initially, allocate a message set to the message processor and each parallel message processor, and after one message processor or the parallel message processor completes processing of a message to be processed in the allocated message set, allocate a message set to the message processor or the parallel message processor until the message set corresponding to the index information in the index information set is allocated.
S503, obtaining the message to be processed in the first message set, and processing the message to be processed in the first message set.
And after the first message set is determined to be obtained, processing the messages to be processed in the first message set.
In the message processing method provided by the embodiment of the present invention, an index information set is set in a storage medium, each index information set includes a plurality of index information, each index information corresponds to one message set, the message set includes a plurality of messages to be processed, the processing time of the message to be processed in the message set corresponding to each index information in the index information set is within a first time period corresponding to the current time, the time length of the first time period is the same as the time length of the processing cycle of the message processor, and the processing time of the message to be processed in one message set is within a sub-time period of the first time period. At the current moment, when the message processor needs to process the message to be processed in the storage medium, a first index information set corresponding to the current moment is obtained first, the first message set is determined according to the index information included in the index information set, and the message to be processed in the first message set is processed. In the process, the processing time of the to-be-processed message in the first message set is near the current time, so that the message processor can conveniently acquire the to-be-processed message to be processed at the current time without traversing the to-be-processed message in the storage medium, the working efficiency of the message processor is improved, and the working efficiency of the service server is further improved.
The method shown in the embodiment of fig. 5 will be described in detail below by specific examples.
For example, assume that the current time is 20 o' clock 1 min 11 sec at 21 st.4/7/2017, and further assume that the processing cycle of the message processor 1 is 1 sec (1000 msec).
When the message processor 1 needs to perform message processing at the current time, the message processor 1 generally queries a preset corresponding relationship, and obtains a corresponding first message type identifier programfetching 1.
The message processor obtains the timestamp 1492776071000 corresponding to the current time according to the processing cycle (1000 ms), where the specific obtaining process may refer to the embodiment shown in fig. 4, and is not described herein again.
The message processor determines the identifier of the first index information set as follows according to the first message type identifier (programwater 1), the preset index information set indicator (indexset), the first timestamp (1492776071000) and the preset prefix (DelayQueue: Content):
DelayQueue:Content:ProgramWatching1:IndexSet:149277607100。
it is assumed that the first index information set includes 100 index information, and the message set corresponding to the 100 index information is denoted as message set 1-message set 100. Assuming that the message processor 1 corresponds to 4 parallel message processors, which are respectively denoted as message processor 2-message processor 5, the message processor 1 may allocate a message set to the 5 message processors according to the processing efficiencies of the message processors 1-5, for example, initially, allocate a message set to the 5 message processors, and after a message processor completes processing a message to be processed in the allocated message set, allocate a message set to the message processor again until the message set corresponding to the index information in the index information set is completely allocated.
Assuming that the message set allocated by the message processor 1 is the message set 1-the message set 20, the message processor 1 processes the messages to be processed in the message set 1-the message set 20.
On the basis of any of the above embodiments, optionally, the message in the cache medium may be subjected to persistent storage, or may also be subjected to non-persistent storage, and optionally, whether the message is subjected to persistent storage may be determined according to the type of the message. When the message is stored in a persistent mode, the user can store the message in a synchronous persistent mode or an asynchronous persistent mode. For the synchronous persistence mode, the message processor can store the received message in the persistence database and then store the message in the cache, and the message storage mode has higher reliability but lower storage efficiency for the message, and is suitable for scenes with high reliability requirements for the message. Aiming at the asynchronous persistence mode, a message processor maintains a first-in first-out queue with static content for each message queue in a memory, after receiving a message, the message is written into the queue, each first-in first-out queue corresponds to an asynchronous thread, the threads are executed once every preset time length, a preset message is obtained from the first-in first-out queue, and the message is written into a persistence database in batch. For a non-persistent mode, the message processor directly writes the message into the cache after receiving the message, the reliability of the mode is lowest, but the processing speed is fastest, and if the cache is abnormally restarted, the message is lost. The method is suitable for scenes with high requirements on message processing performance and low requirements on reliability, such as scenes that a user needs to remind the user to watch the appointed movie content at a certain moment in a reservation.
For the above asynchronous persistence processing method, in the message receiving and storing process, if the service of message receiving is restarted but not written in the persistent database in batch, part of the messages will be lost in the memory, resulting in failure of persistence of the messages. Therefore, the corresponding method provided by the invention comprises the following steps: a corresponding key is maintained in the cache for each fifo queue of the memory, the data structure of the corresponding content is hashmap, the field in the hashmap is the prefix + the server name + the thread number in the foregoing (the thread here is the thread corresponding to each fifo queue in the asynchronous persistence manner in the foregoing), the value in the hashmap is the time when the thread reads data for the first time, the start time when the content is read each time, and the flag indicating whether the writing is completed or not. Before data is acquired, the start time of reading content of the task is updated, the written flag bit is cleared, and the written flag bit is set after the database is successfully written. If the message receiving service is restarted due to an exception, the thread number of each thread changes, and the actions continue to be maintained under the new thread number. And the last thread execution before restart may leave a snapshot in the cache. When the program is started each time, whether a snapshot executed last time is reserved in the cache is checked, and event messages stored in the cache and covered in the time period of the starting processing time of the thread and the last reading time of the thread are searched. And taking out each message from the database to judge whether the message is written or not, and if the message is not written, writing the message into the database. And after the processing is successful, deleting the snapshot of the previous thread.
On the basis of any of the above embodiments, the message processor may further receive an event cancellation message sent by the client, and delete the message to be processed in the cache medium according to the time cancellation message.
The message monitoring module maintains a first-in first-out queue in the static memory for each message queue, and the task deletes each message from the buffer memory and writes each message into the corresponding first-in first-out queue immediately. And each first-in first-out queue correspondingly maintains an asynchronous thread, the threads are executed once every preset time length, preset messages are obtained from the first-in first-out queues, and the messages are moved from an event table of the database to an event history table in batches.
The method controls the number of each task in the message monitoring module to be executed in parallel, and prevents the process with insufficient memory from being hung up due to excessive tasks. In the module, a program internal global static counter is maintained for each task, when the timing task is started each time, the numerical value is increased by 1, and when the task is finished, the numerical value is decreased by 1. And judging the value when the task is started, if the value exceeds a specified value (default 20), determining that the processing capacity of the module exceeds the design load, directly ending the task thread, and simultaneously giving an alarm.
Fig. 6 is a first schematic structural diagram of a message processing apparatus according to an embodiment of the present invention. The message processing apparatus may be provided in a message processor, and referring to fig. 6, the apparatus may include a first determining module 11, a second determining module 12, a first obtaining module 13, and a processing module 14, wherein,
the first determining module 11 is configured to determine a first index information set corresponding to a current time, where the first index information set includes at least one index information, each index information corresponds to a message set, and each message set includes at least one message to be processed;
the second determining module 12 is configured to determine a first message set according to index information included in the first index information set;
the first obtaining module 13 is configured to obtain a message to be processed in the first message set;
the processing module 14 is configured to process the message to be processed;
the processing time of the message to be processed in the message set corresponding to each index information in the first index information set is within a first time period corresponding to the current time, and the time length of the first time period is the same as the time length of the processing cycle of the message processor; the processing time of the message to be processed in one message set is within one sub-period of the first period.
The message processing apparatus provided in the embodiment of the present invention may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
In a possible implementation, the first determining module 11 is specifically configured to:
acquiring a first message type identifier corresponding to the message processor;
generating a first time stamp corresponding to the current time according to the processing period of the message processor;
determining an identifier of the first index information set according to the first message type identifier, a preset index information set indicator and the first timestamp;
and determining the first index information set according to the identification of the first index information set.
In another possible implementation manner, the message processor corresponds to a parallel message processor, and correspondingly, the second determining module 12 is specifically configured to:
determining first index information corresponding to the message processors in the at least one index information according to the number of the parallel message processors;
and determining the first message set according to the first index information.
Fig. 7 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present invention. On the basis of the embodiment shown in fig. 6, please refer to fig. 7, the apparatus further includes a second obtaining module 15, a third determining module 16 and a storing module 17, wherein,
the second obtaining module 15 is configured to obtain a message to be stored and a first processing time of the message to be stored;
the third determining module 16 is configured to determine, according to the first processing time, second index information corresponding to the message to be stored;
the storage module 17 is configured to store the message to be stored in a second message set corresponding to the second index information.
In another possible implementation, the storage module 17 is specifically configured to:
judging whether the second message set exists in a storage medium or not according to the second index information;
if yes, storing the message to be stored to the second message set;
if not, creating the second message set in the storage medium according to the second index information, and storing the message to be stored in the second message set.
In another possible embodiment, the apparatus further comprises a fourth determining module 18, wherein,
the fourth determining module 18 is configured to determine, after the storing module 17 creates the second message set according to the second index information, a second index information set corresponding to the second index information;
the storage module 17 is further configured to store the second index information to the second index information set.
In another possible implementation manner, the third determining module 16 is specifically configured to:
acquiring the message type of the message to be stored;
determining a second message type identifier in at least one message type identifier corresponding to the message type of the message to be stored;
generating a second timestamp corresponding to the first processing moment according to the time granularity corresponding to the message type of the message to be stored;
and determining the second index information according to the second message type identifier and the second timestamp.
In another possible implementation manner, the fourth determining module 18 is specifically configured to:
generating a third timestamp corresponding to the first processing moment according to the time precision corresponding to the message type of the message to be stored; the time precision is N times of the time granularity, N is an integer greater than 1, and the time length corresponding to the time precision is the same as the time length of the processing period of the message processor;
determining the identifier of the second index information set according to the second message type identifier, a preset index information set indicator and the third timestamp;
judging whether the second index information set exists in the storage medium according to the identifier of the second index information set;
if yes, determining the second index information set in the storage medium according to the identification of the second index information set;
and if not, creating a second index information set in the storage medium.
The message processing apparatus provided in the embodiment of the present invention may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the embodiments of the present invention.

Claims (9)

1. A message processing method applied to a message processor, the method comprising:
determining a first index information set corresponding to the current moment, wherein the first index information set comprises at least one index information, each index information corresponds to a message set, and each message set comprises at least one message to be processed;
determining a first message set according to index information included in the first index information set;
acquiring a message to be processed in the first message set, and processing the message to be processed;
the processing time of the message to be processed in the message set corresponding to each index information in the first index information set is within a first time period corresponding to the current time, and the time length of the first time period is the same as the time length of the processing cycle of the message processor; the processing time of the message to be processed in one message set is within one sub-period of the first period; deleting the message set after finishing processing the message to be processed in the message set, and correspondingly deleting the first index information set after deleting the message set corresponding to the first index information set;
determining a first index information set corresponding to the current time, including:
acquiring a first message type identifier corresponding to the message processor;
generating a first time stamp corresponding to the current time according to the processing period of the message processor;
determining an identifier of the first index information set according to the first message type identifier, a preset index information set indicator and the first timestamp;
and determining the first index information set according to the identification of the first index information set.
2. The method of claim 1, wherein the message processor corresponds to a parallel message processor, and accordingly, determining the first message set according to the index information included in the first index information set comprises:
determining first index information corresponding to the message processors in the at least one index information according to the number of the parallel message processors;
and determining the first message set according to the first index information.
3. The method of claim 1, further comprising:
acquiring a message to be stored and a first processing moment of the message to be stored;
determining second index information corresponding to the message to be stored according to the first processing moment;
and storing the message to be stored to a second message set corresponding to the second index information.
4. The method according to claim 3, wherein storing the message to be stored in the second message set corresponding to the second index information comprises:
judging whether the second message set exists in a storage medium or not according to the second index information;
if yes, storing the message to be stored to the second message set;
if not, creating the second message set in the storage medium according to the second index information, and storing the message to be stored in the second message set.
5. The method of claim 4, wherein after creating the second set of messages according to the second index information, further comprising:
determining a second index information set corresponding to the second index information;
and storing the second index information to the second index information set.
6. The method according to claim 5, wherein determining second index information corresponding to the message to be stored according to the first processing time includes:
acquiring the message type of the message to be stored;
determining a second message type identifier in at least one message type identifier corresponding to the message type of the message to be stored;
generating a second timestamp corresponding to the first processing moment according to the time granularity corresponding to the message type of the message to be stored;
and determining the second index information according to the second message type identifier and the second timestamp.
7. The method of claim 6, wherein determining the second set of index information corresponding to the second index information comprises:
generating a third timestamp corresponding to the first processing moment according to the time precision corresponding to the message type of the message to be stored; the time precision is N times of the time granularity, N is an integer greater than 1, and the time length corresponding to the time precision is the same as the time length of the processing period of the message processor;
determining the identifier of the second index information set according to the second message type identifier, a preset index information set indicator and the third timestamp;
judging whether the second index information set exists in the storage medium according to the identifier of the second index information set;
if yes, determining the second index information set in the storage medium according to the identification of the second index information set;
and if not, creating a second index information set in the storage medium.
8. The message processing device is applied to a message processor and comprises a first determining module, a second determining module, a first acquiring module and a processing module, wherein,
the first determining module is configured to determine a first index information set corresponding to a current time, where the first index information set includes at least one index information, each index information corresponds to a message set, and each message set includes at least one message to be processed;
the second determining module is configured to determine a first message set according to index information included in the first index information set;
the first obtaining module is used for obtaining the message to be processed in the first message set;
the processing module is used for processing the message to be processed;
the processing time of the message to be processed in the message set corresponding to each index information in the first index information set is within a first time period corresponding to the current time, and the time length of the first time period is the same as the time length of the processing cycle of the message processor; the processing time of the message to be processed in one message set is within one sub-period of the first period; deleting the message set after finishing processing the message to be processed in the message set, and correspondingly deleting the first index information set after deleting the message set corresponding to the first index information set;
the first determining module is specifically configured to: acquiring a first message type identifier corresponding to the message processor; generating a first time stamp corresponding to the current time according to the processing period of the message processor; determining an identifier of the first index information set according to the first message type identifier, a preset index information set indicator and the first timestamp; and determining the first index information set according to the identification of the first index information set.
9. The apparatus of claim 8, further comprising a second obtaining module, a third determining module, and a storing module, wherein,
the second acquisition module is used for acquiring the message to be stored and the first processing time of the message to be stored;
the third determining module is configured to determine, according to the first processing time, second index information corresponding to the message to be stored;
the storage module is used for storing the message to be stored to a second message set corresponding to the second index information.
CN201710503210.6A 2017-06-27 2017-06-27 Message processing method and device Active CN107222555B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710503210.6A CN107222555B (en) 2017-06-27 2017-06-27 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710503210.6A CN107222555B (en) 2017-06-27 2017-06-27 Message processing method and device

Publications (2)

Publication Number Publication Date
CN107222555A CN107222555A (en) 2017-09-29
CN107222555B true CN107222555B (en) 2020-08-25

Family

ID=59950841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710503210.6A Active CN107222555B (en) 2017-06-27 2017-06-27 Message processing method and device

Country Status (1)

Country Link
CN (1) CN107222555B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110399367B (en) * 2018-04-12 2023-04-14 腾讯科技(深圳)有限公司 Business data processing method and device, computer equipment and storage medium
CN111355777A (en) * 2020-02-14 2020-06-30 西安奥卡云数据科技有限公司 Management method and device of distributed file system and server
CN113570098A (en) * 2020-04-28 2021-10-29 鸿富锦精密电子(天津)有限公司 Shipment volume prediction method, shipment volume prediction device, computer device, and storage medium
CN117811637A (en) * 2023-03-15 2024-04-02 华为技术有限公司 Satellite message transmission method, system and terminal equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06139082A (en) * 1992-10-28 1994-05-20 Hitachi Ltd Task queue managing system
CN105224546A (en) * 2014-06-04 2016-01-06 阿里巴巴集团控股有限公司 Data storage and query method and apparatus
CN105468450A (en) * 2015-12-29 2016-04-06 华为技术有限公司 Task scheduling method and system
CN106406845A (en) * 2015-08-03 2017-02-15 阿里巴巴集团控股有限公司 A task processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06139082A (en) * 1992-10-28 1994-05-20 Hitachi Ltd Task queue managing system
CN105224546A (en) * 2014-06-04 2016-01-06 阿里巴巴集团控股有限公司 Data storage and query method and apparatus
CN106406845A (en) * 2015-08-03 2017-02-15 阿里巴巴集团控股有限公司 A task processing method and device
CN105468450A (en) * 2015-12-29 2016-04-06 华为技术有限公司 Task scheduling method and system

Also Published As

Publication number Publication date
CN107222555A (en) 2017-09-29

Similar Documents

Publication Publication Date Title
CN107222555B (en) Message processing method and device
CN108449405B (en) Event reminding method and device, computer equipment and storage medium
CN107315761B (en) Data updating method, data query method and device
US20180365254A1 (en) Method and apparatus for processing information flow data
EP3562096A1 (en) Method and device for timeout monitoring
CN106933672B (en) Distributed environment coordinated consumption queue method and device
EP3226153A1 (en) Impact analysis-based task redoing method, impact analysis calculation apparatus and one-click reset apparatus
CN112231069A (en) Transaction identifier processing method and device and electronic equipment
CN111770030A (en) Message persistence processing method, device and storage medium
CN110109741B (en) Method and device for managing circular tasks, electronic equipment and storage medium
CN111309548A (en) Timeout monitoring method and device and computer readable storage medium
CN111355765B (en) Network request processing and sending method and device
CN113923181B (en) Group message processing method, device, system and storage medium
CN111143053A (en) Scheduling method of timing task, server and storage device
CN105786917B (en) Method and device for concurrent warehousing of time series data
CN108108126B (en) Data processing method, device and equipment
CN112328602B (en) Method, device and equipment for writing data into Kafka
US20120102168A1 (en) Communication And Coordination Between Web Services In A Cloud-Based Computing Environment
CN111880910A (en) Data processing method and device, server and storage medium
CN111309693A (en) Data synchronization method, device and system, electronic equipment and storage medium
CN108121580B (en) Method and device for realizing application program notification service
CN113302593A (en) Task processing method, device and system, electronic equipment and storage medium
CN112948501B (en) Data analysis method, device and system
CN111488222B (en) Stream aggregation method and device and electronic equipment
US10110737B2 (en) Intelligent options in redial screens of communication devices

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