Message subscription mechanism cross-region service message push method
By adopting message subscription mechanism and message queueing technology in the power system, the problem of low data exchange efficiency in cross-region communication is solved, efficient message push and response is achieved, and the real-time and security of the system are improved.
Patent Information
- Application Number
- CN202110748221.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-01
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-07-01
AI Technical Summary
In power systems, when data exchange is performed through cross-regional communication services, direct transmission of large amounts of data is likely to cause blockage and communication efficiency is low.
The message subscription mechanism is adopted to collect messages from the local service cluster and form a message queue, obtain subscription information from different areas of the power grid, determine the target application unit based on the subscription information, and retrieve messages from the message queue for pushing.
Storing and pushing messages through message queueing avoids congestion caused by the simultaneous transmission of large amounts of data, improving the response efficiency of cross-region service messages, ensuring that the application unit obtains push messages from the power system in a timely manner, improving real-time and security, and thus improving user service quality.
Smart Images

Figure CN113342551B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power systems, and in particular to a method, device, computer equipment and storage medium for pushing messages for cross-region service of a message subscription mechanism. Background Art
[0002] The Operation Smart System (OS2) is a complete, open, and standard technical support system. For power systems with numerous devices, wide coverage, and large capacity, its control form is generally to first layer by voltage level and then partition by region. The various functions of the system are deployed in safety zone I, safety zone II, and safety zone III according to application needs. Among them, safety zone I and safety zone II mainly include data acquisition and exchange function groups and application function groups; safety zone III includes WEB services and mobile terminal services in addition to data acquisition and exchange function groups and application function groups. In the prior art, when data exchange is required between zones, data exchange is generally carried out directly between zones.
[0003] However, this method of exchanging data between zones through cross-zone communication is prone to congestion when there is a large amount of data to be exchanged, and the communication efficiency is low. Summary of the invention
[0004] Based on this, it is necessary to provide a message subscription mechanism cross-region service message push method, device, computer equipment and storage medium to address the technical problems of data exchange through cross-region communication services, direct transmission of large amounts of data easily causing congestion and low communication efficiency.
[0005] A message subscription mechanism cross-region service message push method, the method comprising:
[0006] Collect messages from the local service cluster and form the messages into a message queue;
[0007] Obtain subscription information of different areas of the power grid, and determine the target application unit of the subscription message according to the subscription information;
[0008] The message in the message queue is retrieved, and the message is pushed to the target application unit.
[0009] In one embodiment, forming the message into a message queue includes:
[0010] determining the type of the message;
[0011] According to the type of the message, the message is stored in data partitions to form the message queue.
[0012] In one embodiment, the retrieving the message in the message queue and pushing the message to the target application unit includes:
[0013] Push notification according to the type of the message;
[0014] Obtain corresponding data content from the message queue according to the push prompt.
[0015] In one embodiment, the retrieving the message in the message queue and pushing the message to the target application unit further includes:
[0016] determining a status of said data content;
[0017] When the state of the data content changes, it is determined whether the data content includes content of power grid security risk, and a notification is sent to the local service cluster.
[0018] In one embodiment, the message includes the time when the event occurred, the name of the subject of the event, and the classification identification of the event;
[0019] The collecting of messages from the local service cluster and forming the messages into a message queue includes:
[0020] According to the level of the event, the messages are prioritized to form the message queue.
[0021] In one embodiment, the obtaining subscription information of different areas of the power grid and determining the target application unit of the subscription message according to the subscription information includes:
[0022] Obtain real-time business data uploaded by the distributed subscription message system and data collection terminals;
[0023] A recipient subscribing to the message is searched according to the real-time business data.
[0024] In one of the embodiments, after pushing the message to the target application unit, the method further includes:
[0025] Determining a push status of the message;
[0026] When the push status is push failure, the backup server is called to forward the message. In one embodiment,
[0027] A message subscription mechanism cross-region service message push device, the device comprising:
[0028] A queue forming module, used for collecting messages from a local service cluster and forming the messages into a message queue;
[0029] A target determination module, used to obtain subscription information of different areas of the power grid, and determine a target application unit for a subscription message according to the subscription information;
[0030] The message push module is used to retrieve the message in the message queue and push the message to the target application unit.
[0031] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0032] Collect messages from the local service cluster and form the messages into a message queue;
[0033] Obtain subscription information of different areas of the power grid, and determine the target application unit of the subscription message according to the subscription information;
[0034] The message in the message queue is retrieved, and the message is pushed to the target application unit.
[0035] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0036] Collect messages from the local service cluster and form the messages into a message queue;
[0037] Obtain subscription information of different areas of the power grid, and determine the target application unit of the subscription message according to the subscription information;
[0038] The message in the message queue is retrieved, and the message is pushed to the target application unit.
[0039] The above-mentioned message subscription mechanism cross-region service message push method, device, computer equipment and storage medium obtain the message of the local service cluster and put the message into the message queue; and obtain the subscription information of different areas of the power grid, obtain the target application unit corresponding to the subscription message according to the subscription information, and then retrieve the message in the message queue, and push the message to the corresponding target application unit, use the message queue to store the message, retrieve the message from the message queue for pushing, avoid the problem of congestion caused by sending a large amount of data at the same time, effectively improve the response efficiency of cross-region service messages, and help the application unit to obtain the push message of the power system in time, so that the real-time and security are guaranteed, which is conducive to improving the quality of user service. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of the architecture of a power grid operation control system in one embodiment;
[0041] Figure 2A schematic diagram of a flow chart of a method for pushing messages for cross-region service of a message subscription mechanism in an embodiment;
[0042] Figure 3 A schematic diagram of a flow chart of a method for pushing messages for cross-region service using a message subscription mechanism in another embodiment;
[0043] Figure 4 A schematic diagram of a flow chart of a method for pushing messages for cross-region service of a message subscription mechanism in yet another embodiment;
[0044] Figure 5 It is a structural block diagram of a device for pushing messages for cross-region service of a message subscription mechanism in an embodiment;
[0045] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] In the related technologies, the power grid operation intelligent system is composed of master station systems and plant station systems at the network, province, prefecture (county, distribution) levels. Each master station / plant station system is divided into five parts: Basic Resource Platform (BRP), Operation Control System (OCS), Operation Management System (OMS), Power System Operation Cockpit (POC) or Substation Operation Cockpit (SOC), Mirror Test Training System (MTT). The system follows the Service-Oriented Architecture (SOA) system, builds an integrated support platform and operation service bus (OSB) based on a unified information and communication technology infrastructure and unified model and service interface standards. Various business functions are constructed or improved based on this. The functional modules / business subsystems in the master stations / plant stations at all levels are integrated through the support platform and the horizontal operation service bus, and the interconnection with the upper and lower related business systems is realized through the vertical operation service bus. The system realizes information sharing, coordinated control and process management with other relevant business systems through the OSB standard service interface.
[0048] For power systems with numerous equipment, wide coverage and large capacity, the control method of stratification by voltage level and then by region is adopted under the unified command of the highest-level control center. The power system operation control includes operation control and its automation under normal operation and operation control and its automation under accident conditions. According to the secondary system safety protection requirements, the various functions of the system are deployed in safety zone I, safety zone II and safety zone III according to application needs. Among them, safety zone I and safety zone II mainly include data acquisition and exchange function group and application function group; safety zone III mainly includes data acquisition and exchange function group, application function group, WEB service and mobile terminal service.
[0049] At present, different areas in the power system need to exchange data across regions. During the communication process, due to the mutation of data traffic and unreasonable distribution, the direct transmission of a large amount of data can easily cause congestion, communication interruption, low efficiency and other problems, which is not conducive to timely feedback of safety issues in the power system, resources cannot be used reasonably, network performance is reduced, and service quality cannot be guaranteed.
[0050] Based on this, an embodiment of the present application proposes a message subscription mechanism cross-region service message push method, device, computer equipment and storage medium, wherein the message subscription mechanism cross-region service message push method includes: by obtaining the message of the local service cluster, the message is placed in the message queue; and by obtaining the subscription information of different areas of the power grid, the target application unit corresponding to the subscription corresponding message is obtained according to the subscription information, and then the message in the message queue is retrieved, and the message is pushed to the corresponding target application unit, and the message is stored in the message queue, and the message is retrieved from the message queue for pushing, so as to avoid the problem of congestion caused by sending a large amount of data at the same time, effectively improve the response efficiency of cross-region service messages, and facilitate the application unit to obtain the push message of the power system in time, and the real-time and security are guaranteed, which is conducive to improving the quality of user service.
[0051] In one embodiment, Figure 1 As shown in FIG. 1 , it is a schematic diagram of the architecture of the power grid operation control system. The power grid operation control system includes a human-machine interface 100, a data center 200, and a data acquisition and exchange 300. Among them, the human-machine interface 100 includes a control operation module, a power grid operation monitoring module, a graph model maintenance module, an event monitoring module, and a front-end monitoring and debugging module. The data center 200 includes a real-time library, a relationship library, a timing library, and an object storage library. The data acquisition and exchange 300 includes a control service cluster, a data service cluster, a model service cluster, a file service cluster, a data acquisition and monitoring control SCADA processing cluster, and a front-end service cluster. The specific data flow architecture of the operation control system is shown in FIG. Figure 1It can be understood that the message is obtained through the SCADA processing cluster, and the message obtained by the SCADA processing cluster is placed in the message queue, and the corresponding message is retrieved from the message queue according to the subscription information, so as to push the message to the corresponding application unit, thereby completing the push of cross-region service messages, realizing real-time transmission of data, having high real-time performance and security, and ensuring high service quality.
[0052] In one embodiment, Figure 2 As shown, a message subscription mechanism cross-region service message push method is provided, which is applied to the above-mentioned power grid operation control system, and the method includes the following steps:
[0053] Step S202: collect messages from the local service cluster and form a message queue.
[0054] In this step, the messages of the local service cluster may include various events generated by the service clusters in the operation control system, such as master station alarm messages, etc. The operation control system collects data from each service cluster through the SCADA processing cluster, and the data is temporarily stored in the message queue in the form of messages. The message queue is an important component in the distributed system and can meet the requirements of cross-region service message push. It has the advantages of improving system performance, peak shaving, and reducing system coupling.
[0055] More specifically, a data collection and monitoring control system may be used to collect data from the local service cluster to obtain the message.
[0056] Step S204, obtaining subscription information of different areas of the power grid, and determining a target application unit for subscription messages according to the subscription information.
[0057] In this step, by obtaining subscription messages from different areas of the power grid, it can be understood that the message has a sender and a receiver. The receiver of the message subscribes according to the message type to realize the subscription and release of the message. The sender and receiver of the message can be multiple. The message content subscribed by the receiver of the message is the subscription information. Therefore, according to the subscription information, the application unit corresponding to the subscription to the corresponding message can be obtained, that is, the receiver of the message can be determined according to the message content. The application unit can be understood as the carrier corresponding to the receiver, which can be an application, SMS, email, etc.
[0058] Step S206, retrieve the message in the message queue and push the message to the target application unit.
[0059] In this step, after obtaining the corresponding application unit, the corresponding message is retrieved from the message queue, and the message is pushed to the corresponding target application unit, thereby completing the push of the cross-region service message.
[0060] In one embodiment, a message queue is used to temporarily store messages, and messages are retrieved from the message queue for push. A virtual memory is used as an example for explanation as a storage unit of the message queue. Messages are stored in the virtual memory. The virtual memory has an independent application function and can store different message types. Messages are only stored in the virtual memory and do not occupy local storage in each area. This enables unified management of resources and avoids congestion caused by sending large amounts of data. It also accelerates the response speed of messages and effectively improves the transmission efficiency of cross-region service messages, which is beneficial for users to obtain push messages from the power system in a timely manner. Real-time and security are guaranteed, which is beneficial for improving user service quality.
[0061] It should be noted that the above steps S202 to S206 are implemented based on the data flow architecture of the power grid operation control system. Various types of steady-state, dynamic, protection, video and other data collected by the front-end operating environment directly enter various monitoring function modules such as steady-state monitoring, dynamic monitoring, protection operation monitoring, video and environmental monitoring through the message bus. In this way, the function module provides the data it needs to send to the data integration and service functions of the data center 200 through the message bus for unified management and external release; various types of data that need to be stored and accessed in relational databases and time series databases are uniformly provided to the outside by the database support platform services of the data center 200; the message queue uses the message bus as the transmission carrier to realize unified management of messages.
[0062] In the cross-region service message push method of the above-mentioned message subscription mechanism, the message is placed in the message queue by obtaining the message of the local service cluster; and by obtaining the subscription information of different areas of the power grid, the target application unit corresponding to the subscription message is obtained according to the subscription information, and then the message in the message queue is retrieved and pushed to the corresponding target application unit. The message is stored in the message queue, and the message is retrieved from the message queue for pushing, so as to avoid the problem of congestion caused by sending a large amount of data at the same time, effectively improve the response efficiency of cross-region service messages, and facilitate the application unit to obtain the push message of the power system in time, so that the real-time and security are guaranteed, which is conducive to improving the quality of user service.
[0063] In one embodiment, the above step S202 specifically includes: determining the type of the message; and storing the message in data partitions according to the type of the message to form a message queue.
[0064] In this embodiment, message types have different classifications, and general messages are subscribed according to the classification, and messages of multiple categories can be subscribed at the same time. Before a message is placed in a message queue, the type of the message is first determined, and then data partition storage is performed according to the type of the message, that is, different types of messages are stored in different data partitions, thereby forming a message queue. The message queue is a data queue, and the use of partitioned storage for messages is conducive to speeding up the reading speed of messages and improving the response efficiency of messages. For example, when the data of the main station fault is obtained, the main station fault data is stored in the front storage partition of the message queue. Through the front storage partition, the message can be quickly retrieved and pushed to the corresponding recipient. It can be understood that the fault type data is stored as an emergency message using a data partition method, and the emergency message is read and written first, so that the emergency message can be processed first, effectively improving the response efficiency of the message, and facilitating the rapid processing of fault events.
[0065] In one embodiment, Figure 3 As shown, the specific process of the message subscription mechanism cross-zone service message push method includes the following steps:
[0066] Step S302, determining the type of the message;
[0067] Step S304, storing the messages in data partitions according to the message types to form a message queue;
[0068] Step S306, obtaining subscription information of different areas of the power grid, and determining a target application unit for subscription messages according to the subscription information;
[0069] Step S308, retrieve the message in the message queue and push the message to the target application unit.
[0070] Furthermore, in one embodiment, the message includes the time when the event occurred, the name of the subject of the event and the classification identifier of the event; the above step S304 also includes: according to the level of the event, the message is prioritized to form a message queue.
[0071] It is understandable that the type of message is defined according to actual requirements. The various events generated by each service cluster in the power grid operation control system may include information such as the time when the event occurred, the name of the subject of the event, and the classification identification of the event. The above information can be used to define the event, which is convenient for generating messages, that is, the message at least includes the time when the event occurred, the name of the subject of the event, and the classification identification of the event. Of course, different types of messages can also add other required information, such as the node name and device name of the computer and network device status report message, which will not be described in detail.
[0072] In addition, the level of an event can be understood as the classification of an event based on information such as the time of occurrence of the event, the name of the subject of the event, and the classification identification of the event. It can be understood that events involving the failure safety of the power grid system can be defined as higher-level messages. The higher the level of the event, the higher the urgency. In this way, messages can be prioritized according to the level of the event. The higher the level of the event, the higher the priority of the message corresponding to the event, and the more urgent it needs to be pushed, so as to speed up the handling of emergency events.
[0073] In one embodiment, Figure 4 As shown, the message subscription mechanism cross-zone service message push method includes the following steps:
[0074] Step S402, arranging the messages by priority according to the level of the event to form a message queue;
[0075] Step S404, obtaining subscription information of different areas of the power grid, and determining the target application unit of the subscription message according to the subscription information;
[0076] Step S406, retrieve the message in the message queue and push the message to the target application unit.
[0077] It can be understood that by arranging the priorities of messages to form a message queue, messages with higher priorities can be arranged in the front position of the message queue. When retrieving messages, information is retrieved from the front position and pushed first, thereby pushing messages according to the urgency of the event, effectively improving the response efficiency of messages, and preventing messages from conflicting with each other and causing congestion. The transmission efficiency of cross-regional service messages is effectively improved, which is conducive to timely handling of emergencies, ensuring real-time and security, and helping to improve user service quality.
[0078] In this embodiment, the data acquisition and monitoring control SCADA system is used to collect data from the local service cluster. The SCADA system is a computer-based production process control and dispatching automation system. In the power system, the SCADA system can realize various functions such as data acquisition, equipment control, measurement, parameter adjustment, and various signal alarms. The specific details are not repeated here. The SCADA processing cluster obtains messages, puts the obtained messages into the message queue, and then retrieves the corresponding messages from the message queue according to the subscription information, so as to push the messages to the corresponding application units, thereby completing the push of cross-region service messages, realizing rapid data transmission, and ensuring real-time and security, and ensuring high user service quality.
[0079] It should be noted that the message queue can be understood as a unified shared resource pool built through certain normative constraints. Through virtualization technology, it is divided into storage arrays that can be flexibly configured and dynamically adjusted, which can realize dynamic allocation of resources on demand. When storing messages, resource competition should be avoided during planning. For example, the memory access of the message queue may be inconsistent or discontinuous. The data sorting mechanism is used to aggregate and disperse the stored data, so that the data can be sorted in the form of an array, and the array can be stored in a dispersed manner. Based on the dispersed allocation strategy of the array, resource competition can be effectively avoided when creating a message queue.
[0080] It is understandable that when the message queue is not used, the user's request data is directly written to the database. In the case of high concurrency, the database pressure increases dramatically, which slows down the response speed. By using the message queue to store messages, when a request to retrieve a message is sent to the message queue, the corresponding data is obtained from the message queue and pushed to the corresponding application unit. Since the storage array processing speed of the message queue is faster than that of the database, the response efficiency of the message queue is high, so that the message queue has a good peak-cutting function, that is, through asynchronous processing, events generated by short-term high concurrency are stored in the message queue, thereby flattening the concurrent events during the peak period.
[0081] In addition, cross-region service messages are pushed through message queues. There is no direct coupling between the sender and the receiver. The sender ends the processing of the message when it sends the message to the message queue. The receiver obtains the message from the message queue for subsequent processing. As long as the receiver subscribes to messages of the corresponding type, it can receive messages from the message queue. This has no impact on the original system and business, thereby reducing system coupling.
[0082] In one embodiment, the above step S206 specifically includes: pushing a prompt according to the type of the message; and acquiring corresponding data content from the message queue according to the push prompt.
[0083] It is understandable that the message type supports different classifications, and different types of messages can be prompted by adding identifiers, so that the messages in the message queue can be retrieved and pushed according to the prompts. Specifically, considering that the message may include the time when the event occurred, the name of the subject of the event and the classification identifier of the event, the classification identifier of the event can be used to add a push prompt to the corresponding message. The push prompt is used to quickly identify the corresponding message from the message queue and retrieve it for push. For example, the higher the level of the defined event, the higher the urgency, and the higher the priority of the corresponding message. In this way, different prompts are added according to messages of different levels. The higher the priority message, the higher the level of prompts are added to facilitate priority processing, effectively improving the response efficiency of the message, and facilitating the rapid processing of emergencies.
[0084] In one embodiment, the above step S206 further includes: determining the state of the data content; when the state of the data content changes, determining whether the data content includes content of power grid security risk, and sending a notification to the local service cluster.
[0085] It is understandable that the message queue is used to store messages, and the messages are stored in the message queue in the form of data to achieve unified resource management. The message queue pushes the message to the corresponding target application unit according to the subscription information, without the need to store the message locally. In the message queue, based on the real-time nature of data interaction, the data sending node of the message queue can monitor the sending status of the data content in real time. When the status of the data content changes, it means that the event corresponding to the data content has changed.
[0086] In this embodiment, when the data content includes the content of power grid security risk, considering that the power grid system may have events involving security issues, a notification needs to be sent to the local service cluster so that the local service cluster can be informed of the message change status in a timely manner, and at the same time, the message is given a higher priority and pushed to the corresponding target application unit, so that messages involving power grid security risks can be quickly processed and the emergency response efficiency can be improved. For example, after the data corresponding to the message is written into the message queue, the event corresponding to the message is upgraded to an emergency event, such as the main station upgrades from an alarm message to a shutdown failure. At this time, the message is processed expedited and pushed to the corresponding recipient via email, SMS or application, which is conducive to the application unit to obtain the push message of the power system in a timely manner, with high real-time performance, and effectively improves the user service quality.
[0087] In one embodiment, the above step S204 specifically includes: obtaining real-time business data uploaded by the distributed subscription message system and collecting data from the data collection terminal; and searching for the recipient of the subscription message according to the real-time business data.
[0088] It is understandable that the distributed subscription message system adopts the Kafka system. Kafka is an open source stream processing platform developed by the Apache Software Foundation. It is a high-throughput distributed publish-subscribe message system that can process all action stream data of users on the website. The Kafka data channel is a data exchange channel built based on the Kafka architecture. The decoupling characteristics of Kafka can effectively ensure the transmission of data. The external business data platform refers to a business data platform used to store data generated by the business system. When the business system generates business data, these business data can be uploaded to the external business data platform through the corresponding Kafka channel. The business data platform saves the business data. When the processor receives the business demand data, it can access the external business data platform according to the business demand data to obtain the business data to be processed corresponding to the business demand data. The real-time business data uploaded by the data collection terminal is collected through the distributed subscription message system, and the target real-time business data corresponding to the business data to be processed is searched. According to the target real-time business data and the business data to be processed, the data processing result is obtained, and the data processing result can determine the recipient of the message. It can be understood that a message has a sender and a receiver. The receiver of the message subscribes according to the message type to realize the subscription and publication of the message. The message content subscribed by the receiver of the message is the subscription information. According to the subscription information, the application unit corresponding to the subscription to the corresponding message can be obtained, that is, the receiver of the message can be determined according to the message content.
[0089] In this embodiment, a message queue is used to temporarily store messages, and messages are retrieved from the message queue for push. Messages are only stored in virtual memory and do not occupy local storage in each area. This enables unified management of resources and avoids congestion caused by sending large amounts of data. It also accelerates the response speed of messages and effectively improves the transmission efficiency of cross-region service messages, which is beneficial for users to obtain push messages from the power system in a timely manner. Real-time and security are guaranteed, which is beneficial to improving user service quality.
[0090] In one embodiment, after the above step S206, the method further includes: determining the push status of the message; when the push status is push failure, calling a backup server to forward the message.
[0091] In this embodiment, a virtual memory is used as a storage unit of a message queue, and messages are stored in the virtual memory. The virtual memory can store different message types, and messages are only stored in the virtual memory, and will not occupy the local storage of each area. In order to ensure that the messages in the message queue can be sent smoothly, the operation control system allows the standby server to be used as a standby memory for the message queue. During normal operation, the message queue is used to store messages, and the standby server is in a standby state.
[0092] The data sending node through the message queue can monitor the push status of the message in real time. When the push status is a failure, the virtual storage may have a fault. At this time, the backup server is called to run, and the backup server is used to forward the message to the corresponding application unit to complete the message push, avoiding the push of cross-region service messages due to the inability of the message queue to run. The backup server does not affect the normal operation of the message queue, making resource management more flexible and convenient, ensuring security, and effectively improving user service quality.
[0093] It should be understood that although Figure 2-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0094] In one embodiment, Figure 5 As shown, a message subscription mechanism cross-region service message push device is provided, including: a queue forming module 502, a target determining module 504 and a message pushing module 506, wherein:
[0095] A queue forming module 502 is used to collect messages from the local service cluster and form the messages into a message queue;
[0096] A target determination module 504 is used to obtain subscription information of different areas of the power grid and determine a target application unit of the subscription message according to the subscription information;
[0097] The message push module 506 is used to retrieve the message in the message queue and push the message to the target application unit.
[0098] In one embodiment, the queue forming module 502 is specifically used to determine the type of message; according to the type of the message, the message is partitioned and stored to form a message queue.
[0099] In one embodiment, the message push module 506 is specifically used to push a prompt according to the type of message; and obtain corresponding data content from the message queue according to the push prompt.
[0100] In one embodiment, the message push module 506 is also used to determine the state of the data content; when the state of the data content changes, it is determined whether the data content includes content related to power grid security risks, and a notification is sent to the local service cluster.
[0101] In one embodiment, the message includes the time when the event occurred, the name of the subject of the event and the classification identifier of the event; the queue forming module 502 is also used to prioritize the messages according to the level of the event to form a message queue.
[0102] In one embodiment, the target determination module 504 is specifically used to: obtain the real-time business data uploaded by the distributed subscription message system data collection terminal; and search for the recipient of the subscription message according to the real-time business data.
[0103] In one embodiment, the above device further includes a standby module, which is used to determine the push status of the message; when the push status is push failure, the standby server is called to forward the message.
[0104] It should be noted that the message subscription mechanism cross-region service message push device of the present application corresponds one-to-one to the message subscription mechanism cross-region service message push method of the present application. The technical features and beneficial effects described in the embodiment of the above-mentioned message subscription mechanism cross-region service message push method are applicable to the embodiment of the message subscription mechanism cross-region service message push device. For specific contents, please refer to the description in the embodiment of the method of the present application. It will not be repeated here. This is hereby declared.
[0105] In addition, each module in the above-mentioned message subscription mechanism cross-region service message push device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0106] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data in the process of pushing cross-region service messages of a service message subscription mechanism. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a message subscription mechanism cross-region service message push method is implemented.
[0107] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0108] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0109] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0110] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0111] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0112] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A message subscription mechanism cross-region service message push method, characterized in that: The method comprises: Collect messages from the local service cluster and form the messages into a message queue; wherein different types of messages are stored in different data partitions, the message queue uses a virtual memory as a storage unit, the message queue is divided into a configurable and dynamically adjustable storage array through virtualization technology, and the storage data is aggregated and dispersed using a data sorting mechanism, so that the storage data is sorted in an array form, and the array adopts a dispersed storage method; Obtain subscription information of different areas of the power grid, and determine the target application unit of the subscription message according to the subscription information; Retrieving the message in the message queue and pushing the message to the target application unit; wherein, after the data content corresponding to the message is written into the message queue, the state of the data content in the message is monitored by the data sending node of the message queue; When the state of the data content changes, determining whether the changed content includes content related to power grid security risks; If it is determined that the content includes power grid security risks, a notification is sent to the local service cluster and the priority of the message is increased.
2. The method according to claim 1, characterized in that The forming of the message into a message queue comprises: determining the type of the message; According to the type of the message, the message is stored in data partitions to form the message queue.
3. The method according to claim 2, characterized in that The retrieving the message in the message queue and pushing the message to the target application unit includes: Push notification according to the type of the message; Obtain corresponding data content from the message queue according to the push prompt.
4. The method according to claim 1, characterized in that: The message includes the time when the event occurred, the name of the subject of the event and the classification identification of the event; The collecting of messages from the local service cluster and forming the messages into a message queue includes: According to the level of the event, the messages are prioritized to form the message queue.
5. The method according to claim 1, characterized in that The obtaining of subscription information of different areas of the power grid and determining a target application unit for a subscription message according to the subscription information includes: Obtain real-time business data uploaded by the distributed subscription message system and data collection terminals; A recipient subscribing to the message is searched according to the real-time business data.
6. The method according to claim 1, characterized in that After pushing the message to the target application unit, the method further includes: Determining a push status of the message; When the push status is push failure, the standby server is called to forward the message.
7. A message subscription mechanism cross-region service message push device, characterized in that: The device comprises: A queue forming module is used to collect messages from a local service cluster and form the messages into a message queue; wherein different types of messages are stored in different data partitions, the message queue uses a virtual memory as a storage unit, the message queue is divided into a configurable and dynamically adjustable storage array through virtualization technology, and the storage data is aggregated and dispersed using a data sorting mechanism, so that the storage data is sorted in an array form, and the array adopts a dispersed storage method; A target determination module, used to obtain subscription information of different areas of the power grid, and determine a target application unit for a subscription message according to the subscription information; A message push module, used to retrieve the message in the message queue and push the message to the target application unit; The message push module is also used to monitor the status of the data content in the message through the data sending node of the message queue after the data content corresponding to the message is written into the message queue; when the status of the data content changes, determine whether the changed content includes content related to power grid safety risks; if it is determined that the content includes content related to power grid safety risks, send a notification to the local service cluster and increase the priority of the message.
8. The device according to claim 7, characterized in that The queue forming module is further used to determine the type of the message; according to the type of the message, the message is stored in data partitions to form the message queue.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Message pushing system and method for internet of things
CN104468819A
Regional alarm message pushing method and system based on message queue
CN112702190A