Method and apparatus for obtaining complete real-time data in a distributed control system

By building a local memory cache for real-time data in the distributed control system and supplementing historical data from the historical database, the problem of server and network pressure caused by multiple operator stations acquiring data simultaneously is solved, and efficient acquisition and integrity of real-time data are achieved.

CN116243659BActive Publication Date: 2026-01-27BEIJING GUODIAN ZHISHEN CONTROL TONGDY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211528581.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2026-01-27
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

In a distributed control system, the frequent data retrieval from historical servers by multiple operator stations leads to excessive load on the server and network, making it impossible to effectively obtain real-time data.

Method used

Build a local memory cache for observation point data, and independently perform historical data supplementation and real-time data caching. By caching real-time data locally and supplementing historical data from the historical database, the dependence on the historical server is reduced.

Benefits of technology

This effectively reduces the load on the historical server, ensuring that operators can obtain complete data in real time, reducing network pressure, and improving data acquisition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116243659B_ABST
    Figure CN116243659B_ABST
Patent Text Reader

Abstract

The application provides a method and device for obtaining complete real-time data in a distributed control system, and belongs to the technical field of data processing. The method comprises the following steps: constructing a local memory, wherein the local memory is used for caching data of observation points; obtaining real-time data of the observation points; caching the observation points and the real-time data into the local memory; querying historical data which can supplement the real-time data of the observation points from a historical database; and adding the obtained historical data into the local memory to complete the supplement operation of the observation points. According to the application, the local memory is constructed, the real-time data which needs to be observed is directly provided according to the actual demand of an operator during the operation of the distributed control system, the load of the historical station during the observation of the data by the operator is minimized, and when the complete data of a certain period is needed, the historical data is obtained from the historical database to expand the current real-time data, so that the operator can obtain the complete data in the specified period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and more specifically to a method for acquiring complete real-time data in a distributed control system, a device for acquiring complete real-time data in a distributed control system, an electronic device, and a computer-readable storage medium. Background Technology

[0002] In industrial automation control systems (DCS), operational indicators of equipment are collected and stored within the system to monitor equipment operation. To process this data, the DCS maps it to "points," where point values ​​represent the collected equipment parameter values. These parameter values ​​directly reflect the equipment's operational status, making point values ​​in the DCS a crucial basis for determining whether equipment or operating conditions are abnormal.

[0003] Operators have two main needs when monitoring equipment operation: one is to observe the equipment status in real time, and the other is to view the equipment's operation over a specific period of time. Therefore, the corresponding DCS (Distributed Control System) needs to implement two functions: one is to observe changes in point values ​​in real time, and the other is to view the changes in a specific point over a past period.

[0004] Therefore, when operators want to view the changes at a certain point in real time, they often refresh the data every second to get the latest data. Data from the last few minutes or the last half hour can be displayed to the operator.

[0005] However, in a distributed control system, there are multiple operator stations. If multiple operator stations retrieve data from the historical server at a frequency of seconds, it will put a lot of pressure on the historical server and the network. Summary of the Invention

[0006] The purpose of this invention is to provide a method and apparatus for obtaining complete real-time data in a distributed control system, thereby solving the problem that existing distributed control systems, when multiple operators simultaneously obtain data from a historical server, put significant pressure on the server and network, resulting in the inability to obtain real-time data.

[0007] To achieve the above objectives, embodiments of the present invention provide a method for acquiring complete real-time data in a distributed control system, the method comprising:

[0008] Build local memory, which is used to cache data from observation points;

[0009] Obtain real-time data from the observation points;

[0010] Cache the observation points and their real-time data in local memory;

[0011] Query historical data from the historical database to supplement the real-time data of the observation points with historical data;

[0012] The acquired historical data is added to local memory to complete the historical data supplementation operation for the observation points.

[0013] Preferably, historical data that can supplement the real-time data of the observation point is retrieved from the historical database, including:

[0014] Construct a historical queue;

[0015] Add the observation points that need to be supplemented with historical data to the historical data supplementation queue;

[0016] Based on the observation points in the supplementary historical queue, retrieve the historical data corresponding to the observation point in the historical database.

