[go: up one dir, main page]

CN107272822A - A kind of system clock monitoring method and device - Google Patents

A kind of system clock monitoring method and device Download PDF

Info

Publication number
CN107272822A
CN107272822A CN201710455971.9A CN201710455971A CN107272822A CN 107272822 A CN107272822 A CN 107272822A CN 201710455971 A CN201710455971 A CN 201710455971A CN 107272822 A CN107272822 A CN 107272822A
Authority
CN
China
Prior art keywords
clock
verification data
clock cycle
monitored
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710455971.9A
Other languages
Chinese (zh)
Inventor
程万前
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710455971.9A priority Critical patent/CN107272822A/en
Publication of CN107272822A publication Critical patent/CN107272822A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/14Time supervision arrangements, e.g. real time clock

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

本发明提供了一种系统时钟监控方法及装置,该方法包括:根据预先设定的目标时钟周期,对待监控时钟的时钟周期进行调频处理,获得第一时钟周期;根据目标时钟周期,对参考时钟的时钟周期进行调频处理,获得第二时钟周期;在每一个第一时钟周期,向具有预设容量的存储空间中存储至少一个校验数据;在每一个第二时钟周期,从存储空间中读取较先存储的至少一个校验数据,并将读取到的至少一个校验数据从存储空间中删除;根据在连续两个第二时钟周期读取到的至少两个校验数据,判断待监控时钟是否异常。本发明提供了一种系统时钟监控方法及装置,能够实现对系统时钟进行监控。

The present invention provides a system clock monitoring method and device. The method includes: performing frequency modulation processing on the clock cycle of the clock to be monitored according to the preset target clock cycle to obtain the first clock cycle; The frequency modulation process is performed on the clock cycle to obtain the second clock cycle; in each first clock cycle, at least one check data is stored in the storage space with a preset capacity; in each second clock cycle, read from the storage space Take at least one check data stored earlier, and delete at least one check data read from the storage space; according to at least two check data read in two consecutive second clock cycles, it is judged that the Check whether the clock is abnormal. The invention provides a system clock monitoring method and device, which can monitor the system clock.

Description

一种系统时钟监控方法及装置A system clock monitoring method and device

技术领域technical field

本发明涉及计算机技术领域,特别涉及一种系统时钟监控方法及装置。The invention relates to the technical field of computers, in particular to a system clock monitoring method and device.

背景技术Background technique

系统时钟是服务器系统中非常重要的组成部分,在服务器中多用来为CPU、集成南桥(Platform Controller Hub,PCH)、高速串行计算机扩展总线标准(PeripheralComponent Interconnect Express,PCI-E)槽和基板管理控制器(Baseboard ManagementController,BMC)设备提供时钟。The system clock is a very important part of the server system, and it is mostly used in the server as the CPU, the integrated south bridge (Platform Controller Hub, PCH), the high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCI-E) slot and the base board A management controller (Baseboard Management Controller, BMC) device provides a clock.

系统时钟需要满足一定的频率要求,当系统时钟频率超出允许范围时,服务器会因系统时钟异常而发生计时不准甚至宕机。因此,有必要对系统时钟进行监控,以保证服务器能够正常运行。The system clock needs to meet certain frequency requirements. When the system clock frequency exceeds the allowable range, the server will be inaccurate or even down due to abnormal system clock. Therefore, it is necessary to monitor the system clock to ensure that the server can run normally.

目前,一般的服务器均无法实现对系统时钟进行监控,只能够通过人工计时的方式来验证系统时钟是否异常。At present, general servers cannot monitor the system clock, and can only verify whether the system clock is abnormal through manual timing.

发明内容Contents of the invention

本发明实施例提供了一种系统时钟监控方法及装置,能够实现对系统时钟进行监控。Embodiments of the present invention provide a system clock monitoring method and device, which can monitor the system clock.

第一方面,本发明实施例提供了一种系统时钟监控方法,包括:In a first aspect, an embodiment of the present invention provides a system clock monitoring method, including:

根据预先设定的目标时钟周期,对待监控时钟的时钟周期进行调频处理,获得第一时钟周期;According to the preset target clock cycle, frequency modulation is performed on the clock cycle of the clock to be monitored to obtain the first clock cycle;

根据所述目标时钟周期,对参考时钟的时钟周期进行调频处理,获得第二时钟周期;performing frequency modulation processing on the clock cycle of the reference clock according to the target clock cycle to obtain a second clock cycle;

在每一个所述第一时钟周期,向具有预设容量的存储空间中存储至少一个校验数据,其中,在所述存储空间的容量不足时对存储时间较长的数据进行覆盖;In each of the first clock cycles, at least one verification data is stored in a storage space with a preset capacity, wherein when the capacity of the storage space is insufficient, the data with a longer storage time is overwritten;

在每一个所述第二时钟周期,从所述存储空间中读取较先存储的至少一个所述校验数据,并将读取到的所述至少一个所述校验数据从所述存储空间中删除,其中,当所述存储空间在不存在所述校验数据时,读取特定数据作为所述校验数据;In each of the second clock cycles, read at least one of the verification data stored earlier from the storage space, and transfer the read at least one of the verification data from the storage space Delete in, wherein, when the verification data does not exist in the storage space, read specific data as the verification data;

根据在连续两个所述第二时钟周期读取到的至少两个所述校验数据,判断所述待监控时钟是否异常。Whether the clock to be monitored is abnormal is determined according to at least two verification data read in two consecutive cycles of the second clock.

优选地,所述根据在连续两个所述第二时钟周期读取到的至少两个所述校验数据判断所述待监控时钟是否异常,包括:Preferably, the judging whether the clock to be monitored is abnormal according to at least two verification data read in two consecutive cycles of the second clock includes:

确定在连续两个所述第一时钟周期存储到所述存储空间中的至少两个所述校验数据之间的关联关系;determining an association relationship between at least two check data stored in the storage space in two consecutive first clock cycles;

判断在连续两个所述第二时钟周期读取到的至少两个所述校验数据是否符合所述关联关系;judging whether at least two of the verification data read in two consecutive second clock cycles conform to the association relationship;

如果是,确定所述待监控时钟正常,否则确定所述待监控时钟异常。If yes, it is determined that the clock to be monitored is normal; otherwise, it is determined that the clock to be monitored is abnormal.

优选地,所述根据在连续两个所述第二时钟周期读取到的至少两个所述校验数据判断所述待监控时钟是否异常,包括:Preferably, the judging whether the clock to be monitored is abnormal according to at least two verification data read in two consecutive cycles of the second clock includes:

确定在连续两个所述第一时钟周期存储到所述存储空间中的至少两个所述校验数据之间的关联关系;determining an association relationship between at least two check data stored in the storage space in two consecutive first clock cycles;

判断在连续两个所述第二时钟周期读取到的至少两个所述校验数据是否符合所述关联关系,如果否,记录一次校验数据异常;judging whether at least two of the verification data read in two consecutive second clock cycles conform to the association relationship, and if not, recording an abnormality of the verification data once;

判断本次所记录的所述校验数据异常与上一次所记录的所述校验数据异常之间的时间间隔是否小于预设的时长阈值,如果是,确定所述待监控时钟异常,否则确定所述待监控时钟正常。Judging whether the time interval between the abnormality of the verification data recorded this time and the abnormality of the verification data recorded last time is less than the preset duration threshold, if yes, determine that the clock to be monitored is abnormal, otherwise determine The clock to be monitored is normal.

优选地,在所述记录一次所述校验数据异常之后,进一步包括:Preferably, after recording the abnormality of the verification data once, further comprising:

暂停执行所述在每一个所述第二时钟周期从所述存储空间中读取较先存储的至少一个所述校验数据,并在暂停时长达到预先设定的缓冲时长后,重新开始执行所述在每一个所述第二时钟周期从所述存储空间中读取较先存储的至少一个所述校验数据;suspending execution of the at least one verification data stored earlier from the storage space at each second clock cycle, and restarting execution of the verification data after the pause duration reaches a preset buffer duration Read at least one of the verification data stored earlier from the storage space in each second clock cycle;

其中,所述缓冲时长大于或等于一个所述第二时钟周期。Wherein, the buffer duration is greater than or equal to one cycle of the second clock.

优选地,所述根据预先设定的目标时钟周期,对待监控时钟的时钟周期进行调频处理,获得第一时钟周期,包括:Preferably, the frequency modulation process is performed on the clock cycle of the clock to be monitored according to the preset target clock cycle to obtain the first clock cycle, including:

根据预先设定的目标时钟周期和待监控时钟的标准时钟周期的比值,确定第一调频参数,利用所述第一调频参数对所述待监控时钟的实际时钟周期进行缩放,获得第一时钟周期;Determine the first frequency modulation parameter according to the ratio of the preset target clock period to the standard clock period of the clock to be monitored, and use the first frequency modulation parameter to scale the actual clock period of the clock to be monitored to obtain the first clock period ;

所述根据所述目标时钟周期,对参考时钟的时钟周期进行调频处理,获得第二时钟周期,包括:According to the target clock cycle, performing frequency modulation processing on the clock cycle of the reference clock to obtain the second clock cycle includes:

根据预先设定的目标周期和参考时钟的时钟周期的比值,确定第二调频参数,利用所述第二调频参数对所述参考时钟的时钟周期进行缩放,获得第二时钟周期。A second frequency modulation parameter is determined according to a preset ratio of the target period to the clock period of the reference clock, and the second frequency modulation parameter is used to scale the clock period of the reference clock to obtain the second clock period.

优选地,在所述在每一个所述第一时钟周期,向具有预设容量的存储空间中存储至少一个校验数据之前,进一步包括:Preferably, before storing at least one verification data in a storage space with a preset capacity at each first clock cycle, further comprising:

依次在所述存储空间中存储至少一个符合所述关联关系的缓冲数据。At least one piece of buffer data conforming to the association relationship is sequentially stored in the storage space.

第二方面,本发明实施例提供了一种系统时钟监控装置,包括:调频处理单元、存储单元、读取单元和判断单元;In a second aspect, an embodiment of the present invention provides a system clock monitoring device, including: a frequency modulation processing unit, a storage unit, a reading unit, and a judging unit;

所述调频处理单元,用于根据预先设定的目标时钟周期,对待监控时钟的时钟周期进行调频处理,获得第一时钟周期,还用于根据所述目标时钟周期,对参考时钟的时钟周期进行调频处理,获得第二时钟周期;The frequency modulation processing unit is configured to perform frequency modulation processing on the clock cycle of the clock to be monitored according to the preset target clock cycle to obtain the first clock cycle, and is also used to perform frequency modulation on the clock cycle of the reference clock according to the target clock cycle Frequency modulation processing to obtain the second clock cycle;

所述存储单元,用于在所述调频处理单元获取的每一个所述第一时钟周期,向具有预设容量的存储空间中存储至少一个校验数据,其中,在所述存储空间的容量不足时对存储时间较长的数据进行覆盖;The storage unit is configured to store at least one check data in a storage space with a preset capacity at each first clock cycle acquired by the frequency modulation processing unit, wherein the capacity of the storage space is insufficient Overwrite the data that has been stored for a long time;

