DATA PROCESSING METHOD AND APPARATUS
20230030135 · 2023-02-02
Inventors
Cpc classification
H04L7/048
ELECTRICITY
H04J3/0641
ELECTRICITY
H04L43/106
ELECTRICITY
International classification
Abstract
Embodiments of this application disclose a data processing method, which can be applied to a clock synchronization network system. The system can correct, based on a clock frequency error or a time error, a data timestamp of a data packet collected by the system in a time period in which there is no reference clock, so that a corrected system time of the data packet is consistent with a reference time. This improves accuracy of data record.
Claims
1. A method of data processing, comprising: adjusting a data timestamp T.sub.i of an i.sup.th data packet based on error information, wherein the error information is a clock frequency error or a time error, the clock frequency error is a difference between a system clock frequency and a reference clock frequency, and the time error is a difference between a system time and a reference time; wherein the i.sup.th data packet is any-a data packet collected by a system in a time period in which there is no reference clock, i is a positive integer, and T.sub.i is a system time corresponding to a collection moment of the i.sup.th data packet.
2. The method according to claim 1, wherein the error information is a clock frequency error Δƒ, and Δƒ=ƒ.sub.sys −ƒ.sub.r is a fixed value, wherein ƒ.sub.sys is a system clock frequency corresponding to a moment at which the reference clock is detected again, and ƒ.sub.r is a reference clock frequency.
3. The method according to claim 2, wherein an adjusted data timestamp of the i.sup.th data packet is T.sub.i′ and T.sub.i′satisfies the following:
T.sub.i′=T.sub.i−(Δƒ/ƒ.sub.sys)×T.sub.s×i, wherein T.sub.s is a sampling cycle.
4. The method according to claim 1, wherein the error information is a time error T or a time error t, the time error T is a difference between a reference time corresponding to a first moment and a system time corresponding to the first moment, and t satisfies the following:
t=T/K, wherein the first moment is a moment at which the reference clock is detected again after the i.sup.lt data packet is collected, and K is a quantity of data packets collected in the time period in which there is no reference clock.
5. The method according to claim 4, wherein an adjusted data timestamp of the i.sup.th data packet is T.sub.i′ and T.sub.i′ satisfies the following:
T.sub.i′=T.sub.i −T/K×i, or T.sub.i′=T.sub.i −t×i.
6. The method according to claim 1, wherein the error information is a clock frequency error Δƒ.sub.j and when a j.sup.th data packet is collected, the clock frequency error Δƒ.sub.jsatisfies the following:
Δƒ.sub.j=T.sub.s ×S×j, wherein T.sub.s is a sampling cycle, S is an increase rate of the clock frequency error, S is a real number, and j satisfies 0≤j≤i.
7. The method according to claim 6, wherein an adjusted data timestamp of the i.sup.th data packet is T.sub.i′ and T.sub.i′ satisfies the following:
8. The method according to claim 1, wherein the error information is a clock frequency error Δƒ.sub.j of the any-data packet; and Δƒ.sub.j is determined based on a correspondence between a locally stored clock frequency error of the data packet collected by the system in the time period in which there is no reference clock and a sampling condition.
9. The method according to claim 8, wherein an adjusted data timestamp of the i.sup.th data packet is T.sub.i′ and T.sub.i ′ satisfies the following:
10. A data processing apparatus, comprising: at least one processor; and a memory coupled to the at least one processor and storing program codes, which when executed by the at least one processor, cause the data processing apparatus to perform operations, the operations comprising: adjusting a data timestamp T.sub.i of an i.sup.th data packet based on error information, wherein the error information is a clock frequency error or a time error, the clock frequency error is a difference between a system clock frequency and a reference clock frequency, and the time error is a difference between a system time and a reference time; wherein the i.sup.th data packet is a data packet collected by a system in a time period in which there is no reference clock, i is a positive integer, and T.sub.i is a system time corresponding to a collection moment of the i.sup.th data packet.
11. The data processing apparatus according to claim 10, wherein the error information is a clock frequency error Δƒ, and Δƒ=ƒ.sub.sys −ƒ, is a fixed value, wherein ƒ.sub.sys is a system clock frequency corresponding to a moment at which the reference clock is detected again, and ƒ.sub.r is a reference clock frequency.
12. The data processing apparatus according to claim 11, wherein an adjusted data timestamp of the i.sup.th data packet is T.sub.i′, and T.sub.i′ satisfies the following:
T.sub.i′=T.sub.i−(Δƒ/ƒ.sub.sys)×T.sub.s×i, wherein T.sub.s is a sampling cycle.
13. The data processing apparatus according to claim 10, wherein the error information is a time error T or a time error t, the time error T is a difference between a reference time corresponding to a first moment and a system time corresponding to the first moment, and t satisfies the following:
t=T/K, wherein the first moment is a moment at which the reference clock is detected again after the i.sup.lh data packet is collected, and K is a quantity of data packets collected in the time period in which there is no reference clock.
14. The data processing apparatus according to claim 13, wherein an adjusted data timestamp of the i.sup.th data packet is T.sub.i′, and T.sub.i′ satisfies the following:
T.sub.i′=T−T/K×i, or T.sub.i′=T−t×i.
15. The data processing apparatus according to claim 10, wherein the error information is a clock frequency error Δƒ.sub.j, and when a j.sup.th data packet is collected, the clock frequency error Δƒ.sub.j satisfies the following:
Δƒ.sub.j =T.sub.s ×S×j, wherein T.sub.s is a sampling cycle, S is an increase rate of the clock frequency error, S is a real number, and j satisfies 0≤j≤i.
16. The data processing apparatus according to claim 15, wherein an adjusted data timestamp of the i.sup.th data packet is T.sub.i′, and T.sub.i′ satisfies the following:
17. The data processing apparatus according to claim 10, wherein the error information is a clock frequency error Δƒ.sub.j of the data packet; and Δƒ.sub.j is determined based on a correspondence between a locally stored clock frequency error of the data packet collected by the system in the time period in which there is no reference clock and a sampling condition.
18. The data processing apparatus according to claim 17, wherein an adjusted data timestamp of the i.sup.th data packet is T.sub.i′ and T.sub.i′ satisfies the following:
19. A non-transitory computer-readable storage medium, comprising a program or instructions, which when run on a computer, cause the computer to perform operations, the operations comprising: adjusting a data timestamp T.sub.i of an i.sup.th data packet based on error information, wherein the error information is a clock frequency error or a time error, the clock frequency error is a difference between a system clock frequency and a reference clock frequency, and the time error is a difference between a system time and a reference time; wherein the i.sup.th data packet is a data packet collected by a system in a time period in which there is no reference clock, i is a positive integer, and T.sub.i is a system time corresponding to a collection moment of the i.sup.th data packet.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0051] To describe the technical solutions in the embodiments of the present invention more clearly, the following briefly describes the accompanying drawings for describing the embodiments. It is clear that the accompanying drawings in the following description show merely some embodiments of the present invention, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
DESCRIPTION OF EMBODIMENTS
[0063] The following describes the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application.
[0064] For a clock synchronization network (for example, an intra-vehicle network or a 5G network), a runtime and a frequency of the entire system can be calibrated by using an external reference clock signal. For example, the clock synchronization network can calibrate a runtime and a frequency of a network system by receiving a global positioning system (GPS) signal or a BeiDou navigation satellite system (BDS) signal.
[0065] The network element in the clock synchronization network system may include but is not limited to a sensor, a playback device, a switch, a controller, a computing center, a storage center, and the like.
[0066] The sensor has an information collection capability, and may convert collected information into a signal and transmit the signal to a corresponding network device. Types of sensors may include but are not limited to a millimeter-wave radar, a laser radar, an ultrasonic radar, a camera, an inertial sensor, a speed sensor, an acceleration sensor, a humidity sensor, a light intensity sensor, and the like. The playback device is configured to prompt information, and may include but is not limited to a display, a speaker, a power amplification device, and the like. The switch may perform a routing switching function, and is configured to aggregate and relay various data services, such as an audio and video service, a synchronization message, and a control message. The switch may be a switch or a router. The controller, the computing center, and the storage center may all be configured to perform computing and control of a function, and may be independent or integrated with a gateway. In an embodiment, the controller, the computing center, and the storage center may be a vehicle-mounted computing platform or a vehicle-mounted computer, a domain controller, or a multi-domain controller, for example, an autonomous driving controller or an infotainment controller, or may be a data center that stores important data, for example, a black box or an event data recorder in a vehicle.
[0067] It should be noted that the foregoing network elements are logical concepts. In an actual network system, a form of a network element may be a physical device, a box, a board, or a function implemented by a chip or an area on a board. Alternatively, in the actual network system, a plurality of network elements may be integrated into one device. For example, the switch and the controller may be disposed on one circuit board. This is not limited in this embodiment.
[0068] In an example, when the clock synchronization network system receives an external reference clock signal (for example, a GPS signal), the primary clock and the secondary clock may maintain time and frequency synchronization with the received external reference clock signal. In this case, one or more network elements in the clock synchronization network system all maintain time and frequency synchronization with the external reference clock signal, as shown in
[0069] It can be learned that, in a clock synchronization system running process, if no reference clock signal is input, an error occurs between a system clock and a reference clock. Consequently, a data timestamp of a work log or another data collected by the system in a time period in which there is no reference clock is inaccurate. For example, data recorded in the time period in which there is no reference clock includes a system work log, but there is a specific error between a data timestamp of the system work log and the reference time. Data in the system work log may be used for accident assessment and system debugging. Therefore, the system work log in the time period in which there is no reference clock cannot record a real status of the system.
[0070] To correct a data timestamp of data collected by a system in a time period in which there is no reference clock, an embodiment of this application provides a data processing method. In the method, a data timestamp of any data packet collected by the system in the time period in which there is no reference clock can be corrected based on a clock frequency error or a time error, so that a corrected system time of the data packet is consistent with a reference time. This improves accuracy of data record.
[0071] The following performs description with reference to a specific embodiment.
[0072] An embodiment of this application provides a data processing method. Refer to
[0073] S301: Adjust a data timestamp T.sub.i of an i.sup.th data packet based on error information.
[0074] In a running process of the clock synchronization network system, if no reference clock signal is input, it indicates that the clock synchronization network system is in a time period in which there is no reference clock. For example, when the clock synchronization network system is a vehicle-mounted communications system, if a vehicle enters an area without a GPS, for example, a tunnel or an underground parking lot, the system cannot receive a GPS signal, and therefore, is in the time period in which there is no reference clock.
[0075] In the time period in which there is no reference clock, because the system lacks an external reference clock signal input, a system time may produce an error. For example, the system time gradually slows down. The system time is time of a primary clock (and/or a secondary clock) of the clock synchronization network system in the time period in which there is no reference clock. For example, the system time is time of a primary clock, a secondary clock, and a plurality of network elements of the system shown in
[0076] When receiving the reference clock signal again, the clock synchronization network system may obtain a reference time. The reference time is time of the reference clock signal. For example, the reference time may be real time (for example, time of a GPS signal), or may be an assumed time. This is not limited in this embodiment.
[0077] If the reference time is inconsistent with the system time, the system may determine that an error exists between the system time and the reference time, and the system may obtain the error information. In an embodiment, the error information is obtained by the system when the clock synchronization network system detects the reference clock signal again after the time period in which there is no reference clock ends (for example, the vehicle drives out of the tunnel). For example, the error information is generated through detection calculation. In an embodiment, when the system detects the reference clock signal again, the system may determine the error information based on a generated system work log and the received reference clock signal.
[0078] The error information may be a clock frequency error or a time error. The clock frequency error is a difference between a system clock frequency and a reference clock frequency. For example, a clock frequency error of the system is a frequency difference between the system clock frequency and a clock frequency of a GPS signal. The time error is a difference between the system time and the reference time. For example, when the system receives the GPS signal again, the system determines that the time error is a time difference between the system time and a GPS time. After the clock synchronization network system determines the error information, the system may adjust the data timestamp T of the i.sup.th data packet based on the error information.
[0079] The i.sup.th data packet is any data packet collected by the system in the time period in which there is no reference clock, and i is a positive integer. The data timestamp T of the i.sup.th data packet is a system time at which the i.sup.th data packet is collected and that is recorded by the clock synchronization network system in the time period in which there is no reference signal. The clock synchronization network system collects data according to a specific sampling cycle, that is, the system records one data packet when passing each sampling cycle. For ease of description, in this embodiment, it is assumed that an end time of each sampling cycle is a data timestamp of each data packet, that is, the data timestamp of the i.sup.th data packet is an end time of an i.sup.th sampling cycle. Alternatively, it can be assumed that a start time of each sampling cycle is a data timestamp of each data packet. This is not limited in this embodiment.
[0080] For example, if the error information includes a time error of the i.sup.th data packet, the clock synchronization network system may obtain an adjusted data timestamp of the i.sup.th data packet by subtracting, based on the time error of the i.sup.th data packet, the time error of the i.sup.th data packet from the data timestamp of the i.sup.th data packet. It should be noted that the time error may be a positive number or a negative number. If the time error is a positive number, the system time in the time period in which there is no reference clock is later than the reference time. Alternatively, if the time error is a negative number, the system time in the time period in which there is no reference clock is earlier than the reference time. This is not limited in this embodiment.
[0081] For another example, if the error information includes a clock frequency error of the i.sup.thdata packet, the clock synchronization network system may determine a time error of the i.sup.th data packet based on the clock frequency error of the i.sup.th data packet and a sampling cycle. Then, the time error of the i.sup.th data packet is subtracted from the data timestamp of the i.sup.th data packet based on the time error of the i.sup.th data packet, to obtain an adjusted data timestamp of the i.sup.th data packet. It may be understood that the adjusted data timestamp of the i.sup.th data packet represents real time at which the system collects the i.sup.th data packet when there is a reference clock signal. Therefore, after the data timestamp of the i.sup.th data packet is adjusted, the i.sup.th data packet can reflect a real status of the system. This improves accuracy of data record.
[0082] This embodiment of this application provides the data processing method. The clock synchronization network system may correct, based on the clock frequency error or the time error, the data timestamp of the any data packet collected by the system in the time period in which there is no reference clock. A corrected system time of the any data packet is consistent with the reference time. This can improve accuracy of data record.
[0083] The following describes the operation of adjusting the data timestamp of the i.sup.th data packet based on the time error or the clock frequency error in detail.
[0084]
[0085] In the embodiments of this application, T.sub.s may be understood as a parameter, for example, T.sub.s=10 S, and it is associated with a quantity N of clock cycles that a clock passes at a specific frequency in one T.sub.s. That is, in a reference system of a system clock or a reference system of a reference clock, the clock passes N cycles in one T.sub.s. In addition, in the reference system of the system clock or the reference system of the reference clock, after the clock passes N cycles, it is considered that the clock passes T.sub.s =10 S, and data is collected again. That is, in the embodiments of this application, a value of T.sub.s is unassociated with a system clock or a reference clock that is in use.
[0086] When the system detects the reference clock signal again, the system may record two time periods: a system time T that the system passes in the time period in which there is no reference clock, and a reference time T.sub.i, that the system passes in the time period in which there is the reference clock. The system time that the system passes in the time period in which there is no reference clock starts from a system time corresponding to a moment at which a reference signal is lost, and ends at a system time recorded in a data timestamp of a K.sup.th data packet, as shown in
[0087] It may be understood that, the system time that the system passes in the time period in which there is no reference clock may end at a system time corresponding to the moment at which the reference clock is detected again, or the system time that the system passes in the time period in which there is no reference clock may end at a system time at a moment between the system time recorded in the data timestamp of the K.sup.th data packet and the system time corresponding to the moment at which the reference clock is detected again. This is not limited in this embodiment.
[0088] Because the system time does not generate a deviation at a moment at which the system just losses the reference clock signal, in this embodiment, it is determined that the system time corresponding to the moment at which the reference signal is lost is consistent with the reference time corresponding to the moment at which the reference signal is lost. It should be noted that, when the system detects the reference clock signal again, the system does not configure the data packet identifier without the reference signal for the collected data packet. In this case, the system may determine, based on the data packet identifier of each data packet, a quantity of data packets collected by the system in the time period in which there is no reference clock. For example, the system collects K data packets in total in the time period in which there is no reference clock, shown in
[0089] In an example, when there is the reference clock signal, a system time at which the system collects a data packet is consistent with the reference time, and the system collects data according to a fixed sampling cycle. When the system enters the time period in which there is no reference clock, because the clock synchronization network system has no reference clock, and it is assumed that the system clock is free-run, a specific error occurs between a system clock frequency and a reference clock frequency, and a clock frequency error between the system clock frequency and the reference clock frequency is a fixed value. In addition, the system can still maintain a fixed sampling cycle to collect data.
[0090] Therefore, a time error between a data timestamp of a data packet in each sampling cycle and the reference time may be continuously accumulated according to a rule of an arithmetic progression. In this case, the error information obtained by the system may be a clock frequency error Δƒ, a time error T, or a time error t. The following describes in detail three different types of error information in a system clock free-run scenario.
[0091] In an embodiment, the error information is a clock frequency error Δƒ, and the clock frequency error Δƒ=ƒ.sub.sys−ƒ.sub.r, where ƒ.sub.sys is a system clock frequency corresponding to a moment at which the reference clock is detected again, and ƒ.sub.r is a reference clock frequency. In the time period in which there is no reference clock, the system has only a system clock frequency for reference. When the system detects the reference clock again, the system can obtain a reference clock frequency. In this case, when the system detects the reference clock again, the system can record a system clock frequency corresponding to a moment at which the reference clock is detected again and the reference clock frequency corresponding to the moment at which the reference clock is detected again. It may be understood that the clock frequency error is a fixed value.
[0092] It should be noted that when the clock frequency error is a fixed value, the fixed value may be any positive or negative real number. In this embodiment, it is assumed that in a system clock free-run scenario, a clock frequency of the system fluctuates to a peak value within a short time period, that is, the clock frequency error of the system changes from 0 to the foregoing fixed value within a short time period. Therefore, in the system clock free-run scenario, a clock frequency error of any data packet collected by the system in the time period in which there is no reference clock is Δƒ.
[0093] Because there is the clock frequency error, a time error between the system time and the reference time is accumulated each time the system passes one sampling cycle T after a moment at which a reference signal is lost, and an accumulated time amount is related to the clock frequency error Δƒ.
[0094] For example, the clock frequency error A ƒ and a time error of any data packet collected in the time period in which there is no reference clock are shown in
[0095] In an embodiment, if the system determines that the error information is the clock frequency error Δƒ, the system adjusts a data timestamp of the i.sup.th data packet based on the clock frequency error Δƒ. It is assumed that an adjusted data timestamp of the i.sup.th data packet is T.sub.i′, and T.sub.i′ satisfies the following condition:
T.sub.i′=T.sub.i−(Δƒ/ƒ.sub.sys)×T.sub.s×i, where T.sub.s is a sampling cycle.
[0096] For example, assuming that a system clock frequency is ƒ.sub.sys =2 Hz, and a reference clock frequency is ƒ.sub.r=4[k, the system may determine that a clock frequency error is Δƒ=ƒ.sub.sys −ƒ.sub.r=2−4=−2 Hz. It is assumed that a quantity of data packets collected in the time period in which there is no reference clock is K=10, and a sampling cycle is T.sub.s=0.5S. The system may further obtain that a system time T.sub.i, corresponding to a collection moment of a fourth data packet is 11:00:00. In this case, for the fourth data packet, the system may determine that a time error of the data packet is Δƒ/ƒ.sub.sys×T.sub.s×i=−2Hz/2Hz×0.5s×4=−2s. In this case, an adjusted data timestamp T.sub.i′of the fourth data packet is 11:00:02.
[0097] It may be understood that the adjusted data timestamp T.sub.i′may represent a reference time corresponding to a collection moment of the i.sup.th data packet. For example, the adjusted data timestamp T.sub.i′of the fourth data packet is 11:00:02, that is, it indicates that a reference time corresponding to the collection moment of the fourth data packet is 11:00:02. It should be noted that the foregoing example is merely an example. The sampling cycle may be a second-level sampling cycle, or may be a millisecond-level or microsecond-level sampling cycle. This is not limited in this embodiment.
[0098] Alternatively, the error information is the time error T or the time error t. The time error T is a difference between a reference time corresponding to a first moment and a system time corresponding to the first moment, and the time error t satisfies the following condition:
t=T/K, where
the first moment is a moment at which the reference clock is detected again after the i.sup.th data packet is collected, and K is a quantity of data packets collected in the time period in which there is no reference clock.
[0099] For example, the time error T is shown in
[0100] For another example, the time error satisfies t=T/K, as shown in
[0101] Optionally, if the system determines that the error information is the time error T, the system may adjust the data timestamp of the i.sup.th data packet based on the time error T. It is assumed that an adjusted data timestamp of the i.sup.th data packet is , and T.sub.i′satisfies the following condition:
T=T.sub.i−T/K×i.
[0102] For example, assuming the time error is T=−5s, a quantity of data packets collected in the time period in which there is no reference clock is K=10. The system may obtain that a system time T.sub.i corresponding to a collection moment of a fourth data packet is 11:00:00. In this case, a time error corresponding to the fourth data packet is T/K ×i=−5 s/10×4=−2s. The system determines, according to T.sub.i′=T.sub.i −T/K ×i, that an adjusted data timestamp T.sub.i′ of the fourth data packet is 11:00:02. It may be understood that the adjusted data timestamp T.sub.i′ may represent a reference time corresponding to a collection moment of the i.sup.th data packet. For example, the adjusted data timestamp T.sub.i′ of the fourth data packet is 11:00:02, that is, it indicates that a reference time corresponding to the collection moment of the fourth data packet is 11:00:02.
[0103] In an embodiment, if the system determines that the error information is the time error t, the system adjusts the data timestamp of the i.sup.th data packet based on the time error t. It is assumed that an adjusted data timestamp of the i.sup.th data packet is T.sub.i′, and T.sub.i′ satisfies the following condition:
T.sub.i′=T.sub.i −t×i.
[0104] For example, assuming the time error is T=−5s, a quantity of data packets collected in the time period in which there is no reference clock is K=10. In this case, t=−0.5s may be determined based on the time error T and the quantity K of the data packets collected in the time period in which there is no reference clock, that is, a time error between a data timestamp of a data packet in each sampling cycle and the reference time is continuously accumulated according to a rule of an arithmetic progression whose tolerance is −0.5. The system may obtain that the system time T.sub.i corresponding to the collection moment of the fourth data packet is 11:00:00. In this case, an adjusted data timestamp T.sub.i′ of the fourth data packet is 11:00:02.
[0105] In an embodiment, it is assumed that a reference clock cycle is T.sub.r=0.25s, and correspondingly, a reference clock frequency is ƒ.sub.r=4 Hz. It is assumed that a system clock cycle is T.sub.sys=0.5s, and correspondingly, a system clock frequency is ƒ.sub.sys=2 Hz. A sampling cycle is T.sub.s =0.5s. Therefore, based on physical meaning of the clock frequency error in the foregoing examples, a calculation formula of a corrected data timestamp of the i.sup.th data packet may be deduced as follows:
T.sub.i′=T.sub.i−(T.sub.s×i/T.sub.r−T.sub.s×i/T.sub.sys )×T.sub.sys.
[0106] Table 1 shows a relationship between a quantity of sampling cycles that a system passes, a quantity of system clock cycles, a system recording time, a quantity of reference clock cycles, a reference clock time, and a data timestamp correction of an i.sup.th data packet. It is assumed that the system collects one data packet in each sampling cycle, and the quantity of sampling cycles that the system passes is a quantity of data packets collected by the system.
TABLE-US-00001 TABLE 1 Relationship between a quantity of sampling cycles that a system passes, a quantity of system clock cycles, a system recording time, a quantity of reference clock cycles, a reference clock time, and a data timestamp correction of an i.sup.th data packet Quantity of sampling 1 2 3 4 cycles that a system passes Quantity of system 2 4 6 8 clock cycles System recording time 0.25 × 2 = 0.5 0.25 × 4 = 1 0.25 × 6 = 1.5 0.25 × 8 = 2 (s) Quantity of reference 4 8 12 16 clock cycles Reference clock time 0.25 × 4 = 1 0.25 × 8 = 2 0.25 × 12 = 3 0.25 × 16 = 4 (s) Data timestamp (0.5 × 1/0.25 − (0.5 × 2/0.25 − (0.5 × 3/0.25 − (0.5 × 4/0.25 − correction of an i.sup.th data 0.5 × 1/0.5) × 0.5 × 2/0.5) × 0.5 × 3/0.5) × 0.5 × 4/0.5) × packet (s) 0.5 = 0.5 0.5 = 1 0.5 = 1.5 0.5 = 2
[0107] The quantity of system clock cycles indicates that after there is no reference clock, the system still considers that a system clock cycle is 0.25s, and the system still considers that the system passes two clock cycles while passing a first sampling cycle, that is, the system recording time is 0.5s, as shown in the third row and the second column in Table 1. However, because of the clock frequency error, the system clock cycle becomes 0.5s, that is, a time period in which the system actually passes two clock cycles is 1s. In this case, a time error between the system time and the reference time is 0.5s after the system passes the first sampling cycle, as shown in the sixth row and the second column in Table 1.
[0108] Similarly, when the quantity of sampling cycles that the system passes gradually increases, the time error between the system time and the reference time increases according to a rule of an arithmetic progression whose tolerance is 0.5, as shown in Table 1.
[0109] It can be learned that after the system adjusts the data timestamp of any data packet in the time period in which there is no reference clock, data in each data packet is data collected in each sampling cycle within the reference time, and the data in each data packet may reflect a real status of the system.
[0110] In an example, when there is the reference clock signal, a system time at which the system collects a data packet is consistent with the reference time, and the system collects data according to a fixed sampling cycle. When the system enters the time period in which there is no reference clock, because the clock synchronization network system has no reference clock, and it is assumed that a clock holding algorithm is used in the system, the clock frequency error of the system accumulates slowly. However, the system can still maintain a fixed sampling cycle to collect data.
[0111] Therefore, when a clock holdover algorithm is used in the system, the clock frequency error between the system clock frequency and the reference clock frequency gradually increases according to a specific proportion. Correspondingly, the time error between the system time and the reference time gradually increases. In this case, the error information obtained by the system may be the clock frequency error or a time error T. The following describes in detail two different types of error information in a scenario in which a clock holding algorithm is used in the system.
[0112] In an embodiment, the error information is the clock frequency error. In this embodiment, it is assumed that in the scenario in which the clock holding algorithm is used in the system, a clock frequency of the system slowly increases with a change of time. A clock frequency error of a j.sup.th data packet in the time period in which there is no reference clock is caused by accumulation of clock frequency errors from the first data packet to the j.sup.th data packet. When the j.sup.th data packet is collected, the clock frequency error Δƒ, satisfies the following condition:
Δƒ=T.sub.s×S×j, where
[0113] T.sub.s is a sampling cycle, S is an increase rate of the clock frequency error, S is areal number, and j satisfies 0≤j≤i.
[0114] It is assumed that the increase rate of the clock frequency error is a fixed value, that is, S is a fixed value. In this case, when the j.sup.t data packet is collected, the clock frequency error of the system is T.sub.s×S×j. It can be learned that, in the time period in which there is no reference clock, each time the system collects a data packet, the clock frequency error of the system increases T.sub.s×S, that is, the clock frequency error of the system may be accumulated continuously according to a rule of an arithmetic progression whose tolerance is T XS.
[0115] For example, it is assumed that the increase rate of the clock frequency error is S=1 Hz/s, the sampling cycle is T.sub.s=1s, and a quantity of collected data packets is K=10. In this case, according to the condition that the clock frequency error satisfies, the system may determine that a clock frequency error when a fourth data packet is collected is Δƒ.sub.4=T.sub.s×S×4=4 Hz.
[0116] It should be noted that, because there is the clock frequency error, a time error between the system time and the reference time is accumulated once when the system passes each sampling cycle T after a moment at which a reference signal is lost, and an accumulated time amount is related to the clock frequency error.
[0117] In an embodiment, the error information is the time error. The clock frequency error and a time error of any data packet collected in the time period in which there is no reference clock are shown in
and ƒ.sub.sys,j is a system clock frequency corresponding to a moment at which a j.sup.th data packet is collected. It can be learned that the time error of the i.sup.th data packet is an accumulated time error in i sampling cycles from a sampling cycle in which the system collects the 0.sup.th data packet to a sampling cycle in which the system collects the i.sup.th data packet.
[0118] The time error
of the i.sup.th data packet may be a positive number or a negative number, that is, it indicates that an increased system clock frequency error is a positive number or a negative number. This is not limited in this embodiment.
[0119] It should be noted that Δƒ.sub.0 indicates a clock frequency error of the 0.sup.th data packet collected by the system in the time period in which there is no reference clock. A system time of the 0.sup.th data packet collected by the system in the time period in which there is no reference clock is a system time corresponding to a moment at which the system just losses the reference clock signal, that is, a reference time corresponding to the moment at which the system just losses the reference clock signal. In this case, there is no error between the system time of the 0.sup.th data packet collected by the system in the time period in which there is no reference clock and the reference time, and the clock frequency error of the 0.sup.th data packet is 0, that is, Δƒ.sub.0=0.
[0120] For example, it is assumed that an increase rate of the clock frequency error is S=1 Hz/s, a sampling cycle is T.sub.s=1s, a system clock frequency is ƒ.sub.sys=2 Hz, and a quantity of collected data packets is K=10.
[0121] According to a clock frequency error formula Δƒ.sub.j=T.sub.s×S×j, the system determines that a clock frequency error when the first data packet is collected is Δƒ.sub.1=1Hz, a clock frequency error when the second data packet is collected is Δƒ.sub.2=2Hz, a clock frequency error when the third data packet is collected is Δƒ.sub.3=31z, and a clock frequency error when the fourth data packet is collected is Δƒ.sub.4=4Hz. In this case, according to a time error formula
of the i.sup.th data packet, the system may determine that a time error of the fourth piece of data is
[0122] It may be understood that, when the time error of the i.sup.th data packet is a positive number that is calculated by using the foregoing time error calculation formula
the calculated time error is a maximum value of the time error of the i.sup.th data packet. In an embodiment, if the time error of the i.sup.th data packet is a negative number that is calculated by using the foregoing time error calculation formula
the calculated time error is a minimum value of the time error of the i.sup.th data packet.
[0123] In an embodiment, the error information is the time error. In a possible case, in the time period in which there is no reference clock, when the system enters a K.sup.th sampling cycle, if the system detects the reference clock signal in a short time period before a K.sup.th data packet is collected, a system time that the system passes in the time period in which there is no reference clock is close to K sampling cycles, that is, a quantity of data packets collected by the system is approximately K. However, in the time period in which there is no reference clock, because the system does not collect the K.sup.th data packet, a quantity of collected data packets actually recorded by the system is K−1. An actual time error of the system is nearly one sampling cycle longer than a time error recorded by the system (for example, if a sampling cycle is 10s, an actual time error of the system is 9s longer than the time error recorded by the system). In this case, for an i.sup.th data packet, a time error of the i.sup.th data packet may be an accumulated time error in a plurality of sampling cycles from a sampling cycle in which the system collects the first data packet to a sampling cycle in which the system collects the (i−1).sup.th data packet.
[0124] A time error of the i.sup.th data packet is
and ƒ.sub.sys,jis a system clock frequency corresponding to a moment at which a j.sup.th data packet is collected. It can be learned that the time error of the i.sup.th data packet is an accumulated time error in i−1 sampling cycles from a sampling cycle in which the system collects the 0.sup.th data packet to a sampling cycle in which the system collects the (i−1).sup.th data packet.
[0125] The time error
of the i.sup.th data packet may be a positive number or a negative number, that is, it indicates that an increased system clock frequency error is a positive number or a negative number. This is not limited in this embodiment.
[0126] For example, it is assumed that an increase rate of the clock frequency error is S=1 Hz/s, a sampling cycle is T.sub.s=1s, a system clock frequency is ƒ.sub.sys =2 Hz, and a quantity of collected data packets is K=10.
[0127] According to a clock frequency error formula Δƒ.sub.j=T.sub.s×S×j, the system determines that a clock frequency error when the first data packet is collected is Δƒ.sub.1=1Hz, a clock frequency error when the second data packet is collected is Δƒ=2Hz, and a clock frequency error when the third data packet is collected is Δƒ.sub.3=3 Hz. In this case, according to a time error formula
of the fourth data packet, the system may determine that a time error of the fourth piece of data is
[0128] It may be understood that, when the time error of the i.sup.th data packet is a positive number that is calculated by using the foregoing time error calculation formula
the calculated time error is a minimum value of the time error of the i.sup.th data packet. In an embodiment, if the time error of the i.sup.th data packet is a negative number that is calculated by using the foregoing time error calculation formula
the calculated time error is a maximum value of the time error of the i.sup.th data packet.
[0129] In this case, according to the calculated maximum value and minimum value of the time error of the i.sup.th data packet in the foregoing example, the system may further determine an average value of the time error of the i.sup.th data packet. For example, if the maximum value of the time error of the fourth data packet is 5s and the minimum value is 3s, the system may determine that the average value of the time error of the fourth data packet is 4s.
[0130] In an embodiment, according to the time error, the system may determine that the adjusted data timestamp of the i.sup.th data packet is T.sub.i′, and T.sub.i′satisfies the following condition:
and ƒ.sub.sys,j is a system clock frequency corresponding to a moment at which the j.sup.th data packet is collected.
[0131] For example, it is assumed that a system time corresponding to a collection moment of the fourth data packet is 11:00:00, and S ≥0. According to
the system may determine that the time error of the fourth data packet is 5s. In this case, the system may determine, based on the time error of the fourth data packet and the system time corresponding to the fourth data packet, that an adjusted data timestamp T.sub.i′ of the fourth data packet is 10:59:55, that is, a reference time corresponding to the collection moment of the fourth data packet is 10:59:55.
[0132] For another example, it is assumed that a system time corresponding to a collection moment of the fourth data packet is 11:00:00, and S≥0. According to
the system may determine that the time error of the fourth data
packet is 3s. In this case, the system may determine, based on the time error of the fourth data packet and the system time corresponding to the fourth data packet, that an adjusted data timestamp T.sub.i′ of the fourth data packet is 10:59:57, that is, a reference time corresponding to the collection moment of the fourth data packet is 10:59:57.
[0133] For another example, a minimum value of the adjusted data timestamp of the fourth data packet determined in the foregoing example is 10:59:55, and a maximum value of the adjusted data timestamp of the fourth data packet is 10:59:57. In this case, the system may determine that a reference time corresponding to the collection moment of the fourth data packet is any value in a time period of 10:59:55 to 10:59:57.
[0134] It can be learned that after the system adjusts the data timestamp of any data packet in the time period in which there is no reference clock, data in each data packet is data collected in each sampling cycle within the reference time, and the data in each data packet may reflect a real status of the system.
[0135] In an example, it is assumed that the clock synchronization system has obtained first data when the system performs a system test before use. The first data is data that changes with time and that is of a clock frequency error of the system under different sampling conditions when there is no reference clock. The first data may be prestored in the system.
[0136] The different sampling conditions may include but are not limited to environment detection parameters such as different ambient temperatures and different ambient humidities. The data that changes with time and that is of the clock frequency error under different sampling conditions may include a correspondence between a clock frequency error of any data packet collected by the system in the time period in which there is no reference clock and a sampling condition. The correspondence may be stored in the system in a form of a table, or may be stored in the system in another form (for example, a schematic diagram). This is not limited in this embodiment.
[0137] The following uses a table as an example to describe the correspondence. Table 2 is a correspondence between a clock frequency error of any data packet collected by a system in a time period in which there is no reference clock and a sampling condition. The usage condition includes different ambient temperatures, as shown in Table 2.
TABLE-US-00002 TABLE 2 Correspondence between clock frequency errors of any data packet collected by a system in a time period in which there is no reference clock, different ambient temperatures, and sampling cycles Ambient temperature Sampling 0° C. 10° C. 20° C. 30° C. cycle Clock frequency error 10 s S01 S02 S03 S04 20 s S11 S12 S13 S14 30 s S21 S22 S23 S24
[0138] The clock frequency error shown in Table 2 may be a determined value. For example, S01=300 Hz (Hz), which indicates that when the ambient temperature is 0° C. and the sampling cycle is 1Os, the clock frequency error of any data packet collected by the system in the time period in which there is no reference clock is 300 Hz. In an embodiment, the clock frequency error shown in Table 2 may also be in another form. For example, the clock frequency error S01 is a binary relationship whose variable is an ambient temperature and a sampling cycle. This is not limited in this embodiment.
[0139] The system prestores the correspondence between the clock frequency error of any data packet collected by the system in the time period in which there is no reference clock and the sampling condition, that is, for the i.sup.th data packet, a clock frequency error Δƒ of the i.sup.th data packet may be determined.
[0140] In an embodiment, when the system detects the reference clock signal again, the system may determine, based on the correspondence, that a time error of the i.sup.th data packet is
and T is a sampling cycle. It may be understood that, for the i.sup.th data packet, the time error of the i.sup.th data packet is caused by accumulation of clock frequency errors from the first data packet to the i.sup.th data packet collected by the system in a time period in which there is no reference clock.
[0141] In an embodiment, the system may adjust the data timestamp of the i.sup.th data packet based on the time error T of the i.sup.th data packet. It is assumed that an adjusted data timestamp of the i.sup.thdata packet is T.sub.i′, and T.sub.i′satisfies the following condition:
where
[0142] T.sub.S is a sampling cycle, j is a positive integer, and j≤i.
[0143] In an embodiment, the sampling cycle in the time error calculation formula and the calculation formula for adjusting the data timestamp of the i.sup.th data packet may alternatively be a second cycle. The second cycle is an environment detection cycle corresponding to the sampling condition. For example, when the sampling conditions are different ambient temperatures, the second cycle is an ambient temperature detection cycle.
[0144] For example, if the second period is an ambient temperature detection cycle, it is assumed that the ambient temperature detection cycle is twice the sampling cycle. For example, the sampling cycle is 10s, and the ambient temperature detection period is 20s. The system determines, based on the sampling cycle, that a quantity of data packets collected by the system in the time period in which there is no reference clock is 10. In this case, the system may divide, based on the ambient temperature detection cycle, the data packets collected in the time period in which there is no reference clock into a set of five data packets. For example, a first data packet and a second data packet belongs to a first data packet set, and a third data packet and a fourth data packet belongs to a second data packet set. In this case, for each data packet set, the system may separately determine a clock frequency error of each data packet set based on the correspondence. For example, a clock frequency error of the first data packet set is the corresponding clock frequency error S01 when the ambient temperature is 0° C., that is, clock frequency errors of both the first data packet and the second data packet are S01. For another example, a clock frequency error of the second data packet set is the corresponding clock frequency error S02 when the ambient temperature is 10° C., that is, clock frequency errors of both the third data packet and the fourth data packet are S02.
[0145] It may be understood that, because an environment change cycle is generally greater than the system sampling cycle, when the system calculates and determines, by using the second cycle, the clock frequency error and adjusts the data timestamp of the i.sup.th data packet, a calculation amount of the system can be reduced.
[0146] It can be learned that the system may estimate, based on historical data or time-frequency error data obtained when the system is tested, a clock frequency error of any data packet collected by the system in the time period in which there is no reference signal. Further, the system calculates, based on the clock frequency error, a time error of any data packet collected in the time period in which there is no reference clock, to adjust a data timestamp of any data packet collected in the time period in which there is no reference clock. After the system adjusts the data timestamp of any data packet in the time period in which there is no reference clock, data in each data packet is data collected in each sampling cycle within the reference time, and the data in each data packet may reflect a real status of the system.
[0147] The following describes an apparatus and a device in the embodiments of this application in detail with reference to
[0148] An embodiment of this application provides a data processing apparatus. As shown in
[0150] In an embodiment, the error information is a clock frequency error Δƒ, and the clock frequency error Δƒ=ƒ.sub.sys −ƒ.sub.r is a fixed value, where ƒ.sub.sys is a system clock frequency corresponding to a moment at which the reference clock is detected again, and ƒ.sub.r is a reference clock frequency. For an embodiment, refer to the detailed description of the clock frequency error in the embodiments shown in
[0151] In an embodiment, an adjusted data timestamp of the i.sup.th data packet is T.sub.i′; and 17 satisfies the following condition:
T.sub.i′=T.sub.i −(Δƒ/ƒ.sub.sys)×T.sub.s×i, where
T.sub.s is a sampling cycle. For an embodiment, refer to the detailed description of the clock frequency error and the adjusted data timestamp of the i.sup.th data packet in the embodiments shown in
[0152] In an embodiment, the error information is a time error T or a time error t, the time error T is a difference between a reference time corresponding to a first moment and a system time corresponding to the first moment, and the time error t satisfies the following condition:
t=T/K, where
[0153] the first moment is a moment at which the reference clock is detected again after the i.sup.thdata packet is collected, and K is a quantity of data packets collected in the time period in which there is no reference clock. For an embodiment, refer to the detailed description of the time error in the embodiments shown in
[0154] In an embodiment, an adjusted data timestamp of the i.sup.th data packet is and 17 satisfies the following condition:
T.sub.i′=T.sub.i −T/K×i, or T.sub.i′=T.sub.i −t×i.
[0155] For specific implementation, refer to the detailed description of the time error and the adjusted data timestamp of the i.sup.th data packet in the embodiments shown in
[0156] In an embodiment, the error information is a clock frequency error; and when a j.sup.th data packet is collected, the clock frequency error Δƒ, satisfies the following condition:
Δƒ.sub.j=T.sub.s ×S×j, where
[0157] T.sub.s is a sampling cycle, S is an increase rate of the clock frequency error, S is areal number, and j satisfies 0 ≤j≤i. For an embodiment, refer to the detailed description of the clock frequency error in the embodiments shown in
[0158] In an embodiment, an adjusted data timestamp of the i.sup.th data packet is T.sub.i′; and T.sub.i′ satisfies the following condition:
and ƒ.sub.sys,j is a system clock frequency corresponding to a moment at which the j.sup.th data packet is collected.
[0159] For an embodiment, refer to the detailed description of the clock frequency error and the adjusted data timestamp of the i.sup.th data packet in the embodiments shown in
[0160] In an embodiment, the error information includes a clock frequency error af, of the any data packet; and the clock frequency error Δƒ.sub.j is determined based on a correspondence between a locally stored clock frequency error of the any data packet collected by the system in the time period in which there is no reference clock and a sampling condition. For an embodiment, refer to the detailed description of the clock frequency error in the embodiment shown in Table 2. Details are not described herein again.
[0161] In an embodiment, an adjusted data timestamp of the i.sup.th data packet is T.sub.i′; and T.sub.i′ satisfies the following condition:
[0162] T.sub.s is a sampling cycle, ƒ.sub.sys,j is a system clock frequency corresponding to a moment at which a j.sup.th data packet is collected, and j satisfies 0≤j≤i. For an embodiment, refer to the detailed description of the clock frequency error and the adjusted data timestamp of the i.sup.th data packet in the embodiment shown in Table 2. Details are not described herein again.
[0163] In an embodiment, the data processing apparatus 700 may further include a system work log output unit 702. The system work log output unit 702 is configured to output a system work log, where the system work log includes a data timestamp of a data packet collected by a clock synchronization network in the time period in which there is no reference clock. For an embodiment, refer to the detailed description in the embodiment shown in
[0164] In an embodiment, related functions implemented by the units in
[0165] The transceiver 801 may be configured to send information and receive information. It may be understood that the transceiver 801 is a general term, and may include a receiver and a transmitter. For example, the receiver is configured to receive a clock synchronization signal.
[0166] The processor 802 may be configured to process data of the network device, or process information received by the transceiver 801. For example, the processor 802 may invoke program code stored in the memory 803, to adjust a data timestamp of a data packet. The processor 802 may include one or more processors. For example, the processor 802 may be one or more central processing units (CPUs), a network processor (NP), a hardware chip, or any combination thereof. When the processor 802 is a CPU, the CPU may be a single-core CPU, or may be a multi-core CPU.
[0167] The memory 803 is configured to store the program code. The memory 803 may include a volatile memory (volatile memory), for example, a random access memory (RAM); the memory 803 may also include a nonvolatile memory, for example, a read-only memory (read-only memory, ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); and the memory 803 may further include a combination of the foregoing types of memories.
[0168] The processor 802 may be configured to implement the data processing method in the embodiments of this application. An embodiment is as follows: [0169] adjusting a data timestamp T, of an i.sup.th data packet based on error information, where the error information is a clock frequency error or a time error, the clock frequency error is a difference between a system clock frequency and a reference clock frequency, and the time error is a difference between a system time and a reference time. The i.sup.th data packet is any data packet collected by a system in a time period in which there is no reference clock, i is a positive integer, and T.sub.i is a system time corresponding to a collection moment of the i.sup.th data packet. For an embodiment, refer to the detailed description in the embodiment shown in
[0170] In an embodiment, the error information is a clock frequency error Δƒ, and the clock frequency error Δƒ=ƒ.sub.sys −ƒ is a fixed value, where ƒ.sub.sys is a system clock frequency corresponding to a moment at which the reference clock is detected again, and ƒ.sub.r is a reference clock frequency. For an embodiment, refer to the detailed description of the clock frequency error in the embodiments shown in
[0171] In an embodiment, an adjusted data timestamp of the i.sup.th data packet is and 77 satisfies the following condition:
T.sub.i′=T.sub.i−(Δƒ/ƒ.sub.sys)×T.sub.s×i, where
[0172] T.sub.s is a sampling cycle. For an embodiment, refer to the detailed description of the clock frequency error and the adjusted data timestamp of the i.sup.th data packet in the embodiments shown in
[0173] In an embodiment, the error information is a time error T or a time error t, the time error T is a difference between a reference time corresponding to a first moment and a system time corresponding to the first moment, and the time error t satisfies the following condition:
t=T/K, where
[0174] the first moment is a moment at which the reference clock is detected again after the i.sup.th data packet is collected, and K is a quantity of data packets collected in the time period in which there is no reference clock. For a specific implementation, refer to the detailed description of the time error in the embodiments shown in
[0175] In an embodiment, an adjusted data timestamp of the i.sup.th data packet is T.sub.i′; and T.sub.i′ satisfies the following condition:
T.sub.i′=T.sub.i −T/K×i, or T.sub.i′=T.sub.i −t×i.
[0176] For specific implementation, refer to the detailed description of the time error and the adjusted data timestamp of the i.sup.th data packet in the embodiments shown in
[0177] In an embodiment, the error information is a clock frequency error; and when a j.sup.th data packet is collected, the clock frequency error Δƒ, satisfies the following condition:
Δƒ.sub.j=T.sub.s ×S×j, where
[0178] T.sub.s is a sampling cycle, S is an increase rate of the clock frequency error, S is areal number, and j satisfies 0 ≤j≤i. For a specific implementation, refer to the detailed description of the clock frequency error in the embodiments shown in
[0179] In an embodiment, an adjusted data timestamp of the i.sup.th data packet is 17′; and 17 satisfies the following condition:
and ƒ.sub.sys,j is a system clock frequency corresponding to a moment at which the j.sup.th data packet is collected.
[0180] In an embodiment, the error information includes a clock frequency error Δƒ, of the any data packet; and the clock frequency error Δƒ.sub.j is determined based on a correspondence between a locally stored clock frequency error of the any data packet collected by the system in the time period in which there is no reference clock and a sampling condition. For a specific implementation, refer to the detailed description of the clock frequency error in the embodiment shown in Table 2. Details are not described herein again.
[0181] In an embodiment, an adjusted data timestamp of the i.sup.th data packet is T.sub.i′; and 17 satisfies the following condition:
[0182] T.sub.s is a sampling cycle, ƒ.sub.sys,j is a system clock frequency corresponding to a moment at which a j.sup.th data packet is collected, and j satisfies O j i. For a specific implementation, refer to the detailed description of the clock frequency error and the adjusted data timestamp of the i.sup.th data packet in the embodiment shown in Table 2. Details are not described herein again.
[0183] An embodiment of this application provides a computer-readable storage medium. The computer-readable storage medium stores a program or instructions. When the program or the instructions are run on a computer, the computer is enabled to perform the data processing method in the embodiments of this application.
[0184] An embodiment of this application provides a chip or a chip system. The chip or the chip system includes at least one processor and an interface. The interface and the at least one processor are interconnected by using a line. The at least one processor is configured to run a computer program or instructions, to perform the data processing method in the embodiments of this application.
[0185] The interface in the chip may be an input/output interface, a pin, a circuit, or the like.
[0186] The chip system in the foregoing aspect may be a system on chip (SoC), or may be a baseband chip, or the like. The baseband chip may include a processor, a channel encoder, a digital signal processor, a modem, an interface module, and the like.
[0187] In an embodiment, the chip or the chip system described above in this application further includes at least one memory, and the at least one memory stores instructions. The memory may be an internal storage unit of the chip, for example, a register or a cache, or may be a storage unit of the chip (for example, a read-only memory or a random access memory).
[0188] An embodiment of this application provides a system, including the data processing apparatus and the network device in the embodiments of this application. All or a part of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof When the software is used to implement the embodiments, all or a part of the embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the procedure or functions according to the embodiments of this application are all or partially generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable apparatuses. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or wireless (for example, infrared, radio, and microwave, or the like) manner. The computer-readable storage medium may be any usable medium accessible by a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a high-density digital video disc (DVD)), a semiconductor medium (for example, a solid-state drive (SSD)), or the like.
[0189] A person of ordinary skill in the art may be aware that, in combination with the examples described in the embodiments disclosed in this specification, units and algorithm operations may be implemented by electronic hardware, computer software, or a combination thereof To clearly describe the interchangeability between the hardware and the software, the foregoing has generally described compositions and operations of each example according to functions. Whether the functions are performed by hardware or software depends on particular applications and design constraint conditions of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the embodiment goes beyond the scope of this application.
[0190] The foregoing descriptions are merely specific embodiments of this application, but are not intended to limit the protection scope of this application. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in this application shall fall within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.