A graphical monitoring dynamic refresh method and device

By introducing persistence layer interceptors and transaction message middleware into the terminal production system, generating global and local incremental packages, and combining them with the push mechanism of the Socket server, the problems of high database pressure and unstable data transmission in traditional methods are solved, and the real-time refresh and accuracy of the monitoring interface are achieved, meeting the real-time monitoring needs of terminal production operations.

CN120448451BActive Publication Date: 2025-09-09NEZHA SMART TECHNOLOGY (SHANGHAI) CO LTD

Patent Information

Application Number
CN202510942500.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-09-09
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

The traditional graphical monitoring dynamic refresh method has problems such as high database pressure, unstable data transmission, and low real-time performance in terminal production operations, and cannot meet the real-time monitoring needs.

Method used

The persistence layer interceptor is used to intercept database transaction change events, which are pushed to the global actor using the transaction message middleware to generate a global incremental package. The local actor filters the local data according to the preset query conditions and pushes the incremental data to the target monitoring program in the first-in-first-out queue order through the Socket server.

Benefits of technology

It significantly reduces the pressure on data transmission and database, improves the real-time and accuracy of dynamic data refresh, ensures that the monitoring interface can reflect the latest data changes in real time, and improves operational efficiency and system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448451B_ABST
    Figure CN120448451B_ABST
Patent Text Reader

Abstract

The present application provides a graphical monitoring dynamic refresh method and device, which are applied to the field of information technology. By setting an interceptor in the persistence layer service, the change event of the database can be captured in real time. The change event is then pushed to the global Actor using the transaction message middleware. The global Actor is responsible for maintaining the full data view, and the local Actors filter out customized data on demand to meet the personalized monitoring needs of different users. Finally, the socket service is used to accurately push incremental data and only transmit the data that the user is concerned about, thereby significantly reducing unnecessary data transmission, greatly reducing the pressure on the database and network, and realizing millisecond-level customized dynamic refresh of monitoring data, which significantly improves the real-time performance and accuracy of the monitoring system and meets the strict requirements of terminal production operations for real-time monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to a method and device for dynamically refreshing graphical monitoring. Background Art

[0002] Terminal operations are complex, involving the close coordination of multiple trades and equipment. To ensure smooth operations, the Terminal Operations System (TOS) provides a graphical monitoring program (monitoring program). This program displays various graphical objects, including berths, storage yards, cargo spaces, cargo, ships, loading and unloading equipment, and horizontal transport equipment, in real time against a terminal map. These objects are characterized by coloring, including their status, category, and operation schedule. Statistical analysis data, including loading and unloading progress and efficiency, is also dynamically displayed for each operation line. Through this graphical monitoring interface (monitoring interface), terminal production personnel can fully monitor operation progress and the deployment of resources such as space, personnel, and equipment. This allows them to promptly identify and resolve issues, reducing vessel waiting time in port.

[0003] The monitoring interface displays large-scale production operation data. During production operations, hundreds or even thousands of data changes are constantly being submitted to the database by the TOS. This added, deleted, or modified data needs to be synchronized to the monitoring program in real time, refreshing the corresponding graphical objects on the monitoring interface. To achieve this, a dynamic refresh service in the background needs to efficiently and accurately extract and organize incremental data, push it to the monitoring programs on multiple PC desktops and handheld terminals, and meet the needs of each user to display their own data on the monitoring interface, that is, to customize local data.

[0004] The traditional dynamic refresh method is based on trigger and log table technology. Triggers are added to the relevant tables of the TOS database, and the record changes of these tables are registered in a dedicated log table. Then, the dynamic refresh service periodically polls the log table to obtain logs and parses them. Then, incremental data is extracted from the TOS database through views and pushed to the monitoring program for refreshing the monitoring interface.

[0005] However, this approach has the following problems, which seriously affect the user experience:

[0006] First, because database operations such as reading and writing log tables and extracting incremental data are very frequent, they put great pressure on the database, resulting in the polling frequency being controlled only at the second level, making the real-time performance of dynamic refresh low and unable to meet the needs of real-time monitoring.

[0007] Second, since incremental data is sent to multiple monitoring programs by the dynamic refresh service, and each monitoring program then filters out the local data it needs, it leads to continuous large-scale data transmission between the front-end and back-end, which puts great pressure on transmission, especially in a wireless network environment with poor stability, further reducing the performance and reliability of the system.

[0008] Based on this, a new graphical monitoring dynamic refresh solution is needed. Summary of the Invention

[0009] In view of this, the embodiments of this specification provide a method and device for dynamic refresh of graphical monitoring, which can reduce the data transmission and database pressure of graphical monitoring of the terminal, improve the real-time and accuracy of dynamic data refresh, and enable terminal production personnel to customize real-time monitoring of the production operation process, promptly discover problems and solve them, thereby ensuring that the operation process can be completed smoothly.

[0010] The embodiments of this specification provide the following technical solutions:

[0011] The present invention provides a method for dynamically refreshing a graphical monitoring system, including:

[0012] Intercept the change events of the production operating system database transactions through the persistence layer interceptor;

[0013] Use transactional messaging middleware to push the change event to the global actor that subscribes to the table name;

[0014] The global Actor performs:

[0015] Generate global data based on the view SQL statement; and refresh the global data according to the change event to generate a global incremental package;

[0016] The local actor filters the global data based on preset query conditions to generate local data; and refreshes the local data according to the global incremental package to generate a local incremental package;

[0017] The socket server determines the target monitoring program according to the subscriber dictionary, and pushes the global incremental package and / or the local incremental package to each target monitoring program in a first-in-first-out queue order;

[0018] Each target monitoring program refreshes the graphical monitoring interface according to the received global incremental package and / or local incremental package.

[0019] The embodiment of this specification also provides a graphical monitoring dynamic refresh device, including: an event capture module, a dynamic refresh service and a data docking plug-in;