所述读取单元,用于在所述调频处理单元获取的每一个所述第二时钟周期,从所述存储空间中读取所述存储单元所较先存储的至少一个所述校验数据,并将读取到的所述至少一个所述校验数据从所述存储空间中删除,其中,当所述存储空间在不存在所述校验数据时,读取特定数据作为所述校验数据;The reading unit is configured to read at least one of the verification data stored earlier by the storage unit from the storage space at each second clock cycle acquired by the frequency modulation processing unit, and deleting the at least one read check data from the storage space, wherein, when the check data does not exist in the storage space, read specific data as the check data ;

所述判断单元,用于根据所述读取单元在连续两个所述第二时钟周期读取到的至少两个所述校验数据,判断所述待监控时钟是否异常。The judging unit is configured to judge whether the clock to be monitored is abnormal according to at least two verification data read by the reading unit in two consecutive cycles of the second clock.

优选地,所述判断单元包括:第一确定子单元和第一判断子单元;Preferably, the judging unit includes: a first determining subunit and a first judging subunit;

所述第一确定子单元,用于确定在连续两个所述第一时钟周期存储到所述存储空间中的至少两个所述校验数据之间的关联关系;The first determination subunit is configured to determine an association relationship between at least two check data stored in the storage space in two consecutive first clock cycles;

所述第一判断子单元,用于判断在连续两个所述第二时钟周期读取到的至少两个所述校验数据是否符合所述第一确定子单元确定的所述关联关系,如果是,确定所述待监控时钟正常,否则确定所述待监控时钟异常。The first judging subunit is configured to judge whether at least two check data read in two consecutive second clock cycles conform to the association relationship determined by the first determining subunit, if Yes, it is determined that the clock to be monitored is normal; otherwise, it is determined that the clock to be monitored is abnormal.

优选地,所述判断单元包括:第二确定子单元和第二判断子单元;Preferably, the judging unit includes: a second determining subunit and a second judging subunit;

所述第二确定子单元,确定在连续两个所述第一时钟周期存储到所述存储空间中的至少两个所述校验数据之间的关联关系;The second determination subunit is configured to determine an association relationship between at least two verification data stored in the storage space during two consecutive first clock cycles;

所述第二判断子单元,用于判断在连续两个所述第二时钟周期读取到的至少两个所述校验数据是否符合所述第二确定子单元确定的所述关联关系,如果否,记录一次校验数据异常,还用于判断本次所记录的所述校验数据异常与上一次所记录的所述校验数据异常之间的时间间隔是否小于预设的时长阈值,如果是,确定所述待监控时钟异常,否则确定所述待监控时钟正常。The second judging subunit is configured to judge whether at least two check data read in two consecutive second clock cycles conform to the association relationship determined by the second determining subunit, if No, record the abnormality of the verification data once, and it is also used to judge whether the time interval between the abnormality of the verification data recorded this time and the abnormality of the verification data recorded last time is less than the preset duration threshold, if Yes, it is determined that the clock to be monitored is abnormal; otherwise, it is determined that the clock to be monitored is normal.

优选地,所述第二判断子单元,进一步用于在记录一次所述校验数据发生异常之后,对所述读取单元进行触发;Preferably, the second judging subunit is further configured to trigger the reading unit after an abnormality occurs in the verification data recorded once;

所述读取单元,进一步用于在接收到所述第二判断子单元的触发时,暂停执行所述在每一个所述第二时钟周期从所述存储空间中读取较先存储的至少一个所述校验数据,并在暂停时长达到预先设定的缓冲时长后,重新开始执行所述在每一个所述第二时钟周期从所述存储空间中读取较先存储的至少一个所述校验数据,其中,所述缓冲时长大于或等于一个所述第二时钟周期。The reading unit is further configured to, when receiving the trigger of the second judging subunit, suspend the execution of the reading of at least one stored earlier from the storage space in each second clock cycle. The verification data, and after the pause time reaches the preset buffer time, restart the execution of reading at least one of the calibration data stored earlier from the storage space in each second clock cycle. test data, wherein the buffering duration is greater than or equal to one cycle of the second clock.

优选地,所述调频处理单元,用于根据预先设定的目标时钟周期和待监控时钟的标准时钟周期的比值,确定第一调频参数,利用所述第一调频参数对所述待监控时钟的实际时钟周期进行缩放,获得第一时钟周期,还用于根据预先设定的目标周期和参考时钟的时钟周期的比值,确定第二调频参数,利用所述第二调频参数对所述参考时钟的时钟周期进行缩放,获得第二时钟周期。Preferably, the frequency modulation processing unit is configured to determine a first frequency modulation parameter according to the ratio of a preset target clock period to a standard clock period of the clock to be monitored, and use the first frequency modulation parameter to determine the frequency of the clock to be monitored. The actual clock cycle is scaled to obtain the first clock cycle, which is also used to determine the second frequency modulation parameter according to the ratio of the preset target cycle to the clock cycle of the reference clock, and use the second frequency modulation parameter to the reference clock The clock period is scaled to obtain a second clock period.

优选地,所述存储单元,进一步用于依次在所述存储空间中存储至少一个符合所述关联关系的缓冲数据。Preferably, the storage unit is further configured to sequentially store at least one buffer data conforming to the association relationship in the storage space.

在本发明实施例中,为了待监控时钟和参考时钟的时钟周期有可比性,所以根据预先设定的目标时钟周期,将待监控的时钟周期调频至第一时钟周期,以及将参考时钟的时钟周期调频至第二时钟周期,在每一个第一时钟周期时向存储空间中存入至少一个校验数据,是为了在每一个第二时钟周期从存储空间中读取较先存储的至少一个校验数据,由于存储空间的容量有限,当第一时钟周期与第二时钟周期不同时,会导致存储空间中的校验数据溢出或校验数据不存在,使得从存储空间中读取出的校验数据产生相对应的变化。因此,可以通过从存储空间中读取到的校验数据,来确定第一时钟周期和第二时钟周期是否相同,从而可以确定待监控时钟是否异常,实现对系统时钟进行监控。In the embodiment of the present invention, in order to have comparable clock periods of the clock to be monitored and the reference clock, according to the preset target clock period, the frequency of the clock period to be monitored is adjusted to the first clock period, and the clock period of the reference clock The cycle frequency is adjusted to the second clock cycle, and at least one check data is stored in the storage space at each first clock cycle, in order to read at least one check data stored earlier from the storage space at each second clock cycle. verification data, due to the limited capacity of the storage space, when the first clock cycle is different from the second clock cycle, the verification data in the storage space will overflow or the verification data does not exist, so that the verification data read from the storage space The experimental data produced corresponding changes. Therefore, it can be determined whether the first clock period and the second clock period are the same through the verification data read from the storage space, so as to determine whether the clock to be monitored is abnormal, and monitor the system clock.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are For some embodiments of the present invention, those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1是本发明一实施例提供的一种系统时钟监控方法的流程图;Fig. 1 is a flow chart of a system clock monitoring method provided by an embodiment of the present invention;

图2是本发明一实施例提供的另一种系统时钟监控方法的流程图;FIG. 2 is a flow chart of another system clock monitoring method provided by an embodiment of the present invention;

图3是本发明一实施例提供的又一种系统时钟监控方法的流程图;Fig. 3 is a flowchart of another system clock monitoring method provided by an embodiment of the present invention;

图4是本发明一实施例提供的再一种系统时钟监控方法的流程图;Fig. 4 is a flowchart of another system clock monitoring method provided by an embodiment of the present invention;

图5是本发明一实施例提供的一种系统时钟监控装置的结构示意图;Fig. 5 is a schematic structural diagram of a system clock monitoring device provided by an embodiment of the present invention;

图6是本发明一实施例提供的另一种系统时钟监控装置的结构示意图;FIG. 6 is a schematic structural diagram of another system clock monitoring device provided by an embodiment of the present invention;

图7是本发明一实施例提供的又一种系统时钟监控装置的结构示意图。Fig. 7 is a schematic structural diagram of another system clock monitoring device provided by an embodiment of the present invention.

具体实施方式detailed description

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work belong to the protection of the present invention. scope.

如图1所示,本发明实施例提供了一种系统时钟监控方法,该方法可以包括以下步骤:As shown in FIG. 1, an embodiment of the present invention provides a system clock monitoring method, which may include the following steps:

步骤101:根据预先设定的目标时钟周期,对待监控时钟的时钟周期进行调频处理,获得第一时钟周期;Step 101: Perform frequency modulation processing on the clock cycle of the clock to be monitored according to the preset target clock cycle to obtain the first clock cycle;

步骤102:根据所述目标时钟周期,对参考时钟的时钟周期进行调频处理,获得第二时钟周期;Step 102: Perform frequency modulation processing on the clock cycle of the reference clock according to the target clock cycle to obtain a second clock cycle;

步骤103:在每一个所述第一时钟周期,向具有预设容量的存储空间中存储至少一个校验数据,其中,在所述存储空间的容量不足时对存储时间较长的数据进行覆盖;Step 103: At each first clock cycle, store at least one verification data in a storage space with a preset capacity, wherein when the capacity of the storage space is insufficient, overwrite the data with a longer storage time;

步骤104:在每一个所述第二时钟周期,从所述存储空间中读取较先存储的至少一个所述校验数据,并将读取到的所述至少一个所述校验数据从所述存储空间中删除,其中,当所述存储空间在不存在所述校验数据时,读取特定数据作为所述校验数据;Step 104: At each second clock cycle, read at least one of the verification data stored earlier from the storage space, and transfer the read at least one of the verification data from the Delete in the storage space, wherein, when the verification data does not exist in the storage space, read specific data as the verification data;

步骤105:根据在连续两个所述第二时钟周期读取到的至少两个所述校验数据,判断所述待监控时钟是否异常。Step 105: Determine whether the clock to be monitored is abnormal according to at least two verification data read in two consecutive cycles of the second clock.

在本发明实施例中,为了待监控时钟和参考时钟的时钟周期有可比性,所以根据预先设定的目标时钟周期,将待监控的时钟周期调频至第一时钟周期,以及将参考时钟的时钟周期调频至第二时钟周期,在每一个第一时钟周期时向存储空间中存入至少一个校验数据,是为了在每一个第二时钟周期从存储空间中读取较先存储的至少一个校验数据,由于存储空间的容量有限,当第一周期与第二周期不同时,会导致存储空间中的校验数据溢出或校验数据不存在,使得从存储空间中读取出的校验数据产生相对应的变化。因此,可以通过从存储空间中读取到的校验数据,来确定第一时钟周期和第二时钟周期是否相同,从而可以确定待监控时钟是否异常,实现对系统时钟进行监控。In the embodiment of the present invention, in order to have comparable clock periods of the clock to be monitored and the reference clock, according to the preset target clock period, the frequency of the clock period to be monitored is adjusted to the first clock period, and the clock period of the reference clock The cycle frequency is adjusted to the second clock cycle, and at least one check data is stored in the storage space at each first clock cycle, in order to read at least one check data stored earlier from the storage space at each second clock cycle. verification data, due to the limited capacity of the storage space, when the first cycle is different from the second cycle, the verification data in the storage space will overflow or the verification data does not exist, so that the verification data read from the storage space produce corresponding changes. Therefore, it can be determined whether the first clock period and the second clock period are the same through the verification data read from the storage space, so as to determine whether the clock to be monitored is abnormal, and monitor the system clock.

