Method, device and equipment for reducing service caching time delay and storage medium
By detecting the service reference waterline in real time and adjusting the local clock frequency, the delay problem caused by the service frequency offset in the ACR solution is solved, the cache delay and the server load are reduced, and the cost is saved.
Patent Information
- Application Number
- CN202410730722.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-03
AI Technical Summary
The existing technology introduces millisecond-level delay when the service frequency deviation is caused in the ACR solution, which cannot reflect the advantage of low service delay. How to reduce the delay when the ACR processes the service frequency deviation is an urgent technical problem that needs to be solved.
By calculating the reference waterline of the service and detecting in real time whether the corresponding event triggers the state machine setting waterline, the local clock frequency is adjusted to be consistent with the service clock frequency, and the frequency offset detection state machine truth table is used to perform corresponding actions, reduce or increase clock frequency to reduce cache latency.
It significantly reduces the latency of services in the cache, reduces the server workload and saves costs.
Smart Images

Figure CN118586185A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of simulation service processing, and in particular to a method, device, equipment and storage medium for reducing service cache delay. Background Art
[0002] In order to solve the problem of large and unpredictable Ethernet pipe jitter, the ACR solution based on simulation services introduces a large delay (millisecond level) in frequency deviation measurement. China Mobile has introduced a fine-grained pipe protocol based on the SPN network. The protocol has hard pipe characteristics, low latency, low jitter and predictable jitter. If the existing technology is still used to introduce millisecond-level delay to the service in the ACR function, the superiority of low latency of the service cannot be reflected.
[0003] Therefore, how to reduce the delay introduced when ACR processes service frequency deviation is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of the present invention is to provide a method, device, equipment and storage medium for reducing service cache delay, which can greatly reduce the cache demand and greatly reduce the delay of the service in the cache.
[0005] In a first aspect, the present application provides a method for reducing service cache delay, wherein the method comprises the steps of:
[0006] Calculate the reference watermark of the service, and detect in real time whether the reference watermark triggers a corresponding event of the state machine setting the watermark, wherein the watermark is the amount of cached data;
[0007] When the corresponding event is triggered so that the local clock frequency is inconsistent with the business clock frequency, the preset state machine truth table is searched through the corresponding event, and the corresponding state machine action is executed to adjust the local clock frequency to be consistent with the business clock frequency with a set step size.
[0008] In combination with the above first aspect, as an optional implementation method, when the local clock frequency is greater than the service clock frequency, the truth table of the defined frequency deviation detection state machine is searched by the corresponding event triggered, and the corresponding state machine action is executed to reduce the local clock frequency by a preset step size;
[0009] When the local clock frequency is less than the service clock frequency, the frequency deviation detection state machine truth table defined by the triggered corresponding event is searched for and a corresponding jump is performed to increase the local clock frequency by a preset step size;
[0010] The cached data is sent using the adjusted local clock frequency, and when the preset time is reached, if the reference watermark triggers the preset watermark again, the local clock frequency is adjusted in the aforementioned steps until the local clock frequency is consistent with the service clock frequency.
[0011] In combination with the first aspect above, as an optional implementation manner, the reference waterline is returned to an initial state before adjustment, so that the reference waterline repeatedly triggers an event corresponding to the set waterline.
[0012] In combination with the first aspect, as an optional implementation, based on the state of the defined frequency deviation detection state machine, setting a waterline, defining a minimum frequency deviation step size S, defining a maximum frequency deviation Smax, defining a center frequency F, defining a transmission frequency Fo, defining a stable timer, a state machine event, and a state machine action, a truth table of the frequency deviation detection state machine is established;
[0013] By looking up the frequency deviation detection state machine truth table, determining the action to be performed to trigger the corresponding event, so as to perform a corresponding jump;
[0014] The states of the state machine include: S1: unlock_max, S2: unlock_min, S3: unlock_high, S4: unlock_low, S5: unlock, S6: lock_high, S7: lock_low and S8: lock;
[0015] The waterline setting includes: lev_min, lev_low, lev_mid, lev_high and lev_max, wherein lev_min<lev_low<lev_mid<lev_high<lev_max;
[0016] The state machine events include: E1: L>lev_max, E2: lev_high<L<lev_max, E3: lev_mid<L<lev_high, E4: lev_low<L<lev_mid, E5: lev_min<L<lev_low, E6: L<lev_min and E7: stable timer timeout, where L is the reference waterline;
[0017] The state machine actions include: A1: no operation, keep the current state, A2: jump to S3, Fo=F+S, F=F, A3: jump to S5, Fo=F, F=F, A4: jump to S4, Fo=FS, F=F, A5: jump to S2, Fo=F-Smax, F=FS, A6: jump to S1, Fo=F+Smax, F=F+S, A7: jump to S8, Fo=F, F=F, A8: jump to S7, Fo=FS, F=F and A9: jump to S6, Fo=F+S, F=F.
[0018] In combination with the first aspect above, as an optional implementation, the minimum frequency deviation step S=±1ppm; the maximum frequency deviation is Smax=±50ppm; and the center frequency F=2048kHz.
[0019] In combination with the first aspect above, as an optional implementation method, the amount of real-time data in the memory FIFO is used as the real-time waterline;
[0020] Using the de-jitter algorithm, the average value of the real-time waterline within the preset time is calculated as the reference waterline;
[0021] When it is detected in real time that the reference waterline is greater than or less than the state machine setting waterline, a state machine event corresponding to the trigger frequency setting waterline is determined.
[0022] In combination with the first aspect, as an optional implementation, detecting whether the data of the service is an invalid service, wherein the invalid service is a service data that is in a fixed frame state or no service data is received within a preset time;
[0023] When it is determined to be an invalid service, the current frequency of the local clock is used as a reference, and the service data is compensated once after a preset clock cycle to reduce the additional jitter of the service.
[0024] In a second aspect, the present application provides a device for reducing service cache delay, the device comprising:
[0025] A detection module, which is used to calculate a reference waterline of a service and detect in real time whether the reference waterline triggers a corresponding event of a state machine setting a waterline, wherein the waterline is the amount of cached data;
[0026] An execution module is used to search the preset state machine truth table through the corresponding event and execute the corresponding state machine action when the corresponding event is triggered so that the local clock frequency is inconsistent with the business clock frequency, so as to adjust the local clock frequency to be consistent with the business clock frequency with a set step size.
[0027] In a third aspect, the present application further provides an electronic device, comprising: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method described in any one of the first aspects is implemented.
[0028] In a fourth aspect, the present application further provides a computer-readable storage medium storing computer program instructions, which, when executed by a computer, enables the computer to execute any of the methods described in the first aspect.
[0029] The present application provides a method, device, equipment and storage medium for reducing service cache latency, wherein the method includes: calculating a reference waterline of the service, and detecting in real time whether the reference waterline triggers a corresponding event of the state machine setting the waterline, wherein the waterline is the amount of cached data; when the corresponding event is triggered so that the local clock frequency is inconsistent with the service clock frequency, the preset state machine truth table is searched through the corresponding event, and the corresponding state machine action is executed to adjust the local clock frequency to be consistent with the service clock frequency with a set step size. The present application can greatly reduce the latency of the service in the cache, while reducing the server workload and saving costs.
[0030] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0032] Figure 1 A flow chart of a method for reducing service cache delay provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of a device for reducing service cache delay provided in an embodiment of the present application;
[0034] Figure 3 An architecture diagram for reducing service cache latency provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of state machine definition events provided in an embodiment of the present application;
[0036] Figure 5 A truth table of a state machine provided in an embodiment of the present application;
[0037] Figure 6 A schematic diagram of the operation of the state machine provided in the embodiment of the present application;
[0038] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application;
[0039] Figure 8 A schematic diagram of a computer-readable program medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0041] Furthermore, the drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. Some of the blocks shown in the drawings are functional entities and do not necessarily correspond to physically or logically separate entities.
[0042] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.
[0043] Reference Figure 1 , Figure 1 FIG. 1 is a flow chart of a method for reducing service cache delay provided by the present invention. Figure 1 As shown, the method comprises the steps of:
[0044] Step S101: Calculate the reference watermark of the business, and detect in real time whether the reference watermark triggers the corresponding event of the state machine setting the watermark, wherein the watermark is the amount of cached data.
[0045] Specifically, the real-time data volume in the memory FIFO is used as the real-time waterline, and a de-jitter algorithm is used to calculate the average value of the real-time waterline within a preset time as a reference waterline. When the real-time detection of the reference waterline is greater than or less than the waterline set by the state machine, the state machine event corresponding to the set waterline is determined to be triggered, where the waterline can be understood as the amount of data cached in the cache.
[0046] It should be noted that, for example, the waterlines are set to lev_min, lev_low, lev_mid, lev_high, and lev_max. The size relationship between the waterlines is: lev_min<lev_low<lev_mid<lev_high<lev_max. By calculating the reference waterline, it is determined whether it is greater than lev_max or less than lev_min. Each set waterline corresponds to a corresponding event, which can be referred to Figure 4 When the reference waterline is greater than or less than the set waterline, the corresponding event set by the state machine is triggered.
[0047] In one embodiment, the de-jitter algorithm of the ACR frequency deviation detection state machine for the real-time waterline is to calculate the average value of the real-time waterline within 100us before the current time point as the reference waterline L, and the reference waterline L is used to detect whether to trigger the setting waterline.
[0048] It should be explained that ACR refers to the adaptive clock recovery function, which is to recover the clock frequency used to send out the data stream from the received data stream.
[0049] Step S102: When the corresponding event is triggered so that the local clock frequency is inconsistent with the business clock frequency, the preset state machine truth table is searched through the corresponding event, and the corresponding state machine action is executed to adjust the local clock frequency to be consistent with the business clock frequency with a set step size.
[0050] Specifically, when the local clock frequency is greater than the service clock frequency, the truth table of the defined frequency deviation detection state machine is searched through the corresponding event triggered, and the corresponding state machine action is executed to reduce the local clock frequency by a preset step size;
[0051] The cached data is sent using the reduced local clock frequency, and when the preset time is reached, if the reference waterline triggers the preset waterline again, the local clock frequency continues to be reduced by a preset step size until the local clock frequency is adjusted to be consistent with the business clock frequency.
[0052] When the local clock frequency is less than the service clock frequency, the frequency deviation detection state machine truth table defined by the triggered corresponding event is searched for and a corresponding jump is performed to increase the local clock frequency by a preset step size;
[0053] The cached data is sent using the increased local clock frequency, and when the preset time is reached and the reference waterline triggers the preset waterline again, the local clock frequency continues to be increased by a preset step size until the local clock frequency is adjusted to be consistent with the business clock frequency.
[0054] It is understandable that when the reference waterline triggers the setting of the waterline corresponding event, it means that the local clock frequency is inconsistent with the business clock frequency. At this time, the preset state machine truth table is searched through the corresponding event (see Figure 5 ), execute the corresponding state machine action, and then adjust the local clock frequency to be consistent with the business clock frequency with a set step size to reduce cache delay.
[0055] For ease of understanding, an example is given. Five watermarks are set in sequence based on the data cache depth: lev_min, lev_low, lev_mid, lev_high, and lev_max. In the initial state, the cache uses the local clock to read out data and continuously detects the watermark (i.e., the local clock refers to the clock output by the device crystal oscillator. For example, when carrying E1 services, the local clock is used by default to read out data at a rate of 2048k. At this time, the watermark value of the service cache (the amount of remaining data in the cache) can be obtained in each clock cycle). If the watermark is greater than lev_max, it is considered that the local clock frequency is lower than the data clock (the local clock refers to the clock output by the device crystal oscillator. The service clock refers to the clock used by the instrument to send the service data stream. Because different devices use different crystal oscillators, there will definitely be a frequency deviation between the two frequencies.), then the local clock frequency is adjusted upward by one step (i.e., the clock frequency to be sent is increased by 1ppm). Then the cached data is sent at the highest frequency to reduce the watermark to below lev_mid, and then the cached data is sent using the adjusted local clock. If the waterline triggers lev_min or lev_max again after a period of time, the above operation is repeated until the waterline can be stabilized at lev_mid for a long time. At this time, it is considered that the local clock has been adjusted to be consistent with the data clock. It should be noted that the role of sending cached data at the highest frequency so that the waterline is lowered below lev_mid is to force the waterline back to the initial state, so that the lev_min and lev_max waterlines can be repeatedly triggered, and the sending clock frequency is adjusted according to the set step size multiple times, so that the sending clock frequency is adjusted to be consistent with the business clock frequency.
[0056] In one embodiment, before using the adjusted local clock frequency to send cached data, the reference waterline is returned to the initial state before adjustment so that the reference waterline repeatedly triggers the event corresponding to the waterline setting. It can be understood that since each frequency adjustment is performed in steps, there will be an error less than the step between the final sending clock frequency and the business clock frequency. Lev_low, lev_mid, and lev_high are used to maintain the waterline. When the waterline is lower than lev_low or higher than lev_high, a step will be reduced or increased based on the sending clock frequency to pull the waterline back to lev_mid. Otherwise, if the sending clock frequency is not processed for a long time, this error will cause the waterline to drift in one direction.
[0057] In one embodiment, based on the state of the defined frequency deviation detection state machine, a waterline is set, a minimum frequency deviation step S is defined, a maximum frequency deviation Smax is defined, a center frequency F is defined, a transmission frequency Fo is defined, a stabilization timer is defined, state machine events, and state machine actions are defined to establish a frequency deviation detection state machine truth table; by checking the frequency deviation detection state machine truth table, the action to be executed to trigger the corresponding event is determined to perform a corresponding jump.
[0058] Specifically, 2. define 8 state machine states: S1: unlock_max, S2: unlock_min, S3: unlock_high, S4: unlock_low, S5: unlock, S6: lock_high, S7: lock_low and S8: lock.
[0059] Define the minimum frequency deviation step S; define the maximum frequency deviation Smax; define the center frequency F; define the sending frequency Fo; define a stable timer, start timing when the state machine is in S6 or S7, trigger the "stable timer timeout" event after the timer exceeds the predetermined time, and the timer returns to zero in other state machine states, wherein the minimum frequency deviation step S = ±1ppm; the maximum frequency deviation is Smax = ±50ppm; the center frequency F = 2048kHz.
[0060] Define 5 waterlines: lev_min, lev_low, lev_mid, lev_high, and lev_max. The size relationship between the waterlines is: lev_min<lev_low<lev_mid<lev_high<lev_max.
[0061] Seven state machine events are defined: E1: L>lev_max, E2: lev_high<L<lev_max, E3: lev_mid<L<lev_high, E4: lev_low<L<lev_mid, E5: lev_min<L<lev_low, E6: L<lev_min and E7: stable timer timeout, where L is the reference waterline.
[0062] Define 9 state machine actions: A1: no operation, keep the current state, A2: jump to S3, Fo=F+S, F=F, A3: jump to S5, Fo=F, F=F, A4: jump to S4, Fo=FS, F=F, A5: jump to S2, Fo=F-Smax, F=FS, A6: jump to S1, Fo=F+Smax, F=F+S, A7: jump to S8, Fo=F, F=F, A8: jump to S7, Fo=FS, F=F and A9: jump to S6, Fo=F+S, F=F.
[0063] It is understandable that the triggering events and triggering actions of the above state machine and the definition of the state machine state are based on Figure 5 The truth table of the running state machine can infer the working behavior of the entire ACR state machine (see Figure 6 Implementation example).
[0064] In one embodiment, the data of a service is detected to see if it is an invalid service, wherein the invalid service is a service whose data is in a fixed frame state or no service data is received within a preset time. When it is determined to be an invalid service, the current frequency of the local clock is used as a reference, and the service data is compensated once after a preset clock cycle to reduce additional jitter of the service.
[0065] Reference Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a device for reducing service cache delay provided by the present invention, such as Figure 2 As shown, the device comprises:
[0066] Detection module 201: It is used to calculate the reference watermark of the business and detect in real time whether the reference watermark triggers the corresponding event of the state machine setting the watermark, wherein the watermark is the amount of cached data.
[0067] Execution module 202: When a corresponding event is triggered and the local clock frequency is inconsistent with the business clock frequency, it searches the preset state machine truth table through the corresponding event and executes the corresponding state machine action to adjust the local clock frequency to be consistent with the business clock frequency with a set step size.
[0068] Further, in a possible implementation, the execution module is also used to, when the local clock frequency is greater than the service clock frequency, search the truth table of the defined frequency deviation detection state machine through the triggered corresponding event, and execute the corresponding state machine action to reduce the local clock frequency by a preset step size;
[0069] When the local clock frequency is less than the service clock frequency, the frequency deviation detection state machine truth table defined by the triggered corresponding event is searched for and a corresponding jump is performed to increase the local clock frequency by a preset step size;
[0070] The cached data is sent using the adjusted local clock frequency, and when the preset time is reached, if the reference watermark triggers the preset watermark again, the local clock frequency is adjusted in the aforementioned steps until the local clock frequency is consistent with the service clock frequency.
[0071] Furthermore, in a possible implementation manner, the execution module is also used to return the reference waterline to an initial state before adjustment, so that the reference waterline repeatedly triggers an event corresponding to the set waterline.
[0072] Further, in a possible implementation manner, the execution module is further used to establish a frequency deviation detection state machine truth table based on the state of the defined frequency deviation detection state machine, set a waterline, define a minimum frequency deviation step size S, define a maximum frequency deviation Smax, define a center frequency F, define a transmission frequency Fo, define a stable timer, a state machine event, and a state machine action;
[0073] By looking up the frequency deviation detection state machine truth table, determining the action to be performed to trigger the corresponding event, so as to perform a corresponding jump;
[0074] The states of the state machine include: S1: unlock_max, S2: unlock_min, S3: unlock_high, S4: unlock_low, S5: unlock, S6: lock_high, S7: lock_low and S8: lock;
[0075] The waterline setting includes: lev_min, lev_low, lev_mid, lev_high and lev_max, wherein lev_min<lev_low<lev_mid<lev_high<lev_max;
[0076] The state machine events include: E1: L>lev_max, E2: lev_high<L<lev_max, E3: lev_mid<L<lev_high, E4: lev_low<L<lev_mid, E5: lev_min<L<lev_low, E6: L<lev_min and E7: stable timer timeout, where L is the reference waterline;
[0077] The state machine actions include: A1: no operation, keep the current state, A2: jump to S3, Fo=F+S, F=F, A3: jump to S5, Fo=F, F=F, A4: jump to S4, Fo=FS, F=F, A5: jump to S2, Fo=F-Smax, F=FS, A6: jump to S1, Fo=F+Smax, F=F+S, A7: jump to S8, Fo=F, F=F, A8: jump to S7, Fo=FS, F=F and A9: jump to S6, Fo=F+S, F=F.
[0078] Furthermore, a possible implementation manner further includes a setting module, which is used to set the minimum frequency deviation step S = ±1ppm; the maximum frequency deviation is Smax = ±50ppm; and the center frequency F = 2048kHz.
[0079] Further, in a possible implementation manner, the detection module is further configured to use the amount of real-time data in the memory FIFO as a real-time waterline;
[0080] Using the de-jitter algorithm, the average value of the real-time waterline within the preset time is calculated as the reference waterline;
[0081] When it is detected in real time that the reference waterline is greater than or less than the state machine setting waterline, a state machine event corresponding to the trigger frequency setting waterline is determined.
[0082] Further, in a possible implementation manner, the detection module is further used to detect whether the service data is an invalid service, wherein the invalid service is a service data that is in a fixed frame state or no service data is received within a preset time;
[0083] When it is determined to be an invalid service, the current frequency of the local clock is used as a reference, and the service data is compensated once after a preset clock cycle to reduce the additional jitter of the service.
[0084] Reference Figure 3 , Figure 3 FIG. 1 is a diagram showing an architecture for reducing service cache delay provided by the present invention, such as Figure 3 As shown:
[0085] It consists of an alarm detection & data compensation module, a sending queue module, an ACR frequency deviation detection state machine and a clock generation module. The alarm detection & data compensation module detects the validity of the incoming service (i.e., the service entering from the network side, which is generally sent in the form of network packets and is bursty) (determines the framing status of the service data or determines it as an invalid service when no service data is received for a period of time). If the service is invalid, the clock frequency output by the current clock generation module is used as the benchmark, and the data is compensated after the preset clock cycle to reduce the additional jitter caused by service damage. The sending queue module provides data cache and provides a real-time waterline to the ACR frequency deviation detection state machine. The sending queue module uses the clock provided by the clock generation module as the output clock of the data. The clock generation module can generate a clock with arbitrary frequency deviation based on the local system clock. The ACR frequency deviation detection state machine provides a real-time waterline for detecting the sending queue module to calculate the frequency deviation of the data and provide it to the clock generation module.
[0086] It can be understood that the alarm detection module is used to preprocess the data, the cache waterline of the sending queue and the ACR state machine are used to calculate the service frequency deviation, and finally the clock generation module is used to match the sending clock to the service frequency deviation so that the input service rate matches the rate of sending data.
[0087] In one embodiment, the alarm detection & data compensation module triggers data compensation through the external input E1_ais alarm or E1_los alarm, the compensation data is 0xff, and the compensation period is based on the current output clock 2.048mHz, and the data is compensated once every 8 clock cycles. The clock generation module generates an output clock Fo with a frequency deviation by using a 64-times 131.072mHz system clock and calculating more or less one clock cycle when generating a 2.048mHz clock in a window. The sending queue module is implemented using fifo, and the real-time data volume in fifo is used as the real-time waterline. The data bit width of fifo is 8bit.
[0088] Reference Figure 4 , Figure 4 The state machine defined events provided by the present invention are shown as follows: Figure 4 As shown:
[0089] When the reference waterline is higher than the set waterline, the E1 event is triggered, that is, L>lev_max. In the following, taking E1 as an example, the corresponding events are triggered. E2: lev_high<L<lev_max; E3: lev_mid<L<lev_high; E4: lev_low<L<lev_mid; E5: lev_min<L<lev_low; E6: L<lev_min.
[0090] Set the watermarks of the ACR frequency deviation detection state machine to lev_min=0xc, lev_low=0x10, lev_mid=0x14, lev_high=0x18, and lev_max=0x1c.
[0091] Reference Figure 5 , Figure 5 The state machine truth table provided by the present invention is shown as follows: Figure 5 As shown, all events, actions and states are included. It can be understood that by looking up the frequency deviation detection state machine truth table, the action to be executed to trigger the corresponding event is determined to perform the corresponding jump.
[0092] Reference Figure 6 , Figure 6 FIG. 1 is a schematic diagram of the operation of the state machine provided by the present invention. Figure 6 As shown:
[0093] For easy understanding, an example is given. For example, the business clock frequency is 5ppm higher than the local clock frequency. In the initial state S8, the cache takes out data according to the frequency of the local clock. Since the business clock frequency is high, the calculated L will slowly increase. When it is higher than lev_high (Lup), event E2 is triggered. Figure 3After the table is displayed, A9 needs to be executed, that is, jump to S6, the transmission frequency increases by 1ppm but the center frequency remains unchanged. At this time, the transmission frequency is 1ppm but the center frequency is 0ppm. Since there is still a 4ppm gap between the transmission frequency and the business clock frequency, L will continue to increase slowly until it exceeds lev_max, triggering event E1. Figure 5 After the table is read, A6 needs to be executed, that is, jump to S1 and the transmission frequency becomes 50ppm, and the center frequency plus 1ppm becomes 1ppm. Since the transmission frequency is much greater than the business frequency, L will drop rapidly, triggering events E2 and E3 in turn. Since A1 (no operation) is executed when E2 is triggered according to the table lookup, only A2 is executed when E3 is triggered, that is, jump to S3 and the transmission frequency is 1ppm+1ppm, and the center frequency is 1ppm. At this time, the waterline returns to the initial state (that is, the waterline is pulled back to lev_mid. Otherwise, if the transmission clock frequency is not processed for a long time, this error will cause the waterline to drift in one direction), and the center frequency is corrected. Repeat the above operation many times until the transmission frequency is 4ppm+1ppm and the center frequency is 4ppm. Since the transmission frequency is the same as the business frequency, L will remain unchanged. After this state is maintained for a period of time, the timer overflows and E7 is triggered. The table lookup should execute A7, that is, jump to S8, the transmission frequency becomes the center frequency 4ppm, the ACR clock is locked, and the waterline maintenance mode is entered. In the S8 state, since the center frequency is 4ppm less than 5ppm, L will slowly rise and trigger E2. The table lookup needs to execute A9, that is, jump to S6 and the sending frequency becomes 4ppm+1ppm. After that, the waterline is stable (the waterline will stabilize near lev_mid. According to the waterline depth and the E1 service rate, it can be calculated that the cache delay at this time is about 78.125us, and the delay is calculated as: waterline depth*8 / 2048kHz). It should be noted that the output frequency refers to the frequency used by the device to send data, and the center frequency refers to the frequency point calculated by acr to fit the service frequency. There will be a relatively small error between the center frequency and the service frequency, so based on the center frequency, according to the real-time status of the waterline height, a step size will be increased or decreased in real time as the output frequency to ensure that the waterline is stable and will not drift excessively.
[0094] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present invention will be described. Figure 7 The electronic device 700 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0095] like Figure 7As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).
[0096] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present invention described in the above “Embodiment Method” section of this specification.
[0097] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 721 and / or a cache memory unit 722 , and may further include a read-only memory unit (ROM) 723 .
[0098] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0099] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0100] The electronic device 700 may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or may communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0101] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0102] According to the solution of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present invention described in the above "Exemplary Method" section of the present specification.
[0103] refer to Figure 8 As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0104] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0105] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0106] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0107] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0108] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0109] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
[0110] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
Claims
1. A method for reducing service cache delay, characterized in that: include: Calculate the reference watermark of the business and detect in real time whether the reference watermark triggers the corresponding event of the state machine setting the watermark, where the watermark is the amount of cached data; When the corresponding event is triggered so that the local clock frequency is inconsistent with the business clock frequency, the preset state machine truth table is searched through the corresponding event, and the corresponding state machine action is executed to adjust the local clock frequency to be consistent with the business clock frequency with a set step size.
2. The method according to claim 1, characterized in that When a corresponding event is triggered so that the local clock frequency is inconsistent with the service clock frequency, searching a preset state machine truth table through the corresponding event and executing a corresponding state machine action to adjust the local clock frequency to be consistent with the service clock frequency with a set step size, including: When the local clock frequency is greater than the service clock frequency, searching a truth table of a defined frequency deviation detection state machine through a corresponding event triggered, and executing a corresponding state machine action to reduce the local clock frequency by a preset step size; When the local clock frequency is less than the service clock frequency, searching the frequency deviation detection state machine truth table defined by the triggered corresponding event to perform a corresponding jump and increase the local clock frequency by a preset step size; The cached data is sent using the adjusted local clock frequency, and when the preset time is reached, if the reference waterline triggers the preset waterline again, the local clock frequency is adjusted in the above steps until the local clock frequency is consistent with the business clock frequency.
3. The method according to claim 2, characterized in that Before sending the buffered data using the adjusted local clock frequency, the method includes: The reference waterline is returned to its initial state before adjustment, so that the reference waterline repeatedly triggers the event corresponding to the set waterline.
4. The method according to claim 2, characterized in that include: Based on the defined state of the frequency deviation detection state machine, setting the waterline, defining the minimum frequency deviation step size S, defining the maximum frequency deviation Smax, defining the center frequency F, defining the transmission frequency Fo, defining the stabilization timer, state machine events and state machine actions, a truth table of the frequency deviation detection state machine is established; By looking up the frequency deviation detection state machine truth table, determining the action to be executed when triggering the corresponding event, so as to perform a corresponding jump; The states of the state machine include: S1: unlock_max, S2: unlock_min, S3: unlock_high, S4: unlock_low, S5: unlock, S6: lock_high, S7: lock_low and S8: lock; The waterline setting includes: lev_min, lev_low, lev_mid, lev_high and lev_max, wherein lev_min<lev_low<lev_mid<lev_high<lev_max; The state machine events include: E1: L>lev_max, E2: lev_high<L<lev_max, E3: lev_mid<L<lev_high, E4: lev_low<L<lev_mid, E5: lev_min<L<lev_low, E6: L<lev_min and E7: stability timer timeout, where L is the reference waterline; The state machine actions include: A1: no operation, maintain current state, A2: jump to S3, Fo=F+S, F=F, A3: jump to S5, Fo=F, F=F, A4: jump to S4, Fo=FS, F=F, A5: jump to S2, Fo=F-Smax, F=FS, A6: jump to S1, Fo=F+Smax, F=F+S, A7: jump to S8, Fo=F, F=F, A8: jump to S7, Fo=FS, F=F and A9: jump to S6, Fo=F+S, F=F.
5. The method according to claim 4, characterized in that include: The minimum frequency deviation step size S=±1ppm; the maximum frequency deviation is Smax=±50ppm; and the center frequency F=2048kHz.
6. The method according to claim 1, wherein The reference waterline of the computing service and detecting in real time whether the reference waterline triggers a corresponding event of the state machine setting the waterline include: The real-time data volume in the memory FIFO is used as the real-time waterline; Using the de-jitter algorithm, the average value of the real-time waterline within the preset time is calculated as the reference waterline; When it is detected in real time that the reference waterline is greater than or less than the state machine setting waterline, a state machine event corresponding to the trigger frequency setting waterline is determined.
7. The method according to claim 1, characterized in that Also includes: Detecting whether the service data is an invalid service, wherein the invalid service is a service data that is in a fixed frame state or no service data is received within a preset time; When it is determined to be an invalid service, the current frequency of the local clock is used as a reference and the service data is compensated once after a preset clock cycle to reduce additional jitter of the service.
8. A device for reducing service cache delay, characterized in that: include: A detection module, which is used to calculate a reference watermark for the service and detect in real time whether the reference watermark triggers a corresponding event for setting a watermark in the state machine, wherein the watermark is the amount of cached data; An execution module is used to search the preset state machine truth table through the corresponding event when the corresponding event is triggered so that the local clock frequency is inconsistent with the business clock frequency, and execute the corresponding state machine action to adjust the local clock frequency to be consistent with the business clock frequency with a set step size.
9. An electronic device, characterized in that: The electronic device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that The computer program instructions are stored therein, and when the computer program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 7.
