A message processing method and apparatus
By differentiating between real-time and non-real-time SMS processing, the number of non-real-time SMS messages retrieved is reduced, thus resolving platform failures caused by SMS backlog and achieving efficient and reliable SMS processing.
Patent Information
- Application Number
- CN202211257962.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-10-13
AI Technical Summary
When a large number of SMS messages are received on an SMS platform, the backlog of real-time SMS messages can cause delays in sending messages with high timeliness requirements. This may lead to platform failures or lost SMS messages, affecting user experience and upstream vendor services.
By differentiating between real-time and non-real-time SMS messages, processing real-time SMS messages in real time and reducing the number of non-real-time SMS messages retrieved, resource overload is avoided. A shadow message mechanism and queue priority management are adopted to ensure efficient resource utilization.
It effectively avoids resource overload and SMS loss, improves the reliability of SMS processing and user experience, and reduces resource waste.
Smart Images

Figure CN115696240B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to a message processing method and device. BACKGROUND
[0002] At present, short message is a common information reaching means, and various messages such as verification code and marketing information can be pushed to users through short message. In a scenario, a platform can receive short messages sent by a manufacturer providing services, and send the short messages to users who need to receive the short messages through a communication operator. SUMMARY
[0003] The present application shows a message processing method and device.
[0004] In a first aspect, the present application shows a message processing method, which comprises:
[0005] In the case that a message is received within a time period, it is determined whether the message is a real-time message, and the real-time message comprises a message that needs to be processed in real time;
[0006] In the case that the message is a real-time message, a processing resource is called to process the real-time message in real time, and the extraction quantity is reduced according to the real-time message, and the extraction quantity comprises a threshold value of extracting non-real-time messages in a to-be-processed queue within the time period, and the non-real-time message comprises a received and unprocessed message.
[0007] In an optional implementation, the extraction quantity is reduced according to the real-time message, which comprises:
[0008] An extracted quantity recorded is obtained;
[0009] A difference value between the extracted quantity recorded and a quantity of the real-time message is calculated to obtain a new extraction quantity;
[0010] The new extraction quantity is used to replace the extracted quantity recorded.
[0011] In an optional implementation, the extraction quantity is reduced according to the real-time message, which comprises:
[0012] A shadow message corresponding to the real-time message is generated;
[0013] The shadow message corresponding to the real-time message is cached in the to-be-processed queue.
[0014] In an optional implementation, the to-be-processed queue comprises a plurality of queue groups, and the plurality of queue groups have a priority order.
[0015] The shadow message corresponding to the real-time message is cached in the highest-priority queue group in the plurality of queue groups.
[0016] The shadow message corresponding to the real-time message is cached in the highest-priority queue group in the plurality of queue groups.
[0017] In an optional implementation, the method further includes:
[0018] In a case where the message is a non-real-time message, the non-real-time message is cached in a non-highest-priority queue group in the plurality of queue groups.
[0019] In a second aspect, the application shows a message processing method, the method includes:
[0020] extracting non-real-time messages from the to-be-processed queue according to a reduced extraction quantity within a time period;
[0021] invoking a processing resource to process the extracted non-real-time messages within the time period;
[0022] wherein the reduced extraction quantity is obtained by reducing an extraction quantity according to a quantity of real-time messages received within the time period, the extraction quantity including a threshold quantity of non-real-time messages extracted from the to-be-processed queue within the time period; the real-time messages include messages that need to be processed in real time and have been invoked to be processed in real time by the processing resource, and the non-real-time messages include received and unprocessed messages.
[0023] In an optional implementation, the to-be-processed queue caches the shadow message corresponding to the real-time message;
[0024] The extracting non-real-time messages from the to-be-processed queue according to the reduced extraction quantity within the time period includes:
[0025] obtaining messages from the to-be-processed queue according to an original extraction quantity within a time period; the obtained messages include non-real-time messages of the reduced extraction quantity and the shadow message corresponding to the real-time message; wherein the original extraction quantity includes an original threshold quantity of messages extracted from the to-be-processed queue within the time period;
[0026] screening the non-real-time messages of the reduced extraction quantity from the obtained messages.
[0027] In an optional implementation, the to-be-processed queue includes a plurality of queue groups, the plurality of queue groups have a priority order; and the shadow message is located in a highest-priority queue group in the plurality of queue groups.
[0028] The obtaining the message in the to-be-processed queue according to the original extraction quantity within the time period comprises:
[0029] The obtaining the message in the plurality of queue groups according to the original extraction quantity and the priority of the plurality of queue groups from high to low within the time period.
[0030] In an optional implementation, the non-real-time message is located in a queue group with the lowest priority in the plurality of queue groups.
[0031] The screening the non-real-time message with the reduced extraction quantity from the obtained message comprises:
[0032] The screening the message obtained from the queue group with the lowest priority in the plurality of queue groups from the obtained message.
[0033] In an optional implementation, the method further comprises:
[0034] The shadow message is not processed, and it is marked that the shadow message has been processed.
[0035] In a third aspect, the application shows a message processing device, the device comprises:
[0036] A determination module is configured to determine whether a message is a real-time message when the message is received within a time period, the real-time message comprising a message that needs to be processed in real time.
[0037] A first processing module is configured to invoke a processing resource to process the real-time message in real time when the message is a real-time message, and a reduction module is configured to reduce an extraction quantity according to the real-time message, the extraction quantity comprising a threshold quantity of non-real-time messages extracted in a to-be-processed queue within the time period, the non-real-time message comprising a received and unprocessed message.
[0038] In an optional implementation, the reduction module comprises:
[0039] An obtaining unit is configured to obtain a recorded extraction quantity.
[0040] A calculation unit is configured to calculate a difference between the recorded extraction quantity and a quantity of the real-time message to obtain a new extraction quantity.
[0041] A replacing unit is configured to replace the recorded extraction quantity with the new extraction quantity.
[0042] In an optional implementation, the reduction module comprises:
[0043] A generating unit is configured to generate a shadow message corresponding to the real-time message.
[0044] a cache unit, configured to cache the shadow message corresponding to the real-time message in the to-be-processed queue.
[0045] In an optional implementation, the to-be-processed queue includes a plurality of queue groups, and the plurality of queue groups have a priority order;
[0046] The cache unit includes:
[0047] a cache subunit, configured to cache the shadow message corresponding to the real-time message in a queue group with the highest priority in the plurality of queue groups.
[0048] In an optional implementation, the apparatus further includes:
[0049] a cache module, configured to cache the non-real-time message in a queue group with a non-highest priority in the plurality of queue groups in a case where the message is a non-real-time message.
[0050] In a fourth aspect, a message processing apparatus is shown, and the apparatus includes:
[0051] an extraction module, configured to extract non-real-time messages in a to-be-processed queue according to a reduced extraction quantity within a time period;
[0052] a second processing module, configured to invoke a processing resource to process the extracted non-real-time messages within the time period;
[0053] wherein the reduced extraction quantity is obtained by reducing an extraction quantity according to a quantity of real-time messages received within the time period, the extraction quantity including a threshold quantity of non-real-time messages extracted in the to-be-processed queue within the time period; the real-time messages include messages that need to be processed in real time and have been invoked to be processed in real time by the processing resource, and the non-real-time messages include received and unprocessed messages.
[0054] In an optional implementation, the to-be-processed queue caches the shadow message corresponding to the real-time message;
[0055] The extraction module includes:
[0056] an acquisition unit, configured to acquire messages in a to-be-processed queue according to an original extraction quantity within a time period; the acquired messages include non-real-time messages with a reduced extraction quantity and a shadow message corresponding to the real-time message; wherein the original extraction quantity includes an original threshold quantity of messages extracted in the to-be-processed queue within the time period;
[0057] The screening unit is configured to screen the non-real-time messages with the reduced extraction quantity from the obtained messages.
[0058] In an optional implementation, the to-be-processed queue includes a plurality of queue groups, and the plurality of queue groups have a priority order; and the shadow message is located in a highest-priority queue group of the plurality of queue groups.
[0059] The obtaining unit includes:
[0060] The obtaining sub-unit is configured to, in the time period, obtain messages from the plurality of queue groups according to the original extraction quantity and in a descending order of the priority of the plurality of queue groups.
[0061] In an optional implementation, the non-real-time messages are located in a non-highest-priority queue group of the plurality of queue groups.
[0062] The screening unit includes:
[0063] The screening sub-unit is configured to screen the messages obtained from the non-highest-priority queue group of the plurality of queue groups from the obtained messages.
[0064] In an optional implementation, the extraction module further includes:
[0065] The marking unit is configured to not process the shadow message, and mark that the shadow message has been processed.
[0066] In a fifth aspect, the present application shows an electronic device, which includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the method shown in any one of the preceding aspects.
[0067] In a sixth aspect, the present application shows a non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method shown in any one of the preceding aspects.
[0068] In a seventh aspect, the present application shows a computer program product, when instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the method shown in any one of the preceding aspects.
[0069] Compared with the prior art, the present application has the following advantages:
[0070] In the present application, in the case that a message is received in a time period, it is determined whether the message is a real-time message, the real-time message including a message that needs to be processed in real time; in the case that the message is a real-time message, a processing resource is invoked to process the real-time message in real time, and the extraction quantity is reduced according to the real-time message, the extraction quantity including a threshold quantity of non-real-time messages extracted in the time period from a to-be-processed queue, the non-real-time message including a received and unprocessed message. In this way, it is supported that the non-real-time messages can be extracted in the to-be-processed queue according to the reduced extraction quantity in the time period; the processing resource is invoked to process the extracted non-real-time messages in the time period. Through the present application, the quantity of messages actually processed by the processing resource in the time period can be less than or equal to the maximum processing quantity of messages that can be processed by the processing resource in the time period, so that it can be avoided that the processing resource is caused to fail, or it can be avoided that a part of the non-real-time messages exceeding the maximum processing quantity are discarded by the processing resource and cannot be successfully processed, for example, it can be avoided that the non-real-time messages are discarded by the processing resource and cannot reach a downstream user equipment. BRIEF DESCRIPTION OF DRAWINGS
[0071] Figure 1 is a structural block diagram of a message processing system according to an example embodiment of the present application.
[0072] Figure 2 is a flowchart of a message processing method according to an example embodiment of the present application.
[0073] Figure 3 is a flowchart of a message processing method according to an example embodiment of the present application.
[0074] Figure 4 is a structural block diagram of a message processing device according to an example embodiment of the present application.
[0075] Figure 5 is a structural block diagram of a message processing device according to an example embodiment of the present application.
[0076] Figure 6 is a structural diagram of a device according to an example embodiment of the present application. DETAILED DESCRIPTION
[0077] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0078] The inventor finds that there is often a case that a platform receives a large quantity of short messages respectively sent by a large quantity of service providers in a short time, and sends the large quantity of short messages to users who need to receive the short messages through a communication operator.
[0079] In the case that a large number of short messages are received by the platform in a short time, it is easy to cause the sending speed of the platform sending the short messages to the users through the communication operator to be lower than the receiving speed of the platform receiving the short messages, so as to cause the short messages to be accumulated in the platform, and the platform to send the accumulated short messages to the corresponding users through the communication operator in a subsequent time delay.
[0080] In order to enable the short messages to be accumulated in the platform, and then enable the platform to send the accumulated short messages to the corresponding users through the communication operator in a subsequent time delay, a queue can be set in the platform, and the short messages to be accumulated can be cached in the queue, and then the short messages in the queue are extracted, and the extracted short messages are sent to the corresponding users through the communication operator.
[0081] However, the short messages received by the platform and needed to be sent to the users exist in multiple categories. The timeliness requirements of different categories of short messages are different. Some categories of short messages have higher timeliness requirements, that is, the time length of the time delay is short, and some categories of short messages have lower timeliness requirements, that is, the time length of the time delay can be longer.
[0082] For example, in an example, the platform can receive the verification code short messages (the verification code short messages carry verification codes) sent by a service provider (such as a merchant or a financial institution, etc.), and send the verification code short messages to the users who need to receive the verification code short messages through the communication operator.
[0083] For another example, in another example, the platform can receive the marketing short messages (the marketing short messages carry marketing information) sent by a service provider, and send the marketing short messages to the users who need to receive the marketing short messages through the communication operator.
[0084] Among them, the timeliness requirement of the verification code short message is high, and the timeliness requirement of the marketing short message is low.
[0085] Therefore, if the verification code short messages are accumulated in the platform, the time length of the time delay of the verification code short messages will be long, and the timeliness requirement cannot be met.
[0086] In addition, the inventors found that in the case that the verification code short messages are cached in the queue of the platform, if the queue fails and the platform cannot extract the verification code short messages in the queue, the verification code short messages cannot be sent to the users, the short message service cannot be provided, and the experience of the upstream manufacturers and the users will be reduced.
[0087] Therefore, in order to avoid this situation, the inventors think of a way: in the case that the platform receives the verification code short messages, the verification code short messages are not accumulated, that is, the verification code short messages are not cached in the queue, but are directly forwarded to the corresponding users.
[0088] In the case that the platform receives the marketing short message, the marketing short message backlog can be accumulated, that is, the marketing short message can be buffered in the queue, and then the marketing short message in the queue is extracted, and the extracted marketing short message is sent to the corresponding user through the communication operator.
[0089] In the case that the platform receives the marketing short message, the marketing short message backlog can be accumulated, that is, the marketing short message can be buffered in the queue, and then the marketing short message in the queue is extracted, and the extracted marketing short message is sent to the corresponding user through the communication operator.
[0090] In addition, in the case that the platform needs to forward the short message, the communication resource needs to be called to forward the short message, and the number of short messages that can be forwarded by the communication resource in a time period has an upper limit (maximum processing number).
[0091] The maximum processing number of the communication resource can be equal to the sum of the threshold numbers of the respective queues corresponding to the communication resource.
[0092] However, if the platform not only extracts the threshold number of marketing short messages in the respective queues corresponding to the communication resource in a time period, but also calls the communication resource to forward the threshold number of marketing short messages extracted in the respective queues, and directly forwards at least one verification code short message in the time period, the number of short messages that need to be forwarded by the communication resource in the time period will be greater than the maximum processing number, so that the communication resource will be overloaded, which may cause the communication resource to fail, or a part of the marketing short messages exceeding the maximum processing number may be discarded by the communication resource and cannot reach the downstream user equipment.
[0093] Therefore, in the present application, a solution is provided, and the technical scheme provided by each embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0094] Referring to Figure 1 , a structural schematic diagram of a message processing system of the present application is shown.
[0095] The message processing system comprises an upstream vendor device, a message processing platform, and a downstream user equipment.
[0096] The message processing platform comprises an access node, a decision node, a gateway, and at least one scheduling node.
[0097] In one embodiment, the scheduling node in the message processing platform can be multiple.
[0098] In the case of multiple scheduling nodes in the message processing platform, the multiple scheduling nodes can form a distributed scheduling system, which can perform distributed parallel scheduling processing on the messages received by the message processing system.
[0099] The message includes a communication transmission object and is an information carrier. For example, the message includes a short message, which can include a short message or a PUSH message.
[0100] The message can include a text message, a voice message, a video message, and an image message, which are not limited in the present application.
[0101] In the case of a short message, the short message can include a text short message (such as a short message), a video short message, a voice short message, and an image short message.
[0102] The upstream vendor device has a communication connection with the access node of the message processing platform, and data interaction can be performed between the upstream vendor device and the access node of the message processing platform based on the communication connection.
[0103] The upstream vendor device belongs to an upstream vendor, which includes a vendor (such as a merchant or a financial institution) having a message sending demand.
[0104] For example, in an e-commerce scenario, the upstream vendor can be a merchant, and the merchant uses its own device (upstream vendor device) to send product advertisements or product discount information to a downstream user device (such as a mobile phone) of a downstream user (such as a consumer) through the message processing platform.
[0105] For another example, in an electronic payment scenario, the upstream vendor can be a financial institution, and the financial institution uses its own device (upstream vendor device) to send a payment verification code to a downstream user device (such as a mobile phone) of a downstream user (such as a user who needs to perform a payment action) through the message processing platform to ensure the security of the payment.
[0106] The upstream vendor device includes a server of the upstream vendor or a terminal of the upstream vendor, which can include a mobile phone, a notebook computer, a desktop computer, a PDA (Personal Digital Assistant), a palm computer, and the like, which are not limited in the present application.
[0107] The downstream user device can include a mobile phone, a notebook computer, a desktop computer, a PDA, and the like, which are not limited in the present application.
[0108] The downstream user equipment has a communication connection with the gateway of the message processing platform (the communication connection between the downstream user equipment and the gateway of the message processing platform can be a communication connection via a downstream supplier, which will be described below, and will not be described here in detail), and the gateway of the message processing platform and the downstream user equipment can interact based on the communication connection. The downstream supplier includes a communication supplier and the like.
[0109] The access node is configured to receive a message sent by an upstream manufacturer equipment and required to be forwarded to a downstream user terminal, and send the message to a decision node in the message processing platform.
[0110] The access node can include a router, a switch, a modem, and the like, which will not be limited in the present application.
[0111] The decision node is configured to receive the message sent by the access node, decide a communication resource for forwarding the message in a plurality of communication resources, and then send the resource identifier of the communication resource and the message to a scheduling node capable of scheduling the communication resource. The communication resource can include a communication resource provided by a downstream supplier and the like.
[0112] The explanation of the communication resource can be referred to the description below, which will not be described here in detail.
[0113] The scheduling node capable of scheduling the communication resource has one physical queue in the logical queue corresponding to the communication resource, and the specific explanation can be referred to the embodiments below, which will not be described here in detail.
[0114] The scheduling node capable of scheduling the communication resource is configured to receive at least the message and the resource identifier of the communication resource, determine a time for forwarding the message based on the maximum processing quantity of the communication resource in a time period, and schedule the resource identifier of the communication resource and the message to the gateway at the time, so as to realize the flow control of the communication resource, avoid the quantity of messages actually required to be forwarded by the communication resource in a time period being greater than the maximum processing quantity of the communication resource in the time period, that is, avoid the flow received by the communication resource in a time period being greater than the maximum flow that can be borne by the communication resource in the time period, and further avoid the communication resource being overloaded.
[0115] The control logic of the different scheduling nodes in the message processing platform for the flow control of the communication resource can be the same.
[0116] The scheduling node can be implemented based on a server, which can include a general server, a cloud server, a cloud host, a virtual center, or an elastic computing instance on the cloud, and the like, which will not be limited in the present application.
[0117] The server can include a processor, a hard disk, a memory, a system bus, and the like, and has a similar structure as a general computer, and thus further description is omitted.
[0118] The gateway is configured to receive the resource identifier of the communication resource and the message, and then invoke the communication resource according to the resource identifier to send the message to the corresponding downstream user equipment (in this application, sending a message to the corresponding downstream user equipment can be understood as sending the message to the downstream user equipment that needs to receive the message, and the like).
[0119] The downstream user equipment includes the equipment that the message finally reaches, such as the equipment used by a consumer in an e-commerce scenario and the equipment used by a user who needs to perform a payment action in an electronic payment scenario, and the like.
[0120] Figure 1 The message processing platform includes multiple scheduling nodes, but this does not limit the protection scope of the present application.
[0121] For example, the communication resource that can be invoked is multiple, and for any one communication resource, the communication resource uniquely corresponds to one logical queue, and the logical queue can include one physical queue or more than two physical queues.
[0122] For example, assuming that the QPS (Queries Per Second) of one communication resource is equal to the QPS of one physical queue, the one logical queue corresponding to the communication resource can include one physical queue, and the physical queue can be located in one of the multiple scheduling nodes.
[0123] For another example, assuming that the QPS of the one communication resource is greater than the QPS of one physical queue, in order to improve the utilization rate of the communication resource as much as possible, the one logical queue corresponding to the communication resource can include more than two physical queues.
[0124] Each of the more than two physical queues can be located in a different scheduling node of the multiple scheduling nodes.
[0125] The number of physical queues included in the one logical queue corresponding to the communication resource can be determined according to the QPS of each physical queue and the QPS of the one communication resource.
[0126] For example, assuming that the QPS of the one communication resource is 100 and the QPS of each physical queue is 50, the one logical queue corresponding to the one communication resource can include two physical queues; or, assuming that the QPS of the one communication resource is 90 and the QPS of each physical queue is 30, the one logical queue corresponding to the one communication resource can include three physical queues.
[0127] The physical queue is used to buffer the message, that is, to accumulate the message, so as to facilitate the flow control of the communication resource.
[0128] For example, for any scheduling node, when the scheduling node receives a message and the resource identifier of the communication resource for processing the message decided by the decision node, if the message is not a real-time message, the scheduling node can find the physical queue included in the logical queue corresponding to the communication resource in the physical queue in the scheduling node (the physical queue is located in the scheduling node), and buffer the message in the physical queue. Then the scheduling node processes the messages in the message queue according to the principle of "first in first out and last in last out", and then calls the communication resource to send the dequeued message.
[0129] In addition to the message processing system provided in the above embodiment, referring to Figure 2 The present application also provides a flowchart of a message processing method, which can be applied to an electronic device, and the electronic device includes Figure 1 Any scheduling node shown in the figure, or the electronic device can also include possible devices in other scenarios, which are not limited by the present application.
[0130] In the method, for the electronic device, when the electronic device receives a message within a time period, the message can be processed by the following way. For example, in the method, for the scheduling node, when the scheduling node receives the message sent by the decision node within a time period, the message can be processed by the following way.
[0131] The method includes:
[0132] In step S101, when a message is received within a time period, it is determined whether the message is a real-time message, and the real-time message includes a message that needs to be processed in real time.
[0133] In an example of the present application, the message includes a message sent by a decision node.
[0134] "Processing" includes forwarding (for example, forwarding to other devices, etc., for example, forwarding to downstream user equipment, etc.), calculation or storage, etc.
[0135] In the present application, the received messages can be roughly divided into at least two categories, one of which includes real-time messages, and the other includes non-real-time messages.
[0136] The real-time messages can be understood as follows: in the case that the electronic device receives the real-time messages, the real-time messages need to be processed immediately / real-time, without accumulating the real-time messages in the electronic device, for example, without buffering the real-time messages in the electronic device.
[0137] The non-real-time messages can be understood as follows: in the case that the electronic device receives the non-real-time messages, the non-real-time messages can not be processed immediately / real-time, but can be accumulated in the electronic device according to actual conditions, for example, the non-real-time messages can be buffered in the electronic device according to actual conditions, and then the buffered non-real-time messages are extracted from the electronic device and processed.
[0138] In an embodiment of the present application, in the case that the electronic device is any scheduling node shown in the following figure, the messages sent by the upstream manufacturer device and needing to be forwarded to the downstream user device received by the scheduling node can be roughly divided into at least two categories, one of which includes real-time messages, and the other includes non-real-time messages. Figure 1
[0139] The real-time messages can be understood as follows: in the case that the scheduling node receives the real-time messages sent by the upstream manufacturer device and needing to be forwarded to the downstream user device, the real-time messages need to be forwarded to the downstream user device immediately / real-time, without accumulating the real-time messages in the scheduling node, for example, without buffering the real-time messages in the scheduling node.
[0140] The non-real-time messages can be understood as follows: in the case that the scheduling node receives the non-real-time messages sent by the upstream manufacturer device and needing to be forwarded to the downstream user device, the non-real-time messages can not be forwarded to the downstream user device immediately / real-time, but can be accumulated in the scheduling node according to actual conditions, for example, the non-real-time messages can be buffered in the scheduling node according to actual conditions. Then the buffered non-real-time messages are extracted from the scheduling node and processed.
[0141] For the categories of messages, different categories have category identifiers, for example, the category identifier of the real-time messages is “0”, and the category identifier of the non-real-time messages is “1”, etc.
[0142] The category identifier of the category of messages can be located in a specific field in the message.
[0143] In this way, the category identifier can be extracted in the specific field of the message, and then the category of the message can be determined according to the category identifier. In the present application, the received messages can be roughly divided into at least two categories, one of which includes real-time messages, and the other includes non-real-time messages.
[0136] The real-time messages can be understood as follows: in the case that the electronic device receives the real-time messages, the real-time messages need to be processed immediately / real-time, without accumulating the real-time messages in the electronic device, for example, without buffering the real-time messages in the electronic device.
[0137] The non-real-time messages can be understood as follows: in the case that the electronic device receives the non-real-time messages, the non-real-time messages can not be processed immediately / real-time, but can be accumulated in the electronic device according to actual conditions, for example, the non-real-time messages can be buffered in the electronic device according to actual conditions, and then the buffered non-real-time messages are extracted from the electronic device and processed.
[0138] In an embodiment of the present application, in the case that the electronic device is any scheduling node shown in the following figure, the messages sent by the upstream manufacturer device and needing to be forwarded to the downstream user device received by the scheduling node can be roughly divided into at least two categories, one of which includes real-time messages, and the other includes non-real-time messages. Figure 1
[0139] The real-time messages can be understood as follows: in the case that the scheduling node receives the real-time messages sent by the upstream manufacturer device and needing to be forwarded to the downstream user device, the real-time messages need to be forwarded to the downstream user device immediately / real-time, without accumulating the real-time messages in the scheduling node, for example, without buffering the real-time messages in the scheduling node.
[0140] The non-real-time messages can be understood as follows: in the case that the scheduling node receives the non-real-time messages sent by the upstream manufacturer device and needing to be forwarded to the downstream user device, the non-real-time messages can not be forwarded to the downstream user device immediately / real-time, but can be accumulated in the scheduling node according to actual conditions, for example, the non-real-time messages can be buffered in the scheduling node according to actual conditions. Then the buffered non-real-time messages are extracted from the scheduling node and processed.
[0141] For the categories of messages, different categories have category identifiers, for example, the category identifier of the real-time messages is “0”, and the category identifier of the non-real-time messages is “1”, etc.
[0142] The category identifier of the category of messages can be located in a specific field in the message.
[0143] In this way, the category identifier can be extracted in the specific field of the message, and then the category of the message can be determined according to the category identifier.
[0144] In this way, the electronic device can extract the category identifier in the specific field of the message, and then determine the category of the message according to the category identifier, so as to determine whether the message is a real-time message or a non-real-time message.
[0145] In step S102, in the case where the message is a non-real-time message, the non-real-time message is cached in the to-be-processed queue.
[0146] The electronic device has a plurality of different to-be-processed queues (including physical queues and the like), and the different to-be-processed queues in the electronic device can belong to different logical queues, and the different logical queues correspond to different processing resources respectively.
[0147] In one embodiment, in the case where the electronic device receives the message within a time period, the resource identifier of the processing resource for processing the message can also be received.
[0148] For example, because the electronic device can include the to-be-processed queues in the logical queues corresponding to the different resource identifiers respectively, that is, the electronic device can have a plurality of to-be-processed queues, and the different to-be-processed queues belong to the logical queues corresponding to different processing resources, in order to facilitate the electronic device to determine which processing resource to use to process the message, the sender of the message can send the resource identifier of the communication resource for processing the message to the electronic device in addition to sending the message to the electronic device.
[0149] In this way, in the case where the electronic device obtains the message and the resource identifier of the processing resource for processing the message, and the message is a non-real-time message, the logical queue corresponding to the processing resource corresponding to the resource identifier can be determined, then the to-be-processed queue in the electronic device in the logical queue can be determined, and the message can be cached in the determined to-be-processed queue, so that the message can be extracted and processed in the determined to-be-processed queue later.
[0150] In one embodiment of the present application, in the case where the electronic device is Figure 1 In the case of any scheduling node shown in the figure, the scheduling node can have a plurality of different to-be-processed queues (including physical queues and the like), and the different to-be-processed queues in the scheduling node can belong to different logical queues, and the different logical queues correspond to different communication resources respectively.
[0151] In one embodiment, in the case where the scheduling node receives the message sent by the upstream manufacturer device and needing to be forwarded to the downstream user device within a time period, the resource identifier of the communication resource for forwarding the message can also be received (which can be sent by the upstream manufacturer device, for example, the upstream manufacturer device sends the message and the resource identifier to the scheduling node together).
[0152] For example, the message is sent by the decision node to the scheduling node, since the scheduling node can include different resource identifiers respectively corresponding to the pending queues in the logical queues of different communication resources, that is, the scheduling node can have multiple pending queues, and different pending queues belong to the logical queues of different communication resources. In this way, in order to facilitate the scheduling node to determine which communication resource to use to forward the message, after the decision node decides the communication resource for forwarding the message, the decision node can send the resource identifier of the communication resource for forwarding the message to the scheduling node in addition to sending the message to the scheduling node.
[0153] In this way, in the case that the scheduling node obtains the message and the resource identifier of the communication resource for forwarding the message and determines that the message is a non-real-time message, the corresponding logical queue of the communication resource corresponding to the resource identifier can be determined, and then the pending queue in the logical queue located in the scheduling node can be determined, and the message can be cached in the determined pending queue for later extraction of the message in the determined pending queue and forwarding of the message to the downstream user equipment.
[0154] In step S103, in the case that the message is a real-time message, a processing resource is called to process the real-time message in real time, and the extraction quantity is reduced according to the real-time message, the extraction quantity including a threshold quantity of non-real-time messages extracted in the pending queue within a time period, the non-real-time messages including received and unprocessed messages.
[0155] In the present application, calling a processing resource to process the real-time message in real time includes calling a computing resource to calculate the real-time message (for example, calculating the real-time message by a calculation method to obtain another message, etc.), calling a communication resource to forward the real-time message to other equipment, etc.
[0156] For example, in an embodiment of the present application, for the scheduling node to call the communication resource corresponding to the resource identifier to forward the message to the downstream user equipment in real time, the scheduling node can send the message and the resource identifier of the communication resource for forwarding the message to the gateway in the message processing platform. Then the gateway can receive the message and the resource identifier of the communication resource for forwarding the message, and then use the communication resource corresponding to the resource identifier to forward the message to the downstream user equipment, for example, the gateway can use the communication resource corresponding to the resource identifier to send the message to the forwarding device (for example, including a router, a switch or a base station, etc.) of the downstream supplier corresponding to the communication resource, so that the forwarding device of the downstream supplier forwards the message to the downstream user equipment.
[0157] Additionally, the extraction quantity can be reduced based on the real-time messages. The extraction quantity includes a threshold number of non-real-time messages to be extracted from the queue within a time period. The threshold number represents the maximum number of non-real-time messages that can be extracted from the queue within a time period. For example, the recorded extraction quantity can be obtained, and the difference between the recorded extraction quantity and the number of real-time messages (including the number of real-time messages received in step S101) can be calculated to obtain a new extraction quantity. The new extraction quantity can then replace the recorded extraction quantity.
[0158] Alternatively, for example, the logical queue corresponding to the processing resource can be determined (for example, the logical queue corresponding to the processing resource corresponding to the resource identifier can be found in step S102, which will not be detailed here), and then the pending queue in the logical queue and located in the electronic device can be determined. Furthermore, a shadow message corresponding to the real-time message can be generated and the shadow message corresponding to the real-time message can be cached in the pending queue so that the shadow message corresponding to the real-time message can occupy a place in the pending queue.
[0159] In this application, if the message has been processed in real time within the time period, and is still stored in the logical queue corresponding to the processing resource and in the pending queue of the electronic device, then when the electronic device retrieves the message in the pending queue later, it will also retrieve the message in the pending queue and call the processing resource to process the message, resulting in duplicate processing of the message, which is useless processing and will cause resource waste.
[0160] For example, in electronic devices Figure 1 In the case of any of the scheduling nodes shown, if the message has been forwarded to the downstream user equipment in real time within the time period, and the message is still stored in the logical queue corresponding to the communication resource and is located in the pending queue of the scheduling node, then when the scheduling node retrieves the message in the pending queue later, it will also retrieve the message in the pending queue and call the communication resource to forward the message to the downstream user equipment again, resulting in the message being sent repeatedly to the downstream user equipment, which is a useless transmission and will cause a waste of resources.
[0161] Therefore, to avoid wasting resources, if the message has been processed in real time within the time period, it may no longer be stored in the processing queue. For example, the message may no longer be stored in the logical queue corresponding to the processing resource and in the electronic device's processing queue. For example, in an electronic device... Figure 1 In the case of any of the scheduling nodes shown, the message may no longer be stored in the logical queue corresponding to the communication resource, but in the pending queue of the scheduling node.
[0162] Secondly, since the number of messages that the processing resource can process in the time period is limited (i.e., has a maximum processing number), and the logical queue corresponding to the processing resource includes multiple pending queues, thus, the number of messages (messages to be processed using the processing resource) that can be extracted in each pending queue in the logical queue corresponding to the processing resource in the time period is limited (i.e., has an original extraction number).
[0163] In one embodiment, when the electronic device extracts messages in each pending queue in the time period, the electronic device extracts messages in each pending queue according to the original extraction number of each pending queue by default (i.e., full extraction), for example, when the electronic device extracts messages in a pending queue, the electronic device extracts the original extraction number of messages in the pending queue.
[0164] The sum of the original extraction numbers of each pending queue in the logical queue corresponding to the processing resource can be less than or equal to the maximum processing number.
[0165] In this application, the original extraction numbers of each pending queue are the same as an example, but not as a limitation to the protection scope of this application.
[0166] If the original extraction number of messages is extracted in each pending queue in the time period and the original extraction number of messages extracted in each pending queue is processed based on the processing resource, since the real-time message has been processed in the time period, the number of messages (including the sum of the original extraction numbers of each pending queue and the number of real-time messages that have been processed in the time period) that the processing resource actually processes (actually carries) in the time period will be greater than the maximum processing number of messages that the processing resource can process in the time period, that is, the number of messages that the processing resource actually processes (actually carries) in the time period is more than the maximum processing number of messages that the processing resource can process in the time period by the number of real-time messages that have been processed in the time period.
[0167] Thus, it will cause the processing resource to be overloaded, and further can cause the processing resource to fail, or can cause a part of non-real-time messages exceeding the maximum processing number to be discarded by the processing resource and unable to be processed.
[0168] For example, when the electronic device is a mobile phone, the maximum processing number of messages that the processing resource can process in the time period is 1000, and the original extraction number of each pending queue in the logical queue corresponding to the processing resource is 100, and the number of real-time messages that have been processed in the time period is 200. Figure 1If the original extraction quantity of messages is extracted from each pending queue respectively in the time period and the original extraction quantity of messages extracted from each pending queue respectively is forwarded to the downstream user equipment based on the communication resource, the number of messages actually forwarded (actually carried) by the communication resource in the time period (including the sum of the original extraction quantity of each pending queue and the number of real-time messages already forwarded to the downstream user equipment in the time period) will be greater than the maximum processing quantity of messages that can be forwarded by the communication resource in the time period, i.e., the number of messages actually forwarded (actually carried) by the communication resource in the time period is greater than the maximum processing quantity of messages that can be forwarded by the communication resource in the time period by the number of real-time messages already forwarded to the downstream user equipment in the time period.
[0169] Thus, the communication resource will be overloaded, which may cause the communication resource to fail, or a part of the non-real-time messages exceeding the maximum processing quantity may be discarded by the communication resource and cannot reach the downstream user equipment.
[0170] Thus, in order to avoid the above situation, if the real-time messages have been processed based on the processing resource in the time period, the real-time messages processed in the time period have occupied a part of the processing capability of the processing resource (occupied a part of the message processing quantity in the maximum processing quantity), thus, the number of non-real-time messages actually processed by the processing resource in the time period needs to be less than the maximum processing quantity of messages that can be processed by the processing resource in the time period.
[0171] In one embodiment, in order to make the number of non-real-time messages actually processed by the processing resource in the time period less than the maximum processing quantity of messages that can be processed by the processing resource in the time period, in one example, the number of non-real-time messages extracted from the pending queue in the time period can be made less than the original extraction quantity.
[0172] In order to make the number of non-real-time messages extracted from the pending queue in the time period less than the original extraction quantity, in one example, the maximum number of messages that can be extracted from the pending queue located locally in the time period can be reduced according to the number of received messages, for example, the recorded extraction quantity can be obtained, the difference between the recorded extraction quantity and the number of real-time messages (including the number of received real-time messages in step S101) is calculated to obtain a new extraction quantity, and then the new extraction quantity can be used to replace the recorded extraction quantity.
[0173] Or, in another embodiment, in order to make the number of non-real-time messages actually processed by the processing resource in a time period less than the maximum processing number of messages that can be processed by the processing resource in the time period, in an example, only part of the messages extracted from the to-be-processed queue in the time period can be non-real-time messages that need to be processed.
[0174] For example, part of the messages extracted from the to-be-processed queue in the time period can be non-real-time messages that need to be processed in the time period, and another part of the messages (which can not be non-real-time messages, such as shadow messages for placeholders, etc.) do not need to be processed in the time period, so that the number of messages that do not need to be processed in the time period can be equal to the number of real-time messages that have been processed in the time period.
[0175] For example, in an example, the messages that do not need to be processed in the time period can be shadow messages respectively corresponding to each real-time message that has been processed in the time period. For example, part of the messages extracted from the to-be-processed queue in the time period are non-real-time messages that need to be processed, and another part of the messages are shadow messages, each of which respectively corresponds to one different real-time message that has been processed in the time period, and the shadow messages do not need to be processed.
[0176] In order to make the messages that do not need to be processed in the time period be shadow messages respectively corresponding to each real-time message that has been processed in the time period, in the present application, in the case that the received message is a real-time message and the processing resource is called to process the real-time message in real time, a shadow message corresponding to the real-time message can be generated, and the shadow message corresponding to the real-time message can be cached in the to-be-processed queue to make the shadow message corresponding to the real-time message be able to occupy a place in the to-be-processed queue.
[0177] The to-be-processed queue includes a to-be-processed queue in the electronic device in the logical queue corresponding to the processing resource corresponding to the resource identifier.
[0178] The shadow message corresponding to the real-time message can occupy a place in the to-be-processed queue, the shadow message corresponding to the real-time message is a different message from the real-time message, and the two can be in a binding relationship. The real-time message is a message that needs to be processed, and the shadow message corresponding to the real-time message can occupy a place in the to-be-processed queue and can not be processed.
[0179] When subsequent electronic devices retrieve messages from the queue within the time period, if a shadow message is retrieved, the shadow message can be discarded directly without processing it (because the message corresponding to the shadow message is a real-time message, and the real-time message corresponding to the shadow message has already been processed within the time period). In this way, the number of messages actually processed by the processing resource within the time period can be less than or equal to the maximum number of messages that the processing resource can process within the time period.
[0180] In addition, in scenarios where messages are retrieved from a queue, the principle of "first-in, first-out and last-in, last-out" is usually followed.
[0181] For example, for any message in the queue to be processed, the earlier the message enters the queue, the earlier it will be retrieved from the queue. Conversely, the later the message enters the queue, the later it will be retrieved from the queue.
[0182] In one scenario, shadow messages exist in the processing queue. The real-time messages corresponding to these shadow messages are processed by the relevant processing resource within a given time period. The shadow messages enter the processing queue earlier within the time period. Following the order of entry into the queue from earliest to latest, the messages with the highest initial extraction count include all shadow messages in the processing queue. Furthermore, the number of shadow messages in the processing queue is less than the initial extraction count of messages that can be extracted from the queue within the time period. Therefore, following the "first-in, first-out" and "last-in, last-out" principle, after extracting the initial extraction count of messages from the processing queue, all shadow messages are included in the extracted messages. The processing queue no longer contains shadow messages. Within the time period, the processing resource can be called to process the non-real-time messages (excluding shadow messages) among the extracted messages. Additionally, in addition to the time... The real-time messages corresponding to the shadow messages extracted from the messages that have been processed by the processing resource within the time period are obtained. The total number of messages (including real-time and non-real-time messages) actually processed by the processing resource within the time period is obtained. It can be seen that the total number of messages (including real-time and non-real-time messages) actually processed by the processing resource within the time period is less than or equal to the maximum number of messages that the processing resource can process within the time period. In this way, it can be avoided that the total number of messages (including real-time and non-real-time messages) actually processed by the processing resource within the time period exceeds the maximum number of messages that the processing resource can process within the time period, which can avoid the processing resource from failing, or prevent a portion of non-real-time messages exceeding the maximum processing number from being discarded by the processing resource and failing to be processed successfully.
[0183] However, in another case, there are shadow messages in the to-be-processed queue, the real-time messages corresponding to the shadow messages are processed by calling the processing resource in the time period, at least one shadow message enters the to-be-processed queue later, the original extraction quantity of messages in the front does not include all the shadow messages in the to-be-processed queue in the order of entering the to-be-processed queue from early to late, and the quantity of the shadow messages in the to-be-processed queue is less than the original extraction quantity of messages that can be extracted in the to-be-processed queue in the time period, then according to the principle of "first in first out and last in last out", after the original extraction quantity of messages in the to-be-processed queue are extracted, at least one shadow message is not in the extracted messages, and there is at least one shadow message in the to-be-processed queue, the non-real-time messages in the extracted messages except the shadow messages can be processed by calling the processing resource in the time period, and in addition, the real-time messages corresponding to the shadow messages in the extracted messages that have been processed by calling the processing resource in the time period, the total quantity of messages (including real-time messages and non-real-time messages) actually processed by the processing resource in the time period is obtained, it can be seen that the total quantity of messages (including real-time messages and non-real-time messages) actually processed by the processing resource in the time period will be greater than the maximum processing quantity of messages that can be processed by the processing resource in the time period, and the total quantity of messages (including real-time messages and non-real-time messages) actually processed by the processing resource in the time period will be more than the maximum processing quantity of messages that can be processed by the processing resource in the time period by the quantity of the at least one shadow message, which will cause the processing resource to be overloaded, and further may cause the processing resource to fail, or may cause a part of non-real-time messages exceeding the maximum processing quantity to be discarded by the processing resource and unable to be successfully processed.
[0184] Therefore, in order to avoid this situation as much as possible, in another embodiment of the present application, the to-be-processed queue can include a plurality of queue groups (for example, the to-be-processed queue is split into a plurality of queue groups), and the plurality of queue groups have a priority order.
[0185] Since the timeliness requirement of real-time messages is higher than that of non-real-time messages, the real-time messages can correspond to the queue group with the highest priority order, that is, the shadow messages can correspond to the queue group with the highest priority order. The non-real-time messages can correspond to the queue group with a non-highest priority order.
[0186] In this way, when the non-real-time messages are cached in the to-be-processed queue, the non-real-time messages can be cached in the queue group with a non-highest priority order in the plurality of queue groups.
[0187] In addition, when caching shadow messages in the pending queue, the shadow messages can be cached in the queue group with the highest priority among the plurality of queue groups (for example, when caching the shadow messages corresponding to the real-time messages in the pending queue, the shadow messages corresponding to the real-time messages can be cached in the queue group with the highest priority among the plurality of queue groups).
[0188] In this way, in each queue group in the pending queue, the shadow messages are located in the queue group with the highest priority among the plurality of queue groups, and the non-real-time messages can be located in the queue groups with the non-highest priority.
[0189] Correspondingly, when obtaining the messages in the pending queue according to the original extraction quantity within the time period, the messages can be obtained from the plurality of queue groups according to the original extraction quantity within the time period and in the order of the priority of the plurality of queue groups from high to low. For example, the messages of the original extraction quantity can be obtained from the plurality of queue groups in the order of the priority of the plurality of queue groups from high to low.
[0190] For example, the messages are first extracted from the queue group with the highest priority (the extracted messages are shadow messages), after the extraction of the messages in the queue group with the highest priority is completed, if the total quantity of the extracted messages (shadow messages) is less than the original extraction quantity of the messages that can be extracted from the pending queue within the time period, the messages are then extracted from the queue group with the second highest priority (the extracted messages are non-real-time messages), after the extraction of the messages in the queue group with the second highest priority is completed, if the total quantity of the extracted messages (shadow messages + non-real-time messages) is less than the original extraction quantity of the messages that can be extracted from the pending queue within the time period, the messages are then extracted from the queue group with the third highest priority (the extracted messages are non-real-time messages), and so on, until the total quantity of the extracted messages (shadow messages + non-real-time messages) is equal to the original extraction quantity of the messages that can be extracted from the pending queue within the time period.
[0191] In the present application, in the case that a message is received in a time period, it is determined whether the message is a real-time message, the real-time message including a message that needs to be processed in real time; in the case that the message is a real-time message, a processing resource is invoked to process the real-time message in real time, and the extraction quantity is reduced according to the real-time message, the extraction quantity including a threshold quantity of non-real-time messages extracted in the time period in the to-be-processed queue, the non-real-time message including a received and unprocessed message. In this way, it is supported that the non-real-time messages can be extracted in the to-be-processed queue according to the reduced extraction quantity in the time period; and the processing resource is invoked to process the extracted non-real-time messages in the time period. Through the present application, the quantity of messages actually processed by the processing resource in the time period can be less than or equal to the maximum processing quantity of messages that can be processed by the processing resource in the time period, so that it can be avoided that the processing resource is caused to fail, or it can be avoided that a part of non-real-time messages exceeding the maximum processing quantity are discarded by the processing resource and cannot be successfully processed, for example, it can be avoided that the non-real-time messages are discarded by the processing resource and cannot reach a downstream user equipment.
[0192] Further, for the scenario that the electronic device extracts a message from the to-be-processed queue and processes the message, for example, for the scenario that the invoking node extracts a message from the to-be-processed queue and forwards the message to a downstream user equipment, Figure 3 A flowchart of a message processing method of the present application is shown, the method is applied in an electronic device, the electronic device includes Figure 1 Any of the scheduling nodes shown, or the electronic device can also include possible devices in other scenarios, which are not limited by the present application.
[0193] In step S201, the non-real-time messages are extracted in the to-be-processed queue according to the reduced extraction quantity in the time period.
[0194] The reduced extraction quantity is obtained by reducing the extraction quantity according to the quantity of real-time messages received in the time period (for details, see Figure 1 the embodiments shown, which are not described in detail here), and the extraction quantity includes a threshold quantity of non-real-time messages extracted in the to-be-processed queue in the time period. The real-time message includes a message that needs to be processed in real time and has been processed in real time by the processing resource, and the non-real-time message includes a received and unprocessed message.
[0195] The to-be-processed queue includes one physical queue in a logical queue corresponding to the communication resource, etc.
[0196] The quantity of non-real-time messages extracted in the to-be-processed queue in the time period can be less than or equal to the reduced extraction quantity, etc.
[0197] In step S202, the processing resource is invoked to process the extracted non-real-time messages in the time period.
[0198] In an embodiment of the present application, the shadow message corresponding to the real-time message is not cached in the to-be-processed queue, and all the messages cached in the to-be-processed queue are non-real-time messages. The electronic device can extract the reduced number of messages from the to-be-processed queue, and the reduced number of messages are all non-real-time messages. The processing resource can be invoked for the reduced number of non-real-time messages to process the reduced number of non-real-time messages.
[0199] In another embodiment of the present application, the shadow message corresponding to the real-time message is cached in the to-be-processed queue. The electronic device can extract the original number of messages from the to-be-processed queue, and the original number of messages includes the shadow message. The processing resource can not be invoked for the shadow message, and the shadow message can not be processed. The shadow message can be directly discarded, and it is marked that the shadow message has been processed (for example, sent) in the to-be-processed queue.
[0200] The messages in the original number of messages except the shadow message can be non-real-time messages (for example, the reduced number of non-real-time messages), and the processing resource can be invoked to process the non-real-time messages.
[0201] For example, when the non-real-time messages are extracted from the to-be-processed queue according to the reduced number in the time period, the messages can be obtained from the to-be-processed queue according to the original number in the time period. For example, the original number of messages are obtained from the to-be-processed queue in the time period, and the obtained messages include the reduced number of non-real-time messages and the shadow message corresponding to the real-time message. The original number includes the original threshold number of messages extracted from the to-be-processed queue in the time period, and then the reduced number of non-real-time messages are screened from the obtained messages.
[0202] In an embodiment, the to-be-processed queue includes a plurality of queue groups, and the plurality of queue groups have a priority order. The shadow message is located in the highest priority queue group in the plurality of queue groups.
[0203] In this way, when the messages are obtained from the to-be-processed queue according to the original number in the time period, the messages can be obtained from the plurality of queue groups according to the original number and in the order of the priority of the plurality of queue groups from high to low in the time period. For example, the original number of messages are obtained from the plurality of queue groups in the order of the priority of the plurality of queue groups from high to low.
[0204] In addition, the shadow message can not be processed, and it is marked that the shadow message has been processed.
[0205] In addition, the non-real-time messages are located in the queue groups with the lowest priority among the plurality of queue groups. In this way, when the non-real-time messages with the reduced extraction quantity are filtered from the obtained messages, the messages obtained from the queue groups with the lowest priority among the plurality of queue groups can be filtered from the obtained messages.
[0206] For example, in the case of any of the scheduling nodes shown in FIG. 1, in an embodiment of the present application, the shadow message corresponding to the real-time message is not cached in the to-be-processed queue, and the non-real-time messages are cached in the to-be-processed queue. In this case, the scheduling node can extract the messages with the reduced extraction quantity from the to-be-processed queue, and the messages with the reduced extraction quantity are all non-real-time messages. The communication resource can be called for the non-real-time messages with the reduced extraction quantity, so as to forward the non-real-time messages with the reduced extraction quantity to the downstream user equipment. Figure 1
[0207] In another embodiment of the present application, the shadow message corresponding to the real-time message is cached in the to-be-processed queue. In this case, the scheduling node can extract the messages with the original extraction quantity from the to-be-processed queue, and the messages with the original extraction quantity include the shadow message. For the shadow message in the messages with the original extraction quantity, the communication resource can not be called for the shadow message, so as not to forward the shadow message to the downstream user equipment. The shadow message can be directly discarded, and it is marked that the shadow message has been processed (for example, sent) in the to-be-processed queue.
[0208] The messages other than the shadow message in the messages with the original extraction quantity can be non-real-time messages (for example, the non-real-time messages with the reduced extraction quantity), and the communication resource can be called to forward the non-real-time messages to the downstream user equipment.
[0209] In addition, the shadow message can not be forwarded to the downstream user equipment, and it is marked that the shadow message has been processed.
[0210] In addition, the non-real-time messages are located in the queue groups with the lowest priority among the plurality of queue groups. In this way, when the non-real-time messages with the reduced extraction quantity are filtered from the obtained messages, the messages obtained from the queue groups with the lowest priority among the plurality of queue groups can be filtered from the obtained messages.
[0211] The original extraction quantity includes: the maximum quantity of messages that can be extracted in the time period in the to-be-processed queue (that is, the original maximum quantity of messages that can be extracted in the to-be-processed queue in the time period before the maximum quantity of non-real-time messages that can be extracted in the to-be-processed queue in the time period is reduced).
[0212] The time period can include a time length, for example, time can be divided into a plurality of continuous time periods, each time period has a time length, and the time lengths of the time periods can be the same, etc. The time length of the time period can include 1 second, 2 seconds, or 3 seconds, etc. The specific time length can be determined according to actual conditions, and the application does not limit this.
[0213] The non-real-time message is a message received before and buffered in the to-be-processed queue, and the non-real-time message has not been processed. For example, the non-real-time message is a message received before and buffered in the to-be-processed queue, and the non-real-time message has not been sent to the corresponding downstream user equipment.
[0214] The non-real-time message can be buffered in the to-be-processed queue within the time period, or can be buffered in the to-be-processed queue before the time period.
[0215] If the non-real-time message is buffered in the to-be-processed queue within the time period, the buffering time when the non-real-time message is buffered in the to-be-processed queue within the time period is earlier than the extracting time when the number of messages extracted from the to-be-processed queue within the time period is less than or equal to the original extraction number.
[0216] In addition, the buffering time when the shadow message is buffered in the to-be-processed queue within the time period is earlier than the extracting time when the number of messages extracted from the to-be-processed queue within the time period is less than or equal to the original extraction number.
[0217] The real-time message is a message received before and processed by calling a processing resource, and the non-real-time message has not been processed. For example, the real-time message includes a message received from the upstream manufacturer equipment within the time period and forwarded to the downstream user equipment by calling the communication resource, that is, the real-time message is not buffered in the to-be-processed queue, but has been forwarded to the downstream user equipment.
[0218] The shadow message corresponding to the real-time message is a different message from the real-time message, and the two can be in a binding relationship. The real-time message is a message that needs to be forwarded to the downstream user equipment and has been forwarded to the downstream user equipment, and the shadow message corresponding to the real-time message can occupy a place in the to-be-processed queue, and is not forwarded to the downstream user equipment.
[0219] The to-be-processed queue includes one to-be-processed queue in a logical queue corresponding to a processing resource for processing a real-time message corresponding to a shadow message in a plurality of processing resources. For example, the to-be-processed queue includes one to-be-processed queue in a logical queue corresponding to a communication resource for forwarding a real-time message corresponding to a shadow message in a plurality of communication resources.
[0220] In the present application, the processing resources include multiple, each of which corresponds to a different logical queue, and one logical queue can include multiple to-be-processed queues. Wherein, one logical queue corresponding to one processing resource can be understood as: the one processing resource is used to process the messages in each to-be-processed queue in the one logical queue.
[0221] For example, the communication resources include multiple, each of which corresponds to a different logical queue, and one logical queue can include multiple to-be-processed queues. Wherein, one logical queue corresponding to one communication resource can be understood as: the one communication resource is used to forward the messages in each to-be-processed queue in the one logical queue.
[0222] The multiple scheduling nodes constitute a distributed scheduling system.
[0223] The scheduling nodes can include physical machines or virtual machines, etc.
[0224] For example, the to-be-processed queues in the logical queue corresponding to each communication resource can be scattered in multiple scheduling nodes, for example, the multiple to-be-processed queues included in one logical queue can be located in different scheduling nodes. In this way, each scheduling node has multiple to-be-processed queues, and different to-be-processed queues in the same scheduling node can correspond to different logical queues, that is, different communication resources. The messages in one to-be-processed queue can be forwarded by the communication resource corresponding to the logical queue to which the to-be-processed queue belongs. The communication resource can be provided by a downstream supplier of the message processing platform and can be called by the message processing platform to forward messages. The downstream supplier can include the existing communication operators on the market, etc. The downstream supplier can provide message forwarding services based on the communication resources. The downstream supplier includes communication suppliers, etc.
[0225] The communication resources include TCP (Transmission Control Protocol) connections or UDP (User Datagram Protocol) connections, etc.
[0226] The connection can include the connection between the gateway in the message processing platform and the device of the downstream supplier, etc.
[0227] Alternatively, the communication resources can also include the provided HSF (High-speed Service Framework) services, etc.
[0228] After the decision node receives a message sent by the upstream vendor device and the resource identifier of the communication resource decided by the decision node for forwarding the message, the decision node can send the message sent by the upstream vendor device and the resource identifier of the communication resource decided by the decision node for forwarding the message to the scheduling node only if one of the to-be-processed queues in the logical queue corresponding to the communication resource is located in the scheduling node.
[0229] Thus, for the scheduling node, if the decision node sends the message sent by the upstream vendor device and the resource identifier of the communication resource decided by the decision node for forwarding the message to the scheduling node, one of the to-be-processed queues in the logical queue corresponding to the communication resource is located in the scheduling node.
[0230] In this way, the scheduling node has the ability and qualification to cache the message in one of the to-be-processed queues in the logical queue corresponding to the communication resource located in the scheduling node, and also has the ability and qualification to invoke the communication resource according to the resource identifier to forward the message to the downstream user device.
[0231] The resource identifiers of different communication resources are different, and the resource identifier of a communication resource can include an identity document (Identity Document, ID) of the communication resource, etc.
[0232] For example, in the case of a TCP connection or a UDP connection as the communication resource, the resource identifier of the communication resource can be a port number of the TCP connection or a port number of the UDP connection, etc.
[0233] In the present application, in the case of receiving a message in a time period, it is determined whether the message is a real-time message, and the real-time message includes a message that needs to be processed in real time; in the case of the message being a real-time message, a processing resource is invoked to process the real-time message in real time, and the extraction quantity is reduced according to the real-time message, and the extraction quantity includes a threshold quantity of non-real-time messages extracted in the to-be-processed queue in the time period, and the non-real-time message includes a received and unprocessed message. In this way, it is supported that the non-real-time messages can be extracted in the to-be-processed queue according to the reduced extraction quantity in the time period; the processing resource is invoked to process the extracted non-real-time messages in the time period. Through the present application, the quantity of messages actually processed by the processing resource in the time period can be less than or equal to the maximum processing quantity of messages that can be processed by the processing resource in the time period, which can avoid causing the processing resource to fail, or avoid causing a part of the non-real-time messages exceeding the maximum processing quantity to be discarded by the processing resource and unable to be successfully processed, for example, to avoid being discarded by the processing resource and unable to reach the downstream user device.
[0234] It should be noted that, for the method embodiments, the sequences of the actions do not necessarily require to be executed in a strict order, and some of the actions can be executed in other order or at the same time with the other actions, or be executed in parallel to other actions. Furthermore, the embodiments described in the specification are only exemplary and the involved actions are not necessarily required by the present application.
[0235] Referring to Figure 4 , a structural block diagram of a message processing apparatus of the present application is shown, the apparatus comprising:
[0236] a determining module 11, configured to determine whether a message is a real-time message if the message is received within a time period, the real-time message comprising a message that needs to be processed in real time;
[0237] a first processing module 12, configured to invoke a processing resource to process the real-time message in real time if the message is a real-time message, and a reducing module 13, configured to reduce an extraction quantity according to the real-time message, the extraction quantity comprising a threshold quantity of non-real-time messages to be extracted in a to-be-processed queue within the time period, the non-real-time message comprising a received and unprocessed message.
[0238] In an optional implementation, the reducing module comprises:
[0239] an obtaining unit, configured to obtain a recorded extraction quantity;
[0240] a calculating unit, configured to calculate a difference between the recorded extraction quantity and a quantity of the real-time messages to obtain a new extraction quantity;
[0241] a replacing unit, configured to replace the recorded extraction quantity with the new extraction quantity.
[0242] In an optional implementation, the reducing module comprises:
[0243] a generating unit, configured to generate a shadow message corresponding to the real-time message;
[0244] a caching unit, configured to cache the shadow message corresponding to the real-time message in the to-be-processed queue.
[0245] In an optional implementation, the to-be-processed queue comprises a plurality of queue groups, and the plurality of queue groups have a priority order;
[0246] the caching unit comprises:
[0247] The cache sub-unit is configured to cache a shadow message corresponding to the real-time message in a queue group with the highest priority in the plurality of queue groups.
[0248] In an optional implementation, the device further includes:
[0249] The cache module is configured to cache the non-real-time message in a queue group with a non-highest priority in the plurality of queue groups in a case where the message is a non-real-time message.
[0250] In the present application, in a case where a message is received within a time period, it is determined whether the message is a real-time message, the real-time message including a message that needs to be processed in real time; in a case where the message is a real-time message, a processing resource is invoked to process the real-time message in real time, and the extraction quantity is reduced according to the real-time message, the extraction quantity including a threshold quantity of non-real-time messages extracted from a to-be-processed queue within the time period, the non-real-time message including a received and unprocessed message. In this way, it is supported that the non-real-time messages can be extracted from the to-be-processed queue according to the reduced extraction quantity within the time period; the processing resource is invoked to process the extracted non-real-time messages within the time period. Through the present application, the quantity of messages actually processed by the processing resource within the time period can be less than or equal to the maximum processing quantity of messages that can be processed by the processing resource within the time period, which can avoid causing the processing resource to fail, or avoid causing a part of the non-real-time messages exceeding the maximum processing quantity to be discarded by the processing resource and unable to be successfully processed, for example, to avoid being discarded by the processing resource and unable to reach a downstream user equipment.
[0251] Reference Figure 5 , a structural block diagram of a message processing device of the present application is shown, the device includes:
[0252] The extraction module 21 is configured to extract non-real-time messages from a to-be-processed queue according to a reduced extraction quantity within a time period;
[0253] The second processing module 22 is configured to invoke a processing resource to process the extracted non-real-time messages within the time period;
[0254] The reduced extraction quantity is obtained by reducing the extraction quantity according to the quantity of real-time messages received within the time period, the extraction quantity including a threshold quantity of non-real-time messages extracted from a to-be-processed queue within the time period; the real-time message includes a message that needs to be processed in real time and has been invoked to be processed in real time by the processing resource, and the non-real-time message includes a received and unprocessed message.
[0255] In an optional implementation, the to-be-processed queue caches a shadow message corresponding to the real-time message;
[0256] The extraction module comprises:
[0257] an acquisition unit, configured to acquire messages in a to-be-processed queue according to an original extraction quantity within a time period; the acquired messages comprise non-real-time messages of the reduced extraction quantity and shadow messages corresponding to the real-time messages; wherein the original extraction quantity comprises an original threshold quantity of messages to be extracted in the to-be-processed queue within the time period;
[0258] a screening unit, configured to screen the non-real-time messages of the reduced extraction quantity from the acquired messages.
[0259] In an optional implementation, the to-be-processed queue comprises a plurality of queue groups, and the plurality of queue groups have a priority order; the shadow messages are located in a queue group with the highest priority in the plurality of queue groups.
[0260] The acquisition unit comprises:
[0261] an acquisition subunit, configured to acquire messages in the plurality of queue groups according to the original extraction quantity and in a priority order from high to low of the plurality of queue groups within the time period.
[0262] In an optional implementation, the non-real-time messages are located in a queue group with a non-highest priority in the plurality of queue groups.
[0263] The screening unit comprises:
[0264] a screening subunit, configured to screen the messages acquired from the queue group with the non-highest priority in the plurality of queue groups from the acquired messages.
[0265] In an optional implementation, the extraction module further comprises:
[0266] a marking unit, configured to not process the shadow messages and mark that the shadow messages have been processed.
[0267] In the present application, in the case that a message is received in a time period, it is determined whether the message is a real-time message, the real-time message including a message that needs to be processed in real time; in the case that the message is a real-time message, a processing resource is invoked to process the real-time message in real time, and the extraction quantity is reduced according to the real-time message, the extraction quantity including a threshold quantity of non-real-time messages extracted in the time period from a to-be-processed queue, the non-real-time message including a received and unprocessed message. In this way, it is supported that the non-real-time messages can be extracted in the to-be-processed queue according to the reduced extraction quantity in the time period, and the extracted non-real-time messages are processed by invoking the processing resource in the time period. Through the present application, the quantity of messages actually processed by the processing resource in the time period can be less than or equal to the maximum processing quantity of messages that can be processed by the processing resource in the time period, and it is avoided that the processing resource is caused to fail, or it is avoided that a part of the non-real-time messages exceeding the maximum processing quantity are discarded by the processing resource and cannot be successfully processed, for example, it is avoided that the non-real-time messages are discarded by the processing resource and cannot reach a downstream user equipment.
[0268] The embodiments of the present application further provide a non-volatile readable storage medium, the storage medium storing one or more programs, and the one or more programs, when applied to a device, can make the device execute instructions of steps of the methods in the embodiments of the present application.
[0269] The embodiments of the present application provide one or more machine readable media storing instructions, when executed by one or more processors, make an electronic device execute the method of one or more of the above embodiments. In the embodiments of the present application, the electronic device includes a server, a gateway, a sub-device, and the like, and the sub-device is an Internet of Things device and the like.
[0270] The embodiments of the present disclosure can be implemented as an apparatus configured as desired using any appropriate hardware, firmware, software, or any combination thereof, which can include a server (cluster), a terminal device such as an IoT device, and the like, and an electronic device.
[0271] Figure 6 An exemplary apparatus 1300 that can be used to implement various embodiments in the present application is schematically shown.
[0272] For one embodiment, Figure 6An example apparatus 1300 is shown having one or more processors 1302, a control module (chipset) 1304 coupled to at least one of the processor(s) 1302, a memory 1306 coupled to the control module 1304, a non-volatile memory (NVM) / storage device 1308 coupled to the control module 1304, one or more input / output devices 1310 coupled to the control module 1304, and a network interface 1312 coupled to the control module 1304.
[0273] The processor(s) 1302 can include one or more single core or multi core processors, which can include any combination of general-purpose processors or dedicated processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the apparatus 1300 can be capable of acting as a server device, such as a gateway, in embodiments of the present application.
[0274] In some embodiments, the apparatus 1300 can include one or more computer readable medium (such as the memory 1306 or the NVM / storage device 1308) having instructions 1314 and one or more processors 1302 incorporated with the one or more computer readable medium configured to execute the instructions 1314 to implement modules to perform the actions in the present disclosure.
[0275] For one embodiment, the control module 1304 can include any suitable interface controllers appropriate for communicating with at least one of the processor(s) 1302 and / or any suitable devices or components in communication with the control module 1304.
[0276] The control module 1304 can include a memory controller module to provide an interface to the memory 1306. The memory controller module can be a hardware module, a software module, and / or a firmware module.
[0277] The memory 1306 can be used to, for example, load and store data and / or instructions 1314 for the apparatus 1300. For one embodiment, the memory 1306 can include any suitable volatile memory, such as suitable DRAM. In some embodiments, the memory 1306 can include double data rate fourth generation synchronous dynamic random access memory (DDR4 SDRAM).
[0278] For one embodiment, the control module 1304 can include one or more input / output controllers to provide an interface to the NVM / storage device 1308 and the input / output device(s) 1310.
[0279] For example, NVM / storage 1308 can be used to store data and / or instructions 1314. NVM / storage 1308 can include any suitable non-volatile memory (e.g., flash memory) and / or can include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).
[0280] NVM / storage 1308 can include storage resources that are physically part of the device on which the apparatus 1300 is installed or that is accessed remotely and / or via a network, as described herein. For example, NVM / storage 1308 can be accessed via input / output device(s) 1310 through a network.
[0281] Input / output device(s) 1310 can provide an interface between apparatus 1300 and any suitable device for the receipt, processing, and / or transmission of data by apparatus 1300. Input / output device(s) 1310 can include communication components, pinyin components, sensor components, and / or the like. Network interface 1312 can provide an interface between apparatus 1300 and one or more networks, by which apparatus 1300 can communicate with one or more components of a wireless network, such as an access point of a wireless network based on any of one or more wireless network standards and / or protocols, such as WiFi, 2G, 3G, 4G, 5G, and / or the like, or combinations thereof.
[0282] For one embodiment, at least one of processor(s) 1302 can be packaged together with logic of one or more controllers of control module 1304 (e.g., a memory controller module). For one embodiment, at least one of processor(s) 1302 can be packaged together with logic of one or more controllers of control module 1304 to form a system in a package (SiP). For one embodiment, at least one of processor(s) 1302 can be integrated on the same die with logic of one or more controllers of control module 1304. For one embodiment, at least one of processor(s) 1302 can be integrated on the same die with logic of one or more controllers of control module 1304 to form a system on a chip (SoC).
[0283] In various embodiments, the apparatus 1300 can be, but is not limited to, a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet, a netbook, etc.) In various embodiments, the apparatus 1300 can have more or fewer components, and / or different architectures. For example, in some embodiments, the apparatus 1300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including touch screen displays), a non- volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0284] An electronic device includes one or more processors and one or more machine-readable media having instructions stored thereon that, when executed by the one or more processors, cause the electronic device to perform one or more of the methods described herein.
[0285] For apparatus embodiments, because they are substantially similar to the method embodiments, the description is relatively simple, and the relevant parts are described in the method embodiment.
[0286] Each of the embodiments in the specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts of each embodiment can be referred to each other.
[0287] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams according to the methods, terminal devices (systems), and computer program products of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable information processing terminal devices to produce a machine, so that the instructions executed by the computer or other programmable information processing terminal devices generate a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one block or multiple blocks.
[0288] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable information processing terminal devices to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction devices that implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one block or multiple blocks.
[0289] These computer program instructions can also be loaded into a computer or other programmable information processing terminal device, so that a series of operational steps are performed on the computer or other programmable terminal device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide a process for implementing the functions specified in the flowchart Figure 1 one flow or multiple flows and / or the functions specified in the block Figure 1 one block or multiple blocks.
[0290] Although the preferred embodiments of the present application have been described, those skilled in the art who understand the basic inventive concept can make additional changes and modifications to the embodiments once they get the concept. Therefore, the appended claims are intended to cover the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.
[0291] Finally, it should also be noted that, in this document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or terminal device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or terminal device including the element.
[0292] The above provides a message processing method and device, and the principles and implementation manners of the present application are described by specific examples. The above description of the embodiments is only used to help understand the method and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range can be changed, and the content of the specification should not be understood as a limitation of the present application.
Claims
1. A message processing method characterized by, The method comprises: In the case that a message is received within a time period, determining whether the message is a real-time message, the real-time message including a message that needs to be processed in real time; In the case that the message is a real-time message, invoking a processing resource to process the real-time message in real time, and reducing the extraction quantity according to the real-time message, the extraction quantity including a threshold quantity of non-real-time messages to be extracted in a to-be-processed queue within the time period, the non-real-time messages including received and unprocessed messages; The reduction of the extraction quantity according to the real-time message comprises: generating a shadow message corresponding to the real-time message; and caching the shadow message corresponding to the real-time message in the to-be-processed queue; the shadow message is used for occupying a place in the to-be-processed queue, and a communication resource is not invoked for the shadow message.
2. The method of claim 1, wherein, The reduction of the extraction quantity according to the real-time message comprises: Obtaining a recorded extraction quantity; Calculating a difference between the recorded extraction quantity and a quantity of the real-time messages to obtain a new extraction quantity; Replacing the recorded extraction quantity with the new extraction quantity.
3. The method of claim 1, wherein, The to-be-processed queue comprises a plurality of queue groups, and the plurality of queue groups have a priority order; The caching of the shadow message corresponding to the real-time message in the to-be-processed queue comprises: Caching the shadow message corresponding to the real-time message in a queue group with the highest priority in the plurality of queue groups.
4. The method of claim 3, wherein, The method further comprises: In the case that the message is a non-real-time message, caching the non-real-time message in a queue group with a non-highest priority in the plurality of queue groups.
5. A message processing method characterized by, The method comprises: Extracting non-real-time messages in a to-be-processed queue according to a reduced extraction quantity within a time period; Invoking a processing resource to process the extracted non-real-time messages within the time period; The reduced extraction quantity is obtained by reducing an extraction quantity according to a quantity of real-time messages received within the time period, the extraction quantity including a threshold quantity of non-real-time messages to be extracted in the to-be-processed queue within the time period; the real-time messages include messages that need to be processed in real time and have been invoked to be processed in real time by the processing resource, and the non-real-time messages include received and unprocessed messages; The to-be-processed queue caches a shadow message corresponding to the real-time message; and the extracting of the non-real-time messages in the to-be-processed queue according to the reduced extraction quantity within the time period comprises: obtaining messages in the to-be-processed queue according to an original extraction quantity within the time period; the obtained messages include the non-real-time messages of the reduced extraction quantity and the shadow message corresponding to the real-time message; the original extraction quantity includes an original threshold quantity of messages to be extracted in the to-be-processed queue within the time period; and the non-real-time messages of the reduced extraction quantity are screened from the obtained messages.
6. The method of claim 5, wherein, The to-be-processed queue comprises a plurality of queue groups, and the plurality of queue groups have a priority order; and the shadow message is located in a queue group with the highest priority in the plurality of queue groups. The message is obtained in the to-be-processed queue according to the original extraction quantity within the time period, and the method comprises the following steps: Within the time period, the message is obtained from the plurality of queue groups according to the original extraction quantity and the order from high to low of the priority of the plurality of queue groups.
7. The method of claim 6, wherein, The non-real-time message is located in a queue group with the lowest priority in the plurality of queue groups; The non-real-time message with the reduced extraction quantity is screened from the obtained message, and the method comprises the following steps: The message obtained from the queue group with the lowest priority in the plurality of queue groups is screened from the obtained message.
8. The method according to any one of claims 5-7, characterized in that, The method further comprises the following steps: The shadow message is not processed, and it is marked that the shadow message has been processed.
9. A message processing device, characterized by The device comprises: A determination module is configured to determine whether the message is a real-time message when the message is received within a time period, wherein the real-time message comprises a message that needs to be processed in real time; A first processing module is configured to call a processing resource to process the real-time message in real time when the message is a real-time message, and a reduction module is configured to reduce the extraction quantity according to the real-time message, wherein the extraction quantity comprises a threshold quantity of non-real-time messages that are extracted in a to-be-processed queue within the time period, and the non-real-time message comprises a received and unprocessed message; the reduction of the extraction quantity according to the real-time message comprises: generating a shadow message corresponding to the real-time message; and caching the shadow message corresponding to the real-time message in the to-be-processed queue; the shadow message is used to occupy a position in the to-be-processed queue, and a communication resource is not called for the shadow message.
10. A message processing device, characterized by The device comprises: An extraction module is configured to extract a non-real-time message in a to-be-processed queue according to a reduced extraction quantity within a time period; A second processing module is configured to call a processing resource to process the extracted non-real-time message within the time period; The reduced extraction quantity is obtained by reducing the extraction quantity according to a quantity of real-time messages received within the time period, and the extraction quantity comprises a threshold quantity of non-real-time messages that are extracted in a to-be-processed queue within the time period; the real-time message comprises a message that needs to be processed in real time and has been called to be processed in real time by the processing resource, and the non-real-time message comprises a received and unprocessed message; the shadow message corresponding to the real-time message is cached in the to-be-processed queue; the extraction of the non-real-time message in the to-be-processed queue according to the reduced extraction quantity within the time period comprises: obtaining a message in the to-be-processed queue according to an original extraction quantity within a time period; the obtained message comprises a non-real-time message with the reduced extraction quantity and the shadow message corresponding to the real-time message; wherein the original extraction quantity comprises an original threshold quantity of messages that are extracted in the to-be-processed queue within the time period; and the non-real-time message with the reduced extraction quantity is screened from the obtained message.
11. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes a program to implement the steps of the method of any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, A computer program is stored on a computer-readable storage medium, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for processing service requests
CN102904914A
Batch data processing method and device, computer equipment and storage medium
CN110297711A
Wireless Priority Service within a Distributed Call Processing Architecture
US20120033801A1