针对步骤105可以通过如下两种方式实现,具体包括:Step 105 can be implemented in the following two ways, specifically including:

方式一:判断在连续两个第二时钟周期时,从存储空间读取到的两个校验数据是否符合在连续两个第一时钟周期时向存储空间中存储时确定的两个校验数据的关联关系,从而确定待监控时钟是否异常。Method 1: Judging whether the two verification data read from the storage space conform to the two verification data determined when storing in the storage space during two consecutive first clock cycles during two consecutive second clock cycles , so as to determine whether the clock to be monitored is abnormal.

方式二:记录每次不符合数据关联关系的校验数据发生异常的时间,判断每两次校验数据发生异常的时间间隔是否小于预设的时长阈值,从而判断待监控时钟是否异常。Method 2: Record the abnormality time of each verification data that does not conform to the data association relationship, and judge whether the time interval between two verification data occurrences is less than the preset duration threshold, so as to judge whether the clock to be monitored is abnormal.

下面针对上述两种判断待监控时钟是否异常的方法进行详细说明:The following is a detailed description of the above two methods for judging whether the clock to be monitored is abnormal:

针对方式一,如图2所示,判断待监控时钟是否发生异常的方法可以包括以下步骤:For the first method, as shown in Figure 2, the method for judging whether the clock to be monitored is abnormal may include the following steps:

步骤201:确定在连续两个所述第一时钟周期存储到所述存储空间中的至少两个所述校验数据之间的关联关系;Step 201: Determine an association relationship between at least two check data stored in the storage space in two consecutive first clock cycles;

步骤202:判断在连续两个所述第二时钟周期读取到的至少两个所述校验数据是否符合所述关联关系,如果是,执行步骤203,否则执行步骤204。Step 202: Judging whether at least two verification data read in two consecutive second clock cycles conform to the association relationship, if yes, perform step 203, otherwise perform step 204.

步骤203:确定所述待监控时钟正常,继续执行步骤202;Step 203: Determine that the clock to be monitored is normal, and continue to execute step 202;

步骤204:确定所述待监控时钟异常。Step 204: Determine that the clock to be monitored is abnormal.

方式一提供的确定待监控时钟是否异常的方法,是以在连续两个第二时钟周期读取到的两个校验数据为对象,当连续读取到的两个校验数据不符合两个校验数据对应的关联关系,可能由于向存储空间存储校验数据的速率大于从存储空间读取校验数据的速率,导致存储空间中未被读取的校验数据已经被覆盖,使得连续读取到的两个校验数据不符合对应的关联关系,也可能由于向存储空间存储校验数据的速率小于从存储空间读取校验数据的速率,导致存储空间中的校验数据被读空而读取到特定数据,从而使得连续读取到的两个校验数据不符合对应的关联关系,而向存储空间中存储校验数据的速率由待监控时钟的实际时钟周期决定,因此,当连续读取到的两个校验数据与两个校验数据对应的关联关系不符时,可以判定待监控时钟发生异常。The method for determining whether the clock to be monitored is abnormal provided by the first method is to use two verification data read in two consecutive second clock cycles as the object, when the two verification data read continuously do not meet the two The association relationship corresponding to the verification data may be due to the fact that the rate of storing the verification data in the storage space is greater than the rate of reading the verification data from the storage space, resulting in the verification data that has not been read in the storage space has been overwritten, making continuous reading The two verification data obtained do not conform to the corresponding association relationship, and the verification data in the storage space may be read empty because the rate of storing verification data in the storage space is lower than the rate of reading verification data from the storage space However, specific data is read, so that the two verification data read continuously do not conform to the corresponding association relationship, and the rate of storing verification data in the storage space is determined by the actual clock cycle of the clock to be monitored. Therefore, when When the two verification data read continuously do not match the association relationship corresponding to the two verification data, it can be determined that the clock to be monitored is abnormal.

针对方式二,如图3所示,判断待监控时钟是否发生异常的方法具体可以包括以下步骤:For the second method, as shown in Figure 3, the method for judging whether the clock to be monitored is abnormal may specifically include the following steps:

步骤301:确定在连续两个所述第一时钟周期存储到所述存储空间中的至少两个所述校验数据之间的关联关系;Step 301: Determine an association relationship between at least two verification data stored in the storage space in two consecutive first clock cycles;

步骤302:判断在连续两个所述第二时钟周期读取到的至少两个所述校验数据是否符合所述关联关系,如果是,继续执行步骤302,否则执行步骤303;Step 302: judging whether at least two verification data read in two consecutive second clock cycles conform to the association relationship, if yes, continue to execute step 302, otherwise execute step 303;

步骤303:确定所述校验数据发生异常,并记录所述校验数据发生异常的时间;Step 303: Determine that the verification data is abnormal, and record the time when the verification data is abnormal;

步骤304:判断所述校验数据发生异常的次数是否等于2,如果是,执行步骤305,否则执行步骤302;Step 304: judging whether the number of abnormalities in the verification data is equal to 2, if yes, execute step 305, otherwise execute step 302;

步骤305:判断本次所记录的所述校验数据异常与上一次所记录的所述校验数据异常之间的时间间隔是否小于预设的时长阈值,如果是,执行步骤306,否则执行步骤307;Step 305: Determine whether the time interval between the abnormality of the verification data recorded this time and the abnormality of the verification data recorded last time is less than the preset duration threshold, if yes, execute step 306, otherwise execute step 307;

步骤306:确定所述待监控时钟异常,并结束当前流程;Step 306: Determine that the clock to be monitored is abnormal, and end the current process;

步骤307:将所记录的异常次数清零,并执行步骤302。Step 307: Clear the recorded abnormal times, and execute step 302.

方式二提供的确定待监控时钟是否异常的方法,是以每发生两次校验数据不符合对应的关联关系为对象,当第一次连续读取到的两个校验数据不符合对应的关联关系时,不立即确定待监控时钟发生异常而是记录校验数据发生异常的时间,是由于在待监控时钟向存储空间存储校验数据的速率与从存储空间中读取校验数据的速率有微小的偏差,当微小的偏差经过长时间的累积后,必然会出现一次从存储空间连续读取到的校验数据不符合对应的关联关系的情况,这可能是待监控时钟的固有偏差;继续确定并记录下一次连续读取到的两个校验数据不符合对应的关联关系的时间,在确定两次校验数据发生异常之后,确定两次校验数据发生异常的时间间隔是否小于预设的时长阈值,如果两次异常发生的时间间隔小于时长阈值,说明待监控时钟的实际时钟周期与标准时钟周期存在较大的差异,确定待监控时钟异常;如果两次异常发生的时间差大于时长阈值,说明待监控时钟需要经过较长的时间累计才会出现一次异常,此时可以判定待监控时钟是正常的。The method provided by method 2 to determine whether the clock to be monitored is abnormal is to take every two verification data that do not conform to the corresponding relationship as the object, and when the two verification data that are read consecutively for the first time do not conform to the corresponding correlation When there is a relationship, instead of immediately determining the abnormality of the clock to be monitored, the time when the abnormality occurs in the verification data is recorded, because the rate at which the clock to be monitored stores the verification data in the storage space is different from the rate at which the verification data is read from the storage space. Minor deviation, after a long period of accumulation of minor deviation, there will inevitably be a situation where the verification data read continuously from the storage space does not conform to the corresponding relationship, which may be the inherent deviation of the clock to be monitored; continue Determine and record the time when the next two consecutively read verification data do not conform to the corresponding association relationship. After determining that the two verification data are abnormal, determine whether the time interval between the two verification data occurrences is less than the preset If the time interval between two abnormal occurrences is less than the duration threshold, it means that the actual clock period of the clock to be monitored is quite different from the standard clock period, and it is determined that the clock to be monitored is abnormal; if the time difference between the two abnormalities is greater than the duration threshold , indicating that the clock to be monitored takes a long time to accumulate before an abnormality occurs. At this time, it can be determined that the clock to be monitored is normal.

方式一的确定待监控时钟是否异常的方法适用于要求待监控时钟非常精准的情况,而方式二提供的确定待监控时钟是否异常的方法,适用于对待监控时钟的精准程度要求一般的情况。因此,方式一和方式二适用于不同的应用场景,在实际业务实现过程中,可以根据实际需求进行灵活选择,从而提高了该校验方法的适用性。The method of determining whether the clock to be monitored is abnormal in method 1 is applicable to the situation that the clock to be monitored is required to be very accurate, while the method of determining whether the clock to be monitored is abnormal provided in method 2 is applicable to the situation that the accuracy of the clock to be monitored is required to be general. Therefore, method 1 and method 2 are applicable to different application scenarios, and can be flexibly selected according to actual requirements in the actual service implementation process, thereby improving the applicability of the verification method.

在本发明一实施例中,根据前述方式二所述的确定待监控时钟异常的方法,在记录一次所述校验数据发生异常之后,进一步包括:In an embodiment of the present invention, according to the method for determining the abnormality of the clock to be monitored described in the second method, after recording the abnormality of the verification data once, it further includes:

暂停执行所述在每一个所述第二时钟周期从所述存储空间中读取较先存储的至少一个所述校验数据,并在暂停时长达到预先设定的缓冲时长后,重新开始执行所述在每一个所述第二时钟周期从所述存储空间中读取较先存储的至少一个所述校验数据;suspending execution of the at least one verification data stored earlier from the storage space at each second clock cycle, and restarting execution of the verification data after the pause duration reaches a preset buffer duration Read at least one of the verification data stored earlier from the storage space in each second clock cycle;

其中,所述缓冲时长大于或等于一个所述第二时钟周期。Wherein, the buffer duration is greater than or equal to one cycle of the second clock.

在本发明一实施例中,在确定并记录一次校验数据发生异常之后,不是直接发出报警信息,也不是继续确定并记录下一次校验数据发生异常的时间,而是暂停不小于第二时钟周期的缓冲时长从存储空间中读取校验数据,此做法的目的是避免因为向存储空间中存储校验数据的速率与从存储空间中读取校验数据的速率有微小的偏差,所导致的一次从存储空间连续读取到的两个校验数据不符合对应的关联关系而确定待监控时钟发生异常的情况。In an embodiment of the present invention, after determining and recording an abnormality in the verification data once, instead of directly sending out an alarm message, or continuing to determine and record the time at which the next verification data is abnormal, the timeout is not less than the second clock. The buffering time of the cycle reads the verification data from the storage space. The purpose of this method is to avoid the slight deviation between the rate of storing the verification data in the storage space and the rate of reading the verification data from the storage space. It is determined that the clock to be monitored is abnormal because the two verification data read continuously from the storage space do not conform to the corresponding association relationship.

在本发明一实施例中,所述根据预先设定的目标时钟周期,对待监控时钟的时钟周期进行调频处理,获得第一时钟周期,包括:In an embodiment of the present invention, the frequency modulation processing is performed on the clock cycle of the clock to be monitored according to the preset target clock cycle to obtain the first clock cycle, including:

根据预先设定的目标时钟周期和待监控时钟的标准时钟周期的比值,确定第一调频参数,利用所述第一调频参数对所述待监控时钟的实际时钟周期进行缩放,获得第一时钟周期;Determine the first frequency modulation parameter according to the ratio of the preset target clock period to the standard clock period of the clock to be monitored, and use the first frequency modulation parameter to scale the actual clock period of the clock to be monitored to obtain the first clock period ;

所述根据所述目标时钟周期,对参考时钟的时钟周期进行调频处理,获得第二时钟周期,包括:According to the target clock cycle, performing frequency modulation processing on the clock cycle of the reference clock to obtain the second clock cycle includes:

根据预先设定的目标周期和参考时钟的时钟周期的比值,确定第二调频参数,利用所述第二调频参数对所述参考时钟的时钟周期进行缩放,获得第二时钟周期。A second frequency modulation parameter is determined according to a preset ratio of the target period to the clock period of the reference clock, and the second frequency modulation parameter is used to scale the clock period of the reference clock to obtain the second clock period.

在本发明实施例中,所确定的第一调频参数等于预设的目标时钟周期和待监控时钟的标准时钟周期的比值,所确定的第二调频参数等于预设的目标时钟周期和参考时钟的时钟周期的比值,利用第一调频参数对待监控时钟的实际时钟周期进行缩放,即可获得第一时钟周期,再利用第二调频参数对参考时钟的时钟周期进行缩放,即可获得第二时钟周期,确定第一调频参数和第二调频参数,是为了将待监控时钟的实际时钟周期缩放后获得的第一时钟周期与将参考时钟的时钟周期缩放后获得的第二时钟周期由可比性。In the embodiment of the present invention, the determined first frequency modulation parameter is equal to the ratio of the preset target clock cycle to the standard clock cycle of the clock to be monitored, and the determined second frequency modulation parameter is equal to the ratio of the preset target clock cycle to the reference clock For the ratio of the clock period, use the first frequency modulation parameter to scale the actual clock period of the clock to be monitored to obtain the first clock period, and then use the second frequency modulation parameter to scale the clock period of the reference clock to obtain the second clock period The purpose of determining the first frequency modulation parameter and the second frequency modulation parameter is to compare the first clock period obtained by scaling the actual clock period of the clock to be monitored with the second clock period obtained by scaling the clock period of the reference clock.

在本发明一实施例中,在所述按照创建顺序将所述至少一个校验数据存储到所述存储空间中之前,进一步包括:In an embodiment of the present invention, before storing the at least one verification data in the storage space according to the order of creation, it further includes:

依次在所述存储空间中存储至少一个符合所述数据创建规则的缓冲数据。At least one piece of buffered data conforming to the data creation rule is sequentially stored in the storage space.

在本发明实施例中,在待监控时钟向存储空间存储至少一个校验数据之前,向存储空间中存入至少一个符合数据创建规则的缓冲数据,存储缓冲数据的操作可以避免系统在刚开始工作时,还未执行向存储空间存储校验数据的操作就已经执行从存储空间读取校验数据的操作,而导致的从存储空间中读取不到校验数据确定待监控时钟发生异常的情况。In the embodiment of the present invention, before the clock to be monitored stores at least one verification data in the storage space, at least one buffer data conforming to the data creation rule is stored in the storage space, and the operation of storing the buffer data can prevent the system from starting to work. At this time, the operation of reading the verification data from the storage space has been executed before the operation of storing the verification data to the storage space, and the result is that the verification data cannot be read from the storage space, and it is determined that the clock to be monitored is abnormal .

下面结合前述方式二,对本发明实施例提供的一种系统时钟监控方法,作进一步详细说明,如图4所示,该方法可以包括以下步骤:The method for monitoring a system clock provided by the embodiment of the present invention will be described in further detail below in combination with the aforementioned method 2. As shown in FIG. 4 , the method may include the following steps:

步骤401:创建具有预设容量的存储空间。Step 401: Create a storage space with a preset capacity.

具体地,预先创建具有预设容量的存储空间,便于在待监控时钟产生至少一个校验数据之后存储产生的校验数据。Specifically, a storage space with a preset capacity is created in advance, so as to store the generated check data after the clock to be monitored generates at least one check data.

举例来说,在服务器中创建一个容量为1MB的存储空间。For example, create a storage space with a capacity of 1MB in the server.

步骤402:依次在存储空间中存储至少一个符合数据创建规则的缓冲数据。Step 402: sequentially store at least one piece of buffered data conforming to the data creation rule in the storage space.

具体地,在服务器刚开始工作向存储空间存入校验数据之前,向存储空间中存入至少一个符合数据创建规则的缓冲数据,防止服务器刚开始工作,还未执行向存储空间存入校验数据的操作就已经执行从存储空间读取校验数据的操作,而导致读取不到校验数据发生的异常情况。Specifically, before the server starts to work and stores the verification data into the storage space, at least one buffer data conforming to the data creation rules is stored in the storage space, preventing the server from starting to work, and the verification data has not been stored in the storage space. The data operation has already performed the operation of reading the verification data from the storage space, resulting in an abnormal situation where the verification data cannot be read.

举例来说,向存储空间中存入每个均为0.2MB大小且符合数据创建规则的缓冲数据A、B、C。For example, buffer data A, B, and C each with a size of 0.2MB and meeting the data creation rules are stored in the storage space.

步骤403:确定第一调频参数和第二调频参数。Step 403: Determine the first frequency modulation parameter and the second frequency modulation parameter.

具体地,根据待监控时钟的标准时钟周期和参考时钟的时钟周期,确定第一调频参数和第二调频参数,其中,待监控时钟的标准时钟周期是待监控时钟的理论时钟周期。Specifically, the first frequency modulation parameter and the second frequency modulation parameter are determined according to the standard clock period of the clock to be monitored and the clock period of the reference clock, wherein the standard clock period of the clock to be monitored is a theoretical clock period of the clock to be monitored.

举例来说,服务器的时钟源(即为待监控时钟)的时钟周期为0.02s,参考时钟的时钟频率为0.05s,为了将待监控时钟和参考时钟的时钟周期都调至目标时钟周期0.1s,可以确定待监控时钟的第一调频参数为5,参考时钟的第二调频参数为2。For example, the clock source of the server (that is, the clock to be monitored) has a clock period of 0.02s, and the clock frequency of the reference clock is 0.05s. In order to adjust the clock periods of the clock to be monitored and the reference clock to the target clock period of 0.1s , it can be determined that the first frequency modulation parameter of the clock to be monitored is 5, and the second frequency modulation parameter of the reference clock is 2.

步骤404:利用第一调频参数对待监控时钟的实际时钟周期进行调频,获取待监控时钟的第一时钟周期。Step 404: Use the first frequency modulation parameter to perform frequency modulation on the actual clock period of the clock to be monitored, and obtain the first clock period of the clock to be monitored.

具体地,为了将待监控时钟的标准时钟周期(即为理论时钟周期)和参考时钟的时钟周期都调频至目标时钟周期,需要利用第一调频参数将待监控时钟的标准时钟周期调频至第一时钟周期。Specifically, in order to tune both the standard clock period of the clock to be monitored (that is, the theoretical clock period) and the clock period of the reference clock to the target clock period, it is necessary to use the first frequency tuning parameter to tune the standard clock period of the clock to be monitored to the first clock cycle.

举例来说,利用第一调频参数5,将时钟周期为0.02s的服务器时钟源调频至时钟周期为0.1s。For example, using the first frequency tuning parameter 5, the clock source of the server with a clock period of 0.02s is tuned to a clock period of 0.1s.

步骤405:利用第二调频参数对参考时钟的时钟周期进行调频,获取参考时钟的第二时钟周期。Step 405: Frequency modulation is performed on the clock period of the reference clock by using the second frequency modulation parameter to obtain the second clock period of the reference clock.

具体地,为了将参考时钟的时钟周期和待监控时钟的标准时钟周期(即为理论时钟周期)都调频至目标时钟周期,需要利用第二调频参数将参考时钟的时钟周期调频至第二时钟周期。Specifically, in order to tune both the clock period of the reference clock and the standard clock period (that is, the theoretical clock period) of the clock to be monitored to the target clock period, it is necessary to use the second frequency modulation parameter to tune the clock period of the reference clock to the second clock period .

举例来说,利用第二调频参数2,将时钟周期为0.05s的参考时钟调频至0.1s。For example, by using the second frequency modulation parameter 2, the frequency of the reference clock with a clock period of 0.05s is modulated to 0.1s.

步骤406:根据预设的数据创建规则,依次在每一个第一时钟周期创建至少一个校验数据,并按照创建顺序将至少一个校验数据存储到存储空间中。Step 406: According to the preset data creation rule, at least one check data is sequentially created in each first clock cycle, and the at least one check data is stored in the storage space according to the order of creation.

具体地,在每一个第一时钟周期创建至少一个符合数据创建规则的校验数据,并将创建的校验数据依次存储到存储空间中,便于需要校验数据时从存储空间中读取,但由于存储空间的容量有限,所以当存储空间的容量不足时,后创建的校验数据会覆盖存储时间较长的校验数据,从而可以确保后创建的校验数据可以存入到存储空间中。Specifically, at least one verification data conforming to the data creation rule is created in each first clock cycle, and the created verification data is stored in the storage space in sequence, so that it is convenient to read from the storage space when the verification data is needed, but Due to the limited capacity of the storage space, when the capacity of the storage space is insufficient, the verification data created later will overwrite the verification data stored for a longer period of time, thereby ensuring that the verification data created later can be stored in the storage space.

举例来说,预设的数据创建规则是第一个待监控时钟的0.1s的时钟周期下存入第一个校验数据a+1,第二个待监控时钟的0.1s的时钟周期下存入第二个校验数据a+2,第三个待监控时钟的0.1s的时钟周期下存入第三个校验数据a+3,第四个待监控时钟的0.1s的时钟周期下存入第四个校验数据a+1,循环存入a+1、a+2、a+3这三个校验数据于存储空间中(校验数据a+1、a+2、a+3即为符合数据创建规则的校验数据),每个校验数据的大小均为0.2MB。例如,在第一个待监控时钟的0.1s的时钟周期下,会产生校验数据a+1,将a+1存入存储空间中,在第二个待监控时钟的0.1s的时钟周期下,会产生校验数据a+2,将a+2存入存储空间中。由于存储空间的容量为1MB,且存储空间中已有0.5MB的缓存数据,剩余的存储空间的容量为0.5MB只能存入a+1和a+2两个校验数据,如果在第三个待监控时钟的0.1s的时钟周期下,产生校验数据a+3之后,想将校验数据a+3存入存储空间,需要覆盖存储空间中存储时间较长的校验数据a+1。For example, the default data creation rule is to store the first verification data a+1 in the 0.1s clock cycle of the first clock to be monitored, and store it in the 0.1s clock cycle of the second clock to be monitored Enter the second verification data a+2, store the third verification data a+3 in the 0.1s clock cycle of the third clock to be monitored, and store the third verification data a+3 in the 0.1s clock cycle of the fourth clock to be monitored Enter the fourth verification data a+1, and cyclically store the three verification data a+1, a+2, a+3 in the storage space (verification data a+1, a+2, a+3 That is, the verification data conforming to the data creation rules), and the size of each verification data is 0.2MB. For example, at the 0.1s clock cycle of the first clock to be monitored, the verification data a+1 will be generated, and a+1 will be stored in the storage space, and at the 0.1s clock cycle of the second clock to be monitored , the verification data a+2 will be generated, and a+2 will be stored in the storage space. Since the capacity of the storage space is 1MB, and there is already 0.5MB of cached data in the storage space, the capacity of the remaining storage space is 0.5MB and only two verification data of a+1 and a+2 can be stored. Under the 0.1s clock cycle of the clock to be monitored, after the verification data a+3 is generated, if you want to store the verification data a+3 in the storage space, you need to overwrite the verification data a+1 that has been stored for a long time in the storage space .