[0020] The event capture module includes a persistence layer interceptor, which is embedded in the persistence layer of the production operating system and is used to intercept change events of production operating system database transactions and push the change events to the global actor of the subscription table name using the transaction messaging middleware;

[0021] The dynamic refresh service is deployed in a distributed computing cluster and includes:

[0022] A global Actor unit is used to generate global data based on the view SQL statement; and refresh the global data according to the change event to generate a global incremental package;

[0023] A local Actor unit is configured to filter the global data based on a preset query condition to generate local data; and to refresh the local data according to the global incremental package to generate a local incremental package;

[0024] The socket service unit is used to determine the target monitoring program according to the subscriber dictionary, and push the global incremental package and / or the local incremental package to each target monitoring program in a first-in-first-out queue order;

[0025] The data docking plug-in is embedded in the monitoring program, and the data docking plug-in includes: an API client plug-in and a Socket client plug-in;

[0026] The API client plug-in is used to request global data and / or local data from the dynamic refresh service to build a monitoring interface;

[0027] The Socket client plug-in is used to refresh the graphical monitoring interface of each target monitoring program according to the received global incremental package and / or local incremental package.

[0028] Compared with the prior art, the at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects:

[0029] The persistence layer interceptor captures database transaction change events of the production operating system and pushes these events to the global actor using the transaction messaging middleware. The global actor generates global data based on the view SQL statement and refreshes the global data according to the change event to generate a global incremental package. The local actor filters local data from the global data according to the preset query conditions and further refreshes the local data according to the global incremental package to generate a local incremental package. The socket server accurately pushes the global incremental package and the local incremental package to each target monitoring program in a first-in-first-out queue order based on the subscriber dictionary to ensure the orderliness and accuracy of data transmission. Finally, each target monitoring program refreshes the graphical monitoring interface in real time according to the received incremental package, significantly reducing the pressure on data transmission and database operations, while improving the real-time and accuracy of dynamic data refresh. This enables terminal production personnel to more efficiently customize the real-time monitoring of the production operation process, promptly identify problems and quickly resolve them, thereby ensuring the smooth progress of the operation process and improving overall operation efficiency and the reliability of the monitoring system. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0031] Figure 1 This is a schematic diagram of dynamic refresh data processing in this application;

[0032] Figure 2 This is a diagram of a dynamically refreshed data processing device in this application. DETAILED DESCRIPTION

[0033] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0034] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of this application.

[0035] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this application, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspect described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this apparatus and / or practice this method.

[0036] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. The illustrations only show components related to the present application and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.

[0037] Additionally, in the following description, specific details are provided to provide a thorough understanding of the examples, however, one skilled in the art will appreciate that the examples can be practiced without these specific details.

[0038] Terminal production operations are complex, requiring the collaboration of multiple trades and the linkage of multiple devices. A graphical monitoring interface is required to display the status of berths, storage yards, ships and other objects, as well as the progress of operations (such as loading and unloading efficiency statistics) in real time.

[0039] Through in-depth research and improvement exploration on the dynamic refresh method, the inventors found that the traditional solution using the "trigger + log table polling" mechanism to achieve dynamic data refresh has the following problems: First, frequent reading and writing of log tables and extraction of incremental data cause huge pressure on the database, dragging down the core business performance, and the polling interval is limited by the database pressure, and the refresh delay can only be controlled at the second level, which cannot meet the millisecond-level monitoring requirements of ship loading and unloading; second, the full amount of incremental data is broadcast to all terminals, and the terminals filter local data by themselves, generating a large amount of redundant data, exacerbating the risk of unstable data transmission.

[0040] Based on this, the embodiment of this specification proposes a graphical monitoring dynamic refresh method: introducing the Actor distributed architecture and the interceptor in the persistence layer service. By setting the interceptor in the persistence layer service, the database change events can be captured in real time, and then the change events are pushed to the global Actor using the transaction message middleware. The global Actor is responsible for maintaining the full data view, and the local Actors filter out customized data on demand to meet the personalized monitoring needs of different users. Finally, the Socket service is used to achieve accurate push of incremental data, and only transmits the data that the user is concerned about, thereby significantly reducing unnecessary data transmission, greatly reducing the pressure on the database and network, and realizing millisecond-level customized dynamic refresh of monitoring data, significantly improving the real-time and accuracy of the monitoring system, and meeting the strict requirements of terminal production operations for real-time monitoring.

[0041] The following are explanations of professional terms:

[0042] The Actor distributed parallel computing model originated from Carl Hewitt's 1973 proposal as a conceptual model for parallel computing. Today's mainstream cloud-native tools and runtime environments enable the creation, registration, addressing, activation, operation, and release of virtual actor computing units within distributed system architectures, automatically troubleshooting and restoring normal operations. This enables event-driven and parallel computing within distributed systems. These tools offer real-time performance, reliability, robustness, and scalability, supporting large-scale real-time data processing and high-performance computing. Examples include the open-source Dapr cloud-native runtime environment and development framework.

[0043] A virtual actor computing unit (or actor for short) is a computing unit with independent computation and state (equivalent to a process, without shared memory). It can be deployed in a distributed computing hosting service cluster and registered with the cluster's hosting service instance (i.e., service container). The hosting service is responsible for addressing, activating, running, releasing, and recovering from failures. Actors are transparent to the outside world and are uniquely identified by the actor keyword (or ID). The outside world accesses a specific actor using the agreed-upon ID without knowing which server the actor is running on or how it was activated and released.

[0044] Publish-Subscribe Pattern (Pub / Sub): It is the basis for Actors to implement event-driven and parallel computing, and it also guarantees the real-time and accuracy of dynamic refresh. Dapr's Pub / Sub component encapsulates Pub / Sub middleware, including mainstream message middleware such as Kafka, RocketMQ, RabbitMQ, etc., and can be configured and used on demand.

