Message processing method, equipment and device
Through the combination of multi-level queue technology and message distributor and message confirmer, the challenge of computer room management system processing a large number of messages is solved, efficient and sequential message processing and rational utilization of system resources are achieved, and data storms and waste of system resources that may occur in the data center are avoided.
Patent Information
- Application Number
- CN202510258751.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-13
AI Technical Summary
With the increase of data centers and the refinement of monitoring points of building equipment management systems, the data volume of messages or data that the computer room management system needs to process has become very huge. How to process messages or data in a timely and correctly becomes a challenge. At the same time, how to reasonably use system resources is also a problem that needs to be solved according to the size of the data center.
Using multi-level queue technology, messages are distributed to the corresponding consumer end through the first message distributor, and the second message distributor distributes messages to the second message queue, and the corresponding consumers process these messages. The message confirmer is used to confirm the processing status of the message and dynamically adjust the number of consumer and secondary message queues to adapt to the change in the message data volume.
Real-time, sequence and correctness of large-scale data is achieved, the efficiency of message processing is improved, system resources is rationally utilized, data storms and other problems are avoided, and the risk of global functions being unavailable is reduced.
Smart Images

Figure CN120144335A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and more particularly, to a message processing method, device, and apparatus. Background Art
[0002] Data center infrastructure refers to the physical devices involved in a data center, including, for example, an uninterruptible power supply (UPS) and a transfer switch involved in a power supply system, a precision air conditioner and a fresh air system involved in a refrigeration system, etc. A building management system (BMS) can collect messages or data of the data center infrastructure through an industrial control protocol and publish the collected messages or data through an interface. A data center infrastructure management (DCIM) system can subscribe to messages or data from the building management system, process the messages or data, and present the messages or data or processing results to a user. However, with the increase in the number of data centers and the refinement of the monitoring points of the building management system, the scale of the amount of messages or data that the DCIM system needs to process has become extremely large. Therefore, how to process messages or data in a timely and correct manner is a challenge that the DCIM system needs to solve. At the same time, according to the different scales of data centers, how to reasonably use system resources is also a problem that needs to be solved. Summary of the Invention
[0003] One object of the present disclosure is to provide a message processing method, device, and apparatus.
[0004] According to a first aspect of the present disclosure, there is provided a message processing method, including:
[0005] A first message dispatcher distributes messages from a first-level message queue to a corresponding consumer end in a consumer group corresponding to the first-level message queue. Among them, one or more first-level message queues are set for one or more source systems in a one-to-one correspondence. Messages from a source system are sequentially added to a first-level message queue corresponding to the source system, and messages from the same measurement point in the same source system are distributed to the same consumer end;
[0006] Inside the consumer end, a second message dispatcher distributes messages to corresponding second-level message queues. Among them, messages from the same measurement point in the same source system are distributed to the same second-level message queue; and
[0007] A consumer corresponding to the second-level message queue sequentially processes messages in the second-level message queue. Among them, one or more consumers are set for one or more second-level message queues in a one-to-one correspondence.
[0008] In some embodiments, the message processing method further includes:
[0009] When a consumer processes a message in a secondary message queue corresponding to the consumer, a message identifier of the processed message is obtained by a message confirmator, and the message identifier and a status identifier of the message are stored in a sequential queue, where the message identifier is configured to uniquely indicate the message, the status identifier is configured to indicate a processing status of the message, and when the consumer processes the message, the status identifier of the message indicates a consuming status; and
[0010] When the consumer finishes processing the message, the message confirmator updates the status identifier of the message to indicate a consumed status.
[0011] In some embodiments, the message processing method further includes:
[0012] The message confirmator reads the message identifier and the status identifier of the message from the sequential queue at every first preset time interval until a target message whose status identifier indicates a consuming status is first read during the current reading process; and
[0013] The message confirmator confirms that all messages before the target message in the sequential queue are in a consumed status, deletes the message identifier and the status identifier of the messages confirmed to be in the consumed status in the sequential queue, and feeds back a confirmation result to a corresponding primary message queue.
[0014] In some embodiments, the message processing method further includes:
[0015] At every second preset time interval, the message identifier of the target message read by the message confirmator is obtained;
[0016] When the same message identifier is continuously obtained for a preset number of times, or when the message identifiers of the target messages obtained within a preset duration remain unchanged, it is determined that the target message is a message with abnormal consumption;
[0017] The message identifier and the status identifier of the message with abnormal consumption are deleted from the sequential queue.
[0018] In some embodiments, that a consumer corresponding to a secondary message queue sequentially processes messages in the secondary message queue includes:
[0019] The consumer transmits a message processing result to a target system.
[0020] In some embodiments, the source system includes a building management system BMS; and / or
[0021] The target system includes a data center infrastructure management system DCIM.
[0022] In some embodiments, the number of consumer ends can be dynamically adjusted according to the data volume of messages; and / or
[0023] The number of secondary message queues can be dynamically adjusted according to the data volume of messages.
[0024] In some embodiments, messages from the source system are added to a primary message queue corresponding to the source system in an append mode.
[0025] In some embodiments, the message identifier is configured to uniquely indicate a message, the measurement point identifier is configured to indicate the measurement point that generates the message, and the message identifier and the measurement point identifier increase as the time for generating the message increases;
[0026] The first message dispatcher distributes the messages from the primary message queue to a corresponding consumer end in the consumer group corresponding to the primary message queue, including:
[0027] Calculating a first modulo operation result between the measurement point identifier of the message and the number of consumer ends in the corresponding consumer group; and
[0028] Distributing the message to a corresponding consumer end determined according to the first modulo operation result, wherein messages with the same first modulo operation result are distributed to the same consumer end, and messages with different first modulo operation results are distributed to different consumer ends.
[0029] In some embodiments, the message identifier is configured to uniquely indicate a message, the measurement point identifier is configured to indicate the measurement point that generates the message, and the message identifier and the measurement point identifier increase as the time for generating the message increases;
[0030] Inside the consumer end, the second message dispatcher distributes the message to the corresponding secondary message queue, including:
[0031] Calculating a second modulo operation result between the measurement point identifier of the message and the number of secondary message queues inside the corresponding consumer end; and
[0032] Distributing the message to a corresponding secondary message queue determined according to the second modulo operation result, wherein messages with the same second modulo operation result are distributed to the same secondary message queue, and messages with different second modulo operation results are distributed to different secondary message queues.
[0033] According to a second aspect of the present disclosure, there is provided a message processing device, including a first message dispatcher, a second message dispatcher, and consumers, wherein one or more consumers form a consumer end, and one or more consumer ends form a consumer group;
[0034] The first message dispatcher is configured to distribute messages from a first-level message queue to a corresponding consumer in a consumer group corresponding to the first-level message queue. One or more first-level message queues are set up for one or more source systems respectively. Messages from the source systems are sequentially added to a first-level message queue corresponding to the source system, and messages from the same measurement point in the same source system are distributed to the same consumer.
[0035] The second message dispatcher is configured to distribute messages to corresponding second-level message queues inside the consumer. Messages from the same measurement point in the same source system are distributed to the same second-level message queue; and
[0036] A consumer corresponding to the second-level message queue is configured to process messages in the second-level message queue sequentially. One or more consumers are set up for one or more second-level message queues respectively.
[0037] According to a third aspect of the present disclosure, there is provided a message processing device, including a processor and a memory. Instructions are stored on the memory, and when the instructions are executed by the processor, the operations of the message processing method as described above are implemented.
[0038] According to a fourth aspect of the present disclosure, there is provided a data center system, including:
[0039] A source system;
[0040] A target system; and
[0041] The message processing device or the message processing apparatus as described above.
[0042] According to a fifth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium. Instructions are stored on the non-transitory computer-readable storage medium, and when the instructions are executed by a processor, the operations of the message processing method as described above are implemented.
[0043] According to a sixth aspect of the present disclosure, there is provided a computer program product, including instructions, and when the instructions are executed by a processor, the operations of the message processing method as described above are implemented.
[0044] Through the following detailed description of the exemplary embodiments of the present disclosure with reference to the accompanying drawings, other features and advantages of the present disclosure will become clearer. Description of the Drawings
[0045] The drawings forming a part of the specification depict embodiments of the present disclosure and, together with the specification, are used to explain the principles of the present disclosure.
[0046] Referring to the accompanying drawings, the present disclosure can be more clearly understood according to the following detailed description, where:
[0047] Figure 1 FIG. shows a schematic diagram of a data center system according to an exemplary embodiment of the present disclosure;
[0048] Figure 2 FIG. shows a schematic diagram of at least a part of the process of a message processing method according to an exemplary embodiment of the present disclosure;
[0049] Figure 3 FIG. shows a schematic diagram of a part of the process of a message processing method according to an exemplary embodiment of the present disclosure;
[0050] Figure 4 FIG. shows a schematic diagram of a part of the process of a message processing method according to an exemplary embodiment of the present disclosure;
[0051] Figure 5 FIG. shows a schematic diagram of a message processing apparatus according to an exemplary embodiment of the present disclosure.
[0052] Note that in the embodiments described below, sometimes the same reference numerals are used commonly between different drawings to denote the same parts or parts having the same functions, and their repeated descriptions are omitted. In this specification, similar reference numerals and letters are used to denote similar items. Therefore, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0053] For ease of understanding, the positions, sizes, ranges, etc. of the various structures shown in the drawings and the like sometimes do not represent the actual positions, sizes, ranges, etc. Therefore, the disclosed invention is not limited to the positions, sizes, ranges, etc. disclosed in the drawings and the like. In addition, the drawings do not have to be drawn to scale, and some features may be enlarged to show the details of specific components. Detailed Embodiments
[0054] The following will refer to the accompanying drawings to describe various exemplary embodiments of the present disclosure in detail. It should be noted that: unless otherwise specifically stated, the relative arrangements, numerical expressions, and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.
[0055] The following description of at least one exemplary embodiment is actually merely illustrative and in no way restricts the present disclosure and its application or use. That is, the structures and methods herein are shown in an exemplary manner to illustrate different embodiments of the structures and methods in the present disclosure. However, those skilled in the art will understand that they merely illustrate the exemplary ways in which the present disclosure can be implemented, rather than exhaustive ways. In addition, the drawings do not have to be drawn to scale, and some features may be enlarged to show the details of specific components.
[0056] In addition, technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but in appropriate cases, the said technologies, methods, and devices should be regarded as part of the specification.
[0057] In all the examples shown and discussed here, any specific values should be construed as merely exemplary and not as a limitation. Thus, other examples of the exemplary embodiments may have different values.
[0058] The present disclosure provides a message processing method, a message processing device, and a data center system capable of efficiently and sequentially processing messages related to a data center in a single data center or multi - data center environment. In an exemplary embodiment of the present disclosure, as Figure 1 shown, a data center system may include a source system 110 such as a building management system (BMS), a message processing device 120, and a target system 130 such as a data center infrastructure management (DCIM) system. In Figure 1 a specific embodiment, two source systems 110 (i.e., BMS1 and BMS2) and one target system 130 (i.e., DCIM) are shown. However, it can be understood that in other specific embodiments, the data center system may include more or fewer source systems 110 or target systems 130, which are not limited herein. Among them, a target system 130 can obtain data generated based on messages or data from one or more source systems 110. For each source system 110, a corresponding message processing device 120 can be provided to process the messages or data from the source system 110 and provide them to the corresponding target system 130. It can be understood that, as needed, the source system 110 or the target system 130 can be other types of systems, and are not limited to the BMS and DCIM shown in this article.
[0059] As Figure 1 shown, the message processing device 120 may include a first message dispatcher 121, a second message dispatcher 122, and a consumer 123. Among them, one or more consumers 123 can form a consumer side ( Figure 1 two consumer sides are shown in the figure, i.e., consumer side 1 and consumer side 2), and one or more consumer sides can form a consumer group. By setting multiple consumer sides, efficient processing of messages can be ensured. In the following, taking the processing process of messages related to a source system 110 (e.g., BMS1) in a data center system as an example, the message processing method of the present disclosure will be elaborated in detail. However, it can be understood that the message processing method of the present disclosure can also be used for multiple source systems in a data center system, or can also be used for multiple source systems in multiple data center systems, etc., which are not limited herein.
[0060] In an exemplary embodiment of the present disclosure, as Figure 1 and Figure 2 shown, the message processing method may include:
[0061] Step S210, the first message dispatcher 121 distributes the messages from the first-level message queue 131 to a corresponding consumer in the consumer group corresponding to the first-level message queue 131.
[0062] When the first message dispatcher 121 distributes and processes the messages from the first-level message queue 131, the messages are still stored in the corresponding first-level message queue 131 until the message processing is completed.
[0063] Wherein, one or more first-level message queues 131 may be correspondingly set for one or more source systems 110 to ensure the sequential processing of messages. For example, the first-level message queue 131 shown above in Figure 1 must and can only receive messages from BMS1, and another first-level message queue 131 shown below in Figure 1 must and can only receive messages from BMS2. And so on, if there are more source systems 110 in the data center system, more first-level message queues 131 can be set so that each first-level message queue 131 must and can only receive messages from a corresponding source system 110.
[0064] In some embodiments, to facilitate message representation, each message may include two attribute information, namely a message identifier and a measurement point identifier. Among them, the message identifier may be configured to uniquely indicate the message, that is, the message identifier and the message are in one-to-one correspondence, and the message identifier is globally unique, so as to uniquely and accurately determine the corresponding message according to the message identifier. In a specific example, the message identifier may increase as the time when the message is generated increases, so as to facilitate the subsequent sequential processing of messages. In the case of multiple source systems, or in the case of multiple data center systems and multiple source systems, the data center system code, the source system code, and the message code within the source system can be combined to make the message identifier meet the requirement of global uniqueness. In addition, the measurement point identifier may be configured to indicate the measurement point where the message is generated, or to indicate the source of the message. In some embodiments, the measurement point identifier may also be used to indicate information related to the measurement point, which is not limited herein. In the same source system 110, the measurement point identifier should be distinguishable or uniquely indicate the corresponding measurement point, but among multiple source systems 110, the measurement point identifier may not be unique, that is, multiple measurement points in different source systems 110 may be represented by the same measurement point identifier. Similarly, the measurement point identifier may also increase as the time when the message is generated increases, so as to facilitate the subsequent sequential processing of messages.
[0065] In some embodiments, messages from the source system 110 can be sequentially added to a first-level message queue 131 corresponding to the source system 110 to ensure sequential processing of the messages. For example, messages from the source system 110 can be added to a first-level message queue 131 corresponding to the source system 110 in an append manner, so that messages generated earlier in the source system 110 can be distributed from the first-level message queue 131 first for processing. In addition, during the process of distributing messages, messages from the same measurement point in the same source system 110 can be distributed to the same consumer to ensure the sequentiality of message processing. Here, the same measurement point can include a sensing device that measures a single physical quantity and generates corresponding sensing messages. For example, the measurement point can be a temperature sensor or a humidity sensor, etc. Or, the same measurement point can include a sensing device that measures two or more physical quantities and generates corresponding sensing messages. For example, the measurement point can be a temperature and humidity sensor that can sense both temperature and humidity, etc.
[0066] In some embodiments, based on the above-described manner of characterizing messages using message identifiers and measurement point identifiers, the distribution of messages from the first-level message queue 131 to a corresponding consumer in a consumer group corresponding to the first-level message queue 131 by the first message distributor 121 can include: calculating a first modulo operation result between the measurement point identifier of the message and the number of consumers in the corresponding consumer group; and distributing the message to a corresponding consumer determined according to the first modulo operation result. Among them, messages with the same first modulo operation result can be distributed to the same consumer, while messages with different first modulo operation results can be respectively distributed to different consumers. For example, if the number of consumers in the consumer group is 5, labeled as consumer 0#, consumer 1#, consumer 2#, consumer 3#, and consumer 4# respectively, then when the measurement point identifier of the message is 0015, the message will be distributed to consumer 0#; when the measurement point identifier of the message is 0016, the message will be distributed to consumer 1#; when the measurement point identifier of the message is 0017, the message will be distributed to consumer 2#; and so on. By using such a message distribution method, messages from the same measurement point can be distributed to the same consumer for processing, thereby ensuring the sequentiality of messages from the same measurement point. For example, if a measurement point with a measurement point identifier of 0015 generates message 1 at 17:30, message 2 at 17:40, and message 3 at 18:40, then according to the above message distribution method, message 1, message 2, and message 3 from this measurement point (measurement point identifier 0015) will all be distributed to the same consumer (such as consumer 0#).
[0067] In some embodiments, the number of consumer ends can be dynamically adjusted according to the data volume of the messages to be processed. Specifically, as the data volume of the messages to be processed increases, the number of consumer ends can be appropriately increased to improve the message processing efficiency and rationally utilize the message processing resources.
[0068] Return Figure 1 and Figure 2 , the message processing method of the present disclosure may further include:
[0069] Step S220, inside the consumer end, the second message dispatcher 122 distributes the messages to the corresponding secondary message queues 132.
[0070] Among them, the messages from the same measurement point in the same source system 110 can be distributed to the same secondary message queue 132 to ensure the sequential processing of the messages. Specifically, inside the consumer end, the second message dispatcher 122 distributing the messages to the corresponding secondary message queues 132 may include: calculating the second modulo operation result between the measurement point identifier of the message and the number of secondary message queues inside the corresponding consumer end; and distributing the message to the corresponding one secondary message queue determined according to the second modulo operation result. Among them, the messages with the same second modulo operation result can be distributed to the same secondary message queue, and the messages with different second modulo operation results can be respectively distributed to different secondary message queues. In this way, a message can only be processed by one consumer 123 at the same time, and the messages from the same measurement point can be distributed to the same secondary message queue 132 for subsequent processing, thereby ensuring the sequentiality of the messages of the same measurement point. For example, in Figure 1 the specific embodiment of, there are two secondary message queues 132 provided, then the messages from the measurement points with odd measurement point identifiers will be distributed to Figure 1 the left secondary message queue 132 shown in, and the messages from the measurement points with even measurement point identifiers will be distributed to Figure 1 the right secondary message queue 132 shown in for subsequent processing. It can be understood that Figure 1 the left secondary message queue 132 shown in contains the messages from the measurement points with odd measurement point identifiers, and the right secondary message queue 132 contains the messages from the measurement points with even measurement point identifiers, which is only exemplary, and actually depends on the second modulo operation result between the measurement point identifier of the messages entering this consumer end and the number of secondary message queues inside this consumer end.
[0071] Similarly, the number of secondary message queues can be dynamically adjusted according to the data volume of the messages. Specifically, as the data volume of the messages to be processed increases, the number of secondary message queues can be appropriately increased to improve the message processing efficiency and rationally utilize the message processing resources.
[0072] Further, as Figure 1 and Figure 2 shown, the message processing method of the present disclosure may further include:
[0073] Step S230: Sequentially process the messages in the secondary message queue 132 by a consumer 123 corresponding to the secondary message queue 132.
[0074] Specifically, the consumer 123 processing the message may include operations such as extracting, counting, and converting the data in the message to generate corresponding message processing results. In addition, the consumer 123 processing the message may further include the consumer 123 transmitting the message processing results to the target system 130 so that the user of the target system 130 can analyze and process the message processing results. By transmitting the message processing results, rather than the messages themselves, to the target system 130 for the user to analyze and process, it is possible to avoid directly transmitting a large number of messages, which helps to reduce the amount of data to be transmitted, improve the data processing efficiency, and improve the monitoring effect on data center systems, etc. In some embodiments, one or more consumers 123 may be provided corresponding to one or more secondary message queues 132 one by one, that is, each consumer 123 only processes the messages in its corresponding one secondary message queue 132 to ensure the sequentiality of message processing.
[0075] In some embodiments, as Figure 3 shown, the message processing method may further include:
[0076] Step S310: When the consumer 123 processes the messages in the secondary message queue 132 corresponding to the consumer 123, the message identifier of the processed message is obtained by the message confirmator 124, and the message identifier and status identifier of the message are stored in the sequential queue 133; and
[0077] Step S320: When the consumer 123 finishes processing the message, the message confirmator 124 updates the status identifier of the message to indicate the consumed state.
[0078] Wherein, the status identifier of the message may be configured to indicate the processing status of the message. In a specific example, a value of 1 for the status identifier may indicate the in - consumption state. For example, during the process of the consumer 123 processing the message, the status identifier of the message may be set to 1, indicating that the message is in the in - consumption state; while a value of 2 for the status identifier may indicate the consumed state. For example, when the consumer 123 finishes processing the message, the status identifier of the message may be set to 2, indicating that the message is in the consumed state.
[0079] The message verifier 124 obtains the message identifier of the processed message and stores the message identifier and status identifier of the message in the sequential queue 133, specifically referring to: regardless of whether the message is processed, the message identifier and status identifier of the message are stored in the sequential queue 133. After the consumer 123 finishes processing the message, the consumer 123 sends an indication message to the message verifier 124 indicating that the message has been processed. After receiving the indication message sent by the consumer 123 indicating that the message has been processed, the message verifier 124 updates the status identifier of the message in the sequential queue 133 to 2.
[0080] As described above, in the message verifier 124, a sequential queue 133 can be used to store relevant information of the message. The messages in the sequential queue 133 can be characterized by a message identifier and a status identifier. Or rather, the message identifier and status identifier of the message can be correspondingly stored in the sequential queue 133 to record the processing status of the message. Specifically, in the sequential queue 133, the message identifier and status identifier of the message are stored in ascending order of the message identifier of the message.
[0081] In some embodiments, a message verifier 124 is correspondingly set for each consumer group, that is, each first-level message queue 131 corresponds to a message verifier 124. And in a message verifier 124, a sequential queue 133 can be used to store relevant information of the message.
[0082] Further, as Figure 4 shown, the message processing method may further include:
[0083] Step S410, the message verifier 124 reads the message identifier and status identifier of the message from the sequential queue 133 at every first preset time interval until a target message whose status identifier indicates the in-consumption state is first read during the current reading process; and
[0084] Step S420, the message verifier 124 confirms that all messages before the target message in the sequential queue 133 are in the consumed state, deletes the message identifier and status identifier of the messages confirmed to be in the consumed state in the sequential queue 133, and feeds back the confirmation result to the corresponding first-level message queue 131.
[0085] For example, the message verifier 124 can read the message identifier and status identifier of messages from the sequential queue 133 in sequence every 5 seconds (or other first preset time intervals can be set as required) to confirm whether the messages are successfully consumed, so as to prevent duplicate consumption of messages. For example, assume that the message identifiers of the messages in the sequential queue 133 are 0123, 0124, 0125, 0126, and 0127 in sequence. Among them, the status identifiers of the messages with message identifiers 0123, 0124, 0125, and 0126 are 2 (consumed status), while the status identifier of the message with message identifier 0127 is 1 (consuming status). Then, when the message verifier 124 finds the first message with a status identifier of 1, it ends reading and confirms that all messages with message identifiers less than 0127 have been successfully consumed. The message verifier 124 can delete the message identifier and status identifier of the message in the sequential queue 133 that is confirmed to be in the consumed state to reduce the storage space required by the sequential queue 133 and achieve reasonable utilization of storage resources. In addition, the message verifier 124 can feedback the confirmation result that the message has been successfully consumed to the corresponding first-level message queue 131 to prevent the first-level message queue 131 from repeatedly processing the corresponding message. Specifically, when the corresponding first-level message queue 131 receives the feedback of the confirmation result that the message has been successfully consumed sent by the message verifier 124, it deletes the message from the first-level message queue 131 to prevent the first-level message queue 131 from repeatedly processing the corresponding message.
[0086] However, in some abnormal situations, such as when the consumer 123 is abnormal and fails to successfully consume a message, a certain message may always be in the consuming state. When the message that has been in the consuming state becomes the message with the smallest message identifier in the sequential queue 133 (at the head of the sequential queue 133), it will cause the message verifier 124 to always end reading when reading the message identifier and status identifier of this message, and unable to read the message identifiers and status identifiers of the subsequent messages in the sequential queue 133, even if the status identifiers of the subsequent messages of this message have been updated to 2.
[0087] In order to enable the message verifier 124 to still work properly in the case of an abnormality of the consumer 123 and ensure that the messages that have not been successfully consumed can be consumed again by the consumer 123 to prevent message loss, the following processing method can be adopted. Specifically, the message identifier of the target message read by the message verifier 124 can be obtained at every second preset time interval; in the case where the same message identifier is continuously obtained a preset number of times, or the message identifier of the target message obtained within a preset duration remains unchanged, it can be determined that the target message is a consumption abnormal message; the message identifier and status identifier of the consumption abnormal message can be deleted from the sequential queue 133. It can be understood that the second preset time interval can be greater than or equal to the first preset time interval, and the preset duration can be greater than or equal to the second preset time interval. In this way, the message verifier 124 can still work properly in the case of an abnormality of the consumer 123; at the same time, since the corresponding first-level message queue 131 cannot receive the confirmation result feedback of the successful consumption of the consumption abnormal message sent by the message verifier 124, the consumption abnormal message will not be deleted from the first-level message queue 131, so that the consumption abnormal message can be processed again subsequently.
[0088] The present disclosure also proposes a message processing device, which can be used to replace the message processing device 120 and be arranged in the data center system. In an exemplary embodiment of the present disclosure, as Figure 5 shown, the message processing device 500 may include a processor 510 and a memory 520. Instructions may be stored on the memory 520, and when the instructions are executed by the processor 510, the operations of the message processing method described above can be implemented.
[0089] Specifically, the processor 510 can execute various actions and processes according to the instructions stored in the memory 520. The processor 510 can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute various methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., and can be an X86 architecture or an ARM architecture, etc.
[0090] The memory 520 stores executable instructions which, when executed by the processor 510, implement the message processing method described above. The memory 520 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) which serves as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM). It should be noted that the memories of the methods described herein are intended to include but not be limited to these and any other suitable types of memories.
[0091] The present disclosure also provides a non-transitory computer-readable storage medium on which instructions can be stored, and when the instructions are executed by a processor, the operations of the message processing method described above can be implemented.
[0092] Similarly, the non-transitory computer-readable storage media in the embodiments of the present disclosure are intended to include but not be limited to the above and any other suitable types of memories.
[0093] The present disclosure also provides a computer program product which includes instructions that, when executed by a processor, can implement the operations of the message processing method described above.
[0094] The instructions can be any set of instructions that are directly executable by one or more processors, such as machine code, or any set of instructions that are indirectly executable, such as a script. The terms "instructions", "application", "procedure", "step", and "program" can be used interchangeably herein. The instructions can be stored in a target code format for direct processing by one or more processors, or stored in any other computer language, including scripts or collections of independent source code modules that are interpreted on demand or pre-compiled. The instructions can include instructions that cause one or more processors to act as the respective neural networks that may exist. The functions, methods, and routines of the instructions are explained in more detail in other parts of this document.
[0095] In the technical solution of the present disclosure, by using the multi-level queue technology and combining the message dispatcher and the message confirmer, the real-time performance, sequentiality, and correctness of large-scale data in the target system can be effectively guaranteed, and efficient message processing and sequential guarantee are achieved. In some cases, according to the different scales of the data center or the data center system, the number of consumers or consumers and / or the number of secondary message queues can be dynamically adjusted to ensure the efficient processing of messages and the reasonable utilization of resources. In addition, by executing the message processing logic in units of the source system, problems such as data storms caused by the failure of the source system of an individual data center system in the environment of multiple data center systems and multiple source systems can be effectively avoided, because a data storm in a certain source system will not affect the processing of messages in other source systems (thanks to the fact that each source system can have a dedicated primary message queue and corresponding consumer groups), thus effectively avoiding the situation of global function unavailability and helping to minimize the scope of influence of risks.
[0096] The words "left", "right", "front", "rear", "top", "bottom", "upper", "lower", "high", "low", etc. in the description and claims, if any, are used for descriptive purposes and not necessarily for describing invariant relative positions. It should be understood that such words are interchangeable under appropriate circumstances, so that the embodiments of the present disclosure described herein, for example, can operate in other orientations different from those shown or otherwise described herein. For example, when the device in the drawings is inverted, a feature originally described as "above" other features can then be described as "below" other features. The device can also be oriented in other ways (rotated 90 degrees or in other orientations), and the relative spatial relationships will be correspondingly interpreted at this time.
[0097] In the description and claims, when it is said that an element is "above", "attached" to, "connected" to, "coupled" to, or "in contact" with another element, etc., the element can be directly above, directly attached to, directly connected to, directly coupled to, or directly in contact with the other element, or there can be one or more intermediate elements. In contrast, when it is said that an element is "directly" above, "directly attached" to, "directly connected" to, "directly coupled" to, or "directly in contact" with another element, there will be no intermediate element. In the description and claims, a feature being arranged "adjacent" to another feature can mean that the feature has a part overlapping with the adjacent feature or a part above or below the adjacent feature.
[0098] As used herein, the term "exemplary" means "serving as an example, instance, or illustration" and not a "model" to be precisely copied. Any implementation described herein as exemplary is not necessarily to be construed as preferred or advantageous over other implementations. Moreover, the present disclosure is not limited by any theory expressed or implied in the technical field, background art, summary of the invention, or detailed description.
[0099] As used herein, the term "substantially" means including any minor variations caused by design or manufacturing defects, tolerances of devices or components, environmental effects, and / or other factors. The term "substantially" also allows for differences from perfect or ideal situations due to parasitic effects, noise, and other practical considerations that may exist in an actual implementation.
[0100] Additionally, for reference purposes only, terms such as "first", "second", etc. may also be used herein and are not intended to be limiting. For example, unless the context clearly indicates otherwise, the terms "first", "second", and other such numerical terms referring to a structure or element do not imply an order or sequence.
[0101] It should also be understood that when the term "comprising / including" is used herein, it indicates the presence of the stated features, wholes, steps, operations, units, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, units, and / or components and / or combinations thereof.
[0102] Furthermore, when used in the present disclosure, terms such as "herein", "above", "below", "hereinafter", "above-mentioned", and words of similar import shall refer to the entire present disclosure rather than any particular part of the present disclosure. Additionally, unless otherwise expressly stated or otherwise understood in the context in which it is used, conditional language used herein, such as "may", "might", "for example", "such as", etc., generally is intended to convey that certain embodiments include, while other embodiments do not include, certain features, elements, and / or states. Thus, such conditional language is not generally intended to imply that one or more embodiments in any way require features, elements, and / or states, or whether they include such features, elements, and / or states or perform such features, elements, and / or states in any particular embodiment.
[0103] In the present disclosure, the term "provide" is used broadly to encompass all ways of obtaining an object, so "providing an object" includes, but is not limited to, "purchasing", "preparing / manufacturing", "arranging / setting", "installing / assembling", and / or "ordering" the object, etc. Additionally, in the present disclosure, the terms "circuit", "unit", and "module" may be used interchangeably.
[0104] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items. The terms used herein are for the purpose of describing particular embodiments only and are not intended to limit the disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.
[0105] Those skilled in the art should appreciate that the boundaries between the above operations are merely illustrative. Multiple operations can be combined into a single operation, a single operation can be distributed over additional operations, and operations can be performed at least partially overlapping in time. Moreover, alternative embodiments can include multiple instances of a particular operation, and the order of operations can be varied in various other embodiments. However, other modifications, variations and substitutions are also possible. Aspects and elements of all embodiments disclosed above can be combined in any manner and / or in combination with aspects or elements of other embodiments to provide multiple additional embodiments. Accordingly, the specification and drawings are to be regarded as illustrative rather than restrictive. Indeed, the novel devices, methods and systems described herein can be embodied in various other forms. In addition, various omissions, substitutions and changes in the form of the methods and systems described herein can be made without departing from the spirit of the disclosure. For example, while blocks are presented in a given arrangement, alternative embodiments can perform similar functions with different components and / or circuit topologies, and some blocks can be deleted, moved, added, subdivided, combined and / or modified. Each of these blocks can be implemented in a variety of different ways.
[0106] The various embodiments of the present disclosure may be described in a progressive manner. For the same or similar parts among the various embodiments, reference may be made to each other. Each embodiment focuses on the differences from other embodiments. In the present disclosure, descriptions with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. In the present disclosure, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0107] Although some specific embodiments of the present disclosure have been described in detail by way of examples, those skilled in the art should understand that the above examples are for illustrative purposes only and not for limiting the scope of the present disclosure. The various embodiments disclosed herein can be combined arbitrarily without departing from the spirit and scope of the present disclosure. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A message processing method, comprising: The first message distributor distributes the message from the first-level message queue to a corresponding consumer end in the consumer group corresponding to the first-level message queue, wherein one or more first-level message queues are set in a one-to-one correspondence with one or more source systems, and the messages from the source systems are sequentially added to a first-level message queue corresponding to the source system, and the messages from the same measurement point in the same source system are distributed to the same consumer end; Inside the consumer end, the second message distributor distributes the message to the corresponding secondary message queue, wherein messages from the same measurement point in the same source system are distributed to the same secondary message queue; and The messages in the secondary message queue are processed sequentially by a consumer corresponding to the secondary message queue, wherein one or more consumers are provided in a one-to-one correspondence with one or more secondary message queues.
2. The message processing method according to claim 1, further comprising: When a consumer processes a message in a secondary message queue corresponding to the consumer, the message confirmer obtains a message identifier of the processed message, and stores the message identifier and a state identifier of the message in a sequential queue, wherein the message identifier is configured to uniquely indicate the message, and the state identifier is configured to indicate a processing state of the message, and when the consumer processes the message, the state identifier of the message indicates a consuming state; and When the consumer completes processing the message, the message confirmer updates the status indicator of the message to indicate the consumed status.
3. The message processing method according to claim 2, further comprising: The message confirmer reads the message identifier and the state identifier of the message from the sequential queue at a first preset time interval until the target message whose state identifier indicates a consumption state is read for the first time in the current reading process; as well as The message confirmer confirms that all messages before the target message in the sequential queue are in the consumed state, deletes the message identifier and state identifier of the message confirmed to be in the consumed state in the sequential queue, and feeds back the confirmation result to the corresponding primary message queue.
4. The message processing method according to claim 3, further comprising: At every second preset time interval, obtaining a message identifier of a target message read by the message confirmer; When the same message identifier is obtained continuously for a preset number of times, or the message identifier of the target message obtained within a preset time period remains unchanged, the target message is determined to be a consumption abnormal message; The message identifier and status identifier of the consumption exception message are deleted from the sequential queue.
5. The message processing method according to claim 1, wherein: The messages in the secondary message queue are sequentially processed by a consumer corresponding to the secondary message queue, including: The consumer transmits the message processing result to the target system.
6. The message processing method according to claim 5, wherein: Source systems include building management systems (BMS); and / or The target system includes the computer room management system DCIM.
7. The message processing method according to claim 1, wherein: The number of consumers can be adjusted dynamically based on the amount of data in the message; and / or The number of secondary message queues can be adjusted dynamically according to the data volume of the message.
8. The message processing method according to claim 1, wherein: The message from the source system is added to a primary message queue corresponding to the source system in an appended manner.
9. The message processing method according to claim 1, wherein: The message identifier is configured to uniquely indicate the message, the measurement point identifier is configured to indicate the measurement point where the message is generated, and the message identifier and the measurement point identifier increase as the time when the message is generated increases; The first message distributor distributes the message from the first-level message queue to a corresponding consumer end in the consumer group corresponding to the first-level message queue, including: Calculate the result of a first modulo operation between the measurement point identifier of the message and the number of consumer terminals in the corresponding consumer group; and The message is distributed to a corresponding consumer end determined according to the first modular operation result, wherein messages with the same first modular operation result are distributed to the same consumer end, and messages with different first modular operation results are distributed to different consumer ends.
10. The message processing method according to claim 1, wherein: The message identifier is configured to uniquely indicate the message, the measurement point identifier is configured to indicate the measurement point where the message is generated, and the message identifier and the measurement point identifier increase as the time when the message is generated increases; Inside the consumer end, the second message distributor distributes the message to the corresponding secondary message queue including: Calculate the result of the second modulo operation between the measurement point identifier of the message and the number of the secondary message queues inside the corresponding consumer end; and The message is distributed to a corresponding secondary message queue determined according to the second modular operation result, wherein messages with the same second modular operation result are distributed to the same secondary message queue, and messages with different second modular operation results are distributed to different secondary message queues.
11. A message processing device, comprising a first message distributor, a second message distributor and a consumer, wherein: One or more consumers constitute a consumer end, and one or more consumer ends constitute a consumer group; The first message distributor is configured to distribute messages from a primary message queue to a corresponding consumer end in a consumer group corresponding to the primary message queue, wherein one or more primary message queues are provided in a one-to-one correspondence with one or more source systems, messages from source systems are sequentially added to a primary message queue corresponding to the source system, and messages from the same measurement point in the same source system are distributed to the same consumer end; The second message distributor is configured to distribute messages to corresponding secondary message queues inside the consumer end, wherein messages from the same measurement point in the same source system are distributed to the same secondary message queue; and A consumer corresponding to the secondary message queue is configured to sequentially process messages in the secondary message queue, wherein one or more consumers are provided in a one-to-one correspondence with one or more secondary message queues.
12. A message processing device, comprising a processor and a memory, wherein the memory stores instructions, and when the instructions are executed by the processor, the operation of the message processing method according to any one of claims 1 to 10 is implemented.
13. A data center system, comprising: Source system; Target system; as well as The message processing device according to claim 11 or the message processing apparatus according to claim 12.
14. A non-transitory computer-readable storage medium, wherein: The non-transitory computer-readable storage medium stores instructions, and when the instructions are executed by the processor, the operations of the message processing method according to any one of claims 1 to 10 are implemented.
15. A computer program product, comprising instructions, which, when executed by a processor, implement the operation of the message processing method according to any one of claims 1 to 10.