步骤407:在每一个第二时钟周期,从存储空间中读取存储时间较长的至少一个校验数据,并将存储空间中已被读取的校验数据删除。Step 407: At each second clock cycle, read at least one verification data that has been stored for a long time from the storage space, and delete the read verification data in the storage space.

具体地,由于存储空间的容量有限,所以在每一个第二时钟周期,当从存储空间中读取存储时间较长的校验数据之后将该数据删除,便于及时释放存储空间的容量。当存储空间中不存在校验数据时,读取特定数据作为校验数据,比如特定数据为b。Specifically, since the capacity of the storage space is limited, at each second clock cycle, after the verification data stored for a long time is read from the storage space, the data is deleted, so as to release the capacity of the storage space in time. When there is no verification data in the storage space, specific data is read as verification data, for example, the specific data is b.

举例来说,在第一个参考时钟的0.1s的时钟周期时,按照校验数据存入存储空间的顺序,在存储空间中读取存储时间较长的校验数据a+1,读取校验数据a+1之后,将校验数据a+1从存储空间中删除。在第二个参考时钟的0.1s的时钟周期时,在存储空间中读取存储时间较长的校验数据a+2,读取校验数据a+2之后,将校验数据a+2从存储空间中删除。For example, at the 0.1s clock cycle of the first reference clock, read the verification data a+1 with a longer storage time in the storage space according to the order in which the verification data is stored in the storage space, and read the verification data a+1 in the storage space. After verifying the data a+1, delete the verification data a+1 from the storage space. At the 0.1s clock cycle of the second reference clock, read the verification data a+2 with a long storage time in the storage space, and after reading the verification data a+2, transfer the verification data a+2 from Deleted from storage.

步骤408:判断在连续两个第二时钟周期读取到的至少两个校验数据是否符合数据创建规则,如果是,执行步骤409,否则执行步骤410。Step 408: Judging whether at least two verification data read in two consecutive second clock cycles comply with the data creation rule, if yes, perform step 409, otherwise perform step 410.

具体地,根据从存储空间读取到的校验数据,依次判断连续读取到的两个校验数据是否符合校验数据规则,从而确定待监控始终是否异常。Specifically, according to the verification data read from the storage space, it is sequentially judged whether the two verification data read continuously conform to the verification data rules, so as to determine whether the monitoring is always abnormal.

举例来说,如果在参考时钟的第一个0.1s的时钟周期和第二个0.1s的时钟周期时,从存储空间中读取出的校验数据a+1和a+2,是待监控时钟在第一个0.1s和第二个0.1s的时钟周期时存入的校验数据a+1和a+2,可以确定待监控时钟正常。For example, if the check data a+1 and a+2 read from the storage space are to be monitored during the first 0.1s clock cycle and the second 0.1s clock cycle of the reference clock The verification data a+1 and a+2 stored in the clock during the first 0.1s and second 0.1s clock cycles can determine that the clock to be monitored is normal.

如果在参考时钟的第一个0.1s和第二个0.1s的时钟周期时,从存储空间中读取出的校验数据a+2和a+3,不是待监控时钟在第一个0.1s的时钟周期时存入的校验数据a+1和a+2,可以确定待监控时钟发生异常。If the check data a+2 and a+3 read from the storage space during the first 0.1s and second 0.1s clock cycles of the reference clock are not in the first 0.1s of the clock to be monitored The verification data a+1 and a+2 stored in the clock cycle of the clock cycle can determine that the clock to be monitored is abnormal.

步骤409:确定当前校验数据符合数据创建规则,并继续执行步骤408。Step 409: Determine that the current verification data conforms to the data creation rule, and proceed to step 408.

具体地,根据数据创建规则与当前读取到的校验数据对比,确认符合数据创建规则之后,继续确认下一个从存储空间读取出的校验数据是否符合数据创建规则。Specifically, according to the comparison between the data creation rule and the currently read verification data, after confirming that the data creation rule is met, continue to confirm whether the next verification data read from the storage space conforms to the data creation rule.

举例来说,在参考时钟的第一个0.1s的时钟周期时,从存储空间中读取出的校验数据a+1和a+2,是待监控时钟在第一个0.1s的时钟周期时存入的校验数据a+1和a+2,确定符合数据创建规则,继续校验下一个从存储空间中读取出的校验数据。For example, during the first 0.1s clock cycle of the reference clock, the verification data a+1 and a+2 read from the storage space are the first 0.1s clock cycle of the clock to be monitored The verification data a+1 and a+2 stored at the time are determined to meet the data creation rules, and the next verification data read from the storage space is continued to be verified.

步骤410:确定校验数据发生异常,并记录该校验数据发生异常的时间。Step 410: Determine that the verification data is abnormal, and record the time when the verification data is abnormal.

具体地,在确定从存储空间读取出的校验数据不符合数据创建规则后,确定该校验数据发生异常,并记录一次该校验数据发生异常的时间,在记录一次校验数据发生异常后,不是直接发出报警信息,也不是继续确定并记录下一次校验数据发生异常的时间,而是暂停不小于第二时钟周期的缓冲时长从存储空间中读取校验数据,此做法的目的是避免因为向存储空间中存储校验数据的速率与从存储空间中读取校验数据的速率有微小的偏差,所导致的一次从存储空间连续读取到的两个校验数据不符合对应的关联关系而确定待监控时钟发生异常的情况,在达到暂停时长后,继续确定下一个不符合数据创建规则的校验数据,并记录该校验数据发生异常的时间。Specifically, after it is determined that the verification data read from the storage space does not comply with the data creation rules, it is determined that the verification data is abnormal, and the time when the verification data is abnormal is recorded once, and when the verification data is abnormal once recorded, After that, instead of directly sending out an alarm message, or continuing to determine and record the time when the next verification data is abnormal, it is to suspend the buffer time not less than the second clock cycle to read the verification data from the storage space. The purpose of this approach It is to avoid the slight deviation between the rate of storing the verification data in the storage space and the rate of reading the verification data from the storage space, resulting in that the two verification data continuously read from the storage space do not conform to the corresponding To determine the abnormality of the clock to be monitored, after the pause time is reached, continue to determine the next verification data that does not meet the data creation rules, and record the time when the verification data is abnormal.

举例来说,由于待监控时钟的实际时钟周期发生异常,由原来的0.02s变成0.04s,经过第一调频参数5调频后,待监控时钟的时钟周期变为0.2s。For example, due to an abnormality in the actual clock period of the clock to be monitored, the original 0.02s becomes 0.04s, and after frequency modulation by the first frequency modulation parameter 5, the clock period of the clock to be monitored becomes 0.2s.

待监控时钟在第一个0.2s的时钟周期已经存入a+1和a+2两个校验数据于存储空间中,在参考时钟的第一个0.1s的时钟周期时,从存储空间读取校验数据a+1,读取完a+1后删除校验数据a+1,此时存储空间内剩余校验数据a+2;The clock to be monitored has stored two verification data a+1 and a+2 in the storage space in the first 0.2s clock cycle, and reads from the storage space in the first 0.1s clock cycle of the reference clock Take the verification data a+1, delete the verification data a+1 after reading a+1, and then the remaining verification data a+2 in the storage space;

待监控时钟在第二个0.2s的时钟周期又存入a+3和a+1,在参考时钟的第二个0.1s时,应该读取到的是a+2,但由于存入的a+3和a+1已将a+2覆盖,所以读取到的是a+3,根据连续两次读取到的a+1和a+3,确定不是按照顺序存入的a+1和a+2,所以可以确定校验数据发生异常,记录在参考时钟的第二个0.1s的时钟周期时校验数据发生异常,此时存储空间内剩余的校验数据为a+1,并暂停一个0.1s的缓冲时长从存储空间中读取校验数据;The clock to be monitored stores a+3 and a+1 in the second 0.2s clock cycle, and a+2 should be read in the second 0.1s of the reference clock, but because the stored a +3 and a+1 have overwritten a+2, so a+3 is read. According to a+1 and a+3 read twice in a row, it is determined that a+1 and a+1 are not stored in order. a+2, so it can be determined that the verification data is abnormal. It is recorded that the verification data is abnormal in the second 0.1s clock cycle of the reference clock. At this time, the remaining verification data in the storage space is a+1, and it is suspended A 0.1s buffering time reads the verification data from the storage space;

在暂停的0.1s内,待监控时钟又存入a+2和a+3两个校验数据,并覆盖之前存入的a+1,在参考时钟的第三个0.1s时,应该从存储空间中读取出a+3,但实际读取出的为a+2,根据上一个读取到的a+3和当前读取到的a+2,确定校验数据发生异常,记录校验数据在参考时钟的第三个0.1s时发生第二次异常。Within 0.1s of the pause, the clock to be monitored stores two verification data a+2 and a+3, and overwrites the previously stored a+1. In the third 0.1s of the reference clock, it should start from the storage A+3 is read in the space, but the actual read is a+2. According to the last read a+3 and the current read a+2, it is determined that the verification data is abnormal, and the verification data is recorded. The second anomaly occurs in the data at the third 0.1s of the reference clock.

步骤411:判断校验数据发生异常的次数是否等于2,如果是,执行步骤412,否则执行步骤408。Step 411: Determine whether the number of abnormalities in the verification data is equal to 2, if yes, execute step 412, otherwise execute step 408.

具体地,在第一次校验数据发生异常时不能确定待监控时钟发生异常,是因为待监控时钟有可能因为微小的时钟周期偏差,经过长期积累后导致的一次异常,而是需要确定两次校验数据异常的时间差来判断,所以需要先确定校验数据发生异常的次数是否等于2。Specifically, it cannot be determined that the clock to be monitored is abnormal when the first verification data is abnormal, because the clock to be monitored may be abnormal after long-term accumulation due to a small clock cycle deviation, but it needs to be determined twice It is judged by the time difference of the abnormality of the verification data, so it is necessary to determine whether the number of abnormalities in the verification data is equal to 2.

举例来说,如果记录校验数据发生异常的次数等于2,再进一步确定两次异常的时间差。For example, if the number of abnormal occurrences of the recorded verification data is equal to 2, the time difference between the two abnormalities is further determined.

如果记录校验数据发生异常的次数小于2,则继续判断下次校验数据发生异常的次数是否等于2。If the number of abnormal occurrences of the recorded verification data is less than 2, continue to judge whether the number of abnormal occurrences of the next verification data is equal to 2.

步骤412:确定校验数据第二次发生异常与第一次发生异常之间的时间间隔是否小于预先设定的时长阈值,如果是,执行步骤414,否则执行步骤413。Step 412: Determine whether the time interval between the second occurrence of abnormality in the verification data and the first occurrence of abnormality is less than a preset duration threshold, if yes, execute step 414, otherwise execute step 413.

具体地,确定两次校验数据发生异常的时间差是否符合预先设定的时长阈值,从而确定待监控时钟是否异常。Specifically, it is determined whether the time difference between the two times when the verification data is abnormal meets the preset duration threshold, so as to determine whether the clock to be monitored is abnormal.