[0017] Preferably, the thread that performs the historical data supplementation operation is independent of the thread that caches the real-time data of the observation points in local memory.

[0018] Preferably, the method further includes: setting an expiration time for supplementing historical operations;

[0019] If the historical data update for an observation point is not completed before the expiration time, the historical data update operation for that observation point will be stopped.

[0020] Preferably, the method further includes: cleaning up the observation points in the supplementary historical queue, including:

[0021] Get the write time when the real-time data corresponding to the observation point in the supplementary history queue starts to be written to local memory;

[0022] During the process of writing the real-time data period corresponding to the observation point to local memory, the difference between the current time and the writing time is calculated.

[0023] Calculate the expected observation time length for this observation point;

[0024] If the difference between the current time and the write time is greater than the expected observation period, then the observation point is removed from the supplementary history queue.

[0025] Preferably, the method further includes: updating the observation points in local memory, including:

[0026] Set the maximum number of observation points in the local memory cache;

[0027] During the process of writing data from the observation point to local memory, the data may be historical data or real-time data. The difference between the last access time and the current time of each observation point cached in local memory is calculated.

[0028] If the number of observations cached in local memory reaches the upper limit, the new observations will overwrite the observations corresponding to the largest difference between the last access time and the current time.

[0029] Preferably, the method further includes: cleaning up expired observation points in local memory, including:

[0030] Set the timeout period for accessing observation points in local memory;

[0031] Calculate the difference between the last access time and the current time for each observation point cached in local memory;

[0032] Once an observation point is identified whose difference between the last access time and the current time is greater than the access timeout period, that observation point is deleted from local memory.

[0033] This invention also provides an apparatus for acquiring complete real-time data in a distributed control system. The apparatus is used to implement the aforementioned method for acquiring complete real-time data in a distributed control system. The apparatus includes:

[0034] A building module is used to construct local memory, which is used to cache data from observation points.

[0035] The acquisition module is used to acquire real-time data from the observation points;

[0036] The caching module is used to cache observation points and their real-time data in local memory;

[0037] The query module is used to retrieve historical data from the historical database that can supplement the real-time data of the observation points with historical data;

[0038] The history supplementation module is used to add the acquired historical data to local memory, thus completing the history supplementation operation for the observation points.

[0039] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method for acquiring complete real-time data in the distributed control system described above.

[0040] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method for acquiring complete real-time data in the aforementioned distributed control system.

[0041] Through the above technical solution, this invention constructs local memory to directly provide the real-time data that needs to be observed according to the actual needs of the operator during the operation of the distributed control system. This can minimize the load on the historical station when the operator observes the data. Furthermore, when it is necessary to observe complete data for a certain period of time, historical data can be obtained from the historical database to expand the data of the current observation point, making it easier for the operator to obtain data for the complete time period and thus better understand the operating status of the equipment in the distributed control system.

[0042] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0043] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings:

[0044] Figure 1 This is a flowchart of a method for acquiring complete real-time data in a distributed control system according to one embodiment of the present invention;

[0045] Figure 2 This is a flowchart of adding historical data to local memory, provided by an optional embodiment of the present invention;

[0046] Figure 3 This is a flowchart of cleaning up observation points in the historical queue according to an optional embodiment of the present invention;

[0047] Figure 4 This is a flowchart of updating observation points in local memory provided by an optional embodiment of the present invention;

[0048] Figure 5 This is a flowchart of cleaning up expired observation points in local memory, provided by an optional embodiment of the present invention;

[0049] Figure 6 This is a block diagram of a device for acquiring complete real-time data in a distributed control system provided by an optional embodiment of the present invention. Detailed Implementation

[0050] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.

[0051] Figure 1 This is a flowchart of a method for acquiring complete real-time data in a distributed control system according to one embodiment of the present invention, such as... Figure 1As shown, a method for acquiring complete real-time data in a distributed control system includes:

[0052] Step S101: Construct local memory, which is used to cache data from observation points.

[0053] In this embodiment, the observation point is a certain observation unit in the distributed system, such as the temperature value of a certain device. The distributed control system collects data from the operating device and maps these data into points. Each data point is the collected parameter value of the device, and the parameter value can directly reflect the operating status of the device.

[0054] On each operator station (computer device) of the distributed control system, a local memory is built. The local memory is used to temporarily cache the data of the observation point. This data is the data of the device within a small time period including the current time. The historical data of all devices are centrally stored on a server of the distributed control system. This server is called the history server. Historical data can be obtained by accessing the history server.

[0055] Step S102: Obtain real-time data from the observation point.

[0056] In this embodiment, when an operator wants to view a certain point in real time, that point is used as the observation point. The latest data collected by the distributed control system can be obtained by refreshing the data at a rate of seconds.

[0057] Step S103: Cache the observation points and their real-time data in local memory.

[0058] In this embodiment, after obtaining the real-time data of a certain observation point, the real-time data is directly cached in the local operator station. The real-time data of a certain observation point is stored in the local memory, which allows the operator to access the observation point and view the real-time data of the observation point in real time.

[0059] In a distributed control system, due to the large number of observation points, the number of observation points that an operator can view at the workstation at the same time is inevitably limited, and the number of points that an operator can observe frequently is also limited. Therefore, an upper limit can be set on the number of observation points stored in local memory. For example, each workstation can cache a maximum of 200 points, which means that 200 points can be observed at the same time. When an operator wants to observe the data change of a certain point, this point is used as the observation point, and the real-time data corresponding to this point is actually added to the local memory for caching.

[0060] When the cached observations reach their limit, the observations in local memory need to be updated, such as... Figure 4 As shown, as a further optimization of this embodiment, the method further includes: updating the observation points in local memory, including:

[0061] Step a1: Set the upper limit of the number of observation points in the local memory cache, for example, set 200 observation points.

[0062] Step a2: During the process of writing data from the observation point to the local memory, the data is either historical data or real-time data. Calculate the difference between the last access time and the current time for each observation point cached in the local memory; then the time series of the most recently accessed observation point in the local memory can be obtained.

[0063] Step a3: If the number of observations cached in local memory reaches the upper limit, the new observations will be overwritten by the observations corresponding to the largest difference between the last access time and the current time.

[0064] Once 200 observation points are cached in local memory, when new observation points are acquired, the observation point that the operator has not accessed for the longest time can be selected from the 200 observation points and overwritten according to the time series mentioned above.

[0065] As a further optimization of this embodiment, if some observation points in local memory are only observed occasionally, there is no need to cache these observation points continuously; therefore, as Figure 5 As shown, the method further includes: cleaning up expired observation points in local memory, including:

[0066] Step b1: Set the timeout period for accessing observation points in local memory.

[0067] Step b2: Calculate the difference between the last access time and the current time for each observation point cached in local memory.

[0068] Step b3: Identify observation points where the difference between the last access time and the current time is greater than the access timeout period, and delete these observation points from local memory.

[0069] For example, the access time limit for each observation point can be set to 48 hours. Using the calculation method in step b2, the difference between the last access time and the current time of the 200 observation points is calculated. When the difference of any observation point exceeds 48 hours, it means that the observation point cached in the local memory has not been accessed for more than 48 hours. At this time, the observation point is determined to be an expired point, no longer cached, and is deleted. This invention can minimize the memory occupation during the real-time data caching process.

[0070] Step S104: Query historical data from the historical database that can supplement the real-time data of the observation point with historical data.

[0071] During the operation of a distributed control system, when a new observation point needs to be viewed, the real-time data cached in the local memory is the first observation point. The operator can only observe the current data and cannot observe the data for the most recent few minutes or tens of minutes corresponding to that observation point. In order to observe the complete operating status of the equipment over a period of time, it is necessary to find the historical data corresponding to that observation point within the time period to be observed from the historical database of the distributed control system.

[0072] Specifically, such as Figure 2 As shown, in step S104, historical data that can supplement the real-time data of the observation point is retrieved from the historical database, including:

[0073] Step c1: Construct a history replenishment queue.

[0074] Step c2: Add the observation points that need to be supplemented with historical data to the supplementary historical data queue.

[0075] Step c3: Based on the observation points in the supplementary historical queue, obtain the historical data corresponding to the observation point in the historical database.

[0076] Step S105: Add the acquired historical data to the local memory to complete the historical data supplementation operation for the observation points.

[0077] Therefore, in this embodiment, after finding the historical data corresponding to the observation point from the historical database, the historical data is added to the local memory, and the real-time data of the observation point is expanded using the historical data, so that the operator can observe the operating status of the equipment over a period of time.

[0078] As a further optimization of this embodiment, the thread performing the historical data supplementation operation is independent of the thread caching the real-time data to be observed in local memory; that is, when performing historical data supplementation, an idle thread is called to perform the historical data supplementation operation. Therefore, even if the historical data supplementation operation at an observation point fails, it can still be guaranteed that the current real-time data can be cached in local memory normally, and the historical data supplementation operation will not affect the acquisition of real-time data.

[0079] In this embodiment, when the history replenishment operation fails, an idle thread is rescheduled into the history replenishment queue that needs to replenish history, and waits for the next history replenishment operation.

[0080] As a further optimization of this embodiment, the method further includes: setting an expiration time for the history supplementation operation; if the history supplementation operation for the observation point is not completed before the history supplementation expiration time is reached, the history supplementation for the observation point is stopped; for example, when the history server is offline, the history supplementation operation for a certain observation point cannot be performed continuously, so a history supplementation expiration time can be set, and the history supplementation is stopped when the history supplementation expiration time is reached.

[0081] As a further optimization of this embodiment, such as Figure 3 As shown, the method further includes: cleaning up the observation points in the supplementary history queue, including:

[0082] Step d1: Obtain the write time when the real-time data corresponding to the observation point in the supplementary history queue starts to be written to local memory.

[0083] Step d2: During the process of writing the real-time data period corresponding to the observation point to the local memory, calculate the difference between the current time and the writing time.

[0084] Step d3: Calculate the expected observation time period length for this observation point;

[0085] In this embodiment, the expected observation time period is the sampling interval of each historical data point multiplied by the number of historical data points.

[0086] Step d4: If the difference between the current time and the write time is greater than the expected observation period length, then remove the observation point from the supplementary history queue.

[0087] For example: t1-t2>t0*m*95%: where t1 is the current time, t2 is the time when the real-time data of the observation point starts to be written to the local memory, t0 is the sampling interval of each historical data, and m is the number of historical data; this means that the local memory already contains 95% of the data of the observation point in the last few minutes or tens of minutes, and the historical data supplementation operation cannot bring the expected effect. Therefore, the historical data supplementation operation is no longer needed for the observation point, and the observation point in the historical data supplementation queue is cleared at this time.

[0088] In this embodiment, the following operational example illustrates the clearing of observation points in the supplementary history queue: For example, if the writing time of an observation point is 12:00, and 20 minutes of data needs to be observed, then historical data between 11:40 and 12:00 needs to be retrieved from the historical database. If the historical server is offline or other reasons prevent the supplementary history from being completed, and 10 minutes of real-time data has been acquired (i.e., the current time is 12:10), then 10 minutes of real-time data are available in the local memory. In this case, historical data between 11:50 and 12:00 needs to be retrieved from the historical database for the supplementary history operation. If the supplementary history operation still fails to be completed, and the current time reaches 12:19, then the real-time data cached in the local memory can cover 95% of the 20-minute range. The benefit of the supplementary history operation is not significant, so there is no need to perform the supplementary history operation. Therefore, the observation point in the supplementary history queue is cleared, and no further supplementary history is performed for this observation point.

[0089] In this embodiment, when the distributed control system stops working, it backs up the observation points cached in local memory. When the distributed control system restarts, it adds the backed-up observation points as new observation points to the history replenishment queue and puts them in a state of waiting to be replenished. When it is necessary to view the data of these observation points, the historical data is directly added to the local memory.

[0090] Figure 6 This is a block diagram of a device for acquiring complete real-time data in a distributed control system according to an optional embodiment of the present invention, such as... Figure 6 As shown, the apparatus is used to implement the method for acquiring complete real-time data in the above-mentioned distributed control system, and the apparatus includes:

[0091] A building module is used to construct local memory, which is used to cache data from observation points.

[0092] The acquisition module is used to acquire real-time data from the observation points;

[0093] The caching module is used to cache observation points and their real-time data in local memory;

[0094] The query module is used to retrieve historical data from the historical database that can supplement the real-time data of the observation points with historical data;

[0095] The history supplementation module is used to add the acquired historical data to local memory, thus completing the history supplementation operation for the observation points.

[0096] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method for acquiring complete real-time data in the distributed control system described above.

[0097] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method for acquiring complete real-time data in the aforementioned distributed control system.

[0098] This invention constructs local memory to directly provide the data to be observed according to the actual needs of the operator during the operation of the distributed control system, thereby minimizing the load on the historical server. Furthermore, when it is necessary to observe complete data for a certain period of time, historical data can be obtained from the historical database to expand the real-time data of the current observation point, making it easier for operators to understand the operating status of the equipment in the distributed control system.

[0099] The optional embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above embodiments. Within the scope of the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical solutions of the embodiments of the present invention, and these simple modifications all fall within the protection scope of the embodiments of the present invention.

[0100] It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not describe the various possible combinations separately.

[0101] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a microcontroller, chip, or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0102] Furthermore, various different implementations of the present invention can be combined arbitrarily, as long as they do not violate the spirit of the present invention, they should also be regarded as the content disclosed in the present invention.

Claims

1. A method for acquiring complete real-time data in a distributed control system, characterized in that, The method includes: Build local memory, which is used to cache data from observation points; Obtain real-time data from the observation points; Cache the observation points and their real-time data in local memory; Retrieve historical data from the historical database that can supplement the real-time data of the observation points with historical data, including: Construct a historical queue; Add the observation points that need to be supplemented with historical data to the historical data supplementation queue; Based on the observation points in the supplementary historical queue, retrieve the historical data corresponding to the observation point in the historical database; The acquired historical data is added to local memory to complete the historical data supplementation operation for the observation points; The method further includes: When the cached observations reach their limit, update the observations in local memory. Clean up expired observation points in local memory; This includes cleaning up expired observation points in local memory, including: Set the timeout period for accessing observation points in local memory; Calculate the difference between the last access time and the current time for each observation point cached in local memory; Once an observation point is identified where the difference between the last access time and the current time is greater than the access timeout period, that observation point is deleted from local memory. The method further includes: Clean up the observation points in the historical queue, including: Get the write time when the real-time data corresponding to the observation point in the supplementary history queue starts to be written to local memory; During the process of writing the real-time data period corresponding to the observation point to local memory, the difference between the current time and the writing time is calculated. Calculate the expected observation time length for this observation point; If the difference between the current time and the write time is greater than the expected observation period length, then the observation point is removed from the supplementary history queue. Updating the observation points in local memory includes: Set the maximum number of observation points in the local memory cache; During the process of writing data from the observation point to local memory, the data may be historical data or real-time data. The difference between the last access time and the current time of each observation point cached in local memory is calculated. If the number of observations cached in local memory reaches the upper limit, the new observations will overwrite the observations corresponding to the largest difference between the last access time and the current time.

2. The method according to claim 1, characterized in that, The thread that performs the historical data supplementation operation is independent of the thread that caches the real-time data of the observation points in local memory.

3. The method according to claim 1, characterized in that, The method further includes: setting an expiration time for compiling historical operations; If the historical data update for an observation point is not completed before the expiration time, the historical data update operation for that observation point will be stopped.

4. An apparatus for acquiring complete real-time data in a distributed control system, the apparatus being used to implement the method for acquiring complete real-time data in a distributed control system as described in any one of claims 1-3, characterized in that, The device includes: A building module is used to build local memory, which is used to cache data from observation points; The acquisition module is used to acquire real-time data from the observation points; The caching module is used to cache observation points and their real-time data in local memory; The query module is used to retrieve historical data from the historical database that can supplement the real-time data of the observation points with historical data; The history supplementation module is used to add the acquired historical data to local memory, thus completing the history supplementation operation for the observation points.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for acquiring complete real-time data in the distributed control system according to any one of claims 1-3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the method for acquiring complete real-time data in the distributed control system as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Traffic information filling method based on high-quality data acquisition

    CN104217002A

  • Data processing method and system

    CN110019087A