[0045] Aspect-Orient Programming (AOP) is a method for dynamically and uniformly adding additional functionality to a program without modifying the source code. AOP can be understood as a modular encapsulation of cross-cutting concerns, consisting of a set of advices and a pointcut. Advices define additional logic to be executed at different stages of the target method's execution (such as before, after, and when an exception is thrown); pointcuts precisely match the target methods to which these advices should be applied.

[0046] The following describes the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.

[0047] like Figure 1 As shown, the embodiment of this specification provides a graphical monitoring dynamic refresh method, including:

[0048] Through the persistence layer interceptor, the change events of the database transaction are intercepted. These change events include data addition, deletion, and modification operations. When the database transaction changes, the interceptor captures these change events and packages them into structured messages.

[0049] Using transactional messaging middleware, the change event is pushed to the global actor that subscribes to the table name; the change event is sent in the form of a message, which contains information such as the type of change operation (add, delete, modify), the table name involved, the record number, and the changed field.

[0050] The global Actor performs:

[0051] Generate global data based on the view SQL statement; and refresh the global data according to the change event to generate a global incremental package.

[0052] Specifically, the global Actor receives the addition, deletion, and modification events pushed by the persistence layer interceptor, parses the content of the addition, deletion, and modification events, refreshes the data objects of the global data, organizes the refresh process into incremental data, and broadcasts it to the Socket server and local Actor.

[0053] The local Actor filters the global data based on preset query conditions to generate local data; and refreshes the local data according to the global incremental package to generate a local incremental package.

[0054] Specifically, the local Actor receives incremental data and refreshes the local data based on the preset query conditions. After the refresh is completed, the refresh process is organized into incremental data and broadcast to the Socket server.

[0055] The socket server determines the target monitoring program according to the subscriber dictionary, and pushes the global incremental package and / or the local incremental package to each target monitoring program in a first-in-first-out queue order;

[0056] Among them, the subscriber dictionary records the subscription relationship of each monitoring program to ensure that incremental data can be pushed to the correct monitoring program.

[0057] Each target monitoring program refreshes the graphical monitoring interface according to the received global incremental package and / or local incremental package to ensure that the monitoring interface can reflect the latest data changes in real time.

[0058] In practice, the data displayed on the monitoring interface doesn't correspond one-to-one to database table records. Most data must be obtained through multi-table join queries and is limited to a default range. For standardization purposes, whether querying a single or multiple tables, or even statistical queries, global data is retrieved through view SQL statements. This global data is then filtered into local data for display on the monitoring interface. The incremental data used for interface refreshes is generated by the terminal's production operating system (TOS) database, generating additions, deletions, and modifications. This incremental data is organized into incremental data after undergoing a series of data integration and filtering processes.

[0059] Assume that during a terminal operation, a spreader moves container X from container area A01 to container area B01. The terminal production operating system (TOS) executes SQL to update the location of container X. The interceptor intercepts the SQL and packages the change event, which is then pushed to the global actor subscribed to the table name through the transactional messaging middleware.

[0060] After receiving the change event, the global Actor refreshes the global data according to the event content and generates a global incremental package containing data change information;

[0061] Local actors filter customized data from global data based on preset query conditions and generate local incremental packages based on global incremental packages. Each local actor is responsible for specific monitoring requirements, such as:

[0062] Local Actor 1 (responsible for container area A01): extracts the change information related to container area A01 from the global incremental package and generates a removal event, indicating that container X is removed from container area A01;

[0063] Local Actor 2 (responsible for container area B01): Extracts change information related to container area B01 from the global incremental package and generates a new event, indicating that container X is added to container area B01.

[0064] The socket maintains an independent FIFO queue and sends global increment packets and local increment packets to each monitoring program in sequence, reducing data transmission delay and redundancy.

[0065] Each monitoring program updates the graphical monitoring interface based on the received incremental packets to ensure that the monitoring interface can reflect the latest data changes in real time, such as:

[0066] The large screen in the central control room shows that container X has been moved from container area A01 to container area B01. The A01 monitoring terminal no longer displays container X, while the B01 monitoring terminal displays container X.

[0067] It should be noted that initialization is required when the monitoring program is started.

[0068] On the one hand, it is necessary to obtain global / local data from the dynamic refresh service to build the monitoring interface and display the data; on the other hand, it is necessary to subscribe to incremental data through the dynamic refresh service and establish a Socket connection to continuously receive the pushed incremental data and refresh the monitoring interface until the program is closed.

[0069] In some embodiments, the persistence layer interceptor is implemented by weaving it into the persistence layer service through aspect-oriented programming or by implanting a framework plug-in into the persistence layer service;

[0070] The interception method of the persistence layer interceptor includes:

[0071] Before a database transaction is committed, the change events that meet the monitoring scope are packaged into a change transaction message, and the name of the changed data table is recorded;

[0072] Transactional message middleware is used to broadcast the changed data table name for consumption by subscribed global actors.

[0073] In implementation, instead of the traditional trigger + log table model, the Aspect Orient Programming (AOP) method is mainly used to weave persistence layer interceptors into the TOS persistence layer service. When the persistence layer service submits the addition, deletion, and modification of data, if the operation table, addition, deletion, and modification actions, and updated fields are all within the preset monitoring range, the transaction message mechanism is used to package the addition, deletion, and modification data of the entire transaction into addition, deletion, and modification events. The operation table name is used as the topic and broadcasted through the Pub / Sub middleware for consumption by global actors subscribing to these topics.

[0074] If the framework of the TOS persistence layer service can be modified, the interceptor can be directly implanted into the framework as a plug-in to intercept and reduce unnecessary performance loss.

[0075] In some embodiments, the transactional message-type message middleware adopts a two-phase commit transaction mechanism, including: semi-message storage, transaction status review, and final commit / rollback process.

[0076] During implementation, before the TOS persistence layer service submits the database transaction, it submits the add, delete, and modify events to the publishing channel in the form of a middleware Half Message, using the table names of the operated tables as topics.

