A method, apparatus, chip, and storage medium for determining time synchronization error
By using a counter in the chip and outputting symbol information in B-code format, combined with second pulse signal processing, the problems of high cost and low efficiency in existing technologies are solved, and the determination of time synchronization error is achieved quickly and accurately.
Patent Information
- Application Number
- CN202311349779.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-10-17
AI Technical Summary
In existing technologies, determining time synchronization errors through additional clock synchronization devices results in high costs and low efficiency.
The chip accumulates the current value using a counter, generates the current clock data, and outputs the symbol information in B code format. It also receives the second pulse signal from the module under test to determine the time synchronization error, thus avoiding the need for an additional time synchronization device.
It enables the rapid and accurate determination of time synchronization errors, reduces the cost of time synchronization testing, and improves testing efficiency.
Smart Images

Figure CN117406577B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system technology, and in particular to a method, apparatus, chip, and storage medium for determining time synchronization error. Background Technology
[0002] With the continuous expansion of power system scale and the increasing complexity of power grid structure, the need for power system clock synchronization is becoming increasingly urgent. Currently, power synchronization clocks are widely used in the power industry, including in grid dispatching, protection, control, monitoring, operation, and management. Clock synchronization ensures the synchronization and consistency of various operating equipment. Since time synchronization error is a crucial factor in judging the effectiveness of clock synchronization, it is essential to determine the time synchronization error of power equipment.
[0003] In existing technologies, an additional clock synchronization device typically outputs a serial time exchange code (Inter-Range Instrumentation Group-B, IRIG-B) to the module under test. This clock synchronization device can include the Global Positioning System (GPS) and the BeiDou Navigation Satellite System. Then, time synchronization and time error determination operations can be performed based on the IRIG-B code.
[0004] However, existing technologies require additional clock synchronization devices, resulting in higher costs and lower efficiency for time synchronization testing. Summary of the Invention
[0005] This invention provides a method, apparatus, chip, and storage medium for determining time synchronization error, which can quickly and accurately determine the time synchronization error of the module under test, reduce the cost of time synchronization testing, and improve the efficiency of time synchronization testing.
[0006] According to one aspect of the present invention, a method for determining timing error is provided, applied to a chip, the method comprising:
[0007] The counter value is accumulated according to the preset interrupt cycle. If the current value of the counter corresponds to a whole second, the current clock data is generated based on the current value of the counter and the preset clock data.
[0008] Output the symbol information corresponding to the current clock data in B code format, and transmit the level signal corresponding to the symbol information to the module under test;
[0009] According to the preset interrupt cycle, the second pulse signal fed back by the module under test in response to the level signal is received. Based on the second pulse signal and the current value of the counter, the timing error result corresponding to the module under test is determined.
[0010] Optionally, based on the second pulse signal and the current value of the counter, the timing error result corresponding to the module under test is determined, including:
[0011] Obtain the level value corresponding to the second pulse signal, and determine whether the second pulse signal is at the rising edge based on the level value;
[0012] If so, determine the timing error result corresponding to the module under test based on the current value of the counter;
[0013] If not, return to the operation of receiving the second pulse signal fed back by the module under test in response to the level signal according to the preset interrupt cycle, until the second pulse signal fed back by the module under test is at the rising edge.
[0014] Optionally, based on the current value of the counter, determine the timing error result corresponding to the module under test, including:
[0015] Retrieve the historical values corresponding to the counter;
[0016] Among them, the historical value is the cumulative value corresponding to the counter when the pulse signal of the previous second was at the rising edge;
[0017] Based on the current value and historical values of the counter, determine whether the current value of the counter corresponds to a valid second pulse moment;
[0018] If so, the timing error result corresponding to the module under test is determined based on the effective second pulse time.
[0019] Optionally, based on the current value and historical values of the counter, determine whether the current value of the counter corresponds to a valid second pulse moment, including:
[0020] Determine the difference between the current value and the historical value of the counter;
[0021] Determine whether the difference is within a preset value range;
[0022] If so, then the current value of the counter corresponds to the valid second pulse time.
[0023] Optionally, based on the effective second pulse time, determine the timing error result corresponding to the module under test, including:
[0024] The reference value is determined based on the numerical relationship between the preset whole second value and the preset interruption period;
[0025] Obtain the current value of the counter corresponding to the valid second pulse moment, take the remainder between the current value of the counter and the reference value, and use the remainder result as the time calibration error result of the module under test.
[0026] Optionally, the chip includes a B-code generation module and a second pulse receiving module; the module under test includes a time synchronization interface and a second pulse output interface.
[0027] Output the symbol information corresponding to the current clock data in B-code format, and transmit the corresponding level signal to the module under test, including:
[0028] The B code generation module outputs the code element information corresponding to the current clock data according to the B code format, and transmits the level signal corresponding to the code element information to the module under test through the time synchronization interface.
[0029] According to a preset interrupt cycle, receive the second pulse signal fed back by the module under test in response to the level signal, including:
[0030] The second pulse receiving module receives the second pulse signal fed back from the second pulse output interface of the module under test according to the preset interrupt cycle.
[0031] According to another aspect of the present invention, a timing error determination device is provided, applied to a chip, the device comprising:
[0032] The clock data generation module is used to accumulate the value of the counter according to the preset interrupt cycle. If the current value of the counter corresponds to a whole second, the current clock data is generated based on the current value of the counter and the preset clock data.
[0033] The symbol information output module is used to output the symbol information corresponding to the current clock data in B code format, and transmit the level signal corresponding to the symbol information to the module under test.
[0034] The time synchronization error determination module is used to receive the second pulse signal fed back by the module under test in response to the level signal according to a preset interrupt cycle, and determine the time synchronization error result corresponding to the module under test based on the second pulse signal and the current value of the counter.
[0035] According to another aspect of the present invention, a chip is provided, the chip comprising:
[0036] At least one processor; and
[0037] A memory that is communicatively connected to at least one processor; wherein,
[0038] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the timing error determination method of any embodiment of the present invention.
[0039] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to execute and implement the time synchronization error determination method of any embodiment of the present invention.
[0040] According to another aspect of the present invention, a computer program product is provided, characterized in that the computer program product includes a computer program, which, when executed by a processor, implements the time synchronization error determination method of any embodiment of the present invention.
[0041] The technical solution of this invention accumulates the value of a counter according to a preset interrupt cycle. If the current value of the counter corresponds to an integer second, it generates current clock data based on the current value of the counter and preset clock data. It outputs the symbol information corresponding to the current clock data in B-code format and transmits the level signal corresponding to the symbol information to the module under test. According to the preset interrupt cycle, it receives the second pulse signal fed back by the module under test in response to the level signal. Based on the second pulse signal and the current value of the counter, it determines the time synchronization error result corresponding to the module under test. This technical means can quickly and accurately determine the time synchronization error of the module under test, reduce the cost of time synchronization testing, and improve the efficiency of time synchronization testing.
[0042] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a flowchart of a time synchronization error determination method provided in Embodiment 1 of the present invention;
[0045] Figure 2a This is a schematic diagram of a time synchronization error determination system provided according to Embodiment 2 of the present invention;
[0046] Figure 2b This is a flowchart of another time synchronization error determination method provided in Embodiment 2 of the present invention;
[0047] Figure 2c This is a flowchart of a method for determining a level signal according to Embodiment 2 of the present invention;
[0048] Figure 3a This is a flowchart of another time synchronization error determination method provided in Embodiment 3 of the present invention;
[0049] Figure 3b This is a flowchart of an effective second pulse determination method provided in Embodiment 3 of the present invention;
[0050] Figure 4 This is a schematic diagram of a time synchronization error determination device according to Embodiment 4 of the present invention.
[0051] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the time synchronization error determination method of the present invention. Detailed Implementation
[0052] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0053] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0054] Example 1
[0055] Figure 1 This is a flowchart of a time calibration error determination method according to Embodiment 1 of the present invention. This embodiment is applicable to situations where the time calibration error of a module under test needs to be determined. This method can be executed by a time calibration error determination device, which can be implemented in hardware and / or software, and can be configured in a chip. Figure 1 As shown, the method includes:
[0056] S110. Accumulate the value of the counter according to the preset interrupt cycle. If the current value of the counter corresponds to an integer second, generate the current clock data based on the current value of the counter and the preset clock data.
[0057] In this embodiment, the preset interrupt period can be the time interval between each interrupt, such as 1ms. The current value of the counter can be any integer not less than 0.
[0058] In one specific implementation, firstly, an interrupt can be executed once every preset interrupt period, and the value of a counter is incremented each time an interrupt is executed. Then, after the counter value is incremented, it can be determined whether the current value of the counter is equal to the value corresponding to a whole second. Since a whole second can be 1 second, 2 seconds, 3 seconds, and 4 seconds, the value corresponding to a whole second can be 1000, 2000, 3000, and 4000, etc. The increment of the counter each time can be determined according to the preset interrupt period. For example, if the preset interrupt period is 1 millisecond, the current value of the counter is incremented by 1.
[0059] If the current value of the counter equals the value corresponding to an integer second, then the current value of the counter can be divided by 1000, and the current clock data can be generated based on the division result and the preset clock data. Specifically, the formula for calculating the current clock data can be as follows:
[0060] Time = Tstart + Tick / 1000
[0061] Where Time is the current clock data, Tstart is the preset clock data, and Tick is the current value of the counter.
[0062] For example, assuming the preset clock data is 00:00:00 on January 1, 2020, and the preset interrupt period is 1 millisecond, the current clock data, i.e., 00:00:01 on January 1, 2020, can be generated when the current value of the counter is 1000.
[0063] S120. Output the symbol information corresponding to the current clock data according to the B code format, and transmit the level signal corresponding to the symbol information to the module under test.
[0064] In this embodiment, the code element information may include a reference code element, an identification flag, and time information data. The aforementioned reference code element may include an 8-millisecond high level and a 2-millisecond low level. The level signal may be an IRIG-B code signal.
[0065] In this step, specifically, the level signals corresponding to the symbol information can be output through general purpose input / output ports (GPIO). For example, "0" in the symbol information can be represented as a high level lasting 2 milliseconds, followed by a low level lasting 8 milliseconds; "1" can be represented as a high level lasting 5 milliseconds, followed by a low level lasting 5 milliseconds.
[0066] S130. According to the preset interrupt cycle, receive the second pulse signal fed back by the module under test in response to the level signal, and determine the timing error result corresponding to the module under test based on the second pulse signal and the current value of the counter.
[0067] In this embodiment, the time calibration error result can be the time deviation caused by external interference to the level signal.
[0068] In this step, specifically, the second pulse signal output by the module under test after time calibration can be received at preset interrupt cycles. Then, at the moment the second pulse signal is received, the current value of the counter can be obtained, and the time calibration error result can be determined based on the current value. Finally, it can be determined whether the above time calibration error result meets the actual application requirements of the module under test.
[0069] The advantage of this setup is that, compared to existing technologies that use additional time synchronization devices to output B-code information, the technical solution of this embodiment does not require an external reference clock, but only uses preset clock data as a reference, thus reducing the cost of time synchronization testing and improving the efficiency of time synchronization testing. Secondly, compared to existing technologies that use an oscilloscope to observe the second pulse signal output by the module under test to determine the time synchronization error result, the technical solution of this embodiment determines the time synchronization error result based on the current value of the counter, which can achieve rapid and accurate determination of the time synchronization error of the module under test.
[0070] The technical solution of this embodiment accumulates the value of a counter according to a preset interrupt cycle. If the current value of the counter corresponds to an integer second, the current clock data is generated based on the current value of the counter and preset clock data. The symbol information corresponding to the current clock data is output in B-code format, and the level signal corresponding to the symbol information is transmitted to the module under test. The second pulse signal fed back by the module under test in response to the level signal is received according to the preset interrupt cycle. Based on the second pulse signal and the current value of the counter, the timing error result corresponding to the module under test is determined. This technical means solves the problem of high cost of timing test caused by using an additional time synchronization device to send B-code information. It can quickly and accurately determine the timing error of the module under test, reduce the cost of timing test, and improve the efficiency of timing test.
[0071] Example 2
[0072] Figure 2a This is a schematic diagram of a time synchronization error determination system according to Embodiment 2 of the present invention. This embodiment is a further refinement of the above technical solution. The technical solution in this embodiment can be combined with the various optional solutions in one or more of the above embodiments.
[0073] like Figure 2a As shown, this embodiment discloses a time synchronization error determination system, including a module under test (DUT) and a chip. The DUT includes a time synchronization interface and a second pulse output interface. The chip includes a B-code generation module and a second pulse receiving module. Specifically, the B-code generation module can output the symbol information corresponding to the current clock data according to the B-code format, and transmit the corresponding level signal to the DUT through the time synchronization interface. The second pulse receiving module can receive the second pulse signal fed back from the second pulse output interface of the DUT according to a preset interrupt period. Optionally, the second pulse receiving module can then decode the second pulse signal to obtain the current value of the counter.
[0074] The advantage of this setup is that, compared to existing technologies that require additional equipment for time synchronization testing, the technical solution in this embodiment uses a chip for time synchronization testing, making the test environment setup simpler and the operation easier, thereby improving the efficiency of time synchronization testing. Secondly, compared to additional time synchronization devices, the technical solution in this embodiment uses a lower-cost chip for time synchronization testing, reducing the cost of time synchronization testing.
[0075] Figure 2b This is a flowchart of another time synchronization error determination method provided by Embodiment 2 of the present invention, as shown below. Figure 2b As shown, the method includes:
[0076] S210. Accumulate the value of the counter according to the preset interrupt cycle. If the current value of the counter corresponds to an integer second, generate the current clock data based on the current value of the counter and the preset clock data.
[0077] S220: Output the symbol information corresponding to the current clock data according to the B code format, and transmit the level signal corresponding to the symbol information to the module under test.
[0078] Figure 2c This is a flowchart of a method for determining a level signal according to Embodiment 2 of the present invention. Figure 2cAs shown, after the test board corresponding to the chip is powered on, the GPIO pins and preset clock data of the B-code generation module are first initialized, and the current value of the counter is cleared. Then, a 1ms interrupt can be enabled, that is, an interrupt routine with a preset interrupt period of 1ms is started. Specifically, while the time synchronization test is not stopped, an interrupt is executed every 1ms. After that, it can be determined whether the interrupt time has arrived. If so, the current value of the counter is incremented when the interrupt routine is executed. After the current value of the counter is incremented, it is determined whether the current value of the counter corresponds to an integer second. If so, the preset clock data is updated (that is, the current clock data is generated), and the symbol information corresponding to the current clock data is output according to the B-code format. If not, the symbol information corresponding to the preset clock data is output according to the B-code format. Finally, the level signal corresponding to the symbol information is transmitted to the module under test through the GPIO port.
[0079] S230: Receive the second pulse signal fed back by the module under test in response to the level signal according to the preset interrupt cycle.
[0080] S240: Obtain the level value corresponding to the second pulse signal. Determine whether the second pulse signal is at the rising edge based on the level value. If yes, execute S250; otherwise, return to execute S230.
[0081] In this embodiment, the level value can include 0 and 1.
[0082] For example, if the level value is 1, the second pulse signal can be considered to be on the rising edge. If the level value is 0, the second pulse signal can be considered to be on the falling edge.
[0083] S250. Based on the current value of the counter, determine the timing error result corresponding to the module under test.
[0084] In this step, specifically, the time calibration error result can be determined based on the current value of the counter and the preset whole second value.
[0085] The advantage of this setting is that, since the current time is a whole second only when the second pulse signal is on the rising edge, the accuracy of the time calibration error determination is improved by obtaining the current value of the counter when the second pulse signal is on the rising edge and determining the time calibration error result based on the current value.
[0086] The technical solution of this embodiment accumulates the value of a counter according to a preset interrupt cycle. If the current value of the counter corresponds to an integer second, the current clock data is generated based on the current value of the counter and preset clock data. A B-code generation module outputs the symbol information corresponding to the current clock data according to the B-code format, and transmits the corresponding level signal to the module under test (DUT) through a time synchronization interface. A second pulse receiving module receives the second pulse signal fed back from the second pulse output interface of the DUT according to a preset interrupt cycle. The level value corresponding to the second pulse signal is obtained, and it is determined whether the second pulse signal is at a rising edge based on the level value. If so, the time synchronization error result corresponding to the DUT is determined based on the current value of the counter. If not, the operation of receiving the second pulse signal fed back by the DUT in response to the level signal according to the preset interrupt cycle is resumed until the second pulse signal fed back by the DUT is at a rising edge is completed. This technical approach solves the problem of high cost in time synchronization testing caused by using an additional time synchronization device to send B-code information. It enables rapid and accurate determination of the time synchronization error of the DUT, reduces the cost of time synchronization testing, and improves the efficiency of time synchronization testing.
[0087] Example 3
[0088] Figure 3a This is a flowchart of another time synchronization error determination method provided by Embodiment 3 of the present invention. This embodiment is a further refinement of the above technical solution, and the technical solution in this embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 3a As shown, the method includes:
[0089] S310. Accumulate the value of the counter according to the preset interrupt cycle. If the current value of the counter corresponds to an integer second, generate the current clock data based on the current value of the counter and the preset clock data.
[0090] S320: Output the symbol information corresponding to the current clock data in B code format, and transmit the level signal corresponding to the symbol information to the module under test.
[0091] S330: Receive the second pulse signal fed back by the module under test in response to the level signal according to the preset interrupt cycle.
[0092] S340: Obtain the level value corresponding to the second pulse signal. Determine whether the second pulse signal is at the rising edge based on the level value. If yes, execute S350; otherwise, return to execute S330.
[0093] S350, Obtain the historical value corresponding to the counter.
[0094] In this embodiment, the historical value can be the cumulative value corresponding to the counter when the pulse signal was at the rising edge of the previous second.
[0095] S360. Based on the current value and historical values of the counter, determine whether the current value of the counter corresponds to a valid second pulse moment. If yes, execute S370; otherwise, return to execute S330.
[0096] In an optional embodiment of the present invention, determining whether the time corresponding to the current value of the counter is a valid second pulse time based on the current value of the counter and the historical value includes: determining the difference between the current value of the counter and the historical value; determining whether the difference is within a preset value range; if so, determining that the time corresponding to the current value of the counter is a valid second pulse time.
[0097] In this embodiment, the preset value range may include a preset maximum value and a preset minimum value. The difference between the preset maximum value and the preset minimum value can be a preset percentage of a preset integer second. The preset percentage can be set according to user needs, such as 10%. The preset integer second value can be a value corresponding to an integer second, such as 1000.
[0098] In this step, specifically, assuming the current value of the counter is 2023, the historical value is 1000, and the preset value range is greater than 990 and less than 1090, then the difference between the current value and the historical value can be considered to be within the preset value range. At this point, it can be determined that the time corresponding to the current value of the counter is the valid second pulse time.
[0099] S370. Determine the timing error result corresponding to the module under test based on the effective second pulse time.
[0100] Optionally, in this step, the current value of the counter corresponding to the valid second pulse moment can be obtained. Then, the remainder between the current counter value and a preset integer second value is taken, and the remainder result is used as the timing error result for the module under test. The preset integer second value can be set according to user needs.
[0101] The advantage of this setting is that, since the whole second is a multiple of 1000, the remainder of the current counter value and 1000 can be used as the time calibration error result.
[0102] In an optional embodiment of the present invention, determining the timing error result corresponding to the module under test based on the effective second pulse time includes: determining a reference value based on the numerical relationship between a preset integer second value and a preset interruption period; obtaining the current value of the counter corresponding to the effective second pulse time; taking the remainder between the current value of the counter and the reference value; and using the remainder result as the timing error result corresponding to the module under test.
[0103] In this embodiment, the reference value can be the result of dividing a preset integer second value by a preset interrupt period. For example, assuming the preset integer second value is 1000 and the preset interrupt period is 1ms, the reference value is 1000. At this time, if the current value of the counter is 1023, the time synchronization error result can be obtained as 23ms.
[0104] The technical solution of this embodiment solves the problem of high cost of time synchronization testing caused by using an additional time synchronization device to send B code information. It outputs the symbol information corresponding to the current clock data in B code format and transmits the corresponding level signal to the module under test. According to a preset interrupt period, it receives the second pulse signal fed back by the module under test in response to the level signal. It obtains the level value corresponding to the second pulse signal, determines whether the second pulse signal is at a rising edge based on the level value, and if so, obtains the historical value corresponding to the counter. Based on the current value and the historical value of the counter, it determines whether the time corresponding to the current value of the counter is a valid second pulse moment. If so, it determines the time synchronization error result corresponding to the module under test based on the valid second pulse moment. If not, it returns to the operation of receiving the second pulse signal fed back by the module under test in response to the level signal according to the preset interrupt period until the second pulse signal fed back by the module under test is at a rising edge. This technical means solves the problem of high cost of time synchronization testing caused by using an additional time synchronization device to send B code information. It can quickly and accurately determine the time synchronization error of the module under test, reducing the cost of time synchronization testing and improving the efficiency of time synchronization testing.
[0105] Figure 3b This is a flowchart of a valid second pulse determination method provided according to Embodiment 3 of the present invention. Figure 3b As shown, after the test board corresponding to the chip is powered on, the GPIO pins and preset clock data corresponding to the B code generation module are first initialized, and the current value of the counter is cleared. Then, a 1ms interrupt can be enabled. It is determined whether the interrupt time has arrived. If so, the level value corresponding to the second pulse signal can be obtained through the GPIO. Then, it can be determined whether the second pulse signal is on the rising edge based on the level value. If so, the current value and historical value of the counter can be obtained, and it can be determined whether the second pulse signal is a valid second pulse based on the current value and historical value. If the second pulse signal is a valid second pulse, the time corresponding to the current value of the counter can be taken as the valid second pulse time, that is, the rising edge time can be taken as the valid second pulse time. If the second pulse signal is not a valid second pulse, the operation of receiving the second pulse signal fed back by the module under test according to the preset interrupt period is resumed until the second pulse signal fed back by the module under test is on the rising edge.
[0106] Example 4
[0107] Figure 4 This is a schematic diagram of a time synchronization error determination device according to Embodiment 4 of the present invention. Figure 4 As shown, the device includes:
[0108] The clock data generation module 41 is used to accumulate the value of the counter according to the preset interrupt period. If the current value of the counter corresponds to a whole second, the current clock data is generated according to the current value of the counter and the preset clock data.
[0109] The symbol information output module 42 is used to output the symbol information corresponding to the current clock data in B code format, and transmit the level signal corresponding to the symbol information to the module under test.
[0110] The timing error determination module 43 is used to receive the second pulse signal fed back by the module under test in response to the level signal according to a preset interrupt cycle, and determine the timing error result corresponding to the module under test based on the second pulse signal and the current value of the counter.
[0111] The technical solution in this embodiment, through the cooperation of the clock data generation module, the code element information output module, and the time synchronization error determination module, solves the problem of high cost of time synchronization testing caused by using an additional time synchronization device to send B code information. It can quickly and accurately determine the time synchronization error of the module under test, reduce the cost of time synchronization testing, and improve the efficiency of time synchronization testing.
[0112] Optionally, the time synchronization error determination module 43 includes:
[0113] The rising edge detection unit is used to obtain the level value corresponding to the second pulse signal and determine whether the second pulse signal is at the rising edge based on the level value.
[0114] The time synchronization error determination unit is used to determine the time synchronization error result of the module under test based on the current value of the counter when the second pulse signal is at the rising edge.
[0115] The second pulse signal receiving unit is used to return to the operation of receiving the second pulse signal fed back by the module under test in response to the level signal according to the preset interrupt period when the second pulse signal is not at the rising edge, until the second pulse signal fed back by the module under test is at the rising edge.
[0116] The historical value acquisition unit is used to acquire the historical value corresponding to the counter; wherein, the historical value is the cumulative value corresponding to the counter when the pulse signal of the previous second was at the rising edge;
[0117] The second pulse timing determination unit is used to determine whether the current value of the counter corresponds to a valid second pulse timing based on the current value and historical values of the counter; if so, the timing error result corresponding to the module under test is determined based on the valid second pulse timing.
[0118] The difference determination unit is used to determine the difference between the current value and the historical value of the counter;
[0119] The difference range judgment unit is used to determine whether the difference is within a preset value range;
[0120] The valid second pulse determination unit is used to determine the time corresponding to the current value of the counter as the valid second pulse time when the difference is within a preset value range.
[0121] The reference value determination unit is used to determine a reference value based on the numerical relationship between a preset whole second value and a preset interruption period;
[0122] The remainder unit is used to obtain the current value of the counter corresponding to the effective second pulse moment, perform a remainder operation between the current value of the counter and the reference value, and use the remainder result as the time calibration error result of the module under test.
[0123] The signal receiving unit is used to receive the second pulse signal fed back from the second pulse output interface of the module under test according to a preset interrupt cycle through the second pulse receiving module.
[0124] Optionally, the symbol information output module 42 includes:
[0125] The symbol information output unit is used to output the symbol information corresponding to the current clock data in the B code format through the B code generation module, and transmit the level signal corresponding to the symbol information to the module under test through the time synchronization interface.
[0126] The time synchronization error determination device provided in the embodiments of the present invention can execute the time synchronization error determination method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.
[0127] Example 5
[0128] Figure 5 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0129] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0130] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0131] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the time synchronization error determination method.
[0132] In some embodiments, the time synchronization error determination method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the time synchronization error determination method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the time synchronization error determination method by any other suitable means (e.g., by means of firmware).
[0133] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0134] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0135] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0136] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0137] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0138] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0139] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0140] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for determining time synchronization error, characterized in that, Applied to a chip, the method includes: The counter value is accumulated according to a preset interrupt cycle. If the current value of the counter corresponds to a whole second, the current clock data is generated based on the current value of the counter and the preset clock data. Output the symbol information corresponding to the current clock data in B code format, and transmit the level signal corresponding to the symbol information to the module under test. According to a preset interrupt cycle, the second pulse signal fed back by the module under test in response to the level signal is received, and the timing error result corresponding to the module under test is determined based on the second pulse signal and the current value of the counter. The determination of the timing error result corresponding to the module under test based on the second pulse signal and the current value of the counter includes: Obtain the level value corresponding to the second pulse signal, and determine whether the second pulse signal is at the rising edge based on the level value; If so, the timing error result corresponding to the module under test is determined based on the current value of the counter; If not, return to the operation of receiving the second pulse signal fed back by the module under test in response to the level signal according to the preset interrupt period, until the second pulse signal fed back by the module under test is at the rising edge. The determination of the timing error result corresponding to the module under test based on the current value of the counter includes: Obtain the historical value corresponding to the counter; The historical value is the cumulative value corresponding to the counter when the pulse signal of the previous second was at the rising edge; Based on the current value and historical values of the counter, determine whether the current value of the counter corresponds to a valid second pulse moment; If so, the timing error result corresponding to the module under test is determined based on the effective second pulse time.
2. The method according to claim 1, characterized in that, Based on the current value and historical values of the counter, determine whether the current value of the counter corresponds to a valid second pulse moment, including: Determine the difference between the current value and the historical value of the counter; Determine whether the difference is within a preset numerical range; If so, then the current value of the counter corresponds to the valid second pulse time.
3. The method according to claim 1, characterized in that, Based on the effective second pulse time, the timing error result corresponding to the module under test is determined, including: The reference value is determined based on the numerical relationship between the preset whole second value and the preset interruption period; Obtain the current value of the counter corresponding to the effective second pulse moment, take the remainder between the current value of the counter and the reference value, and use the remainder result as the time calibration error result corresponding to the module under test.
4. The method according to claim 1, characterized in that, The chip includes a B-code generation module and a second pulse receiving module; the module under test includes a time synchronization interface and a second pulse output interface. The step of outputting the symbol information corresponding to the current clock data according to the B code format and transmitting the level signal corresponding to the symbol information to the module under test includes: The B code generation module outputs the code element information corresponding to the current clock data according to the B code format, and transmits the level signal corresponding to the code element information to the module under test through the time synchronization interface. The step of receiving the second pulse signal fed back by the module under test in response to the level signal according to the preset interrupt period includes: The second pulse receiving module receives the second pulse signal fed back from the second pulse output interface of the module under test according to a preset interrupt cycle.
5. A time synchronization error determination device, characterized in that, Applied to a chip, the device includes: The clock data generation module is used to accumulate the value of the counter according to a preset interrupt cycle. If the current value of the counter corresponds to an integer second, the current clock data is generated based on the current value of the counter and the preset clock data. The symbol information output module is used to output the symbol information corresponding to the current clock data in B code format, and transmit the level signal corresponding to the symbol information to the module under test. The time synchronization error determination module is used to receive the second pulse signal fed back by the module under test in response to the level signal according to a preset interrupt cycle, and determine the time synchronization error result corresponding to the module under test based on the second pulse signal and the current value of the counter. The time synchronization error determination module includes: A rising edge determination unit is used to obtain the level value corresponding to the second pulse signal and determine whether the second pulse signal is at a rising edge based on the level value. The time calibration error determination unit is used to determine the time calibration error result corresponding to the module under test based on the current value of the counter if the condition is met. The second pulse signal receiving unit is used to return to the operation of receiving the second pulse signal fed back by the module under test in response to the level signal according to the preset interrupt period if no, until the second pulse signal fed back by the module under test is at the rising edge. Specifically, the time synchronization error determination unit is used to obtain the historical value corresponding to the counter; wherein the historical value is the cumulative value corresponding to the counter when the previous second pulse signal is at the rising edge; based on the current value of the counter and the historical value, it determines whether the time corresponding to the current value of the counter is a valid second pulse time; if so, it determines the time synchronization error result corresponding to the module under test based on the valid second pulse time.
6. A chip, characterized in that, The chip includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the time synchronization error determination method according to any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the time synchronization error determination method according to any one of claims 1-4.
8. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the time synchronization error determination method according to any one of claims 1-4.
Citation Information
Patent Citations
Compass-based method for generating Germany long-wave near Frankfurt 77.5 KHz (DCF77) time code
CN102243475A
IRIG-B direct current code decoding and time synchronization automatic switching method based on FPGA
CN113791533A