举例来说,预先设定的时长阈值为0.5s,由于第一次发生数据异常和第二次发生数据异常的时间差为0.1s的,小于时长阈值0.5s,可以所以确定待监控时钟异常。For example, the preset duration threshold is 0.5s. Since the time difference between the first occurrence of data anomaly and the second occurrence of data anomaly is 0.1s, which is less than the duration threshold of 0.5s, it can be determined that the clock to be monitored is abnormal.

如果第一次发生数据异常和第二次发生数据异常的时间差为0.6s,不小于时长阈值0.5s,可以确定待监控时钟正常。If the time difference between the first occurrence of data anomaly and the second occurrence of data anomaly is 0.6s and not less than the duration threshold of 0.5s, it can be determined that the clock to be monitored is normal.

步骤413:确定待监控时钟正常,并继续执行步骤408。Step 413: Determine that the clock to be monitored is normal, and proceed to step 408.

具体地,两次校验数据发生异常的时间差不小于设定的时长阈值,可以确定待监控时钟正常。Specifically, if the time difference between the abnormality of the two verification data is not less than the set duration threshold, it can be determined that the clock to be monitored is normal.

举例来说,如果第一次发生数据异常和第二次发生数据异常的时间差为0.1s,不小于时长阈值,可以确定待监控时钟正常。For example, if the time difference between the first occurrence of data anomaly and the second occurrence of data anomaly is 0.1s, which is not less than the duration threshold, it can be determined that the clock to be monitored is normal.

步骤414:确定待监控时钟异常,并发出报警信息。Step 414: Determine that the clock to be monitored is abnormal, and send an alarm message.

具体地,根据两次校验数据发生异常的时间差小于设定的时长阈值,可以确定待监控时钟发生异常,向服务器发出报警信息。Specifically, according to the fact that the time difference between the two verification data occurrences is less than the set duration threshold, it can be determined that the clock to be monitored is abnormal, and an alarm message is sent to the server.

举例来说,如果第一次发生数据异常和第二次发生数据异常的时间差为0.1s,小于时长阈值设定的0.5s,可以确定待监控时钟异常,向服务器发出待监控时钟速度过快的报警信息。For example, if the time difference between the first data anomaly and the second data anomaly is 0.1s, which is less than the 0.5s set by the duration threshold, it can be determined that the clock to be monitored is abnormal, and a notification that the clock to be monitored is too fast is sent to the server. Alarm information.

如图5所示,本发明实施例提供了一种系统时钟监控装置,包括:As shown in Figure 5, an embodiment of the present invention provides a system clock monitoring device, including:

调频处理单元501、存储单元502、读取单元503和判断单元504;A frequency modulation processing unit 501, a storage unit 502, a reading unit 503 and a judging unit 504;

所述调频处理单元501,用于根据预先设定的目标时钟周期,对待监控时钟的时钟周期进行调频处理,获得第一时钟周期,还用于根据所述目标时钟周期,对参考时钟的时钟周期进行调频处理,获得第二时钟周期;The frequency modulation processing unit 501 is configured to perform frequency modulation processing on the clock cycle of the clock to be monitored according to the preset target clock cycle to obtain the first clock cycle, and is also used to adjust the clock cycle of the reference clock according to the target clock cycle Perform frequency modulation processing to obtain a second clock cycle;

所述存储单元502,用于在所述调频处理单元501获取的每一个所述第一时钟周期,向具有预设容量的存储空间中存储至少一个校验数据,其中,在所述存储空间的容量不足时对存储时间较长的数据进行覆盖;The storage unit 502 is configured to store at least one check data in a storage space with a preset capacity at each first clock cycle acquired by the frequency modulation processing unit 501, wherein, in the storage space Overwrite the data stored for a long time when the capacity is insufficient;

所述读取单元503,用于在所述调频处理单元501获取的每一个所述第二时钟周期,从所述存储空间中读取所述存储单元502所较先存储的至少一个所述校验数据,并将读取到的所述至少一个所述校验数据从所述存储空间中删除,其中,当所述存储空间在不存在所述校验数据时,读取特定数据作为所述校验数据;The reading unit 503 is configured to read from the storage space at least one of the calibration values stored earlier by the storage unit 502 at each second clock cycle acquired by the frequency modulation processing unit 501. verification data, and delete the read at least one verification data from the storage space, wherein, when the verification data does not exist in the storage space, read specific data as the check data;

所述判断单元504,用于根据所述读取单元503在连续两个所述第二时钟周期读取到的至少两个所述校验数据,判断所述待监控时钟是否异常。The judging unit 504 is configured to judge whether the clock to be monitored is abnormal according to at least two verification data read by the reading unit 503 in two consecutive cycles of the second clock.

基于图5所示的一种系统时钟监控装置,本发明一实施例中,如图6所示,所述判断单元504包括:第一确定子单元5041和第一判断子单元5042;Based on a system clock monitoring device shown in FIG. 5, in an embodiment of the present invention, as shown in FIG. 6, the judging unit 504 includes: a first determining subunit 5041 and a first judging subunit 5042;

所述第一确定子单元5041,用于确定在连续两个所述第一时钟周期存储到所述存储空间中的至少两个所述校验数据之间的关联关系;The first determination subunit 5041 is configured to determine an association relationship between at least two check data stored in the storage space in two consecutive first clock cycles;

所述第一判断子单元5042,用于判断在连续两个所述第二时钟周期读取到的至少两个所述校验数据是否符合所述第一确定子单元5041确定的所述关联关系,如果是,确定所述待监控时钟正常,否则确定所述待监控时钟异常。The first judging subunit 5042 is configured to judge whether at least two verification data read in two consecutive second clock cycles conform to the association relationship determined by the first determining subunit 5041 , if yes, determine that the clock to be monitored is normal, otherwise determine that the clock to be monitored is abnormal.

基于图5所示的所述一种系统时钟监控装置,本发明一实施例中,如图7所示,所述判断单元504包括:第二确定子单元5043和第二判断子单元5044;Based on the system clock monitoring device shown in FIG. 5, in an embodiment of the present invention, as shown in FIG. 7, the judging unit 504 includes: a second determining subunit 5043 and a second judging subunit 5044;

所述第二确定子单元5043,确定在连续两个所述第一时钟周期存储到所述存储空间中的至少两个所述校验数据之间的关联关系;The second determining subunit 5043 is configured to determine an association relationship between at least two verification data stored in the storage space in two consecutive first clock cycles;

所述第二判断子单元5044,用于判断在连续两个所述第二时钟周期读取到的至少两个所述校验数据是否符合所述第二确定子单元5043确定的所述关联关系,如果否,记录一次校验数据异常,还用于判断本次所记录的所述校验数据异常与上一次所记录的所述校验数据异常之间的时间间隔是否小于预设的时长阈值,如果是,确定所述待监控时钟异常,否则确定所述待监控时钟正常。The second judging subunit 5044 is configured to judge whether at least two verification data read in two consecutive second clock cycles conform to the association relationship determined by the second determining subunit 5043 , if not, record the abnormality of the verification data once, which is also used to judge whether the time interval between the abnormality of the verification data recorded this time and the abnormality of the verification data recorded last time is less than the preset duration threshold , if yes, determine that the clock to be monitored is abnormal, otherwise determine that the clock to be monitored is normal.

在本发明一实施例中,In one embodiment of the present invention,

所述调频处理单元,用于根据预先设定的目标时钟周期和待监控时钟的标准时钟周期的比值,确定第一调频参数,利用所述第一调频参数对所述待监控时钟的实际时钟周期进行缩放,获得第一时钟周期,还用于根据预先设定的目标周期和参考时钟的时钟周期的比值,确定第二调频参数,利用所述第二调频参数对所述参考时钟的时钟周期进行缩放,获得第二时钟周期;The frequency modulation processing unit is configured to determine a first frequency modulation parameter according to the ratio of a preset target clock period to a standard clock period of the clock to be monitored, and use the first frequency modulation parameter to determine the actual clock period of the clock to be monitored Perform scaling to obtain the first clock period, and also determine a second frequency modulation parameter according to the ratio of the preset target period to the clock period of the reference clock, and use the second frequency modulation parameter to adjust the clock period of the reference clock Scale to get the second clock cycle;

在本发明一实施例中,所述第二判断子单元,用于在记录第一次所述校验数据发生异常之后,对所述读取单元进行触发;In an embodiment of the present invention, the second judging subunit is configured to trigger the reading unit after recording the abnormality of the verification data for the first time;

所述读取单元,进一步用于在接收到所述记录子单元的触发时,暂停执行所述在每一个所述第二时钟周期从所述存储空间中读取较先存储的至少一个所述校验数据,并在暂停时长达到预先设定的缓冲时长后,重新开始执行所述在每一个所述第二时钟周期从所述存储空间中读取较先存储的至少一个所述校验数据,其中,所述缓冲时长大于或等于一个所述第二时钟周期。The reading unit is further configured to, when receiving the trigger of the recording subunit, suspend the execution of the reading of at least one of the earlier stored from the storage space in each second clock cycle. verifying the data, and after the pause time reaches the preset buffering time, restarting the execution of reading at least one of the verification data stored earlier from the storage space in each second clock cycle , wherein the buffer duration is greater than or equal to one cycle of the second clock.

在本发明一实施例中,所述存储单元,进一步用于依次在所述存储空间中存储至少一个符合所述关联关系的缓冲数据。In an embodiment of the present invention, the storage unit is further configured to sequentially store at least one buffer data conforming to the association relationship in the storage space.

在本发明实施例中,为了待监控时钟和参考时钟的时钟周期有可比性,所以调频处理单元根据预先设定的目标时钟周期,将待监控的时钟周期调频至第一时钟周期,以及将参考时钟的时钟周期调频至第二时钟周期,存储单元在每一个调频处理单元获取的第一时钟周期时向存储空间中存入至少一个校验数据,是为了读取单元在每一个调频处理单元获取的第二时钟周期从存储空间中读取较先存储的至少一个校验数据,由于存储空间的容量有限,当第一时钟周期与第二时钟周期不同时,会导致存储空间中的校验数据溢出或校验数据不存在,使得从存储空间中读取出的校验数据产生相对应的变化。因此,判断单元可以通过读取单元从存储空间中读取到的校验数据,来确定第一时钟周期和第二时钟周期是否相同,从而可以确定待监控时钟是否异常,实现对系统时钟进行监控。In the embodiment of the present invention, in order to have comparable clock periods of the clock to be monitored and the reference clock, the frequency modulation processing unit frequency-tunes the clock period to be monitored to the first clock period according to the preset target clock period, and the reference The clock cycle of the clock is frequency-modulated to the second clock cycle, and the storage unit stores at least one verification data in the storage space during the first clock cycle obtained by each frequency-modulation processing unit, so that the reading unit obtains at each frequency-modulation processing unit The second clock cycle reads at least one check data stored earlier from the storage space. Due to the limited capacity of the storage space, when the first clock cycle is different from the second clock cycle, the check data in the storage space will be Overflow or check data does not exist, so that the check data read from the storage space has a corresponding change. Therefore, the judging unit can determine whether the first clock cycle and the second clock cycle are the same by reading the verification data read by the unit from the storage space, so as to determine whether the clock to be monitored is abnormal, and realize monitoring the system clock .