[0077] If the database transaction is successfully committed, the middleware's commit message is submitted; if the database transaction is not successfully committed, the middleware's rollback message is submitted.

[0078] For example, RocketMQ is used to ensure the consistency of local transactions and message data, ensuring that TOS either succeeds or fails in both operations of executing local transactions and sending messages.

[0079] In some embodiments, the global Actor is uniquely identified by a view name;

[0080] The local Actor is uniquely identified by "view name + serialized query condition", where the query condition is a structured data serialized string.

[0081] During implementation, the global data displayed on the monitoring interface can be obtained from the global Actor of the dynamic refresh service using the view name, and the ID of the global Actor is identified by the view name.

[0082] When a global actor is activated, it first retrieves the view's SQL statement from the Terminal Operation System (TOS) database, analyzes the tables being queried, uses these table names as topics, and subscribes to the Pub / Sub middleware for add, delete, and modify events related to these tables. It then uses the view's SQL statement to retrieve global data from the Terminal Operation System (TOS) database. View SQL statements include built-in conditionals, which means they can have a preset default scope.

[0083] For example, if you want to display the containers in the yard, that is, the on-site containers, the default scope of the view is to determine whether the containers are stacked in the container area, that is, only those with a value for the container area ID attribute are classified as on-site containers.

[0084] The local data displayed on the monitoring interface can be retrieved from the local actor of the dynamic refresh service using the view name and query criteria. The local actor's ID is identified by the view name + query criteria. When activated, the local actor uses the view name as its ID to access the global actor. The global actor then filters the global data based on the submitted query criteria to select the local data that meets the query criteria, without requiring database access. For example, to retrieve containers from a specific container area, the global actor for the container area ID can be used as the query criteria to access the global actor for the container area, filtering the container inventory for that container area.

[0085] In some embodiments, refreshing the global data according to the change event includes:

[0086] When a change event involves a single-table query, the corresponding data object is searched in the global data using the record number, and the data object is refreshed based on the change event and the changed field. If the refreshed data object exceeds the default range of the view, the data object is removed from the global data.

[0087] When a change event involves multi-table query, all related data objects are searched in the global data using the record number, and related data objects are refreshed in cascade based on the change event and the changed fields. If any of the refreshed related data objects exceeds the default range of the view, the cascaded data object is removed from the global data.

[0088] When a change event involves a statistical query, new global data is obtained from the database to replace the local global data.

[0089] During implementation, once a CRUD event is received from the persistence layer interceptor, the content of the CRUD event is parsed and the data object of the global data is refreshed.

[0090] For single-table queries, directly search for the data object in the global data using the record ID, then refresh the data object using actions and update fields. If the refresh exceeds the default range of the view, the data object is removed from the global data.

[0091] Suppose there is a view used to display containers in the yard. The default scope is that the container area ID attribute has a value. If a container is moved out of the yard and the attribute value becomes NULL after refresh, it exceeds the default scope of the view. The global Actor removes the data object of the container from the global data to maintain the consistency and accuracy of the global data.

[0092] For multi-table queries, directly search for data objects in the global data using the record ID. Multiple objects may be found. Then, use actions and update fields to refresh these data objects. If the refresh exceeds the default range of the view, the data object is removed from the global data.

[0093] For statistical queries, directly obtain new global data from the TOS database and replace the local data.

[0094] The local global data can be completely replaced with the latest global data obtained.

[0095] You can also compare new and old statistical values ​​to generate a numerical difference increment package, and only update the changed parts of the local global data.

[0096] In some embodiments, when a change event involves a statistical query, the event is stored in a cache queue. When a preset time threshold or event quantity threshold is reached, new global data is obtained from the database to replace the local global data.

[0097] If the event frequency is too high and querying the database directly would cause a lot of pressure, set a query frequency that is acceptable to the user and query the database only after a period of events have accumulated, such as once every 30 seconds. Or, query the database only when the number of events reaches a threshold.

[0098] In some embodiments, pushing the global incremental package and / or the local incremental package to each target monitoring program in a first-in-first-out queue order includes:

[0099] The subscriber retrieves the message first-in-first-out queue corresponding to the monitoring program from the message first-in-first-out queue dictionary and checks whether the sequence number of the head message is consistent with the sequence number of the received message. If they are consistent, the message is cancelled; otherwise, the message is resent.

[0100] If the message fails to be sent or the socket connection is disconnected, the message is resent;

[0101] If the socket is not reconnected within the preset time, the following actions are performed:

[0102] Clean up subscriber cache data;

[0103] And / or, unsubscribe from the global incremental package and / or the local incremental package.

[0104] During implementation, the subscriber list is traversed, subscribers are extracted one by one, the subscribers are used to retrieve the self-incrementing sequence number from the sequence number dictionary, and the subscribers are used to retrieve the message FIFO queue from the message FIFO queue dictionary.

[0105] The sequence number, view name, query condition, and incremental data are packaged together and enqueued into the FIFO queue as a message.

[0106] Find the socket connection with the same IP address as the subscriber client in the socket service and send the message.

[0107] Continue to traverse the next subscriber until the last subscriber, ending this event.

[0108] If incremental data is misplaced or lost during the push process, the accuracy of the data displayed on the monitoring interface will be affected. This is a common problem in environments with poor network stability. It is necessary to ensure data accuracy during the message sending and receiving process. Specifically:

[0109] When the monitoring program's socket client receives a message, it extracts the sequence number from the message as a message receipt and sends it back to the socket server. Upon receiving the message receipt, the socket server uses the subscriber (i.e., the socket connection attribute) to retrieve the message FIFO queue from the message FIFO queue dictionary and check whether the sequence number matches the sequence number of the head message. If so, the message is dequeued and the head message is removed. If not, the message is resent, traversing the message FIFO queue from the head, pushing each message out through the socket connection one by one.

[0110] Once the Socket server receives the heartbeat message from the Socket client, it immediately sends it back.

