CN103414545B - Overtime determination methods between heterogeneous system and system - Google Patents

Overtime determination methods between heterogeneous system and system Download PDF

Info

Publication number
CN103414545B
CN103414545B CN201310330239.0A CN201310330239A CN103414545B CN 103414545 B CN103414545 B CN 103414545B CN 201310330239 A CN201310330239 A CN 201310330239A CN 103414545 B CN103414545 B CN 103414545B
Authority
CN
China
Prior art keywords
timestamp
timeout
clock controlled
overflow
controlled system
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.)
Active
Application number
CN201310330239.0A
Other languages
Chinese (zh)
Other versions
CN103414545A (en
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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201310330239.0A priority Critical patent/CN103414545B/en
Publication of CN103414545A publication Critical patent/CN103414545A/en
Application granted granted Critical
Publication of CN103414545B publication Critical patent/CN103414545B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides the overtime determination methods between a kind of heterogeneous system and system, method therein includes: the time-out time for clock controlled system stabs and system timestamp is respectively provided with an overflow status position, wherein, time-out time stamp is that the system timestamp of clock controlled system adds timeout interval, and time-out time stamp is identical with the length of system timestamp;The result of unrolling stabbed according to system timestamp and time-out time, the overflow status position stabbing system timestamp and time-out time carries out set;Difference between the logical relation between overflow status position and the overflow status position of system timestamp according to time-out time stamp, and time-out time stamp and system timestamp, it may be judged whether time-out.By the present invention, during carrying out time-out judgement, it is possible to simplify the attended operation of overflow status position, and do not limited by timestamp length so that it is there is under various application scenarios higher more flexible efficient condition adaptability.

Description

Timeout judgment method and system between heterogeneous systems
Technical Field
The present invention relates to the field of clock system application technology in heterogeneous systems, and more particularly, to a timeout determination method and system between heterogeneous systems.
Background
With the rapid development of the internet and the continuous deepening of the informatization degree of the whole society, the heterogeneous system receives more and more attention and application by virtue of various characteristics of resource integration, advantage complementation and the like. In heterogeneous systems, the complementary cooperation of advantages requires an efficient synchronization mechanism to ensure that clock synchronization is a very critical issue.
Clock synchronization between different systems usually adopts Unix time stamps as a universal synchronization solution, and also solves the problem of software and hardware synchronization clock in heterogeneous systems by adopting the Unix time stamps.
The Unix timestamp is a representation of time, defined as the total number of seconds from Greenwich time 1970, 01, 00 hours, 00 minutes, 00 seconds, to date. Unix timestamps are used not only in Unix systems, Unix-like systems, but are also widely adopted in many other operating systems.
Most operating systems are now 32-bit, that is, the time stamp is represented by a signed binary number of length 32 bits. Due to the limitation of data bit width, the data bit width can only represent 14 minutes and 07 seconds to 1 month, 19 months and 3 days of the world time at most, and is represented by binary: 01111111111111111111111111111111, (0x7FFF: FFFF), the next second, the binary digit is 10000000000000000000000000000000, (0x8000:0000), which is a negative number, so each system would misinterpret the time as 1901, 12, 13, 20, 45 minutes, 52 seconds, known as timestamp wrap-around overflow due to a change in the sign bit. To solve the wrap-around overflow problem, the occurrence of wrap-around overflow can be delayed by increasing the data bit width. The current solution is to convert the system from 32 bits to 64 bits, which can represent up to 292, 277, 026, 596, 12 months, 4 days, 15 hours, 30 minutes and 08 seconds.
In heterogeneous systems, and in particular in hardware systems, subject to resource constraints, the data bit width of the timestamp is typically shorter, and thus the probability of causing wrap-around overflow is greater. For example, when the data bit width of the timestamp is 26 bits, the wrap-around overflow occurs theoretically for 776 days. In general, in a hardware system, in order to save resources, the data structure of the hardware system cannot solve the wrap-around overflow phenomenon by simply increasing the length of the timestamp, so when wrap-around occurs, if the system or application logic does not consider the situation, besides the incorrect conversion in the time form, the data structure can also have a serious influence on all applications or service logic related to the timestamp, such as a ticket service of a charging system or a plurality of state update logics in network equipment.
In practical application, a clock master control system with a long system time stamp is usually used as a time standard, and a controlled hardware system is synchronously updated at a fixed time interval, so as to achieve clock synchronization between heterogeneous systems.
In a controlled hardware system (i.e. an application system), it is often necessary to complete a timed trigger task, i.e. it is often necessary to trigger an event within a specified time period at a specified time point, and whether the event is triggered is determined by a timeout determination. The designated time point is referred to as an issuing time point, the designated time period is referred to as a timeout interval, and a time stamp for recording an event trigger time is referred to as a timeout time stamp (the timeout time stamp is the issuing time + the timeout interval). For example, a certificate expires after one hour from the time it is issued. For the application, whether the certificate is valid or not is determined by timeout judgment, that is, whether the current system timestamp minus the timeout timestamp is greater than zero or not, if the current system timestamp minus the timeout timestamp is greater than zero, the application is timed out, and if the current system timestamp minus the timeout timestamp, the application is not timed out. If the determination has timed out, a certificate failure event is triggered.
The above timeout determination is also affected by timestamp wrap-around overflow: for example, when the timeout timestamp has wrap-around overflow and the system time has no wrap-around overflow, the actual situation is not timeout, but the timeout timestamp has wrap-around overflow at this time, which is a negative number; and the current system time stamp is a positive number, and the system time stamp minus the timeout time stamp is greater than zero, so that the error judgment of the timeout can be made.
There are generally two solutions to deal with the above wrap-around overflow, the difference calculation method and the overflow status bit method.
The difference value calculation method is to solve the problem in a clock controlled system by depending on the numerical rule of a timestamp, and the difference value is defined as the system timestamp minus an overtime timestamp. When wrap-around overflow occurs for the timeout timestamp, the difference is 2^ N-1 at maximum. For example, if the timestamp is 32 bits, then the difference is 2^32-1 at maximum. Typically, the user-defined maximum timeout interval is small compared to the maximum difference, typically the timeout interval is 1 day or 1 month at the maximum, even though the maximum timeout interval, if the length of the timestamp is appropriate, the difference is much larger than the timeout interval when wrap-around overflow occurs. This rule provides a basis for judging wrap-around overflow by the value itself. 2^ (N-1) -1 can be generally defined as the basis for determining the wrapping difference, i.e. if the difference is greater than 2^ (N-1) -1, then wrapping is considered to occur; if the difference is less than 2^ (N-1) -1, then it is assumed that no wrap-around has occurred. The above determination is not strict and the difference determination criteria needs to be adjusted appropriately according to the time interval of the timeout detection and the frequency of the specific application update. Meanwhile, it should be noted that if the user-defined timeout interval is close to the difference determination criterion, the risk of erroneous determination may be increased.
The overflow status bit method is to use a flag bit in the timestamp of the clock controlled system (usually hardware) to identify the occurrence status of the timestamp wrap-around event. FIG. 1 illustrates a state diagram for identifying the occurrence of wrap-around overflow by using a flag bit in a prior art timeout determination. As shown in fig. 1, the clock-controlled system synchronizes the system time stamp of the clock-controlled system from the clock-master system, with the system time stamp of the clock-master system as a time standard. In the clock controlled system, if the system timestamp of the clock controlled system and the overtime interval are wrapped, the overflow state position is 1, and if wrapping does not occur, the overflow state position is 0. When the overflow state bit is not set, normally calculating the difference value between the overtime timestamp and the system timestamp, and judging whether the time is overtime or not according to the size of the overtime timestamp and the system timestamp; when the overflow state bit is set but the system timestamp is not wrapped, overtime cannot occur; when the overflow state bit is set and the system timestamp is wrapped back, normally calculating the difference value between the overtime timestamp and the system timestamp, and judging whether the system timestamp is overtime or not according to the size of the overtime timestamp and the system timestamp; when the system timestamp is subjected to wrap-around overflow again, the overflow status bits of all the timeout timestamps need to be synchronously set back to 0, and the subsequent judgment logic is the same as that of the previous system timestamp.
Both of the above solutions present problems. In the difference value calculation scheme, although the algorithm only depends on the timestamp value, no extra cost is provided, the timeout interval is required to be far smaller than the wrap-around difference value when wrap-around overflow occurs, and if the timestamp length is short, the size of the settable timeout interval is influenced. In the second scheme, the overflow status bits are costly to maintain, and especially when there are a large number of timeout timestamps to maintain, synchronizing the overflow status bits of all timeout timestamps back to 0 may cause a high load. Moreover, when the timeout timestamp changes at any time, if the timeout timestamp is driven by a message, the modification of the overflow status bit driven by the message and the concurrent logic between the modifications of the overflow status bit driven by the time need to be maintained, which easily causes the confusion of the overflow status bit.
Disclosure of Invention
In view of the foregoing problems, an object of the present invention is to provide a method and a system for determining timeout between heterogeneous systems, so as to simplify the maintenance operation of an overflow status bit, and enable the method and the system to have stronger, more flexible and efficient adaptability in various application scenarios.
According to an aspect of the present invention, a timeout determining method between heterogeneous systems is provided, including:
respectively setting an overflow state bit for a timeout timestamp of a clock controlled system and a system timestamp of the clock controlled system, wherein the timeout timestamp is the system timestamp of the clock controlled system plus a timeout interval, and the length of the timeout timestamp is the same as that of the system timestamp of the clock controlled system; the clock controlled system takes the system time stamp of the clock master control system as a time standard to synchronize the system time stamp of the clock controlled system from the clock master control system;
setting an overflow state bit of a system timestamp of a clock controlled system according to a rewinding result of the system timestamp of the clock controlled system and setting the overflow state bit of an overtime timestamp of the clock controlled system according to the rewinding result of the overtime timestamp of the clock controlled system;
and judging whether the system time stamp is overtime or not according to the logical relationship between the overflow state bit of the overtime time stamp and the overflow state bit of the system time stamp of the clock controlled system and the difference value between the overtime time stamp and the system time stamp of the clock controlled system, wherein the logical relationship is exclusive-or operation.
During the process of setting the overflow state position of the system timestamp of the clock controlled system, when the system timestamp of the clock controlled system is in wrap overflow, the overflow state position of the system timestamp of the clock controlled system is inverted; in the process of setting the overflow state position of the overtime timestamp, when the overtime timestamp generates wrap-around overflow, the overflow state position of the overtime timestamp is reversed.
Wherein the time-out interval is smaller than the maximum value that the time-out timestamp can represent.
In another aspect, the present invention further provides a timeout determining system between heterogeneous systems, including:
the system comprises an initial unit, a clock controlled system and a clock controlled system, wherein the initial unit is used for setting an overflow state bit for a timeout timestamp of the clock controlled system and a system timestamp of the clock controlled system respectively, the timeout timestamp is the system timestamp of the clock controlled system plus a timeout interval, and the length of the timeout timestamp is the same as that of the system timestamp of the clock controlled system; the clock controlled system takes the system time stamp of the clock master control system as a time standard to synchronize the system time stamp of the clock controlled system from the clock master control system;
the clock controlled system comprises a setting unit, a clock controlled system and a control unit, wherein the setting unit is used for setting an overflow state bit of a system timestamp of the clock controlled system according to a rewinding result of the system timestamp of the clock controlled system and setting the overflow state bit of an overtime timestamp of the clock controlled system according to the rewinding result of the overtime timestamp of the clock controlled system;
and the overtime judging unit is used for judging whether the overtime exists according to the logical relationship between the overflow state bit of the overtime timestamp and the overflow state bit of the system timestamp of the clock controlled system and the difference value between the overtime timestamp and the system timestamp of the clock controlled system.
By utilizing the method and the system for judging the timeout between the heterogeneous systems, the maintenance operation of the overflow status bit can be simplified in the process of judging the timeout, and the method and the system are not limited by the length of the timestamp, so that the method and the system have more flexible and efficient condition adaptability in various application scenes.
To the accomplishment of the foregoing and related ends, one or more aspects of the invention comprise the features hereinafter fully described and particularly pointed out in the claims. The following description and the annexed drawings set forth in detail certain illustrative aspects of the invention. These aspects are indicative, however, of but a few of the various ways in which the principles of the invention may be employed. Further, the present invention is intended to include all such aspects and their equivalents.
Drawings
Other objects and results of the present invention will become more apparent and more readily appreciated as the same becomes better understood by reference to the following description and appended claims, taken in conjunction with the accompanying drawings. In the drawings:
FIG. 1 is a state diagram illustrating the occurrence of wrap-around overflow in a conventional timeout determination by using a flag bit;
fig. 2 is a flowchart illustrating a timeout determination method between heterogeneous systems according to an embodiment of the present invention;
FIG. 3 is a diagram of session timeout determination logic according to an embodiment of the present invention;
fig. 4 is a system 400 for determining timeout between heterogeneous systems according to an embodiment of the present invention.
The same reference numbers in all figures indicate similar or corresponding features or functions.
Detailed Description
Specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Aiming at the problems that the overflow state bit is relatively high in maintenance cost and is easy to cause disorder of the overflow state bit when the conventional overtime judgment method between heterogeneous systems handles wrap-around overflow, the invention adds an overflow state bit on a system timestamp data structure of a clock controlled system, inverts the state position when the system timestamp wraps around, and judges whether the system timestamp is overtime or not according to the logical relationship between the overflow state bit of the overtime timestamp and the overflow state bit of the system timestamp and the difference value between the overtime timestamp and the system timestamp. According to the invention, in the overtime judgment process, the maintenance operation of the overflow status bit can be simplified, and the method is not limited by the length of the timestamp, so that the method has stronger, more flexible and efficient condition adaptability under various application scenes.
For describing the timeout determination method between heterogeneous systems in detail, fig. 2 is a schematic flowchart illustrating the timeout determination method between heterogeneous systems according to an embodiment of the present invention.
As shown in fig. 2, the timeout determining method between heterogeneous systems according to the present invention includes:
s210: and respectively setting an overflow state bit for the timeout timestamp of the clock controlled system and the system timestamp of the clock controlled system, wherein the timeout timestamp is the system timestamp of the clock controlled system plus a timeout interval, and the length of the timeout timestamp is the same as that of the system timestamp of the clock controlled system.
In one example of the invention, the first bit of the timeout timestamp of the clock controlled system and the system timestamp of the clock controlled system is set as the overflow status bit, and then the clock controlled system synchronizes the system timestamp of the clock controlled system from the clock master system with the system timestamp of the clock master system as a time standard.
In the present invention, since the heterogeneous system of two system timestamps is involved, the system timestamp of the clock master system is used as a time standard, and the clock slave system synchronizes the system timestamp of the clock slave system with the system timestamp of the clock master system. For example, the length of the system timestamp of the clock master system is M bits, and the length of the system timestamp of the clock slave system is N bits. Wherein, the system time stamp of the clock master control system is larger than the system time stamp of the clock controlled system (namely N < M). And when the clock is synchronized, the system timestamp of the clock master control system is taken as a time standard, and the clock controlled system synchronizes the system timestamp of the clock controlled system from the clock master control system. The system timestamp of the clock controlled system is limited by the length, so the system timestamp of the clock controlled system is synchronized to the last N bits of the system timestamp of the clock master system. The timeout judging method and the timeout judging system between heterogeneous systems are mainly realized in a clock controlled system.
S220: setting an overflow state bit of a system timestamp of a clock controlled system according to a rewinding result of the system timestamp of the clock controlled system, and setting the overflow state bit of an overtime timestamp of the clock controlled system according to the rewinding result of the overtime timestamp of the clock controlled system.
In the process of setting the overflow state position of the system timestamp of the clock controlled system, when the system timestamp is in wrap overflow, the overflow state position of the system timestamp of the clock controlled system is inverted; in the process of setting the overflow state bit of the overtime timestamp, when the overtime timestamp is wrapped and overflowed, the overflow state bit of the overtime timestamp is inverted, wherein the overtime timestamp is the system updating timestamp plus the overtime interval.
It should be noted that, a connection table is usually used to record the connection state of the data stream, and when a connection enters a certain state, a timestamp of a state update (i.e., a system update timestamp) is recorded in the connection table. The sum of the time stamp of the state update and the timeout interval of the state is usually recorded in the connection table as a timeout time stamp.
Specifically, as an example of the present invention, when the system is in an initial operating stage, an overflow status bit of a system timestamp of the clock controlled system and an overflow status bit of a timeout timestamp in the connection table are both 0, and when a wrap-around overflow occurs to the timeout timestamp in the connection table, an overflow status position of the timeout timestamp in the connection table is inverted, that is, set to 1; when the system timestamp of the clock controlled system is also in wrap-around overflow, setting the overflow state position of the system timestamp of the clock controlled system to be 1; and when the overtime timestamp in the connection table generates wrap-around overflow again, setting the overflow state position of the overtime timestamp in the connection table to be 0.
In addition, in the present invention, the timeout interval is smaller than the maximum value that the timeout timestamp can represent. For example, the length of the timeout timestamp is N bits, then the timeout interval should be less than 2^ (N-1) -1.
S230: and judging whether the time is overtime or not according to the logical relationship between the overflow state bit of the overtime timestamp and the overflow state bit of the system timestamp of the clock controlled system and the difference between the overtime timestamp and the system timestamp of the clock controlled system.
In step S230, each time the clock controlled system performs a polling interval, an timeout determination is performed on each timeout timestamp, and the polling interval is smaller than the timeout interval, and when performing the timeout determination on each timeout timestamp, an exclusive or operation is performed on an overflow status bit of the timeout timestamp and an overflow status bit of a system timestamp of the clock controlled system, and then whether the timeout occurs is determined according to a result of the exclusive or operation.
That is to say, in the process of determining whether the system time stamp is overtime, performing an exclusive or operation on an overflow status bit of the overtime time stamp and an overflow status bit of the system time stamp of the clock controlled system, when an exclusive or result of the overflow status bit of the overtime time stamp and the overflow status bit of the system time stamp of the clock controlled system is false, calculating a difference between the system time stamp of the clock controlled system and the overtime time stamp, if the difference is greater than zero, the system time stamp is overtime, and if the difference is less than zero, the system time stamp is not overtime.
In order to more clearly and specifically describe the timeout determining method provided by the present invention, the following takes the network session timeout management system as an example to describe the present invention in more detail.
In the session management of the firewall, timeout management is required, and the timeout management function can be completed on a specific session management board. Namely, the following functions are completed on the single board: if the session has no message exchange within the appointed time-out interval, the session is judged to be overtime, and the session overtime processing is triggered.
Obviously, on the session management board, it is necessary to establish a timeout timestamp for each session, and record the timeout time point of the session: the timeout timestamp is the last message exchange time + the timeout interval. Since a large number of sessions may be managed, in order to save system resources, the system timestamp and the timeout timestamp of the board are set to 19 bits, and the first bit is an overflow status bit.
The session management single board is used as a clock controlled system, and the system time stamp of the session management single board is synchronous with another clock master control single board with a 32-bit time stamp. And during synchronization, the system timestamp of the session management single board is set to be the last 19 bits of the system timestamp of the clock master control single board. After synchronization, the system timestamp of the session management board records the current time by increasing 1 per second. When the timestamp reaches 2^18-1, wrap-around overflow will occur in the next second, and the overflow status bit of the system timestamp of the session management single board is set to be inverted.
In the session management board, an overtime timestamp is maintained for each session, where the overtime timestamp is the last message exchange time + the overtime interval. When a wrap-around overflow occurs, its overflow status bit is inverted. For example, the time interval of the session timeout detection is set to 128 seconds, the session timeout time is set to 1024 seconds, and the session whose timeout is detected is deleted from the session table.
Obviously, the above configuration satisfies the following 3 preconditions:
precondition 1, the timeout interval is less than the maximum expressible value of the timestamp.
And 2, on the premise that the time interval for performing timeout detection on each session is smaller than the timeout time interval.
For sessions that have been detected as timed out, it is no longer detected, precondition 3.
At this time, the timeout judgment of the session is a comprehensive judgment of two overflow status bits and a difference value between the timeout timestamp and the system timestamp:
case 1: the overflow status bit of the system timestamp and the overflow status bit of the overtime timestamp are both 0 (if the system is in the initial operation stage), whether the system timestamp is overtime or not is determined by the difference value of the system timestamp and the overtime timestamp, if the difference value is greater than 0, the system timestamp is overtime, otherwise, the system timestamp is not overtime;
case 2: when the overtime timestamp generates wrap-around overflow and the system timestamp does not generate wrap-around overflow, the overflow status bit of the system is 0, the overflow status bit of the overtime timestamp is 1, and the overtime does not occur;
case 3: when the overtime timestamp and the system timestamp are subjected to wrap overflow at the same time, the overflow state bit of the system timestamp is 1, the overflow state bit of the overtime timestamp is also 1, whether the overtime exists or not is determined by the difference value between the system timestamp and the overtime timestamp, if the difference value is greater than 0, the overtime exists, otherwise, the overtime does not exist;
case 4: when the overtime timestamp is rewound again and the system timestamp is not rewound again, the overflow state bit of the overtime timestamp is set back to 0, the system overflow state bit is 1, and the overtime does not occur;
in summary, fig. 3 shows a logical relationship diagram of the session timeout determination according to the embodiment of the present invention. As shown in fig. 3, the session management board synchronizes the system timestamp from the clock master board by using the system timestamp of the clock master board as a time standard. In the session management board, the timeout determination depends on an xor result of two overflow status bits (that is, an overflow status bit of the timeout timestamp and an overflow status bit of the system timestamp in the session management table), the xor result may be implemented by an xor gate circuit, and a difference between the system timestamp and the timeout timestamp, where the difference may be implemented by an 18-bit subtractor, and each logical relationship is shown in table 1:
TABLE 1
For clarity of description of the decision process of table 1, the following will be illustrated by way of example:
example 1: the system timestamp of the session management single board when the last message exchange of the session a occurs is as follows: 129025 (binary 011111100000000001), its timeout timestamp is: 129025+1024 is 130049 (binary 011111110000000001) because no wrap-around overflow has occurred, at which time the timeout timestamp overflow status bit is still 0.
If the timeout detection is performed when the system timestamp is 130080 (binary 011111110000100000), at this time, the system timestamp does not generate wrap-around overflow, and the overflow status bit is also 0; the two status bits are xor' ed, the value is 0, and the difference between the system timestamp and the timeout timestamp needs to be calculated: 130080-.
Example 2: the system timestamp of the session management single board when the last message exchange of the session B occurs is as follows: 131009 (binary 011111111111000001), then its timeout timestamp is: 131009+1024 ═ 132033 (binary 100000001111000001), because a wrap-around overflow occurs, at which time the timeout timestamp overflow status bit is 1.
If the timeout detection is performed when the system timestamp is 130080 (binary 011111110000100000), at this time, the system timestamp does not generate wrap-around overflow, and the overflow status bit is 0; and performing exclusive or on the two state bits, wherein the value is 1, and the judgment of no timeout can be directly performed.
Example 3: the system timestamp of the session management board when the last message exchange of the session C occurs is: 131009 (binary 011111111111000001), then its timeout timestamp is: 131009+1024 ═ 132033 (binary 100000001111000001), because a wrap-around overflow occurs, at which time the timeout timestamp overflow status bit is 1.
If the timeout detection is performed when the system timestamp is 131000 (binary 11111111110111000), the system timestamp also has wrap-around overflow at this time, and the overflow status bit is also 1; the two status bits are xor' ed, the value is 0, and the difference between the system timestamp and the timeout timestamp needs to be calculated: 131000-.
Example 4: the system timestamp of the session management board when the last message exchange of the session D occurs is: 262081 (binary 111111111111000001), its timeout timestamp is: 262081+1024 is 961 (binary 000000001111000001) because wrap-around overflow occurs again, at which time the timeout timestamp overflow status bit is 0.
If the timeout detection is performed when the system timestamp is 131000 (binary 11111111110111000), the system timestamp also has wrap-around overflow at this time, and the overflow status bit is 1; and performing exclusive or on the two state bits, wherein the value is 1, and the judgment of no timeout can be directly performed.
Corresponding to the method, the invention also provides a timeout judging system between heterogeneous systems. Fig. 4 illustrates a timeout determination system 400 between heterogeneous systems according to an embodiment of the present invention.
As shown in fig. 4, the timeout determination system 400 between heterogeneous systems provided by the present invention includes an initial unit 410, a setting unit 420, and a timeout determination unit 430.
The initialization unit 410 is configured to set an overflow status bit for a timeout timestamp of the clock controlled system and a system timestamp of the clock controlled system, where the timeout timestamp is the system timestamp of the clock controlled system plus a timeout interval, and the lengths of the timeout timestamp and the system timestamp of the clock controlled system are the same; the clock controlled system takes the system time stamp of the clock master control system as a time standard to synchronize the system time stamp of the clock controlled system from the clock master control system; the setting unit 420 is configured to set an overflow status bit of a system timestamp of a clock controlled system according to a rewinding result of the system timestamp of the clock controlled system, and set an overflow status bit of an timeout timestamp of the clock controlled system according to a rewinding result of the timeout timestamp of the clock controlled system; the timeout determining unit 430 is configured to determine whether to timeout according to a logical relationship between an overflow status bit of the timeout timestamp and an overflow status bit of a system timestamp of the clock controlled system, and a difference between the timeout timestamp and the system timestamp of the clock controlled system, where the logical relationship is an exclusive-or operation.
In addition, the setting unit 420 may further include a first state position inversion unit and a second state position inversion unit (not shown in the figure), wherein, in the process of setting the overflow state position of the system timestamp of the clock controlled system, when the system timestamp of the clock controlled system has wrap-around overflow, the first state position inversion unit inverts the overflow state position of the system timestamp of the clock controlled system; in the process of setting the overflow state position of the timeout timestamp, when the timeout timestamp generates wrap-around overflow, the second state position reversing unit reverses the overflow state position of the timeout timestamp.
Also, the above-mentioned timeout interval is smaller than the maximum value that the timeout timestamp can represent.
In another embodiment of the present invention, the timeout determining unit further includes an exclusive or operation unit (not shown in the figure), and in the process of determining whether the timeout determining unit is timeout, the exclusive or operation unit performs an exclusive or operation on the overflow status bit of the timeout timestamp and the overflow status bit of the system timestamp of the clock controlled system; when the result of the exclusive or of the overflow status bit of the overtime timestamp and the overflow status bit of the system timestamp of the clock controlled system is false, calculating the difference between the system timestamp of the clock controlled system and the overtime timestamp, if the difference is greater than zero, the system timestamp of the clock controlled system is overtime, and if the difference is less than zero, the system timestamp of the clock controlled system is not overtime; and when the result of the exclusive or of the overflow status bit of the timeout timestamp and the overflow status bit of the system timestamp of the clock controlled system is true, not timeout occurs.
It can be seen from the above description of the embodiments that the method and system for judging timeout between heterogeneous systems provided by the present invention change the judgment of the overflow occurrence condition into a comprehensive judgment of two overflow status bits by extending the overflow status bit of the system timestamp of the clock controlled system, so that during the timeout judgment, the maintenance operation of the overflow status bit is simplified, and the method and system for judging timeout between heterogeneous systems have stronger, more flexible and efficient condition adaptability in various application scenarios.
In addition, it should be noted that the timeout determining method and system between heterogeneous systems provided by the present invention are not limited to be used in the scenarios described in the above embodiments, and can be used in scenarios where timeout determination is required, such as a user authentication system, a charging system, and a timed task management system.
The timeout judging method and system between heterogeneous systems according to the present invention are described above by way of example with reference to the accompanying drawings. However, it should be understood by those skilled in the art that various modifications may be made to the above-described timeout determination method and system between heterogeneous systems without departing from the scope of the present invention. Therefore, the scope of the present invention should be determined by the contents of the appended claims.

Claims (6)

1. A timeout judging method between heterogeneous systems comprises the following steps:
respectively setting an overflow state bit for a timeout timestamp of a clock controlled system and a system timestamp of the clock controlled system, wherein the timeout timestamp is the system timestamp of the clock controlled system plus a timeout interval, and the length of the timeout timestamp is the same as that of the system timestamp of the clock controlled system; the clock controlled system takes the system time stamp of the clock master control system as a time standard to synchronize the system time stamp of the clock controlled system from the clock master control system;
setting an overflow state bit of a system timestamp of the clock controlled system according to a rewinding result of the system timestamp of the clock controlled system and setting an overflow state bit of an overtime timestamp of the clock controlled system according to a rewinding result of the overtime timestamp of the clock controlled system, wherein when the overtime timestamp has a rewinding overflow, the overflow state bit of the overtime timestamp is inverted; when the system timestamp of the clock controlled system is in wrap-around overflow, the overflow state position of the system timestamp of the clock controlled system is reversed;
and judging whether the time is overtime or not according to the logical relationship between the overflow state bit of the overtime timestamp and the overflow state bit of the system timestamp of the clock controlled system and the difference value between the overtime timestamp and the system timestamp of the clock controlled system, wherein the logical relationship is exclusive-or operation.
2. The inter-heterogeneous-system timeout method according to claim 1, wherein the timeout period is smaller than a maximum value that the timeout timestamp can represent.
3. The inter-heterogeneous-system timeout judging method according to claim 1, wherein an overflow status bit of the timeout timestamp is exclusive-ORed with an overflow status bit of a system timestamp of the clock controlled system in judging whether timeout occurs,
when the result of the exclusive or of the overflow status bit of the timeout timestamp and the overflow status bit of the system timestamp of the clock controlled system is false, calculating the difference between the system timestamp of the clock controlled system and the timeout timestamp, if the difference is greater than zero, the system timestamp of the clock controlled system is overtime, and if the difference is less than zero, the system timestamp of the clock controlled system is not overtime;
and when the result of the exclusive or of the overflow status bit of the overtime timestamp and the overflow status bit of the system timestamp of the clock controlled system is true, not overtime.
4. A timeout determination system between heterogeneous systems, comprising:
the system comprises an initial unit, a clock controlled system and a clock controlled system, wherein the initial unit is used for setting an overflow state bit for a timeout timestamp of the clock controlled system and a system timestamp of the clock controlled system respectively, the timeout timestamp is the system timestamp of the clock controlled system plus a timeout interval, and the length of the timeout timestamp is the same as that of the system timestamp of the clock controlled system; the clock controlled system synchronizes the system time stamp of the clock controlled system from the clock master control system by taking the system time stamp of the clock master control system as a time standard;
a setting unit, configured to set an overflow status bit of a system timestamp of the clock controlled system according to a rewinding result of the system timestamp of the clock controlled system, and set an overflow status bit of a timeout timestamp of the clock controlled system according to a rewinding result of the timeout timestamp of the clock controlled system, where the setting unit includes: the first state position reversing unit is used for reversing the overflow state position of the system timestamp of the clock controlled system when the system timestamp of the clock controlled system is in wrap-around overflow in the process of setting the overflow state position of the system timestamp of the clock controlled system; a second state position reversing unit, configured to, in a process of setting an overflow state position of the timeout timestamp, reverse the overflow state position of the timeout timestamp when wrap-around overflow occurs in the timeout timestamp;
and the overtime judging unit is used for judging whether the system time stamp of the clock controlled system is overtime or not according to the logical relationship between the overflow state bit of the overtime time stamp and the overflow state bit of the system time stamp of the clock controlled system and the difference value between the overtime time stamp and the system time stamp of the clock controlled system, wherein the logical relationship is exclusive-or operation.
5. The inter-heterogeneous-system timeout system of claim 4, wherein the timeout interval is less than a maximum value that the timeout timestamp can represent.
6. The inter-heterogeneous-system timeout judging system according to claim 4, wherein the timeout judging unit comprises:
an exclusive-or operation unit, configured to perform an exclusive-or operation on an overflow status bit of the timeout timestamp and an overflow status bit of a system timestamp of the clock controlled system in a process of determining whether the timeout determination unit determines to be timeout; wherein,
when the result of the exclusive or of the overflow status bit of the timeout timestamp and the overflow status bit of the system timestamp of the clock controlled system is false, calculating the difference between the system timestamp of the clock controlled system and the timeout timestamp, if the difference is greater than zero, the system timestamp of the clock controlled system is overtime, and if the difference is less than zero, the system timestamp of the clock controlled system is not overtime;
and when the result of the exclusive or of the overflow status bit of the overtime timestamp and the overflow status bit of the system timestamp of the clock controlled system is true, not overtime.
CN201310330239.0A 2013-07-31 2013-07-31 Overtime determination methods between heterogeneous system and system Active CN103414545B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310330239.0A CN103414545B (en) 2013-07-31 2013-07-31 Overtime determination methods between heterogeneous system and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310330239.0A CN103414545B (en) 2013-07-31 2013-07-31 Overtime determination methods between heterogeneous system and system

Publications (2)

Publication Number Publication Date
CN103414545A CN103414545A (en) 2013-11-27
CN103414545B true CN103414545B (en) 2016-09-14

Family

ID=49607532

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310330239.0A Active CN103414545B (en) 2013-07-31 2013-07-31 Overtime determination methods between heterogeneous system and system

Country Status (1)

Country Link
CN (1) CN103414545B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273229B (en) * 2017-05-24 2020-06-26 百富计算机技术(深圳)有限公司 Method, device and computer readable storage medium for processing timer timing exception
CN109543988A (en) * 2018-11-16 2019-03-29 中国银行股份有限公司 The method, apparatus and storage medium of optimization transaction overtime threshold
CN110209685B (en) * 2019-06-12 2020-04-21 北京九章云极科技有限公司 Real-time data processing method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6081507A (en) * 1998-11-04 2000-06-27 Polytechnic University Methods and apparatus for handling time stamp aging
CN1719806A (en) * 2005-07-15 2006-01-11 中国人民解放军国防科学技术大学 Dynamic load allocating method for network processor based on cache and apparatus thereof
CN101420366A (en) * 2007-10-23 2009-04-29 中兴通讯股份有限公司 Device and method for guaranteeing quality of real-time service in wideband wireless access system
CN101755419A (en) * 2007-05-21 2010-06-23 思达伦特网络公司 Globally synchronized timestamp value counter
CN102170663A (en) * 2011-05-23 2011-08-31 迈普通信技术股份有限公司 3G (The Third Generation Telecommunication)-based method and equipment for guaranteeing service quality in real-time transmission service
CN102999395A (en) * 2011-09-09 2013-03-27 腾讯科技(北京)有限公司 Method and system for data reading and writing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6081507A (en) * 1998-11-04 2000-06-27 Polytechnic University Methods and apparatus for handling time stamp aging
CN1719806A (en) * 2005-07-15 2006-01-11 中国人民解放军国防科学技术大学 Dynamic load allocating method for network processor based on cache and apparatus thereof
CN101755419A (en) * 2007-05-21 2010-06-23 思达伦特网络公司 Globally synchronized timestamp value counter
CN101420366A (en) * 2007-10-23 2009-04-29 中兴通讯股份有限公司 Device and method for guaranteeing quality of real-time service in wideband wireless access system
CN102170663A (en) * 2011-05-23 2011-08-31 迈普通信技术股份有限公司 3G (The Third Generation Telecommunication)-based method and equipment for guaranteeing service quality in real-time transmission service
CN102999395A (en) * 2011-09-09 2013-03-27 腾讯科技(北京)有限公司 Method and system for data reading and writing

Also Published As

Publication number Publication date
CN103414545A (en) 2013-11-27

Similar Documents

Publication Publication Date Title
US9552382B2 (en) Reference counter integrity checking
US10078559B2 (en) System and method for input data fault recovery in a massively parallel real time computing system
CN110932815B (en) Time synchronization method, device, network equipment and storage medium
US10348279B2 (en) Skew control
CN103414545B (en) Overtime determination methods between heterogeneous system and system
US10564664B2 (en) Integrated skew control
Quinton et al. Typical worst case response-time analysis and its use in automotive network design
US10075520B2 (en) Distributed aggregation of real-time metrics for large scale distributed systems
CN111753012A (en) Data synchronization method, device, equipment and storage medium
CN114491656A (en) Method and apparatus in a blockchain network
CN113987073A (en) Method and device for updating state information in delayed mode and electronic equipment
CN112347143A (en) Multi-data stream processing method, device, terminal and storage medium
CN111078418B (en) Operation synchronization method, device, electronic equipment and computer readable storage medium
Yingchareonthawornchai et al. Efficient algorithms for predicate detection using hybrid logical clocks
WO2020172881A1 (en) Block generation method and apparatus, computer device and storage medium
JP2013009332A5 (en)
US20230280997A1 (en) Automated process and system update scheduling in a computer network
CN113765692B (en) Current limiting method, device, electronic equipment and computer readable medium
US11347689B2 (en) Method, device and computer program product for event ordering
CN112989773B (en) Method, apparatus, device and computer readable medium for synchronizing update data
CN113220554A (en) Method and apparatus for detecting performance of program code
CN112256700A (en) Data storage method and device, electronic equipment and computer readable storage medium
CN112988497A (en) Method, electronic device and computer program product for managing backup system
Ting A temporal order resolution algorithm in the multi-server time stamp service framework
US11792135B2 (en) Automated process scheduling in a computer network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant