A distributed control system timing device and method
By designing a distributed first server and second server structure in the DCS system, and using an external clock source to realize high-precision clock synchronization of the DCS system, the problems of complex configuration and large workload in the prior art are solved, and the system's autonomous, controllable and high-precision timing matching are realized.
Patent Information
- Application Number
- CN202210068066.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2042-01-20
AI Technical Summary
The prior art has complex configuration and heavy workload problems in clock synchronization in distributed control systems (DCS), especially when multiple computers or controllers need to be configured separately.
A DCS timing device and method are designed, through a first server and a second server distributed in each site, the first server is connected to an external clock source, and obtains time at a preset interval, and the second server sends a time request to the first server to correct the local time.
It realizes autonomous, controllable and high-precision clock synchronization of the DCS system, simplifies the configuration process and reduces the workload.
Smart Images

Figure CN116527181B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to but is not limited to the field of automatic control, and in particular to a distributed control system timing device and method. Background Art
[0002] In a distributed control system (DCS), data exchanges are frequent and contain time stamps. In particular, some fault and operation log information requires high clock accuracy. Therefore, a clock synchronization solution that can ensure stable and high-precision clocks within the system is particularly important.
[0003] The commonly used time synchronization scheme at present is the Network Time Protocol (NTP) time synchronization. NTP is a protocol used to synchronize the time of each computer in the network. It synchronizes the computer clock to the Coordinated Universal Time (UTC).
[0004] However, when using NTP for time synchronization, the NTP service needs to be configured separately, the process is relatively complicated, and the NTP configuration is relatively cumbersome; and each computer or controller needs to be configured separately, which will increase the workload excessively if the number is too large. Summary of the invention
[0005] In a first aspect, an embodiment of the present application provides a DCS timing device, including: a first server and a plurality of second servers distributed at each site, each site is provided with a first server or a second server, the first server is connected to each second server, and each two second servers are connected to each other;
[0006] The first server is connected to an external clock source, and the first server is used to obtain time from the external clock source at a preset interval, and after receiving a time synchronization request from the second server, send the obtained time to the second server;
[0007] The second server is used to send a time synchronization request to the first server, and after receiving the time sent by the first server, use the time to correct the local time.
[0008] In a second aspect, an embodiment of the present application provides a DCS timing method, the method comprising:
[0009] The first server obtains time from an external clock source at a preset interval, and after receiving a time synchronization request from the second server, sends the obtained time to the second server;
[0010] The second server is used to send a time synchronization request to the first server, and after receiving the time sent by the first server, use the time to correct the local time;
[0011] The first server and multiple second servers are distributed at various sites of the DCS, each site is provided with a first server or a second server, the first server is connected to each second server, and every two second servers are connected to each other.
[0012] Compared with the prior art, the distributed control system timing device and method provided by at least one embodiment of the present application has the following beneficial effects: it only needs to configure the server to be connected to the external clock source, use the external clock source as the reference timing clock, and use the server connected to the external clock source as the clock source inside the DCS system. The configuration is simple and can achieve autonomous, controllable, and high-precision timing of the system.
[0013] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0015] Figure 1 A structural block diagram of a DCS timing device provided by an embodiment of the present invention;
[0016] Figure 2 A connection diagram of a DCS timing device provided by an embodiment of the present invention;
[0017] Figure 3 A schematic diagram of the DropTime interface provided by an embodiment of the present invention;
[0018] Figure 4 The present invention provides a flow chart of a DCS timing method. DETAILED DESCRIPTION
[0019] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0020] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0021] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0022] Figure 1 The structural block diagram of the DCS timing device provided by the embodiment of the present invention is as follows: Figure 1 As shown, the DCS timing device may include: a first server 11 and a plurality of second servers 12 distributed at each site, such as Figure 1 In the second server 1, the second server 2, ... the second server M, M ≥ 1, each site is provided with a first server or a second server, the first server is connected to each second server, and every two second servers are connected to each other.
[0023] The first server is connected to the external clock source 13, and is used to obtain time from the external clock source at preset intervals, and send the obtained time to the second server after receiving a time synchronization request from the second server.
[0024] The second server is used to send a time synchronization request to the first server, and after receiving the time sent by the first server, use the time to correct the local time.
[0025] In this embodiment, the DCS timing device is used to synchronize the time of each server (such as the first server and the second server) in the DCS system. The DCS timing device may include: an external clock source, a first server, and a second server. The first server connected to the external clock source can directly obtain the external clock source time for its own system timing to ensure that its own clock is consistent with the external clock source clock. The second server that is not connected to the external clock source can send a synchronization request to the selected clock source through a set of preset clock source selection principles to complete its own timing. In this embodiment, the second server that is not connected to the external clock source can send a synchronization request to the first server to use the time obtained by the first server from the external clock source as its own system timing to meet the clock stability of its own system.
[0026] The first server refers to a server in the DCS system connected to an external clock source, and the second server refers to a server in the DCS system that is not connected to an external clock source, that is, a server in the DCS system except the first server.
[0027] In one example, the external clock source may include: a Global Positioning System (GPS) satellite signal or a Beidou satellite signal.
[0028] The DCS timing device provided in the embodiment of the present invention only needs to configure the server to be connected to the external clock source, use the external clock source as the reference timing clock, and use the server connected to the external clock source as the clock source inside the DCS system. The configuration is simple and can achieve autonomous, controllable, and high-precision timing of the system.
[0029] In an exemplary embodiment of the present invention, a time synchronization program can be set in advance in each server (such as the first server and the second server) in the DCS system. It is only necessary to send the configured file (configuration file) to the first server and the second server, and each server can directly start the time synchronization program to achieve the time synchronization of its own clock. After configuring which server or servers are connected to the external clock source through the configured file to serve as the first server, the time synchronization program in the server is started to complete the corresponding time synchronization. For example, after the time synchronization program in the first server is started, it reads in the configured file whether the local machine is the first server. If the local machine is the first server, the external clock source is used as its own clock source, and the program allocates a thread to automatically load the external clock source time synchronization function and synchronize with it. Or after the time synchronization program in the second server is started, it reads in the configured file whether the local machine is the first server. If the local machine is not the first server, the clock source is determined by the preset clock source selection principle, such as using the first server as its own clock source when the external clock source is not abnormal, or using the preset principle to select one from other second servers as its own clock source when the external clock source is abnormal.
[0030] The server connected to the external clock source, ie, the first server, may be referred to as a time server (TimeSever, TS for short), and the external clock source may be referred to as an external standard clock source (External Standard Time, EST for short).
[0031] The preset principle may be referred to as a retreat principle, which refers to a principle for changing the clock source when a TS fails or other situations that affect the accuracy of time synchronization occur.
[0032] In an exemplary embodiment of the present invention, the first server may include at least one of the following: a host computer provided with a man-machine interface (Man and Machine Interface, MMI for short) and a distributed processing unit (Distributed Processing Unit, DPU for short) controller;
[0033] The second server is also used to send a time synchronization request to the first server, and if it receives the first time sent by the host computer and the second time sent by the DPU controller at the same time, use the first time sent by the host computer to correct the local time.
[0034] In this embodiment, the first server may be a host computer or a DPU controller, or the first server may include both a host computer and a DPU controller. The second server may include a host computer or a DPU controller.
[0035] In this embodiment, the MMI host computer or the DPU controller can be connected to an external clock source to obtain time from the external clock source. When the host computer runs the time synchronization program, if the local computer is TS, the time synchronization program is responsible for obtaining clock data from the EST clock source to update the local clock, and can respond to clock acquisition requests from other stations (including DPU or MMI). When the DPU controller runs the time synchronization program, when the clock signal line is normally connected to EST, the clock signal can be extracted from IOBUS to update the local clock.
[0036] In this embodiment, the MMI host computer or the DPU controller can be used as the clock source inside the DCS system, and the time synchronization program on the server in each site can provide a port to receive clock acquisition requests from the time synchronization programs on the servers of other sites.
[0037] In this embodiment, it is only necessary to send the configured file to the host computer or DPU controller in the DCS system and directly start the corresponding time synchronization program to achieve the time synchronization and stabilization of the clock, and the configuration is simple.
[0038] Figure 2 A connection diagram of a DCS timing device provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the DCS timing device may include: an external clock source, a first server, a second server, an engineer station, an operator station, etc. Among them, the external clock source may be a GPS clock source. The first server may also include: an MMI host computer connected to an external clock source (the MMI host computer may be called an MMI clock server) and a DPU controller (which may be called a DPU connected to station B). Both the MMI clock server and the DPU connected to station B may be connected to an external clock source, that is, external timing may include two parts: timing of the DPU controller and timing of the MMI host computer. The second server may include: an MMI host computer not connected to an external clock source (the MMI host computer may be called other MMI) and a DPU controller (which may be called a DPU not connected to station B).
[0039] In one example, if Figure 2 As shown, the host computer can be connected to the external clock source through a serial line, and obtain message information from the external clock source through the serial line to obtain the time of the external clock source.
[0040] Each DPU real controller and each host computer will run the time synchronization program, which is a console program. The host computer needs to modify the configuration file of the pre-set station startup tool to automatically start the time synchronization program. If the host computer only uses virtual DPUs and runs multiple virtual DPUs, it is necessary to manually configure the station startup tool of a virtual DPU to start the time synchronization program, while other virtual DPUs do not start the time synchronization program. The real DPU needs to modify the startup script to automatically start the time synchronization program.
[0041] In one example, if Figure 2 As shown, the DPU controller can be connected to an external clock source through a clock signal line, and obtain a B code signal from the external clock source through the clock signal line to obtain the time of the external clock source.
[0042] The time synchronization program of the DPU controller needs to call the IOM API (abbreviated as IOM) to let the IOM monitor its process. The program reads the configuration file to distinguish whether the DPU controller is connected to an external clock source, that is, whether it is connected to the B code. Among them, the implementation principle and detection principle of the DPU controller connecting to the B code are the same as those of the existing solution, and this embodiment will not be limited or elaborated here.
[0043] The timing principle of the DPU connected to an external clock source (i.e., connected to code B) is as follows: when the timing program is started, the internal clock of the IOM is obtained through the interface provided by the IOM first. While retrieving the clock, it is determined whether the current clock is available. If available, the clock obtained by the IOM is directly used to synchronize the local system clock; if it is unavailable, the abnormal information is fed back to the second server, or one of the other servers in the DCS system is selected as its own timing device according to the preset principle, and the clock signal is requested from the selected timing device.
[0044] Among them, the timing device selected according to the retreat principle (such as high priority or maximum site number) can be called a pick time server (PTS for short).
[0045] In one example, a DPU controller that is not connected to the B code can request time from the local domain PTS.
[0046] In an exemplary embodiment of the present invention, the configured time server (i.e., the first server) can be a pair, and two time servers are configured for one domain. The two configured time servers are not divided into a primary and a backup relationship. For ease of understanding, the time server with a large site number or a high priority can be called a primary time server, and the time server with a small site number or a low priority can be called a backup server.
[0047] When the server's time synchronization program starts, it will read the configuration file to obtain the local configuration information. In the configuration information, it will read whether the local machine is TS. If the local machine is TS, it will specify its current clock source as EST, and the program will assign a thread to automatically load the EST time synchronization function to synchronize with it. If the local machine is not TS (that is, the second server, which can be called a normal server), the local machine will send a time synchronization request to the selected clock source through a set of preset clock source selection principles to complete its own timing. For example, when the external clock source is normal, it can periodically send a time synchronization request to TS, or when the external clock source is abnormal, it can periodically send a time synchronization request to PTS, and modify the local system time through the returned time data. Among them, all servers in the DCS system have the function of responding to clock requests.
[0048] In an exemplary embodiment of the present invention, after receiving the time synchronization request from the second server, before sending the acquired time to the second server, the first server is further configured to:
[0049] Detect whether there is an abnormality in the external clock source; if there is no abnormality, send the acquired time to the second server; if there is an abnormality, feedback abnormal information to the second server, and the abnormal information is used to indicate that the external clock source is abnormal.
[0050] In this embodiment, when TS can normally receive EST time data and change the system time, all servers (stations) except the normally working standby TS and the DPU connected to the B code must send requests to the main TS. TS listens to the fixed port to receive the request, obtains the request station address, and feeds back the corresponding message to the address.
[0051] In the case of data transmission error between EST and main TS or EST failure, the local state parameters in the message fed back by the main TS to the second server (such as MMI host computer, DPU controller) change, and all the host computers and DPU controllers communicating with it retreat according to the defined retreat principle and send time requests to the backup TS or PTS. TS degenerates into a common server (i.e., the second server), and the main TS also starts to send time requests to the backup TS or PTS to modify the local time.
[0052] In an example, the first server detecting whether an external clock source is abnormal may include:
[0053] The first server determines that the external clock source is abnormal if it detects at least one of the following situations:
[0054] The difference between the time first obtained when the first server starts or reconnects to the external clock source and its own time exceeds the set threshold;
[0055] The first server does not receive a time signal sent by an external clock source within a preset time;
[0056] Whether there is a jump in the time obtained twice from the external clock source by the first server, if the difference between the two times obtained from the external clock source is not within a set range, it is determined that there is a jump.
[0057] In this embodiment, when the time synchronization program is started, the provisions for TS to obtain EST time information for the first time in the program configuration file are read. When TS starts or reconnects to EST and receives EST time for the first time, if the difference between this time and the local time is too large, whether EST is used as the standard. If EST is configured to be the standard, the local clock is unconditionally synchronized when the EST time is first accepted when the time synchronization program is started; if not, it is considered that EST time is unreliable when the difference is too large, and TS degenerates into an ordinary server, and does not automatically restore the time synchronization with EST, requiring manual intervention of DropTime to restore. Among them, DropTime is described in detail in the following embodiment.
[0058] When TS is used as the clock source in the DCS system and works normally, there is an allowable jump in the time data obtained from EST twice (the default configuration item is 3s). If the error range is within the clock source, the system time can be modified; if it exceeds the error range, the clock source is considered unreliable and the defense is withdrawn. Among them, when the jump is too large, TS will not automatically restore the time synchronization with EST, and manual intervention (DropTime tool) is required.
[0059] In this embodiment, when an external clock device fails, such as a clock device disconnection, a clock jump, or a clock device signal format error (parsing error), the fault problem can be quickly diagnosed and fault information can be sent, and the fault diagnosis information is comprehensive.
[0060] The second server is also used to send a time synchronization request to the first server. If it receives abnormal information sent by the first server, it will use a preset principle to select a second server from the remaining multiple second servers as its own timing device, and send a time synchronization request to the timing device, and correct the local time according to the time sent by the timing device; it is also used to return the local time after receiving the time synchronization request sent by other second servers.
[0061] In this embodiment, when the time synchronization program is started, the configuration file is read to obtain the local configuration information. If it is the second server, the local machine sends a time synchronization request to the selected clock source through a set of preset clock source selection principles to complete its own time synchronization. For example, when the external clock source is abnormal, it can select one of the other servers in the DCS system as its own time synchronization device (i.e., PTS) according to the retreat principle, send a time synchronization request to the PTS periodically, and modify the local system time through the returned time data.
[0062] In this embodiment, the second server sends a time request to the PTS, and then verifies the feedback time data to synchronize the time for the local machine. The DCS system is a redundant network with two networks A and B, and the request and feedback information are sent to the A and B networks at the same time.
[0063] In one example, the second server verifies the time data message fed back by TS or PTS, and modifies the system time if the message parsing data is complete; if the message parsing data is wrong, the time synchronization is abandoned.
[0064] In an exemplary embodiment of the present invention, the second server selects one second server from the other multiple second servers as its own timing device according to a preset principle, which may include:
[0065] The second server selects one second server from the other multiple second servers as its own timing device according to the priority level;
[0066] In this embodiment, when all external clock sources fail and TS cannot normally feedback the time request, according to the defined fallback principle, the second server can send a request to the second server with the highest priority. The second server with the highest priority or the largest site number can serve as the PTS and can feedback the time data after receiving the time request.
[0067] When the time synchronization program is running, it will search for available servers as clock sources in priority order based on the local status. The priority order can be: priority of clock servers connected to the factory-wide clock source > priority of DPU controllers connected to B code synchronization > priority of time servers not connected to the factory-wide clock source > priority of MMI host computer (MMI priority with larger site number > MMI priority with site number) > priority of DPU controllers not connected to B code synchronization (DPU priority with larger site number > DPU priority with smaller site number). Among them, the priority of a DPU controller configured with B code is still higher than that of an ordinary DPU controller when the external clock source fails or the B code is not connected.
[0068] In an exemplary embodiment of the present invention, the second server selects one second server from the other multiple second servers as its own timing device according to a preset principle, which may include:
[0069] The second server selects one second server from the remaining plurality of second servers as its own timing device according to the size of the site number, wherein each site where the second server is located is correspondingly provided with a site number.
[0070] In this embodiment, when all external clock sources fail and TS cannot normally feedback the time request, according to the defined fallback principle, the second server can send a request to the second server with the largest site number. The second server with the highest priority or the largest site number can serve as the PTS and can feedback the time data after receiving the time request.
[0071] In this embodiment, each server can have a complete set of retreat principles. When the clock source in the system changes, such as the clock source is powered off and offline, other host computers in the system that request time from the clock source and the controller will select the next available device as the clock source to continue time calibration, which is highly flexible.
[0072] In an exemplary embodiment of the present invention, if TS cannot normally connect to the EST clock source signal or PTS cannot feedback time, each server can automatically select a new clock source for time synchronization according to a predefined fallback principle.
[0073] Fallback with the configured time server as the clock source: When the time server is disconnected from EST or the EST time data is unreliable, the servers at other stations confirm that the current clock source is unreliable and need to switch the clock source based on the local status fed back by the clock server; when the servers at other stations cannot receive the feedback signal from the time server, they will send a time synchronization request to the clock source again. If they cannot receive the feedback time synchronization information again, the time server is offline and the time source is switched.
[0074] With the DPU connected to the B code as the clock source, the protection is as follows: When the configured time server cannot work properly, with the DPU connected to the B code as the clock source, the DPU connected to the B code cannot obtain the B code time normally, and the local state is not MRUN_NORMAL, the server of other stations obtains the local state of the station and then switches the clock source; when the DPU connected to the B code is offline, the clock source is switched. Among them, MRUN_NORMAL means that the local state is running normally.
[0075] De-defense with MMI host computer or DPU controller not connected to B code as clock source: When MMI host computer or DPU controller not connected to B code is used as time source, whether to de-defense needs to consider whether the communication with other station servers is normal, that is, whether the clock source determines whether the station is offline. If the current clock source is offline, it is necessary to switch to the next level clock source according to the defined de-defense principle.
[0076] In an exemplary embodiment of the present invention, when the current clock source is a backup time server and is normally connected to EST, if the primary time server normally connected to EST comes back online, the time source is switched to the primary time server.
[0077] When the current clock source is the DPU controller or MMI host computer, the configured time server or the connected B-code DPU controller is back online and running normally, the clock source is switched to the time server.
[0078] When the current time source is the host computer MMI (A), the host computer MMI (B) with a high retreat priority is restarted or back online. Because the restart or back online time is unreliable, the local state of the host computer MMI (B) is INITIALIZED (indicating the initial state or the state of back online after being offline), and other station servers will not switch the clock source. In the current state, the host computer MMI (B) will request time information from the clock source host computer MMI (A), and after receiving the feedback information, it will change the local time and change the local state to MRUN_NORMAL (indicating normal operation). Among them, the time of the host computer MMI (B) is reliable and can be used as a clock source. The host computer MMI (B) can feedback the local state to other station servers to change the clock source to the host computer MMI (B).
[0079] In an exemplary embodiment of the present invention, in order to distinguish whether the received message type is a message requesting, receiving time information or local status, command ID 0x01 may be a message requesting time, command ID 0x81 may be a message feedbacking clock, command ID 0x02 may be a message requesting local status, and command ID 0x82 may be a message feedbacking local status.
[0080] The message serial number fed back by the clock source can be defined as 0 to 255, and will automatically turn to 0 after 255.
[0081] The status of this machine is to confirm the status of all PTS in the DCS system.
[0082] The local status types can include:
[0083] MRUN_NORMAL, indicating normal operation;
[0084] TS_EST_OFF, indicating that TS is disconnected from EST;
[0085] EST_DATE_ERROR, indicating that the data received by EST was parsed multiple times with errors;
[0086] EST_JUMP_HUG, indicating that the ST jump is too large;
[0087] TS_EST_DFFERENT_HUG, indicating that the system time is too different from EST when the time synchronization program is started or when the EST is reconnected;
[0088] DROP_OFFLINE, which means the server on the site is offline;
[0089] INITIALIZED, indicating the initial state or the state of returning to the online state after being offline
[0090] DPU_B_OFF_LINE, indicating that the B code is not connected
[0091] DPU_B_PARSE_ERROR, indicating B code parsing error
[0092] DPU_B_JUMP_HUGE, indicating B code jump
[0093] When the synchronization program is started, the machine status will be judged immediately:
[0094] When this station is TS and works normally, the local status in the TS feedback message is MRUN_NORMAL. When TS cannot obtain time data from EST and is disconnected from EST, the local status is TS_EST_OFF. When there is a large range jump in EST time, the local status is EST_JUMP_HUG. When the time synchronization program is started or EST is reconnected, the system time is too different from EST, and the configuration is not based on EST. The local status is TS_EST_DFFERENT_HUG. The received EST data has three consecutive parsing errors, and the local status is EST_DATE_ERROR. When TS is offline, the local status is DROP_OFFLINE. The server on the site is in the initial state, and the local status is INITIALIZED.
[0095] When this station is a real DPU controller station configured with B code and can obtain time data from IOM and work normally, the local state is MRUN_NORMAL. When disconnected from the external clock, the local state is DPU_B_OFF_LINE. If B code is parsed incorrectly three times in a row, the local state is DPU_B_PARSE_ERROR. If B code data jumps, the local state is DPU_B_JUMP_HUGE.
[0096] When this station is an MMI host station or is not connected to a B-code DPU controller station, the local state initialization value is INITIALIZED. When this station receives the time feedback from PTS and modifies the system time, the local state is changed to MRUN_NORMAL to prevent the MMI host computer that comes online later and has a high priority from directly synchronizing time with other host computers without synchronizing time when the MMI host computer is used as the clock source, causing time jitter. If this station is offline, that is, it cannot receive any request or feedback message, the station state is set to DROP_OFFLINE.
[0097] When PTS is offline, PTS cannot provide feedback to the host computer or DPU controller that requested the information. According to the retreat principle, the next station is requested for information, and the status of the previous PTS is recorded as DROP_OFFLINE. All stations must periodically send status requests to stations with higher priority than PTS, and carry the status of the station in the request message, and record the status of the station received in the feedback. If the received station status is MRUN_NORMAL and its priority is greater than the current PTS priority, the time source is switched.
[0098] In an exemplary embodiment of the present invention, the configuration file name may be timing.ini, and is located in the timing program installation directory / etc files. The configuration file is specifically defined as follows:
[0099] [period]
[0100] est_send_cycle=1, indicating that the default period of EST sending time to TS is 1s, which is related to the protocol and the configuration change is invalid;
[0101] est_timeout=3, indicating that the timeout period for TS to receive EST time data is 3s by default, which is related to the protocol. Changing the configuration will have no effect.
[0102] est_error_range=3, indicating the allowable error between the two data before and after TS receives the EST timing, the default is 3s.
[0103] timing_cycle=60, which indicates the period of time data requested by the host computer and DPU controller from PTS, in seconds (s);
[0104] request_state_cycle=30, indicating the state cycle of the requesting station, in seconds (s);
[0105] est_systime_differentials = 1800, indicating that the TS first receives the EST time, and the difference between this time and the local system time is allowed to be 30 minutes by default;
[0106] is_est_priority=0, indicating whether to use EST as the priority when TS receives EST time for the first time and the difference between this time and the local system time is too large. 1 indicates that EST is the priority, and 0 indicates no.
[0107] [DEVICE]
[0108] REGULATION=DLT1100, which means the configuration of TS. The timing program obtains the current protocol message format by reading the configuration. The protocol formats compatible with the current program are the East China protocol TIMEST and the power standard protocol DLT1100.1-2009 (which can be abbreviated as DLT1100 in the configuration).
[0109] [COM]
[0110] COM_PORT = 1, indicating the configuration of TS, the port used for the connection between TS and EST;
[0111] COM_BAUD=9600, indicating TS configuration, the baud rate used by the port;
[0112] COM_BYTESIZE=8, indicating TS configuration, data bit;
[0113] COM_STOPBIT = 1, indicating TS configuration, port data stop bit;
[0114] COM_PARITY=NONE, indicating TS configuration, verification mode. The current protocol specifies the verification mode, and this configuration is invalid.
[0115] In this embodiment, the time calibration cycle can be modified, and the time calibration cycle can be configured and modified in the configuration file, and the time calibration response time is fast.
[0116] In an exemplary embodiment of the present invention, self-diagnosis events and alarms can be implemented, and fault problems can be quickly diagnosed. The alarm point needs to be configured in the project configuration file, and the format of the project configuration file is:
[0117] TimeSrc. Station No. = GP point
[0118] The keyword Key is TimeSrc.station number, and the value Value is the GP point name.
[0119] The alarm points established by the time synchronization program are GP points, specifically:
[0120] DU_GPS_BREAK, indicating that the standard external clock source is disconnected;
[0121] DU_GPS_ERROR, indicating that the standard external clock source parsing error;
[0122] DU_GPS_LEAP indicates a clock jump failure of the standard external clock source.
[0123] When an alarm is triggered or restored, a self-diagnosis event will be sent. The events are divided into:
[0124] LK_GPS_TIME_GOOD, indicating that the standard external clock source is normal;
[0125] LK_GPS_TIME_LEAP, indicating / standard external clock source clock jump failure;
[0126] LK_SD_DPU_GPS_BREAK, indicating that the standard external clock source is disconnected;
[0127] LK_SD_DPU_GPS_RECEIVE_ERR, indicating that the standard external clock source parsing error.
[0128] Only servers (stations) connected to external clock sources will trigger alarms and send self-diagnosis events. Servers (stations) connected to external clock sources are configured time servers and DPU controllers connected to B code. When the external clock source is invalid or restored, the configured time server and DPU controller connected to B code will send self-diagnosis events and set the switch value to trigger or release the alarm:
[0129] When the time server or B-code DPU controller is working normally, it will send a self-diagnosis event and set the switch value when it loses the connection with EST, thereby triggering an alarm. When the external clock source is reconnected with the time server and B-code DPU controller, it will also send a self-diagnosis event and restore the switch value to release the alarm.
[0130] When the server connected to the external clock source receives a large jump in the EST data, it sends a self-diagnosis event and sets the switch value to trigger an alarm; the droptime tool is used to force the alarm to be released.
[0131] When the server connected to the external clock source receives external clock source data and parses it incorrectly for three consecutive times, it will send a self-diagnosis event and set the switch value to trigger an alarm; after receiving the external clock source data normally, the alarm will be cleared.
[0132] In an exemplary embodiment of the present invention, DropTime can be called a time management program, which is used to view the clock source and system time of each station and can manually trigger forced time synchronization. DropTime runs on the host computer. The server of DropTime is a time synchronization program, which is used to query the time information of each station and intervene in the stations that require manual intervention. The query information includes domain number-station number, station status, clock source, station time, local station time, and the time difference between the target station and the local station, in milliseconds (ms).
[0133] Figure 3 A schematic diagram of the DropTime interface provided by an embodiment of the present invention, such as Figure 3As shown, the DropTime interface can be composed of two parts: the display area and the title area. The title area mainly includes three buttons: the manual intervention button (Intervane), the refresh button (Refrash) and the termination (Exit) button, and the termination button can also be called the exit button.
[0134] Manual intervention button: This button is initially unavailable and only intervenes in the time server and the DPU controller connected to the B code. When the station state DropState is one of the three situations: external clock jump (EstJumpHug), the external clock source is too different from the local time at the first startup (TsEstDifferentHug), and the B code clock jump (DpuBJumpHuge), click the row where the station to be intervened is located, and the intervention button will become clickable. After clicking, it will trigger the forced following of the external clock source time of the station.
[0135] Refresh button: This button is clickable on the initial interface. After clicking, the button turns gray and unclickable, and data information is displayed in the display area.
[0136] Stop button: When the refresh button is clicked, it becomes unclickable. At this time, the Exit button changes to Stop to stop the refresh. When the refresh is completed or the refresh is stopped, this button becomes clickable. Click Exit in the initial state or the refresh is completed state to exit the program.
[0137] The display area may include multiple columns. The first column is the domain number and station number corresponding to all stations in the configuration file, and they are arranged from large to small according to the domain number and station number.
[0138] The second column DropState station status can be divided into:
[0139] Initialized, indicating the initialization state;
[0140] RunNormal means that the operation is normal. Normal stations normally request to receive the clock source time, and the time server normally receives the external clock.
[0141] TsEstOff, indicating that the time server is disconnected from the external clock source;
[0142] EstJumpHug, indicating a time server jump;
[0143] TsEstDifferentHug, which means that the time server and the external clock source are too far apart when the system is started for the first time.
[0144] EstDateError, indicating that the external clock source data is wrong;
[0145] DpuBOffLine, indicating that the DPU connected to B code is disconnected from B code;
[0146] DpuBParseError, indicating B code parsing error;
[0147] DpuBJumpHuge, indicating B code jump;
[0148] Offline means offline or no data is found;
[0149] Reading: indicates that data is being queried.
[0150] The third column TimeSourceDrop can be:
[0151] For a normal station, it is displayed as the clock source station number, and for a normal time server, it is displayed as ConnectEST Normal.
[0152] The fourth column Remote can be: the station time of the query.
[0153] The fifth column Local can be: the current station time when droptime is running.
[0154] The sixth column Diff may be: the time difference between the query station and the current station, in milliseconds (ms).
[0155] In this embodiment, the DropTime process can be used for monitoring. When the time synchronization program exits due to some other reasons, fault information will be automatically triggered and fed back to the DCS system for maintenance by the staff.
[0156] Figure 4 A flow chart of a DCS timing method provided by an embodiment of the present invention, such as Figure 4 As shown, the DCS timing method may include:
[0157] S401: The first server obtains time from an external clock source at a preset interval, and after receiving a time synchronization request from a second server, sends the obtained time to the second server.
[0158] S402: The second server is configured to send a time synchronization request to the first server, and after receiving the time sent by the first server, use the time to correct the local time.
[0159] The first server and multiple second servers are distributed at various sites of the DCS, each site is provided with a first server or a second server, the first server is connected to each second server, and every two second servers are connected to each other.
[0160] The implementation subject of the DCS timing method provided in the embodiment of the present invention is Figure 1 The technical solution of the device embodiment shown has similar implementation principles and effects, which will not be described in detail here.
[0161] In an example, after the first server receives the time synchronization request from the second server, before sending the acquired time to the second server, the method may further include:
[0162] Detecting whether the external clock source is abnormal;
[0163] If there is no abnormality, the acquired time is sent to the second server;
[0164] If there is an abnormality, abnormal information is fed back to the second server, where the abnormal information is used to indicate that the external clock source is abnormal;
[0165] The DCS timing method may also include:
[0166] After the second server sends a time synchronization request to the first server, if it receives abnormal information sent by the first server, it selects a second server from the remaining multiple second servers as its own timing device according to the preset principle, sends a time synchronization request to the timing device, and corrects the local time according to the time sent by the timing device; and returns the local time after receiving the time synchronization requests sent by other second servers.
[0167] In one example, the second server selects one second server from the remaining plurality of second servers as its own timing device according to a preset principle, which may include:
[0168] The second server selects one second server from the other multiple second servers as its own timing device according to the priority level;
[0169] or,
[0170] The second server selects one second server from the remaining plurality of second servers as its own timing device according to the size of the site number, wherein each site where the second server is located is correspondingly provided with a site number.
[0171] In an example, the first server detecting whether the external clock source is abnormal may include:
[0172] The first server determines that the external clock source is abnormal if it detects at least one of the following situations:
[0173] The difference between the time first obtained when the first server starts or reconnects to the external clock source and its own time exceeds a set threshold;
[0174] The first server does not receive a time signal sent by an external clock source within a preset time;
[0175] Whether there is a jump in the time obtained by the first server twice from the external clock source; if the difference between the two times obtained from the external clock source is not within a set range, it is determined that there is a jump.
[0176] In one example, the first server includes at least one of the following: a host computer having a man-machine interface MMI and a distributed processing unit DPU controller;
[0177] The DCS timing method may also include:
[0178] After the second server sends a time synchronization request to the first server, if it receives the first time sent by the host computer and the second time sent by the DPU controller at the same time, it uses the first time sent by the host computer to correct the local time.
[0179] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A distributed control system DCS timing device, characterized in that: include: A first server and a plurality of second servers distributed at each site, wherein each site is provided with a first server or a second server, the first server is connected to each second server, and each two second servers are connected to each other; The first server is connected to an external clock source, and the first server is used to obtain time from the external clock source at a preset interval, and after receiving a time synchronization request from the second server, send the obtained time to the second server; The second server is used to send a time synchronization request to the first server, and after receiving the time sent by the first server, use the time to correct the local time; After the first server receives the time synchronization request from the second server and before sending the acquired time to the second server, the first server is also used to: detect whether there is an abnormality in the external clock source; If there is no abnormality, the acquired time is sent to the second server; if there is an abnormality, abnormal information is fed back to the second server, where the abnormal information is used to indicate that the external clock source is abnormal; The second server is also used to send a time synchronization request to the first server. If it receives abnormal information sent by the first server, it will use a preset principle to select a second server from the remaining multiple second servers as its own timing device, and send a time synchronization request to the timing device, and correct the local time according to the time sent by the timing device; it is also used to return the local time after receiving the time synchronization request sent by other second servers.
2. The device according to claim 1, characterized in that The second server selects one second server from the other multiple second servers as its own timing device according to a preset principle, including: The second server selects one second server from the other multiple second servers as its own timing device according to the priority level; or, The second server selects one second server from the remaining plurality of second servers as its own timing device according to the size of the site number, wherein each site where the second server is located is correspondingly provided with a site number.
3. The device according to claim 1, characterized in that The first server detecting whether the external clock source is abnormal includes: The first server determines that the external clock source is abnormal if it detects at least one of the following situations: The difference between the time first obtained when the first server starts or reconnects to the external clock source and its own time exceeds a set threshold; The first server does not receive a time signal sent by an external clock source within a preset time; Whether there is a jump in the time obtained by the first server twice from the external clock source; if the difference between the two times obtained from the external clock source is not within a set range, it is determined that there is a jump.
4. The device according to claim 1, characterized in that The first server includes at least one of the following: a host computer with a man-machine interface MMI and a distributed processing unit DPU controller; The second server is also used to send a time synchronization request to the first server, and if the second server simultaneously receives the first time sent by the host computer and the second time sent by the DPU controller, use the first time sent by the host computer to correct the local time.
5. The device according to claim 4, characterized in that The host computer is connected to an external clock source via a serial line, and obtains message information from the external clock source via the serial line to obtain the time of the external clock source.
6. The device according to claim 4, characterized in that The DPU controller is connected to an external clock source via a clock signal line, and obtains a B code signal from the external clock source via the clock signal line to obtain the time of the external clock source.
7. The device according to claim 1, characterized in that The external clock source includes: a global positioning system GPS satellite signal or a Beidou satellite signal.
8. A distributed control system DCS timing method, characterized in that: The method comprises: The first server obtains time from an external clock source at a preset interval, and after receiving a time synchronization request from the second server, sends the obtained time to the second server; The second server is used to send a time synchronization request to the first server, and after receiving the time sent by the first server, use the time to correct the local time; The first server and the plurality of second servers are distributed at each site of the DCS, each site is provided with a first server or a second server, the first server is connected to each second server, and each two second servers are connected to each other; After the first server receives the time synchronization request from the second server, before sending the acquired time to the second server, the method further includes: detecting whether the external clock source is abnormal; if not, sending the acquired time to the second server; if there is an abnormality, feeding back abnormal information to the second server, wherein the abnormal information is used to indicate that the external clock source is abnormal; The method also includes: after the second server sends a time synchronization request to the first server, if it receives abnormal information sent by the first server, it selects a second server from the remaining multiple second servers as its own timing device according to a preset principle, sends a time synchronization request to the timing device, and corrects the local time according to the time sent by the timing device; and returns the local time after receiving the time synchronization requests sent by other second servers.
Citation Information
Patent Citations
Method and device for time backtracking
CN105763278A
Distributed control system and control method thereof, and computer readable storage medium
CN110147081A