[0111] If a message fails to be sent or the socket connection is disconnected, the socket connection will be released and the disconnection time will be recorded in the disconnection dictionary. When the socket is reconnected, the disconnection time in the disconnection dictionary will be deleted and the message will be resent.

[0112] The connection and disconnection dictionary is traversed periodically (for example, every 10 seconds). If the socket is not reconnected for more than a period of time (for example, 30 seconds), the subscriber is considered offline and no incremental data is pushed. The subscriber cache data is cleared and even the incremental data of the global / local actor is unsubscribed.

[0113] This application can reduce the data transmission and database pressure of graphical monitoring, improve the real-time and accuracy of dynamic data refresh, and enable terminal production personnel to customize real-time monitoring of production operations, promptly identify problems and solve them, thereby ensuring the smooth completion of the operation process.

[0114] Based on the same inventive concept, the present application also provides a graphical monitoring dynamic refresh device, including: an event capture module, a dynamic refresh service and a data docking plug-in;

[0115] The event capture module includes a persistence layer interceptor, which is embedded in the persistence layer and is used to intercept the change event of the database transaction and push the change event to the global actor of the subscription table name using the transaction message middleware;

[0116] The dynamic refresh service is deployed in a distributed computing cluster and includes:

[0117] A global Actor unit is used to generate global data based on the view SQL statement; and refresh the global data according to the change event to generate a global incremental package;

[0118] A local Actor unit is configured to filter the global data based on a preset query condition to generate local data; and to refresh the local data according to the global incremental package to generate a local incremental package;

[0119] The socket service unit is used to determine the target monitoring program according to the subscriber dictionary, and push the global incremental package and / or the local incremental package to each target monitoring program in a first-in-first-out queue order;

[0120] The data docking plug-in is embedded in the monitoring program, and the data docking plug-in includes: an API client plug-in and a Socket client plug-in;

[0121] The API client plug-in is used to request global data and / or local data from the dynamic refresh service to build a monitoring interface;

[0122] The Socket client plug-in is used to refresh the graphical monitoring interface of each target monitoring program according to the received global incremental package and / or local incremental package.

[0123] In some embodiments, the persistence layer interceptor is implemented by weaving it into the persistence layer service through aspect-oriented programming or by implanting a framework plug-in into the persistence layer service;

[0124] Before a database transaction is committed, it packages the change events that meet the monitoring scope into a change transaction message and records the name of the changed data table;

[0125] Transactional message middleware is used to broadcast the changed data table name for consumption by subscribed global actors.

[0126] In some embodiments, when the global Actor unit is activated, the view name is used as a unique identifier to obtain the view SQL from the database;

[0127] When the local Actor unit is activated, it uses "view name + serialized query condition" as a unique identifier to obtain local data that meets the query condition from the global Actor unit; wherein the query condition is a structured data serialized string.

[0128] The following is another example of a graphical monitoring dynamic refresh device, which is a schematic illustration formed by combining the above examples. Figure 2 As shown, it includes: dynamic refresh service, supplemented by data docking plug-in embedded in the monitoring program, and persistence layer interceptor woven / implanted into TOS persistence layer service;

[0129] The dynamic refresh service consists of a series of service components built on a distributed computing hosting service cluster. These components can handle TOS addition, deletion, and modification events, provide API services for monitoring programs to subscribe to incremental data and obtain global / local data, and provide a socket service for pushing incremental data to monitoring programs. The dynamic refresh service includes: API server, socket server, global actor, and local actor.

[0130] Among them, the API server is used to respond to service requests initiated by the monitoring program. By default, the RPC (Remote Procedure Call) protocol is used (if the monitoring program is a browser or terminal APP, other remote access technologies such as WebAPI can also be used). The input parameters are the client IP address, port number, view name, and query conditions.

[0131] Specifically, define the ID for accessing global / local Actors and assign a value: if the incoming parameter does not contain a query condition, the view name is used for assignment; if the incoming parameter also contains a query condition, the query condition is first serialized into a JSON string, and then the view name and JSON string are concatenated with a plus sign to assign the ID.

[0132] Extract the client IP address and port number from the incoming parameters, and use them together with the global / local Actor ID as parameters to access the internal API interface of the Socket server and subscribe to incremental data for the monitoring program.

[0133] Access the specified Actor using the global / local Actor ID to obtain global / local data.

[0134] The obtained global / local data is given to the monitoring program as the return result of the service request.

[0135] End this response.

[0136] The socket server is used to receive incremental data pushed by global / local actors and accurately push it to subscribed monitoring programs, thereby achieving real-time and targeted transmission of incremental data.

[0137] During implementation, we first define: a socket service dictionary, which records socket services on different ports, with the port number as the key and the socket service as the value; subscribers, whose attributes are the client IP address and port number; a subscriber dictionary, which records the one-to-many relationship between global / local actors and subscribers, with the global / local actor ID as the key and the subscriber list as the value; sequence numbers, which are assigned a self-increasing sequence number starting from 1 and used to mark the order in which incremental data is sent; a sequence number dictionary, which records the sequence numbers of different subscribers, with the subscriber as the key and the sequence number as the value. Each time a sequence number is retrieved, it is an incremented and recorded sequence number; a message first-in-first-out (FIFO) queue, which is assigned to each subscriber. The message content consists of the sequence number, view name, query condition, and incremental data; a message FIFO queue dictionary, which records the message FIFO queues of different subscribers, with the subscriber as the key and the message FIFO queue as the value; and a connection and disconnection dictionary, which records the time when a socket connection is disconnected, with the subscriber as the key and the disconnection time as the value.

[0138] Then provide an internal API interface, which can use the RPC protocol to respond to service requests initiated by the API server. The incoming parameters are the client IP address, port number, and global / local Actor ID.