本发明各个实施例至少具有如下有益效果:Various embodiments of the present invention have at least the following beneficial effects:

1、在本发明实施例中,为了待监控时钟和参考时钟的时钟周期有可比性,所以根据预先设定的目标时钟周期,将待监控的时钟周期调频至第一时钟周期,以及将参考时钟的时钟周期调频至第二时钟周期,在每一个第一时钟周期时向存储空间中存入至少一个校验数据,是为了在每一个第二时钟周期从存储空间中读取较先存储的至少一个校验数据,由于存储空间的容量有限,当第一时钟周期与第二时钟周期不同时,会导致存储空间中的校验数据溢出或校验数据不存在,使得从存储空间中读取出的校验数据产生相对应的变化。因此,可以通过从存储空间中读取到的校验数据,来确定第一时钟周期和第二时钟周期是否相同,从而可以确定待监控时钟是否异常,实现对系统时钟进行监控。1. In the embodiment of the present invention, in order to make the clock periods of the clock to be monitored and the reference clock comparable, according to the preset target clock period, the frequency of the clock period to be monitored is adjusted to the first clock period, and the reference clock The clock cycle frequency is adjusted to the second clock cycle, and at least one check data is stored in the storage space at each first clock cycle, in order to read at least one of the earlier stored data from the storage space at each second clock cycle A check data, due to the limited capacity of the storage space, when the first clock cycle is different from the second clock cycle, it will cause the check data in the storage space to overflow or the check data does not exist, so that the read from the storage space The verification data of the corresponding changes. Therefore, it can be determined whether the first clock period and the second clock period are the same through the verification data read from the storage space, so as to determine whether the clock to be monitored is abnormal, and monitor the system clock.

2、本发明实施例中,方式一提供的确定待监控时钟是否异常的方法,是以在连续两个第二时钟周期读取到的两个校验数据为对象,当连续读取到的两个校验数据不符合两个校验数据对应的关联关系,可能由于向存储空间存储校验数据的速率大于从存储空间读取校验数据的速率,导致存储空间中未被读取的校验数据已经被覆盖,使得连续读取到的两个校验数据不符合对应的关联关系,也可能由于向存储空间存储校验数据的速率小于从存储空间读取校验数据的速率,导致存储空间中的校验数据被读空而读取到特定数据,从而使得连续读取到的两个校验数据不符合对应的关联关系,而向存储空间中存储校验数据的速率由待监控时钟的实际时钟周期决定,因此,当连续读取到的两个校验数据与两个校验数据对应的关联关系不符时,可以判定待监控时钟发生异常。2. In the embodiment of the present invention, the method for determining whether the clock to be monitored is abnormal provided by the first method is to use two verification data read in two consecutive second clock cycles as the object, and when the two consecutively read A verification data does not conform to the corresponding relationship between the two verification data. It may be that the rate of storing verification data in the storage space is greater than the rate of reading verification data from the storage space, resulting in unread verification data in the storage space. The data has been overwritten, so that the two verification data read continuously do not conform to the corresponding association relationship. It may also be because the rate of storing verification data in the storage space is lower than the rate of reading verification data from the storage space, causing the storage space to fail. The verification data in is read empty and specific data is read, so that the two consecutively read verification data do not conform to the corresponding association relationship, and the rate of storing verification data in the storage space is determined by the clock to be monitored The actual clock cycle is determined. Therefore, when the two verification data read continuously do not match the correlation relationship corresponding to the two verification data, it can be determined that the clock to be monitored is abnormal.

3、在本发明实施例中,方式二提供的确定待监控时钟是否异常的方法,是以每发生两次校验数据不符合对应的关联关系为对象,当第一次连续读取到的两个校验数据不符合对应的关联关系时,不立即确定待监控时钟发生异常而是记录校验数据发生异常的时间,是由于在待监控时钟向存储空间存储校验数据的速率与从存储空间中读取校验数据的速率有微小的偏差,当微小的偏差经过长时间的累积后,必然会出现一次从存储空间连续读取到的校验数据不符合对应的关联关系的情况,这可能是待监控时钟的固有偏差;继续确定并记录下一次连续读取到的两个校验数据不符合对应的关联关系的时间,在确定两次校验数据发生异常之后,确定两次校验数据发生异常的时间间隔是否小于预设的时长阈值,如果两次异常发生的时间间隔小于时长阈值,说明待监控时钟的实际时钟周期与标准时钟周期存在较大的差异,确定待监控时钟异常;如果两次异常发生的时间差大于时长阈值,说明待监控时钟需要经过较长的时间累计才会出现一次异常,此时可以判定待监控时钟是正常的。3. In the embodiment of the present invention, the method for determining whether the clock to be monitored is abnormal provided by the second method is based on the fact that the verification data does not conform to the corresponding relationship every two times. When a verification data does not conform to the corresponding relationship, it is not immediately determined that the clock to be monitored is abnormal but the time when the verification data is abnormal is recorded. There is a slight deviation in the rate of reading verification data in the system. When the slight deviation is accumulated for a long time, there will inevitably be a situation where the verification data continuously read from the storage space does not conform to the corresponding relationship. This may It is the inherent deviation of the clock to be monitored; continue to determine and record the time when the next two consecutively read verification data do not conform to the corresponding relationship, and after determining that the two verification data are abnormal, determine the two verification data Whether the time interval between abnormal occurrences is less than the preset duration threshold. If the time interval between two abnormal occurrences is less than the duration threshold, it means that the actual clock period of the clock to be monitored is quite different from the standard clock period, and it is determined that the clock to be monitored is abnormal; if If the time difference between the two abnormalities is greater than the duration threshold, it means that the clock to be monitored needs a long time to accumulate before an abnormality occurs. At this time, it can be determined that the clock to be monitored is normal.

4、在本发明实施例中,在本发明一实施例中,在确定并记录一次校验数据发生异常之后,不是直接发出报警信息,也不是继续确定并记录下一次校验数据发生异常的时间,而是暂停不小于第二时钟周期的缓冲时长从存储空间中读取校验数据,此做法的目的是避免因为向存储空间中存储校验数据的速率与从存储空间中读取校验数据的速率有微小的偏差,所导致的一次从存储空间连续读取到的两个校验数据不符合对应的关联关系而确定待监控时钟发生异常的情况。4. In the embodiment of the present invention, in one embodiment of the present invention, after determining and recording an abnormality in the verification data, it is not to send an alarm message directly, nor to continue to determine and record the time when the next verification data is abnormal , but to suspend the buffering duration of not less than the second clock cycle to read the verification data from the storage space. The purpose of this approach is to avoid the There is a slight deviation in the rate, which results in the fact that the two verification data read continuously from the storage space do not conform to the corresponding correlation, and it is determined that the clock to be monitored is abnormal.

5、在本发明实施例中,所确定的第一调频参数等于预设的目标时钟周期和待监控时钟的标准时钟周期的比值,所确定的第二调频参数等于预设的目标时钟周期和参考时钟的时钟周期的比值,利用第一调频参数对待监控时钟的实际时钟周期进行缩放,即可获得第一时钟周期,再利用第二调频参数对参考时钟的时钟周期进行缩放,即可获得第二时钟周期,确定第一调频参数和第二调频参数,是为了将待监控时钟的实际时钟周期缩放后获得的第一时钟周期与将参考时钟的时钟周期缩放后获得的第二时钟周期由可比性。5. In the embodiment of the present invention, the determined first frequency modulation parameter is equal to the ratio of the preset target clock period to the standard clock period of the clock to be monitored, and the determined second frequency modulation parameter is equal to the preset target clock period and the reference The ratio of the clock period of the clock, using the first frequency modulation parameter to scale the actual clock period of the clock to be monitored, can obtain the first clock period, and then use the second frequency modulation parameter to scale the clock period of the reference clock, and then obtain the second Clock period, determining the first frequency modulation parameter and the second frequency modulation parameter, is to scale the first clock period obtained by scaling the actual clock period of the clock to be monitored and the second clock period obtained by scaling the clock period of the reference clock for comparability .

6、在本发明实施例中,在本发明实施例中,在待监控时钟向存储空间存储至少一个校验数据之前,向存储空间中存入至少一个符合数据创建规则的缓冲数据,存储缓冲数据的操作可以避免系统在刚开始工作时,还未执行向存储空间存储校验数据的操作就已经执行从存储空间读取校验数据的操作,而导致的从存储空间中读取不到校验数据确定待监控时钟发生异常的情况。6. In the embodiment of the present invention, in the embodiment of the present invention, before the clock to be monitored stores at least one verification data in the storage space, store at least one buffer data conforming to the data creation rules in the storage space, and store the buffer data The operation can prevent the system from executing the operation of reading the verification data from the storage space before performing the operation of storing the verification data in the storage space when the system starts to work, resulting in failure to read the verification data from the storage space The data identifies the abnormality of the clock to be monitored.

需要说明的是,在本文中,诸如第一和第二之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个〃····〃”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同因素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or sequence. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a "..." does not exclude the presence of additional same elements in the process, method, article or apparatus comprising said element.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储在计算机可读取的存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质中。Those of ordinary skill in the art can understand that all or part of the steps to realize the above method embodiments can be completed by program instructions related hardware, and the aforementioned programs can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

最后需要说明的是:以上所述仅为本发明的较佳实施例,仅用于说明本发明的技术方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所做的任何修改、等同替换、改进等,均包含在本发明的保护范围内。Finally, it should be noted that the above descriptions are only preferred embodiments of the present invention, and are only used to illustrate the technical solution of the present invention, and are not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.

Claims (10)