[0139] Specifically, the client IP address, port number, and global / local Actor ID are extracted from the incoming parameters. If there is no socket service with the port number in the socket service dictionary, then: a new socket service is constructed and the port is opened, and the new socket service is added to the socket service dictionary.

[0140] If there is no subscriber list for the global / local actor's ID in the subscriber dictionary, then: use the global / local actor's ID as the Topic to subscribe to the incremental data pushed by the global / local actor to the Pub / Sub middleware, build an empty subscriber list to record the subscribers of the global / local actor, and add it to the subscriber dictionary.

[0141] Construct a new subscriber using the client IP address and port number and add it to the subscriber list. If there is a duplicate, it will not be added.

[0142] The updated subscriber dictionary is stored in the database so that in case of a crash, the service can be automatically reconstructed and restored in the service cluster to rebuild and populate the subscriber dictionary.

[0143] End this response.

[0144] When processing incremental data events, once the incremental data pushed by the global / local Actor is received, the subscriber list is retrieved from the subscriber dictionary using Topic.

[0145] Extract the view name and query conditions from the Topic, which is the ID of the global / local Actor:

[0146] View name: The string before the plus sign. If there is no plus sign, the entire Topic string is used.

[0147] Query conditions: The string after the plus sign is obtained by deserializing it from JSON. If there is no plus sign, the result is empty.

[0148] Traverse the Socket service dictionary, and if the port number exists in the subscriber list, start a thread and pass the Socket service, subscriber list, and incremental data to the thread. In these threads:

[0149] Traverse the subscriber list and extract the subscribers one by one; use the subscriber to retrieve the self-incrementing sequence number from the sequence number dictionary; use the subscriber to retrieve the message FIFO queue from the message FIFO queue dictionary; package the sequence number, view name, query conditions and incremental data together as the message enqueue FIFO queue; find the socket connection with the same IP address as the subscriber client in the socket service and send the message; continue to traverse the next subscriber until the last subscriber; end this event.

[0150] Message sending and receiving mechanism: If the incremental data is disordered or lost during the push process, it will affect the accuracy of the data displayed on the monitoring interface. This is a common problem in environments with poor network stability. It is necessary to ensure the accuracy of the data during the message sending and receiving process.

[0151] Specifically, maintain the message order: using the TCP protocol can ensure that data arrives in order;

[0152] Deregistering / Resending Messages: When the monitoring program Socket client receives a message, it needs to extract the sequence number from the message as a message receipt and send it back to the Socket server. Upon receiving the message receipt, the Socket server uses the subscriber (i.e., the Socket connection attribute) to retrieve the message FIFO queue from the message FIFO queue dictionary and check whether the sequence number matches the sequence number of the head message. If so, the message is deregistered and the head message is dequeued. If not, the message is resent, traversing the message FIFO queue from the head, and pushing each message out through the Socket connection one by one.

[0153] Heartbeat mechanism: Once the Socket server receives the heartbeat message sent by the Socket client, it immediately sends it back;

[0154] Reconnection mechanism: If a message fails to be sent or the socket connection is disconnected, the socket connection will be released and the disconnection time will be recorded in the disconnection dictionary. When the socket is reconnected, the disconnection time in the disconnection dictionary will be deleted and the message will be resent.

[0155] Clean up subscribers: traverse the disconnection dictionary periodically (for example, every 10 seconds). If the socket is not reconnected for more than a period of time (for example, 30 seconds), the subscriber is considered offline and no longer pushes incremental data. The subscriber cache data is cleaned up, and even the incremental data of the global / local actor is unsubscribed.

[0156] Specifically, traverse the subscriber dictionary and delete subscribers from the subscriber list one by one. If the subscriber list is cleared, it means that no monitoring program needs to subscribe to the incremental data of this global / local Actor. Then use the key value (that is, the ID of the global / local Actor) to unsubscribe from the incremental data of the corresponding Topic on the Pub / Sub middleware, delete the Key-Value data in the subscriber dictionary, use the subscriber to delete the Key-Value data in the sequence number dictionary, use the subscriber to delete the Key-Value data in the message FIFO queue dictionary, and use the subscriber to delete the Key-Value data in the disconnection dictionary.

[0157] Global Actor is responsible for managing and maintaining global data, processing addition, deletion, and modification events related to this data, and broadcasting incremental data to other components.

[0158] During implementation, first define: define the view name, that is, its own ID; define the SQL statement of the view, that is, the content of the view; define the queried tables, that is, the list of table names of the tables queried by the view; define global data, that is, the list of data objects recorded in the form of dynamic objects.

[0159] When activated, the initialization process is executed: the view name is used to obtain the view's SQL statement from the TOS database; the tables being queried are analyzed from the view's SQL statement; the table names of the queried tables are used as topics to subscribe to the Pub / Sub middleware for the addition, deletion, and modification events of these tables pushed by the persistence layer interceptor; the view's SQL statement is used to obtain global data from the TOS database; and initialization ends.

[0160] Provides an internal API interface: uses the RPC protocol to respond to service requests initiated by the API server / local Actor, and the incoming parameters are query conditions.

[0161] Specifically, if the query condition is empty, the returned result is global data; if the query condition is not empty, the returned result is local data that meets the query condition filtered out from the global data; and this response ends.

[0162] When processing add, delete, and modify events, once the add, delete, and modify events pushed by the persistence layer interceptor are received, the content of the add, delete, and modify events is parsed and the data objects of the global data are refreshed, including:

[0163] For single-table queries, directly search for the data object in the global data using the record ID, then refresh the data object using the action and update fields. If the refresh exceeds the default range of the view, the data object is removed from the global data.

[0164] For multi-table queries, directly search for data objects in the global data using the record ID. Multiple objects may be found, and then refresh these data objects using actions and update fields. If the refresh exceeds the default range of the view, the data object is removed from the global data.

[0165] For statistical queries, directly query the TOS database to obtain the latest global data and replace the local data. If the event frequency is too high and querying the database directly would cause a lot of pressure, set a user-approved query frequency and query the database only after a period of events have accumulated, such as once every 30 seconds.

[0166] The above refresh process is organized into incremental data, and the ID is used as a Topic to broadcast it through the Pub / Sub middleware for consumption by the Socket servers and local Actors that subscribe to these Topics, ending this event.

[0167] The local Actor is used to filter the global data based on preset query conditions to generate local data; and refresh the local data according to the global incremental package to generate a local incremental package.

[0168] During implementation, first define: define the view name, which is extracted from its own ID and is the string before the plus sign; define the query condition, which is extracted from its own ID and is obtained by deserializing the string after the plus sign through JSON; define local data, which is a list of data objects recorded in the form of dynamic objects; define the global Actor's ID, which is the view name.

[0169] When activated, the initialization process is executed: the global actor's ID is used to access the specified actor, the query conditions are passed in, and local data is obtained; the global actor's ID is used as the topic to subscribe to the global actor's incremental data from the Pub / Sub middleware; and the initialization ends.

[0170] Provides an internal API interface: uses the RPC protocol to respond to service requests initiated by the API server, and returns results as local data.

[0171] When processing incremental data events: Once incremental data pushed by the global Actor is received, the data objects of the local data are refreshed according to the refresh process in the incremental data. If the updated data exceeds the query condition range, the data objects are removed from the local data. The above refresh process is organized into incremental data, and the ID is used as the Topic to broadcast it through the Pub / Sub middleware for consumption by the Socket server that subscribes to these Topics. End this event.

[0172] Data docking plug-ins include: API clients and Socket clients embedded in the monitoring program. Through these plug-ins, you can subscribe to incremental data from the dynamic refresh service and obtain global / local data to build and refresh the monitoring interface.

[0173] Among them, the API client plug-in is used to provide a local API interface that responds to the monitoring program's docking dynamic refresh service request, and the input parameters are the view name and query conditions.

[0174] Specifically, according to the IP address of the API server, the dynamic refresh service API server is accessed, and the incoming parameters are the client IP address, port number, view name, and query conditions; the obtained global / local data is given to the monitoring program as a return result to build a monitoring interface; and this response ends.

[0175] Socket client plug-in, used to connect to the dynamic refresh service Socket server, receive incremental data, and maintain the connection until the monitoring program is closed.

[0176] Specifically, connect to the Socket server: connect to the Socket server according to the IP address and port number of the Socket server, which is usually executed when the monitoring program is initialized or the Socket is reconnected;

[0177] Receive incremental data: Provide a local event interface to the monitoring program to trigger the refresh of the monitoring interface. Once a message is received, the sequence number, view name, query conditions and incremental data are extracted from the message. If the sequence number is consistent with the local sequence number, the event interface is triggered, and the view name, query conditions and incremental data are transmitted to notify the monitoring program to refresh the monitoring interface. The local sequence number is increased by one, and the sequence number is sent back to the Socket server as a message receipt to end this event.

[0178] Message sending and receiving mechanism: Cooperate with the Socket server to ensure that incremental data will not be confused or lost.

[0179] Heartbeat mechanism: The Socket client sends a heartbeat message to the Socket server at a fixed time (for example, 9 seconds by default).

[0180] Reconnection mechanism: If the Socket client fails to receive the heartbeat on time (for example, the default 18 seconds) or fails to send a message, it will actively release the Socket connection and try to reconnect to the Socket server.

[0181] It should be noted that before using the plug-in, it must be defined first, including:

[0182] Define the client IP address, which is the local IP address of the monitoring program;

[0183] Defines the port number used by the Socket client to connect to the Socket server. This allows the monitor to start multiple processes without interfering with each other, by assigning different port numbers. The port number can be stored in the local configuration file.

[0184] Define the IP address of the API server and store it in the local configuration file.

[0185] Define the IP address of the socket server and store it in the local configuration file.

[0186] Defines the local sequence number, with an initial value of 1, which is used to compare the sequence number sent by the Socket server.

[0187] The persistence layer interceptor is used to weave / implant the persistence layer interceptor into the TOS persistence layer service using AOP / plug-in methods, obtain the addition, deletion, and modification data of database transactions, and package them into addition, deletion, and modification events for consumption by subscribed global actors.

[0188] Specifically, first define: Define the monitoring scope: stored in the configuration file, the content includes: the table to be monitored, the addition, deletion and modification actions, and the updated fields; define the release channel: stored in the configuration file; define the AOP entry point: write rules for the code to intercept the TOS persistence layer service, and write the matching rules of the entry point, such as the matching conditions of the nouns of the class and method to be cut in. The matching conditions can contain wildcards.

[0189] When the TOS persistence layer service initiates a database transaction, it begins recording the SQL statements and parameters for adding, deleting, and modifying data. After comparing the monitoring scope, only the SQL statements and parameters within the monitoring scope are recorded and packaged into the add, delete, and modify events, and the tables operated on are recorded. Before the TOS persistence layer service commits the database transaction, the add, delete, and modify events are submitted to the publishing channel in the form of a middleware Half Message message, using the table names of the tables being operated on as Topics. If the database transaction is successfully committed, the middleware's Commit message is submitted. If the database transaction is not successfully committed, the middleware's Rollback message is submitted.

[0190] Compensation mechanism: If the TOS persistence layer service happens to be down during the period, the Pub / Sub middleware compensation mechanism is used to ensure that the transaction message is successfully submitted.

[0191] This application combines distributed architecture, Actor model, Pub / Sub, Socket, AOP, etc. to create a new dynamic refresh architecture and device.

[0192] This application organizes the addition, deletion, and modification events of database transactions into customized incremental data for interface refresh through hierarchical management of global and local actors, and undergoes a series of data integration and filtering processes.

[0193] Compared with traditional methods, the present invention realizes the layer-by-layer push of data throughout the entire process, and can achieve dynamic refresh at the millisecond level, completely meeting the real-time needs of terminal production personnel for monitoring the production operation process.