1. a kind of system clock monitoring method, it is characterised in that including:
According to the target clock cycle set in advance, the clock cycle for treating monitoring clock carries out frequency modulation processing, when obtaining first The clock cycle;
According to the target clock cycle, frequency modulation processing is carried out to the clock cycle of reference clock, the second clock cycle is obtained;
In each described first clock cycle, at least one verification data is stored into the memory space with preset capacity, Wherein, the data longer to storage time in the off-capacity of the memory space are covered;
In each described second clock cycle, read from the memory space compared with least one the described check number first stored According to, and at least one described verification data described in reading deletes from the memory space, wherein, when the storage is empty Between when in the absence of the verification data, read specific data and be used as the verification data;
The verification data according at least two read the continuous two second clock cycles, judges described to be monitored Whether clock is abnormal.
2. according to the method described in claim 1, it is characterised in that
The basis read the continuous two second clock cycles at least two described in verification data judge described in treat Whether monitoring clock is abnormal, including:
It is determined that in continuous two the first clock cycle storages to verification data described at least two in the memory space Between incidence relation;
Whether verification data described in judging read the continuous two second clock cycles at least two meets the pass Connection relation;
If it is, determining that the clock to be monitored is normal, otherwise determine that the clock to be monitored is abnormal;
And/or
The basis read the continuous two second clock cycles at least two described in verification data judge described in treat Whether monitoring clock is abnormal, including:
It is determined that in continuous two the first clock cycle storages to verification data described at least two in the memory space Between incidence relation;
Whether verification data described in judging read the continuous two second clock cycles at least two meets the pass Connection relation, if not, verification data exception of record;
Judge between the abnormal verification data exception recorded the last time of described verification data that this is recorded when Between be spaced whether be less than default duration threshold value, if it is, determining that the clock to be monitored is abnormal, otherwise determine described to be monitored Clock is normal.
3. method according to claim 2, it is characterised in that
After the record once the verification data exception, further comprise:
Pause reads at least one more first stored in each described second clock cycle described in performing from the memory space The individual verification data, and after pause duration reaches buffering duration set in advance, restart execution described at each The second clock cycle is read from the memory space compared with least one the described verification data first stored;
Wherein, the buffering duration is more than or equal to a second clock cycle.
4. according to the method described in claim 1, it is characterised in that
Described the clock cycle for treating monitoring clock carries out frequency modulation processing according to the target clock cycle set in advance, obtains the One clock cycle, including:
According to target clock cycle set in advance and the ratio of the standard clock cycle of clock to be monitored, determine that the first frequency modulation is joined Number, is zoomed in and out using first chirp parameter to the actual clock cycle of the clock to be monitored, obtains the first clock week Phase;
It is described that frequency modulation processing is carried out to the clock cycle of reference clock according to the target clock cycle, obtain second clock week Phase, including:
According to target period set in advance and the ratio of the clock cycle of reference clock, the second chirp parameter is determined, institute is utilized State the second chirp parameter to zoom in and out the clock cycle of the reference clock, obtain the second clock cycle.
5. according to any described method in claim 2 to 3, it is characterised in that
Described in each described first clock cycle, at least one verification is stored into the memory space with preset capacity Before data, further comprise:
At least one buffered data for meeting the incidence relation is stored in the memory space successively.
6. a kind of system clock supervising device, it is characterised in that including:Frequency modulation processing unit, memory cell, reading unit and sentence Disconnected unit;
The frequency modulation processing unit, for according to the target clock cycle set in advance, the clock cycle for treating monitoring clock to enter The processing of row frequency modulation, obtained for the first clock cycle, is additionally operable to, according to the target clock cycle, enter the clock cycle of reference clock The processing of row frequency modulation, obtains the second clock cycle;
The memory cell, for each described first clock cycle obtained in the frequency modulation processing unit, to pre- If storing at least one verification data in the memory space of capacity, wherein, in the off-capacity of the memory space to storage Time longer data are covered;
The reading unit, for each the described second clock cycle obtained in the frequency modulation processing unit, is deposited from described Read in storage space the memory cell compared with least one the described verification data first stored, and described in reading at least One verification data is deleted from the memory space, wherein, when the memory space is in the absence of the verification data When, read specific data and be used as the verification data;
The judging unit, for read according to the reading unit the continuous two second clock cycles at least two The individual verification data, judges whether the clock to be monitored is abnormal.
7. device according to claim 6, it is characterised in that
The judging unit includes:First determination subelement and the first judgment sub-unit;
First determination subelement, for determining in continuous two the first clock cycle storages into the memory space At least two described in incidence relation between verification data;
First judgment sub-unit, for judge to read the continuous two second clock cycles at least two described in Whether verification data meets the incidence relation that first determination subelement is determined, if it is, when determining described to be monitored Clock is normal, otherwise determines that the clock to be monitored is abnormal;
And/or
The judging unit includes:Second determination subelement and the second judgment sub-unit;
Second determination subelement, it is determined that being stored in continuous two first clock cycle into the memory space extremely Incidence relation between few two verification datas;
Second judgment sub-unit, for judge to read the continuous two second clock cycles at least two described in Whether verification data meets the incidence relation that second determination subelement is determined, if not, verification data of record It is abnormal, it is additionally operable to judge the verification data exception and the last verification data exception recorded that this is recorded Between time interval whether be less than default duration threshold value, if it is, determining that the clock to be monitored is abnormal, otherwise determine described Clock to be monitored is normal.
8. device according to claim 7, it is characterised in that
Second judgment sub-unit, is further used for after record once the verification data generation exception, reads described Unit is taken to be triggered;
The reading unit, is further used for when receiving the triggering of second judgment sub-unit, pause perform it is described Each described second clock cycle is read from the memory space compared with least one the described verification data first stored, and Pause duration reached after buffering duration set in advance, restart to perform it is described in each described second clock cycle from institute At least one the described verification data read in memory space compared with first storing is stated, wherein, the buffering duration is more than or equal to one The individual second clock cycle.
9. device according to claim 6, it is characterised in that
The frequency modulation processing unit, for the standard clock cycle according to target clock cycle set in advance and clock to be monitored Ratio, determine the first chirp parameter, the actual clock cycle of the clock to be monitored entered using first chirp parameter Row scaling, obtained for the first clock cycle, is additionally operable to the ratio of the clock cycle according to target period set in advance and reference clock Value, is determined the second chirp parameter, the clock cycle of the reference clock is zoomed in and out using second chirp parameter, is obtained The second clock cycle.
10. according to any described device in claim 7 to 8, it is characterised in that
The memory cell, is further used for storing at least one in the memory space successively and meets the incidence relation Buffered data.
CN201710455971.9A 2017-06-16 2017-06-16 A kind of system clock monitoring method and device Pending CN107272822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710455971.9A CN107272822A (en) 2017-06-16 2017-06-16 A kind of system clock monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710455971.9A CN107272822A (en) 2017-06-16 2017-06-16 A kind of system clock monitoring method and device

Publications (1)

Publication Number Publication Date
CN107272822A true CN107272822A (en) 2017-10-20

Family

ID=60067627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710455971.9A Pending CN107272822A (en) 2017-06-16 2017-06-16 A kind of system clock monitoring method and device

Country Status (1)

Country Link
CN (1) CN107272822A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061802A (en) * 2019-12-26 2020-04-24 宁波三星医疗电气股份有限公司 Power data management processing method and device and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1555052A (en) * 2003-12-26 2004-12-15 威盛电子股份有限公司 Method and circuit for detecting and correcting CD reading clock pulse
CN1722776A (en) * 2004-07-16 2006-01-18 上海乐金广电电子有限公司 Clock restoring arrangement in digital broadcasting receiver
CN1771556A (en) * 2004-03-19 2006-05-10 索尼株式会社 Information reproduction device and read clock monitoring method
CN101018153A (en) * 2007-02-26 2007-08-15 华为技术有限公司 Method and device for eliminating the error accumulation caused by the clock deviation in the network device
CN101206496A (en) * 2006-12-20 2008-06-25 富士通株式会社 Automatic frequency monitoring circuit, electronic device, automatic frequency monitoring method and program
CN102201810A (en) * 2010-03-23 2011-09-28 奇景光电股份有限公司 Apparatus for controlling clock recovery and method thereof
CN102387369A (en) * 2010-09-02 2012-03-21 瑞昱半导体股份有限公司 Device for receiving signal and method for receiving clock signal
CN102929735A (en) * 2012-10-19 2013-02-13 北京星网锐捷网络技术有限公司 Clock-correcting method and equipment
CN103003807A (en) * 2010-07-28 2013-03-27 格诺多有限公司 Modifying read patterns for a fifo between clock domains
CN103365757A (en) * 2013-07-29 2013-10-23 浙江中控技术股份有限公司 Clock detecting method and device
CN104380273A (en) * 2012-06-18 2015-02-25 高通股份有限公司 Adaptive offset synchronization of data based on ring buffers
CN105718413A (en) * 2016-01-14 2016-06-29 深圳市同创国芯电子有限公司 Channel alignment method, device and system
CN106301746A (en) * 2015-05-28 2017-01-04 深圳市中兴微电子技术有限公司 Clock recovery method and device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1555052A (en) * 2003-12-26 2004-12-15 威盛电子股份有限公司 Method and circuit for detecting and correcting CD reading clock pulse
CN1771556A (en) * 2004-03-19 2006-05-10 索尼株式会社 Information reproduction device and read clock monitoring method
CN1722776A (en) * 2004-07-16 2006-01-18 上海乐金广电电子有限公司 Clock restoring arrangement in digital broadcasting receiver
CN101206496A (en) * 2006-12-20 2008-06-25 富士通株式会社 Automatic frequency monitoring circuit, electronic device, automatic frequency monitoring method and program
CN101018153A (en) * 2007-02-26 2007-08-15 华为技术有限公司 Method and device for eliminating the error accumulation caused by the clock deviation in the network device
CN102201810A (en) * 2010-03-23 2011-09-28 奇景光电股份有限公司 Apparatus for controlling clock recovery and method thereof
CN103003807A (en) * 2010-07-28 2013-03-27 格诺多有限公司 Modifying read patterns for a fifo between clock domains
CN102387369A (en) * 2010-09-02 2012-03-21 瑞昱半导体股份有限公司 Device for receiving signal and method for receiving clock signal
CN104380273A (en) * 2012-06-18 2015-02-25 高通股份有限公司 Adaptive offset synchronization of data based on ring buffers
CN102929735A (en) * 2012-10-19 2013-02-13 北京星网锐捷网络技术有限公司 Clock-correcting method and equipment
CN103365757A (en) * 2013-07-29 2013-10-23 浙江中控技术股份有限公司 Clock detecting method and device
CN106301746A (en) * 2015-05-28 2017-01-04 深圳市中兴微电子技术有限公司 Clock recovery method and device
CN105718413A (en) * 2016-01-14 2016-06-29 深圳市同创国芯电子有限公司 Channel alignment method, device and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061802A (en) * 2019-12-26 2020-04-24 宁波三星医疗电气股份有限公司 Power data management processing method and device and storage medium

Similar Documents

Publication Publication Date Title
US8839017B2 (en) Electronic device and method for detecting power statuses of electronic device
WO2020232871A1 (en) Method and device for microservice dependency analysis
US9355002B2 (en) Capturing trace information using annotated trace output
US20150193336A1 (en) Computing device and method for recording system event logs of computing device
US20080127067A1 (en) Method and system for timing code execution in a korn shell script
CN103268277A (en) Method and system for outputting log information
CN106326067A (en) Method and device for monitoring CPU (central processing unit) performance under pressure test
CN106021054A (en) Method and apparatus for testing upgrading and downgrading stability of BMC
CN104778123A (en) Method and device for detecting system performance
CN110008090B (en) A method, apparatus and computer-readable storage medium for monitoring memory errors
US10108474B2 (en) Trace capture of successfully completed transactions for trace debugging of failed transactions
US9916220B2 (en) Smart logging of trace data for storage systems
US20120154158A1 (en) Computing device and alarm method of the computing device
CN105404813B (en) A kind of daily record generation method of Intrusion Detection based on host system of defense, apparatus and system
CN109684130B (en) Method and device for data backup in computer room
CN109558209B (en) A monitoring method for virtual machines
CN107272822A (en) A kind of system clock monitoring method and device
CN111078418B (en) Operation synchronization method, device, electronic equipment and computer readable storage medium
US9069888B2 (en) Tracking errors in a computing system
US9298468B2 (en) Monitoring processing time in a shared pipeline
CN113220554B (en) Method and apparatus for detecting performance of program code
CN111382380A (en) Statistical method and device for page access duration
CN111625853B (en) Snapshot processing method, device and equipment and readable storage medium
CN115733740A (en) Log detection method and device, computer equipment and computer readable storage medium
CN114637651A (en) Memory frame rate detection method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171020