[0194] Compared with traditional methods, the present invention has zero pressure on the database. Only customized incremental data is transmitted between the server and the client, which can greatly reduce the pressure on network transmission. There are no special requirements for the hardware configuration of the monitoring program. Moreover, the dynamic refresh service adopts a distributed architecture, which can scale hardware resources according to the data scale, and the overall cost investment is lower.

[0195] In this specification, the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments described later, the description is relatively simple, and the relevant parts can be referred to the partial description of the previous embodiments.

[0196] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A graphical monitoring dynamic refresh method, characterized in that: include: Intercept the change events of the production operating system database transactions through the persistence layer interceptor; The interception method of the persistence layer interceptor includes: Before a database transaction is committed, the change events that meet the monitoring scope are packaged into a change transaction message, and the name of the changed data table is recorded; Use transactional message middleware to broadcast the changed data table name for consumption by subscribed global actors; The global Actor performs: Generate global data based on the view SQL statement; and refresh the global data according to the change event to generate a global incremental package; The local actor filters the global data based on preset query conditions to generate local data; and refreshes the local data according to the global incremental package to generate a local incremental package; The socket server determines the target monitoring program according to the subscriber dictionary, and pushes the global incremental package and / or the local incremental package to each target monitoring program in a first-in-first-out queue order; Each target monitoring program refreshes the graphical monitoring interface according to the received global incremental package and / or local incremental package.

2. The graphical monitoring dynamic refresh method according to claim 1, characterized in that: The persistence layer interceptor is implemented by weaving it into the persistence layer service of the production operating system through an aspect-oriented programming method or by implanting a framework plug-in into the service.

3. The graphical monitoring dynamic refresh method according to claim 2, characterized in that: The transactional message middleware adopts a two-phase commit transaction mechanism, including: semi-message storage, transaction status review and final commit / rollback process.

4. The graphical monitoring dynamic refresh method according to claim 1, characterized in that: The global Actor is uniquely identified by the view name; The local Actor is uniquely identified by "view name + serialized query condition", where the query condition is a structured data serialized string.

5. The graphical monitoring dynamic refresh method according to claim 1, characterized in that: The refreshing of the global data according to the change event includes: When a change event involves a single-table query, the corresponding data object is searched in the global data using the record number, and the data object is refreshed based on the change event and the changed field. If the refreshed data object exceeds the default range of the view, the data object is removed from the global data. When a change event involves multi-table query, all related data objects are searched in the global data using the record number, and related data objects are refreshed in cascade based on the change event and the changed fields. If any of the refreshed related data objects exceeds the default range of the view, the cascaded data object is removed from the global data. When a change event involves a statistical query, new global data is obtained from the production operating system database to replace the local global data.

6. The graphical monitoring dynamic refresh method according to claim 5, characterized in that: When a change event involves a statistical query, the event is stored in a cache queue. When the preset time threshold or event quantity threshold is reached, new global data is obtained from the production operating system database to replace the local global data.

7. The graphical monitoring dynamic refresh method according to claim 1, characterized in that: The step of pushing the global incremental package and / or the local incremental package to each target monitoring program in a first-in-first-out queue order includes: The subscriber retrieves the message first-in-first-out queue corresponding to the monitoring program from the message first-in-first-out queue dictionary and checks whether the sequence number of the head message is consistent with the sequence number of the received message. If they are consistent, the message is cancelled; otherwise, the message is resent. If the message fails to be sent or the socket connection is disconnected, the message is resent; If the socket is not reconnected within the preset time, the following actions are performed: Clean up subscriber cache data; And / or, unsubscribe from the global incremental package and / or the local incremental package.

8. A graphical monitoring dynamic refresh device, characterized in that: include: Event capture module, dynamic refresh service and data docking plug-in; The event capture module includes a persistence layer interceptor, which is embedded in the persistence layer of the production operating system and is used to intercept change events of database transactions of the production operating system. The interception method of the persistence layer interceptor includes: before the database transaction is committed, packaging the change events that meet the monitoring scope into a change transaction message and recording the name of the changed data table; Use transactional message middleware to broadcast the changed data table name for consumption by subscribed global actors; The dynamic refresh service is deployed in a distributed computing cluster and includes: A global Actor unit is used to generate global data based on the view SQL statement; and refresh the global data according to the change event to generate a global incremental package; A local Actor unit is configured to filter the global data based on a preset query condition to generate local data; and to refresh the local data according to the global incremental package to generate a local incremental package; The socket service unit is used to determine the target monitoring program according to the subscriber dictionary, and push the global incremental package and / or the local incremental package to each target monitoring program in a first-in-first-out queue order; The data docking plug-in is embedded in the monitoring program, and the data docking plug-in includes: an API client plug-in and a Socket client plug-in; The API client plug-in is used to request global data and / or local data from the dynamic refresh service to build a monitoring interface; The Socket client plug-in is used to refresh the graphical monitoring interface of each target monitoring program according to the received global incremental package and / or local incremental package.

9. The graphical monitoring dynamic refresh device according to claim 8, characterized in that: The persistence layer interceptor is implemented by weaving it into the persistence layer service of the production operating system through an aspect-oriented programming method or by implanting a framework plug-in into the service.

10. The graphical monitoring dynamic refresh device according to claim 8, characterized in that: When the global Actor unit is activated, it is uniquely identified by the view name and the view SQL is obtained from the production operating system database; When the local Actor unit is activated, it uses "view name + serialized query condition" as a unique identifier to obtain local data that meets the query condition from the global Actor unit; wherein the query condition is a structured data serialized string.

Citation Information

Patent Citations

  • Lightweight data visualization method and device

    CN113434590A

  • Container terminal cross-service information communication and data synchronization method

    CN117527827A

Cited By

  • Data auditing method and device

    CN121211442A

  • A data auditing method and apparatus

    CN121211442B