CN116030846B - Timing jump synchronization method and electronic equipment - Google Patents

Timing jump synchronization method and electronic equipment Download PDF

Info

Publication number
CN116030846B
CN116030846B CN202210715521.XA CN202210715521A CN116030846B CN 116030846 B CN116030846 B CN 116030846B CN 202210715521 A CN202210715521 A CN 202210715521A CN 116030846 B CN116030846 B CN 116030846B
Authority
CN
China
Prior art keywords
time
timing
timer
slave
jump
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210715521.XA
Other languages
Chinese (zh)
Other versions
CN116030846A (en
Inventor
李猛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Publication of CN116030846A publication Critical patent/CN116030846A/en
Application granted granted Critical
Publication of CN116030846B publication Critical patent/CN116030846B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application provides a timing jump synchronization method and electronic equipment, and belongs to the technical field of terminals. The method comprises the following steps: querying a state of the master timer in response to starting timing of the slave timer; when the state of the master timer is timing starting or timing is resumed after suspension, acquiring synchronous adjustment time length of the slave timer according to the timing parameters of the slave timer and the timing parameters of the master timer; and adjusting the timing starting time or the total pause time of the slave timer according to the synchronous adjustment time length so that the slave timer and the master timer synchronously jump. According to the method, in a scene of using two timer controls, the hopping frequencies of the two independent timers are adaptively synchronized, so that the two timers form uniform animation visually, and better interface use experience is brought to a user.

Description

Timing jump synchronization method and electronic equipment
The present application claims priority from the chinese patent application filed at 30 months of 2022, 05, to the national intellectual property office, application number 202210603470.1, application name "method for timing jump synchronization and electronic device", the entire contents of which are incorporated herein by reference.
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method for timing jump synchronization and an electronic device.
Background
At present, a mode of jumping the timing time every second is adopted for timing. When the timing time of the two timers is displayed on one display interface at the same time, if the timing time jumps corresponding to the two timers are inconsistent, the user experience is poor.
Disclosure of Invention
The embodiment of the application provides a timing jump synchronization method and electronic equipment, which are used for adaptively synchronizing jump frequencies of two independent timers in a scene of using two timer controls, so that the two timers form uniform animation visually and better interface use experience is brought to users.
In a first aspect, a method for timing jump synchronization is provided, applied to an electronic device, where the electronic device includes a first interface, the first interface includes a master timing and a slave timing, the master timing corresponds to a master timer, and the slave timing corresponds to a slave timer, and the method includes:
querying a state of the master timer in response to the slave timer starting to count;
when the state of the master timer is recording starting or recording is resumed after suspension, acquiring synchronous adjustment time length of the slave timer according to the timing parameters of the slave timer and the timing parameters of the master timer;
And adjusting the timing starting time or the total pause time of the slave timer according to the synchronization adjustment time so that the slave timer and the master timer synchronously jump.
According to the timing jump synchronization method provided by the implementation mode, the jump frequencies of the two independent timers are adaptively synchronized in a scene of using the two timer controls, so that the two timers can form uniform animation visually, and better interface watching experience is brought to a user.
With reference to the first aspect, in certain implementation manners of the first aspect, when the state of the master timer is that recording is started, and a timing start time of the master timer is earlier than a timing start time of the slave timer; or when the master timer resumes timing after suspending, the slave timer starts timing, and the resume time of the master timer is earlier than the start time of the slave timer, the method specifically includes:
acquiring a first synchronous adjustment time length, wherein the first synchronous adjustment time length is a difference value obtained by subtracting the timing starting time of the master timer from the timing starting time of the timer;
when the first synchronization adjustment time length is smaller than one half of a jump period, increasing the timing starting time of the slave timer by the first synchronization adjustment time length to obtain the adjusted timing starting time of the timer;
And when the first synchronization adjustment time length is greater than or equal to half of the jump period, reducing the timing starting time of the slave timer by the first synchronization adjustment time length so as to acquire the adjusted timing starting time of the timer.
With reference to the first aspect, in some implementations of the first aspect, when the state of the master timer is recording start, and the timing start time of the master timer is later than the timing start time of the slave timer, the method specifically includes:
acquiring a second synchronous adjustment time length which is the difference value of the timing starting time of the master timer minus the timing starting time of the slave timer;
when the second synchronous adjustment duration is smaller than half of the jump period, increasing the timing starting time of the slave timer by the second synchronous adjustment duration to obtain the adjusted timing starting time of the timer;
and when the second synchronization adjustment time length is greater than or equal to half of the jump period, reducing the timing starting time of the slave timer by the second synchronization adjustment time length so as to acquire the adjusted timing starting time of the timer.
With reference to the first aspect, in certain implementations of the first aspect, when the master timer resumes counting after pausing, counting from the master timer, and the method specifically includes:
acquiring the next theoretical jump time after the main timer resumes timing;
acquiring a third synchronous adjustment time length, wherein the third synchronous adjustment time length is the remainder of the jump period by the difference value between the next theoretical jump time and the timing starting time of the slave timer;
when the third synchronous adjustment duration is smaller than half of the jump period, increasing the timing starting time of the slave timer by the third synchronous adjustment duration to obtain the adjusted timing starting time of the timer;
and when the third synchronous adjustment time length is greater than or equal to half of the jump period, reducing the timing starting time of the slave timer by the third synchronous adjustment time length so as to acquire the adjusted timing starting time of the timer.
With reference to the first aspect, in certain implementation manners of the first aspect, when the slave timer resumes counting after pausing, and the master timer keeps counting, the method specifically includes:
acquiring the next theoretical jump time of the master timer relative to the recovery time of the slave timer;
Calculating a first gap duration from the recovery moment of the slave timer to the next theoretical jump moment;
acquiring a fourth synchronous adjustment time length which is the difference value obtained by subtracting the first gap time length from the next theoretical jump time and the recovery time of the slave timer;
and increasing the pause total time length of the slave timer by the fourth synchronous adjustment time length to acquire the adjusted pause total time length of the slave timer.
With reference to the first aspect, in certain implementation manners of the first aspect, when the master timer and the slave timer both pause and resume to count, the method specifically includes:
acquiring the next theoretical jump time after the main timer resumes timing;
calculating a second gap duration of the recovery moment of the master timer from the next theoretical jump moment and a third gap duration of the recovery moment of the slave timer from the next theoretical jump moment;
obtaining a fifth synchronous adjustment time length, wherein the fifth synchronous adjustment time length is the difference value of the second gap time length minus the third gap time length;
and increasing the pause total time length of the slave timer by the fifth synchronous adjustment time length to acquire the adjusted pause total time length of the slave timer.
With reference to the first aspect, in certain implementation manners of the first aspect, the method further includes:
and when the absolute value of the error between the timing time of the slave timer and the real timing time after the multiple adjustment is larger than the jump period, the timing time of the slave timer is fast or slow for a duration corresponding to the jump period.
With reference to the first aspect, in some implementations of the first aspect, when an absolute value of an error between the counted time of the slave timer after the multiple adjustments and the actual counted time is greater than the jump period, the step of advancing the counted time of the slave timer by a duration corresponding to one jump period specifically includes:
and when the absolute value of the error between the timing time of the slave timer after the multiple adjustment and the real timing time is larger than the jump period, if the time length corresponding to one jump period is slowed down, the obtained corrected timing time is smaller than the timing time when the slave timer is not corrected, and the timing time when the slave timer is not corrected at present is maintained.
In a second aspect, there is provided an electronic device comprising: one or more processors; one or more memories; the one or more memories store one or more computer programs comprising instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any of the implementations of the first aspect described above.
In a third aspect, there is provided a computer readable storage medium storing computer executable program instructions which, when run on a computer, cause the computer to perform a method as described in any one of the implementations of the first aspect above.
In a fourth aspect, there is provided a computer program product comprising computer program code which, when run on a computer, causes the computer to perform the method according to any of the preceding implementation forms of the first aspect.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 2 is a block diagram of a software architecture of an electronic device 100 according to an embodiment of the present application.
Fig. 3A to 3D are schematic diagrams of GUI related to some main angle mode shooting processes according to embodiments of the present application.
Fig. 4 is a schematic diagram of a timing jump synchronization adjustment rule according to a first embodiment of the present application.
Fig. 5 is a schematic diagram of a timing jump synchronization adjustment rule according to a second embodiment of the present application.
Fig. 6 and fig. 7 are schematic diagrams of a timing jump synchronization adjustment rule according to a third embodiment of the present application.
Fig. 8 and fig. 9 are schematic diagrams of a timing jump synchronization adjustment rule according to a fourth embodiment of the present application.
Fig. 10 and fig. 11 are schematic diagrams of a timing jump synchronization adjustment rule according to a fifth embodiment of the present application.
Fig. 12 is a schematic time diagram for assisting in understanding the calculation of the duration from the recording time to the theoretical jump time according to the embodiment of the present application.
Fig. 13 is a schematic time diagram for calculating a duration from a recording resume time to a theoretical jump time with assistance of another understanding provided in the embodiment of the present application.
Fig. 14 is a schematic time diagram for assisting in understanding the calculation of the duration from the recording time to the theoretical jump time according to still another embodiment of the present application.
Fig. 15 is a schematic flowchart of a method for timing jump synchronization according to an embodiment of the present application.
Fig. 16 is a schematic flow chart of another method for timing jump synchronization according to an embodiment of the present application.
Fig. 17 is a timing diagram of a method for timing jump synchronization according to an embodiment of the present application.
Detailed Description
It should be noted that the terms used in the implementation section of the embodiment of the present application are only used to explain the specific embodiment of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise indicated, "/" means or, for example, a/B may represent a or B; "and/or" herein is merely one association relationship describing an associated obstacle, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, in the description of the embodiments of the present application, unless otherwise indicated, "a plurality" means two or more, and "at least one", "one or more" means one, two or more.
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a definition of "a first", "a second" feature may explicitly or implicitly include one or more of such features.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
Along with the development of terminal technology and the transition of life habits, more and more users are used to record video recording life by using electronic equipment such as mobile phones and the like. To meet the diverse needs of users, electronic devices provide increasingly diverse video recording modes. In some video recording modes, the same interface can display multiple video recording windows simultaneously for a user to take a picture of different objects. Different video recording windows usually display respective shooting timings independently, however, when different windows start shooting at different times, a phenomenon that timing jump of a plurality of windows is inconsistent easily occurs, resulting in poor user experience.
In view of this, the embodiment of the application provides a method for timing jump synchronization, which performs adaptive synchronization on jump frequencies of two independent timers in a scene of using two timer controls, so that timing jumps of the two timers form a continuous animation of step frequency visually, and better interface viewing experience is brought to users.
Exemplary, as shown in fig. 1, a schematic structural diagram of an electronic device 100 according to an embodiment of the present application is provided.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other terminals, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the terminal through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The display screen 194 is used to display images, videos, and the like.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like. Video codecs are used to compress or decompress digital video. The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card. The internal memory 121 may be used to store computer executable program code including instructions.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The method can also be used for identifying the gesture of the terminal, and is applied to the applications such as horizontal and vertical screen switching, pedometers and the like. The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The fingerprint sensor 180H is used to collect a fingerprint. The temperature sensor 180J is for detecting temperature. The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The bone conduction sensor 180M may acquire a vibration signal.
In addition, the electronic device 100 further includes a barometric pressure sensor 180C and a distance sensor 180F. Wherein the air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
For example, the software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the application, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated. Fig. 2 is a software configuration block diagram of the electronic device 100 according to the embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages. As shown in fig. 2, the application package may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the terminal vibrates, and an indicator light blinks.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of obstacle life cycle management, stack management, thread management, security and abnormality management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The method for timing jump synchronization provided by the embodiment of the application can be applied to a scene that the electronic equipment respectively performs timing by utilizing two timings, and particularly can be applied to a scene that the big and small windows are independently timed when shooting in a main angle mode. In order to facilitate understanding, the method for timing jump synchronization provided by the embodiment of the application is described below in connection with a shooting scene of a main angle mode.
The principal angle mode is exemplified by taking a certain object in a shooting scene as a shooting principal angle during shooting, focusing the principal angle while shooting a large window, and simultaneously displaying a small window on a shooting screen to show the shooting screen for the principal angle.
For easy understanding, the embodiment of the present application uses the electronic device 100 as a mobile phone as an example, and describes a scene of capturing video in a main angle mode. Fig. 3A to 3D are schematic diagrams of graphical user interfaces (graphical user interface, GUI) involved in some main angle mode shooting processes according to embodiments of the present application.
Fig. 3A shows an interface content 301 currently output by a screen display system of a mobile phone in an unlock mode of the mobile phone, where the interface content 301 is a home screen interface of the mobile phone. The home screen interface may include an application icon display area 10 for displaying various types of application (App) icons, such as clock icons, calendar icons, gallery icons, memo icons, file management icons, email icons, music icons, calculator icons, recorder icons, sports health icons, weather icons, browser icons, setup icons, and the like. Under the plurality of application icons may be a page indicator display region 20 that includes page indicators for indicating the positional relationship of the currently displayed page to other pages. A tray application icon display area 30 may be displayed below the page indicator for displaying a plurality of tray application icons, such as camera application icons, address book application icons, telephone dialing application icons, information application icons, and the like. In other embodiments, the cell phone home screen interface may include more or less application icons or tray application icons than illustrated, as the application is not limited in this regard. Above the interface, a status bar 40 may also be displayed, which status bar 40 may include: one or more signal strength indicators of mobile communication signals (or cellular signals), one or more signal strength indicators of wireless high fidelity (wireless fidelity, wi-Fi) signals, power indicators of the handset 1, time indicators, etc.
When the handset detects that the user outputs a click 302 for the camera application on the home screen interface 301, the camera application may be started, displaying a photographing interface 303 as shown in fig. 3B. The photographing interface 303 may include a viewfinder, an album icon, a photographing control, a rotation control, and the like.
The view finding frame is used for acquiring an image of shooting preview and displaying the preview image in real time. The album icon is used for entering the album quickly, and after the mobile phone detects that the user clicks the album icon, the shot photos or videos and the like can be displayed on the touch screen. The shooting control is used for shooting or video recording, and when the mobile phone detects that the user clicks the shooting control, the mobile phone executes shooting operation and stores the shot photo; or when the mobile phone is in the video recording mode, after the user clicks the shooting control, the mobile phone executes video recording operation and stores the recorded video. The camera rotation control is used for controlling the front camera and the rear camera to be switched.
In addition, the photographing interface 303 further includes a function control for setting a photographing mode, such as a night view photographing mode, a portrait photographing mode, a video recording mode, a main angle mode, and more modes, as shown in fig. 3B.
In some embodiments, when the mobile phone detects that the user inputs the click operation 304 for the main angle mode, the mobile phone may enter the main angle shooting mode, and at this time, as shown in fig. 3C, an operation prompt "click image tracking frame" of the main angle mode may be displayed above the preview screen of the viewfinder, a segment of the tracking frame Jiao Shipin may be additionally generated, and a tracking frame may be displayed on the photographed object.
When the mobile phone detects a click operation 305 for a certain object focus tracking frame in the preview image, the object is focused and photographed. Meanwhile, a photographing window 306 as shown in fig. 3D is displayed at the photographing interface. For convenience of distinction, the display window corresponding to the main preview interface will be hereinafter referred to as a large window, and the photographing window 306 will be referred to as a small window. As shown in fig. 3D, in the main angle mode, the large window and the small window may display respective corresponding timing times, respectively. Because the shooting time of the big window and the small window are respectively independently counted by the two timers, in the shooting process, the numbers of the two timers may not be consistent, but the jump needs to be consistent so as to better meet the look and feel of a user.
To meet the consistent timing jump, the timing time of the small window needs to be synchronized. In a scenario where timing jump synchronization is required, it is generally necessary to perform synchronization timing whenever there is a change in shooting status (start), stop, pause, resume). However, in the main angle mode described in the embodiment of the present application, the large window is used as the main shooting window, and the interaction logic of the user has the following limitations:
(1) Recording a small window after starting recording in a large window or starting recording synchronously with the large window;
(2) Resuming recording after the large window pauses can trigger the small window to start recording;
(3) When the large window pauses recording, the small window can also pause recording; when the recording of the large window is finished, the recording of the small window is finished;
(4) In normal recording of a large window, the small window may pause or resume recording independently.
For example, in the principal angle mode, the scene involved may be as shown in table 1:
TABLE 1
When one timer is in a suspended or end timing state and the other is normally timing, since there is no timing comparison object, no jump synchronization is involved. That is, the method for timing jump synchronization provided by the embodiment of the present application is suitable for a scenario where two timers start timing or pause resume timing without timing, that is, a scenario where the timing problem in table 1 exists as a result of Y.
In the embodiment of the application, the display time of the large window and the small window can be calculated by the following formula (1-1):
T setTextTime =T realTime -T startTime -T pauseTotalDuration (1-1)
wherein T is setTextTime The timing time of the current display of the big window/the small window is set; t (T) realTime The system time corresponding to the current moment is the system time; t (T) startTime The corresponding system time is the system time when the large window/small window starts recording; t (T) pauseTotalDuration For the total duration of the pause recording.
For convenience of distinction, the timing parameter corresponding to the large window is denoted by T (uppercase) and the timing parameter corresponding to the small window is denoted by T (lowercase) hereinafter.
It should be noted that, the system time may correspond to the timing time of the system itself, which cannot be adjusted.
It should be further noted that the timing time of the current display of the big window and the small window may be different, for example, the small window is started to record after the big window records the 4s video, and then the timing time of the big window display is 00:04, and the timing time of the small window display is 00:00. However, since the timing hopping periods of the big window and the small window are the same (taking hopping every 1s as an example), if the hopping time of the small window and the hopping time of a certain sub-big window can be aligned, the hopping synchronization of the big window and the small window can be realized.
Based on the above, the method for timing jump synchronization provided by the application adopts master-slave logic, takes the timing time of a large window as master timing (master timer), takes the timing time of a small window as slave timing (slave timer), and the timing jump of the slave timing is changed according to the current state of the master timing. Specifically, the large window is taken as a main shooting scene, the timing (master timer) is taken as a reference system, the main shooting scene is obtained by calculation according to the formula (1-1), the small window is not synchronously adjusted, the timing time of the current display of the small window is adjusted according to the actual recording state of the corresponding large window when the small window starts to record or pauses to resume recording (specifically, by adjusting t of the small window) startTime ) Or the total duration of the pause recording (t pauseTotalDuration ) Realization). When there is a timing problem, if the small window cannot acquire the state of the large window in real time (for example, whether the large window starts recording/resuming recording), the timer of the small window will execute the polling operation on the state of the large window through the corresponding timing refreshing mechanism, and periodically inquire the state of the large window. When the state of acquiring the big window changes in the polling process (for example, the big window starts recording/resumes recording), the timer of the small window can immediately perform synchronous adjustment, and then the polling is ended.
The above-mentioned timing refresh mechanism may refer to: between two successive timing hops of the master and slave timing, the timer will refresh the displayed timing time in the background at a certain refresh frequency, for example, multiple (e.g., 4-5) refreshes of the same number in 1 second, instead of 1 second for 1 time. If the timing time does not reach the jump time, the timing time after refreshing is not changed; if the timing time reaches or is later than the timing jump time, the timing time after refreshing can jump, and the time after jumping is displayed. For example, taking a refresh rate of 5 times/second (i.e. refresh the counted time every 200 ms), assuming that the counted time of the current (large window or small window) is 00:04, the timer will refresh the counted time at a time of 00:04+200ms, and the counted time is still displayed as 00:04 after the refresh because the time at this time does not reach the next counted transition time (00:05), and then the refresh is performed every 200 ms. When the next time of counting the jump time (00:05) is reached, the count time after refreshing is displayed as 00:05, and at the moment, from the view angle of the user, the count time jumps from 00:04 to 00:05.
The manner in which timing hops are synchronously adjusted and the related background are described above. The method for timing jump synchronization provided by the embodiment of the application is described below with reference to a specific scenario.
Scene one: and synchronizing the recording timing starting time of the small window, wherein the time sequence is that the large window starts recording first and the small window starts recording later.
Exemplary, as shown in fig. 4, a schematic diagram of a timing jump synchronization adjustment rule related to scenario one is shown.
In one possible scenario, during the recording of a large window video, the main angle mode is turned on, and the small window starts video recording, where the timing start time corresponding to the main timing is earlier than the timing start time of the slave timing. As shown in FIG. 4, the master clock is at T startTime Starting timing at time, and starting timing at t startTime The time begins to count.
In some embodiments, the small window may poll the state of the large window when counted from the timer, where the polling frequency may be the same as the refresh frequency corresponding to the refresh mechanism, such as once every 200 ms. And when the large window is determined to start recording in the polling process, performing synchronous adjustment timing jump.
In some embodiments, during the polling process, the small window may also query other timing parameters corresponding to the large window, such as the recording start time (T startTime ) And a previous transition time (T1) adjacent to the widget timing start time and a next transition time (T2) adjacent thereto.
In connection with fig. 4, rules for synchronization adjustment of portlets may include: (1) Calculating the recording start time (t) startTime ) And the difference Δt between the previous transition instant (T1) of the large window and its neighbors, wherein Δt=t startTime -T1; (2) Determining the starting recording time t of the small window according to the difference startTime Which jump time of the large window is closer, namely judging t startTime Time is closer to time T1 or T startTime The time is closer to the time T2; (3) When the recording starting time of the small window and the previous jump time (T1) adjacent to the small window are closer, the timing starting time of the small window is advanced by deltat, namely, the timing starting time of the small window is synchronously adjusted to be T1.
Since the jump period of the small window is the same as that of the large window, after the timing start time of the small window is corrected to be aligned with a certain jump time (T1 in this case), the jump time of the subsequent small window is the same as that of the large window, namely, the jump synchronization of the small window and the large window is realized.
Alternatively, from the viewpoint of the displayed time, after the window is adjusted synchronously, the time of the window is set to T1, and the time T of the window is calculated according to the above formula (1-1) setTextTime The method comprises the following steps: t is t setTextTime =T realTime -T1-t pauseTotal . Since no pause occurs in the size window in this scenario, T pauseTotal Taking 0, i.e. t setTextTime =T realTime -T1. Similarly, the timing time T of the large window setTextTime Can be expressed as T setTextTime =T realTime -T startTime
Due to T1 and T startTime The time difference is an integer times of jump period, so the timing time of the big window and the timing time of the small window are also an integer times of jump period, and the timing jump of the two is aligned.
Similarly, if the recording start time of the small window and the next transition time (T2) adjacent to the small window are closer in the rule (3), the timing start time of the small window can be delayed by (1- Δt), that is, the timing start time of the small window is synchronously adjusted to T2, so that the timing transitions of the small window and the large window can be synchronously achieved.
That is, for the first scenario, the rule of synchronously adjusting the timing start time of the small window is to judge whether the timing start time of the small window is close to the last jump time of the large window or close to the next jump time of the large window, if the timing start time of the small window is close to the last jump time of the large window, the timing start time of the small window is adjusted to the last jump time of the large window, otherwise, the timing start time of the small window is adjusted to the next jump time of the large window.
When the jump period is 1 second, an error of ±0.5s is caused to the timing start time of the widget based on the adjustment. The method for error correction will be described below, and will not be described in detail here.
According to the timing jump synchronization method provided by the embodiment of the application, the jump frequencies of the two independent timers are adaptively synchronized in the scene of using the two timer controls, so that the two timers can form uniform animation visually, and better interface watching experience is brought to a user.
Scene II: and synchronizing the recording timing starting time of the small window, wherein the time sequence is that the small window starts recording first and the large window starts recording later.
Exemplary, as shown in fig. 5, a schematic diagram of a timing jump synchronization adjustment rule related to scenario two is shown.
In one possible scenario, the user may select the principal mode before the recording function is turned on (e.g., before clicking on the recording control). After the shooting interface displays the large window and the small window simultaneously, the user clicks the recording. At this time, from the perspective of the user, the large window and the small window synchronously start recording. However, the actual recording start timing is: the small window starts recording first, and the large window starts recording later.
In some embodiments, when the widget timer begins to count, the widget may poll the status of the large window, where the polling frequency may be the same as the refresh frequency corresponding to the refresh mechanism, such as once every 200 ms. And when the large window is determined to start recording in the polling process, performing synchronous adjustment timing jump. During the polling process, the small window can inquire whether the large window starts recording, and other timing parameters corresponding to the large windowNumber, e.g. recording start time (T startTime )。
In connection with fig. 5, rules for synchronization adjustment of portlets may include: (1) Calculating the difference between the large window timing start time and the small window timing start time, and taking the remainder of the jump period (1 s) by using the difference to obtain a result startDiff, wherein startDiff (T startTime -t startTime ) %1s; (2) By comparing the size relation of startDiff and 0.5s (half of the jump period), the recording timing starting time T of the large window is judged startTime More closely approach the middle and T of the small window startTime Which time of jump is adjacent to the front and back, namely, judging T startTime Time is closer to time T1 or T startTime The time is closer to the time t 2; (3) When the recording timing of the large window starts to be time T startTime And the AND T in the small window startTime When the adjacent previous jump time (t 1) is closer, the timing start time of the small window is delayed by startDiff, namely, the timing start time of the small window is synchronously adjusted to be t startTime +startdiff; when the recording timing of the large window starts to be time T startTime And the AND T in the small window startTime When the adjacent next jump time (t 2) is closer, the timing starting time of the small window is advanced (1-startDiff), namely, the timing starting time of the small window is synchronously adjusted to be t startTime (1-startDiff)。
That is, when the recording timing start time of the large window is later than the small window, if the timing start time is close to the last jump time of the small window, the recording timing start time of the small window is adjusted backwards to enable the last jump time of the small window to be aligned with the timing start time of the large window; otherwise, the small window recording timing starting time is forward adjusted by (1-startDiff) time length, so that the next jump time of the small window is aligned with the timing starting time of the large window. Here, the previous jump time and the next jump time are relative to the recording timing start time of the large window.
When the jump period is 1 second, an error of ±0.5s (the error value is startDiff or (1-startDiff)) is caused to the timing start time of the widget based on the adjustment. The method for error correction will be described below, and will not be described in detail here.
According to the timing jump synchronization method provided by the embodiment of the application, the jump frequencies of the two independent timers are adaptively synchronized in the scene of using the two timer controls, so that the two timers form uniform animation visually, and better interface watching experience is brought to a user.
Scene III: the pause and record resumption of the large window triggers the small window to start recording, and the recording timing and the starting moment of the small window are synchronized.
Exemplary, as shown in fig. 6 and 7, is a schematic diagram of a timing jump synchronization adjustment rule related to scenario three.
In one possible scenario, the user starts the large window recording (when the main angle mode is not started), after a period of time, the large window recording is paused, the main angle mode is started in the pause process, and when the large window pauses and resumes, the small window is triggered to start recording. At this time, from the perspective of the user, the pause of the large window is resumed and the recording of the small window is started synchronously. However, the actual recording timing can be divided into two types: the method comprises the steps of 1, starting recording by a small window, and recovering recording after a large window; and the time sequence 2 is that the large window resumes recording first, the small window begins recording later, and timing jump exists between the time when the large window resumes recording and the time when the small window begins recording.
For timing 1: when the widget starts recording, i.e. the timer starts counting, the widget may poll the status of the large window, wherein the polling frequency may be the same as the refresh frequency corresponding to the refresh mechanism, such as once every 200 ms. And when the large window is determined to start recording in the polling process, performing synchronous adjustment timing jump. During the polling process, the small window can inquire whether the large window resumes recording, and timing parameters corresponding to the large window, such as resuming recording time.
In connection with fig. 6, rules for synchronization adjustment of portlets may include: (1) Calculating the next theoretical jump time T of the large window according to the inquired timing parameters of the large window nextsetTextTime The method comprises the steps of carrying out a first treatment on the surface of the (2) Calculation ofBig window next theoretical jump time T nextsetTextTime And the difference value of the timing starting time of the small window, and taking the remainder of the jump period (1 s) by using the difference value to obtain a result startDiff, wherein startdiff= (T) nextsetTextTime -t startTime ) %1s; (3) By comparing the size relation of startDiff and 0.5s (half of the jump period), the recording recovery time T of the large window is judged resume More closely approach the middle and T of the small window resume Which time of jump is adjacent; (4) When recording and recovering time T of large window resume And the AND T in the small window resume When the adjacent previous jump time is closer, the timing start time of the small window is delayed by startDiff, namely, the timing start time of the small window is synchronously adjusted to be t startTime +startdiff (the timing time of the windows before and after synchronization for this case can be as shown in fig. 6); when recording and recovering time T of large window resume And the AND T in the small window resume When the adjacent next jump time is closer, the timing starting time of the small window is advanced (1-startDiff), namely, the timing starting time of the small window is synchronously adjusted to be t startTime - (1-startDiff) (the corresponding pre-synchronization and post-synchronization widget timing time for this case may be as shown in fig. 7).
That is, when the next theoretical jump time of the large window is close to one second on the small window, the timing start time of the small window is backwards adjusted to enable the one second on the small window to be aligned with the pause resume time of the large window; otherwise, the timing start time of the small window is adjusted forward by (1-startDiff) time length, so that the next second of the small window (namely, the first timing jump after the small window starts recording) is aligned with the pause resume time of the large window.
It should be noted that, in this scenario, the next theoretical transition time T of the large window is related to nextsetTextTime The specific calculation manner required for calculation is described in detail below and is not described in detail herein.
For timing 2: since the timing jump exists in the large window after the recording is suspended and resumed, the suspension-resume recording brake of the large window has no influence on the state of the small window, so that the resume recording of the large window can be ignored, and the situation is regarded as the situation in the scene one when the large window operates normally and the recording of the small window is synchronous, and the corresponding adjustment rule of the scene one can be adopted at the moment. Reference is specifically made to the above related description, and no further description is given here.
It should be noted that, when the jump period is 1 second, the adjustment manner in the third scenario may cause an error of ±0.5 (the error value is startDiff or (1-startDiff)) to the timing start time of the widget, and the error may need to be corrected later. The method for error correction will be described below, and will not be described in detail here.
According to the timing jump synchronization method provided by the embodiment of the application, the jump frequencies of the two independent timers are adaptively synchronized in the scene of using the two timer controls, so that the two timers form uniform animation visually, and better interface watching experience is brought to a user.
Scene four: the small window pauses the recording due to out-of-focus, and automatically resumes the recording after the focus is restored, and the large window is in a normal recording state in the whole process (namely, the small window timer singly pauses-resumes the recording).
Exemplary, as shown in fig. 8 and 9, is a schematic diagram of a timing jump synchronization adjustment rule related to scenario four.
The rules for synchronization adjustment of portlets for scene four may include: (1) Calculating the next theoretical jump time T of the large window according to the inquired timing parameters of the large window nextsetTextTime The method comprises the steps of carrying out a first treatment on the surface of the (2) Calculating the time length t of the small window recovery time from the next theoretical jump time of the large window resumegap The method comprises the steps of carrying out a first treatment on the surface of the (3) According to the next theoretical jump time T of the large window nextsetTextTime The recovery time of the small window is distant from the time t of the next theoretical jump time of the large window resumegap Recovery time t of small window resume Calculating the time length t needed to be adjusted for the synchronization of the small window resumeDiff Wherein t is resumeDiff =T nextsetTextTime -t resumegap -t resume The method comprises the steps of carrying out a first treatment on the surface of the (4) According to the time length t which needs to be adjusted in the window current synchronization resumeDiff And the total duration t of the actual pause of the widget pauseTotalDuration Calculating the corrected pause total time t of the window synchronization pausefixed Wherein t is pausefixed =t pauseTotalDuration +t resumeDiff
When 0 < t resumeDiff When less than 1, the adjusted correction pauses for a total time t pausefixed Increase t resumeDiff The corresponding synchronized portlet timing time is shown in FIG. 8.
When-1 is less than t resumeDiff When the time is less than or equal to 0, the adjusted correction pause total time t pausefixed Reducing t resumeDiff The corresponding synchronized portlet timing time is shown in FIG. 9.
The above-mentioned correction of the total pause duration can also be regarded as adjusting the timing start time of the widget by t startDiff Duration of time, where t startDiff =t resumeDiff . Specifically, as shown in FIG. 8, when 0 < t resumeDiff When < 1, it can be regarded as delaying the timing start time of the widget by t startDiff Duration of time; as shown in FIG. 9, when-1 < t resumeDiff When the time is less than or equal to 0, the timing starting time of the small window can be regarded as being advanced by t startDiff Duration of time.
It should be noted that, due to uncertainty of operation, t resumeDiff The theoretical value of (1, 1), i.e. compared to the actual total pause time t pauseTotalDuration Corrected pause total time t acquired after small window adjustment pausefixed May increase/decrease, and thus, an error within + -1 s (t resumeDiff )。
According to the timing jump synchronization method provided by the embodiment of the application, the jump frequencies of the two independent timers are adaptively synchronized in the scene of using the two timer controls, so that the two timers form uniform animation visually, and better interface watching experience is brought to a user.
Scene five: and synchronously recovering the small window. After the small window is out of focus and recording is suspended, the large window also suspends recording, then the focus of the small window resumes recording, and the large window resumes recording (the large window resumes recording at the same time).
Exemplary, as shown in fig. 10 and 11, a schematic diagram of a timing jump synchronization adjustment rule related to scenario five is shown.
The rule for performing synchronization adjustment on the widget in the scene five may include: (1) Calculating the recovery time T of a large window resume Duration T from the next theoretical jump time of the large window resumegap The next theoretical jump time of the large window can be understood as "if not paused, the corresponding jump time is recorded normally by the large window" shown in fig. 10 and 11; (2) Calculating the recovery time t of the small window resume Duration t from the next theoretical transition time of the widget resumegap The next theoretical jump time of the widget can be understood as "if not paused," the widget normally records the corresponding jump time "shown in fig. 10 and 11; (3) According to the time length T of the large window recovery time from the next theoretical jump time resumegap Duration t of the next theoretical jump time from the recovery time of the small window resumegap Calculating the time length t needed to be adjusted for the synchronization of the small window rusumeDiff Wherein t is resumeDiff =T resumegap -t resumegap The method comprises the steps of carrying out a first treatment on the surface of the (4) According to the time length t which needs to be adjusted in the window current synchronization rusumeDiff And the total duration t of the actual pause of the widget pauseTotalDuration Calculating the corrected pause total time t of the window synchronization pausefixed Wherein t is pausefixed =t pauseTotalDuration +t rusumeDiff
When 0 < t resumeDiff When less than 1, the adjusted correction pauses for a total time t pausefixed Increase t resumeDiff The corresponding synchronized portlet timing time is shown in FIG. 10.
When-1 is less than t resumeDiff When the time is less than or equal to 0, the adjusted correction pause total time t pausefixed Reducing t resumeDiff The corresponding synchronized portlet timing time is shown in FIG. 11.
The correction of the total pause duration can also be usedThe timing starting time of the small window is regarded as being adjusted by t startDiff Duration of time, where t startDiff =t resumeDiff . Specifically, as shown in FIG. 10, when 0 < t resumeDiff When < 1, it can be regarded as delaying the timing start time of the widget by t startDiff Duration of time; as shown in FIG. 11, when-1 < t resumeDiff When the time is less than or equal to 0, the timing starting time of the small window can be regarded as being advanced by t startDiff Duration of time.
Similar to scenario four, t due to operational uncertainty resumeDiff The theoretical value of (1, 1), i.e. compared to the actual total pause time t pauseTotalDuration Corrected pause total time t acquired after small window adjustment pausefixed May increase/decrease, and thus, an error within + -1 s (t resumeDiff )。
According to the timing jump synchronization method provided by the embodiment of the application, the jump frequencies of the two independent timers are adaptively synchronized in the scene of using the two timer controls, so that the two timers form uniform animation visually, and better interface watching experience is brought to a user.
In the method for timing and synchronous hopping provided by the embodiment of the application, after the small window synchronizes the timing and hopping frequency of the large window, the displayed timing time of the small window has an error with the real recording time, and the error can be accumulated along with each recovery of recording. This problem arises because the small window timer display time needs to be advanced or retarded each time the small window starts recording or resumes recording, depending on the state of the large window. Therefore, in order to make the displayed time closer to the real recording time of the widget, the time needs to be corrected. The error correction method adopted in the timing synchronization jump method provided by the embodiment of the application is specifically described below.
Aiming at errors, the method for timing and synchronizing jump provided by the application has the following solution ideas: the widget timer adds error compensation logic, compensates when the accumulated error exceeds 0.5s (half of the jump period), and the compensation operation forces the widget display time to be 'fast/slow' for 1 second. Through the analysis, the error caused by the synchronous start of the small window is within 0.5s, and the small window accords with the specification and is not adjusted; errors caused by synchronous recovery of the small window are within 1s, and the errors are accumulated, so that compensation is needed.
Specifically, after the nth resume recording of the widget, the display duration (i.e., display time) and the real duration of the widget are as shown in formulas (1-2) and (1-3), respectively:
display duration: t is t setTextTime(n) =t realTime -t startTime -t fixedPauseTotalDuration(n) (1-2)
Real duration: t is t setTextTime(n) ’=t realTime -t startTime -t realPauseTotalDuration(n) (1-3)
The two formulas are subtracted to obtain an error (n) caused by the nth recovery recording, as shown in formulas (1-4):
error(n)=t setTextTime(n) -t setTextTime(n) '=t realPauseTotalDuration(n )-t fixedPauseTotalDuration(n) (1-4)
after the nth recovery recording, the error sum (n) epsilon (-1, 1) is within 0.5s, namely, the error sum (n-1) epsilon (-0.5, 0.5) of the accumulated error sum (n-1) of the previous n-1 recovery recording, so that the total error sum (n) epsilon (-1.5, 1.5). According to the numerical range to which the n total errors sumError (n) specifically belong, the compensation mode can be divided into three cases:
(1) When sumError (n) is E (-0.5, 0.5), the error is within an acceptable range, and no compensation is performed;
(2) When sumError (n) is E (-1.5, -0.5), the compensation measure is to delay for 1s, the error correction is (-0.5+1 ), namely (-0.5, 0.5), and the error specification is met again after compensation;
(3) When sumDiff (n) ∈ (0.5, 1.5), the compensation measure is to advance the display time by 1s, the error correction is (0.5-1, 1.5-1), i.e., (-0.5, 0.5), and the error specification is met again after compensation.
In the embodiment of the application, the timing time of the small window is forced to be 'fast/slow' for 1 second when the error compensation logic is performed. The logic of time display is to round down, and jump is avoided when the time is less than 1 s. Thus, to ensure the correctness of the time increment, the processing may be performed in the following manner in different cases:
mode one: when forced slow for 1s, the final error is (-0.5, 0.5), while when the final error is less than 0, the compensating action may cause the display time to immediately decrease for 1s, visually representing a time "reverse flow". At this time, an additional special condition is needed to be added to overcome the problem that the timing time is not increased, and the special condition is that the timing time after error correction is smaller than the last time value compared with the last time value, the current timing value is not refreshed, the current timing value is kept to be displayed, and the refresh value of the timer is ensured not to be smaller than the last time value.
Mode two: when the time is forced to be adjusted for 1s, the time can be increased immediately for 1s, but because the display logic of the time is an integer and continuous single increment, the timing time is increased immediately for 1s to meet the single increment rule, and no special judgment is needed.
When calculating the adjustment time length of the small window in the fourth scene and the fifth scene, the time length from the recording recovery time to the next theoretical jump time, namely T resumegap And t resumegap . The specific calculation of this parameter is described below.
Exemplary, as shown in fig. 12, a time schematic diagram for calculating a duration from a recording time to a theoretical jump time is provided for assisting in understanding the calculation of the duration from the recording time to the theoretical jump time.
When it should be noted that, the next theoretical jump time in the embodiment of the present application is relative to the resume recording time of the large window and/or the small window, which may specifically be the first timing jump after the resume recording of the large window and/or the small window.
When a large window or a small window is paused, the corresponding T can be determined based on the pause time and the last jump time relative to the pause time resumegap Or t resumegap That is, T can be determined upon suspension resumegap Or t resumegap . Assuming that the current resume recording is the nth time, compared with the last time of the current resume recording The jump time of one time timing is t lastSetTextTime The following cases (taking the timing parameters of the small window as an example) can be classified:
in case 1, there is a timing jump between the present pause time and the last resume time, so that the duration t from the present resume time to the next theoretical jump time resumeGap(n) =1-(t pasuseTime(n) –t lastSetTextTime )。
Wherein, t is as shown in connection with FIG. 12 pasuseTime(n) For the nth pause time, t lastSetTextTime And pausing the corresponding last jump time for the nth time. When the small window is at t pasuseTime(n) When recording is suspended, the time t from the last jump time lastSetTextTime The duration of (2) is as follows: (t) pasuseTime(n) –t lastSetTextTime ) The method comprises the steps of carrying out a first treatment on the surface of the Let t be pasuseTime(n) The time is not paused, and theoretically, the duration from the next jump time should be: 1- (t) pasuseTime(n) –t lastSetTextTime ) Where 1 means a jump period, i.e. 1s. Because the timing time remains unchanged during the pause, the duration from the next jump time still needs 1- (t) after recording is resumed pasuseTime(n) –t lastSetTextTime ) I.e. the time t from the current recovery time to the next theoretical jump time resumeGap(n) =1-(t pasuseTime(n) –t lastSetTextTime )。
In case 2, no timing jump exists between the present pause time and the last resume time, so that the duration t from the present resume time to the next theoretical jump time resumeGap =t resumeGap(n-1) –(t pasuseTime(n) –tr esumeTime(n-1) )。
Wherein, t is shown in connection with FIG. 13 resumeGap(n-1) Is the duration from the (n-1) th pause time to the next theoretical jump time, t pasuseTime(n) Is the nth time of pause, t resumeTime(n-1) The (n-1) th recovery time. When the small window is at t pasuseTime(n-1) When the (n-1) -th pause recording occurs, the corresponding time length t is from the next theoretical jump time resumeGap(n-1) The calculation may be performed in the manner as in case 1.
In case 3, as shown in FIG. 14, there should theoretically be a timing jump (t) between the nth pause time and the (n-1) th resume time setTextTime ) However, since the operation is too fast (the time length from the (n-1) th recovery time to the nth pause time is less than 200ms of the refresh frequency of the timer), the timing time at the nth recovery time should be refreshed immediately to perform timing jump when the program is not yet refreshed esumeGap =0. The instant refresh timing time may be the same as the nth recovery time, or the timing jump may be performed as fast as possible based on the performance limitation.
According to the timing jump synchronization method provided by the embodiment of the application, the jump frequencies of the two independent timers are adaptively synchronized in the scene of using the two timer controls, so that the two timers form uniform animation visually, and better interface use experience is brought to users.
In addition to the timing jump synchronization described above, the method for timing jump synchronization provided by the embodiment of the application can also perform red dot animation synchronization. Exemplary, as shown in fig. 15, a schematic flow chart of a method for timing jump synchronization is provided in the present application.
S1501, the widget timer starts recording or resumes recording.
S1502, the small window red dot animation starts.
S1503, judging whether the large window timer starts recording.
When the large window timer starts recording (i.e., the determination result is yes), step S1504 and step S1505 are executed. When the large window timer does not start recording (i.e., the determination result is no), step S1506 is executed.
S1504, the small-window red dot animation acquires a large-window real-time difference value.
S1505, setting the value of the small-window red-dot animation differentiator to be equal to the value of the large-window real-time differentiator.
In some embodiments, when the timer is in a time state, the small window timer acquires the real-time value of the large window timer red-dot animation differentiator, and then updates the own differentiator value to the value of the large window.
In some embodiments, an android native animation differentiator may be utilized to set an infinite repetition animation with a total duration of 1s, and according to the differentiator change speed, the transparency is updated, and when the differentiator value is less than 0.5, the transparency is set to be greater than 0.5, and when the transparency is set to be 255.
S1506, executing the small window red-spot animation according to a default strategy.
The default policy may be various, such as flashing according to a preset period, which is not limited herein.
According to the timing jump synchronization method provided by the embodiment of the application, through the synchronization of the red point flash of the big and small window timers, unified animation can be formed visually by the two timers, and better interface use experience is brought to users.
Exemplary, as shown in fig. 16, a schematic flow chart of another method for timing jump synchronization is provided in the present application. The process is mainly used for carrying out jump synchronization on the text timing time (or the digital timing time) in the first scene to the fifth scene.
S1601, the widget timer starts counting.
S1602, it is determined whether the large window timer starts counting.
When the large window timer does not start counting (i.e., the judgment result is no), step S1603 is executed; when the large window timer starts counting (i.e., the determination result is yes), step S1604 is performed.
S1603, the widget does not adjust the timing start time, i.e., isstrattimefixed=wire.
S1604, the widget adjusts the timing start time, i.e., isstrattimefix=false.
S1605, it is determined whether pause-resume exists between last and next timed text refresh of the large window.
When there is pause-resume between last and next time of the timed text refresh of the large window (i.e., the judgment result is yes), step S1606 is performed; when there is no pause-resume between the last and the next timed text refresh of the large window (i.e., no in the judgment result), step S1607 is performed.
S1606, the portlet resumes recording without adjusting the timing start time, i.e., fixedstrattimewhanresupe=wire.
S1607, adjusting the timing starting time of the small window to be the last text jumping time of the large window.
S1608, a small window timer (setRecorderTimer) is set.
S1609, judging whether the small window finishes recording.
When the small window finishes recording (namely, the judgment result is yes), ending the flow; when the portlet does not end recording (i.e., no result of determination), step S1610 is executed.
S1610, it is determined whether the widget resumes recording after suspension.
When the small window is paused, recording is resumed (namely, the judgment result is yes), the following steps are executed:
s1611, according to the next time of text refreshing timing time in the large window state calculating period, the total time length of the pause of the small window is adjusted.
S1612, calculating error between timing time of resume display and real recording time length
S1613, calculating and repairing the accumulated error.
When the portlet is not paused, recording is resumed (namely, the judgment result is NO), and the following steps are executed:
s1614, it is determined whether the large window starts recording and the small window does not adjust the timer start time (isstarttimefix=true).
When the large window does not start recording or the small window is adjusted to the timing start time (i.e., the judgment result is no), step S1608 is executed. When the large window starts recording and the small window does not adjust the timing start time (i.e., the determination result is yes), step S1615 is performed.
S1615, the widget does not adjust the timing start time (isstrattimefix=true).
S1616, judging whether the large window resumes recording and the small window resumes recording without adjusting the timing starting time.
When the large window is not restored to record or the small window is restored to record, adjusting the timing starting time (i.e. the judgment result is no), and executing step S1608; when recording is resumed and the widget resumes recording, the timing start time is not adjusted (i.e., the determination result is yes), step S1617 is performed.
S1617, the widget resumes the recording time adjustment timer start time (fixedstrattimewhenresume=false).
S1618, the small window adjusts the timing starting time and keeps the whole second step length with the large window.
After that, step S1608 may be performed. And continuing the dynamic bar to adjust the timing time of the small window so that the timing jump of the small window and the large window are synchronous.
According to the timing jump synchronization method provided by the embodiment of the application, the jump frequencies of the two independent timers are adaptively synchronized in the scene of using the two timer controls, so that the two timers form uniform animation visually, and better interface use experience is brought to users.
Exemplary, as shown in fig. 17, a timing diagram of a method for timing jump synchronization is provided in the present application.
In some embodiments, the large window timer interface implementation class module sends a start timing instruction to the large window timer sub-class module; responding to the timing starting instruction, and sending the timing starting instruction to a timer base class module corresponding to the big window by the big window timer sub-class module; in response to the start timing instruction, the timer base class module performs an operation of refreshing the timing number. The large window timer sub-module sets up an animation differentiator.
On one side of the small window, the small window timer interface realization class module sends a timing starting instruction to the small window timer sub-class module; responding to the starting timing instruction, the small window timer sub-module sets a main timer (namely, a timer of a large window) and sends the starting timing instruction to a timer base class module corresponding to the small window; in response to the start timing instruction, the timer-based class module performs an operation of polling whether the large window starts recording or resumes recording.
And then, the timer base class module corresponding to the small window inquires the timer base class module corresponding to the large window to acquire the digital refreshing time. And the timer base class module corresponding to the small window corrects the timing starting time based on the acquired large window digital refreshing time. The small window timer sub-module inquires the large window timer sub-module to acquire the difference value of the large window, and resets the difference value of the small window timer sub-module according to the difference value of the large window. And refreshing the timing number in the process of correcting the timing starting time by the timer base module corresponding to the small window.
In some embodiments, the large window timer interface implementation class module sends a pause timing instruction to the large window timer sub-class module; responding to the pause timing instruction, and sending the pause timing instruction to a timer base class module corresponding to the big window by the big window timer sub-module; in response to the pause timing instruction, the timer-based class module performs an operation of updating the timing state. The large window timer sub-module pauses the red-dot animation.
On one side of the small window, the small window timer interface realization class module sends a timing suspension instruction to the small window timer sub-class module. And responding to the pause timing instruction, pausing the red-dot animation by the widget timer sub-module, and sending the pause timing instruction to the timer base class module corresponding to the widget. In response to the pause timing instruction, the timer base class module performs calculation of the theoretical time difference t of the first jump after the next recovery resumegap Is performed according to the operation of (a).
In some embodiments, the large window timer interface implementation class module sends a pause resume timing instruction to the large window timer sub-class module; responding to the pause resume timing instruction, and sending a pause resume instruction to a timer base class module corresponding to the big window by the big window timer sub-module; in response to the pause timing instruction, the timer-based class module performs an operation of updating the timing state. The large window timer sub-module resumes the red dot animation.
On one side of the small window, the small window timer interface realization class module sends a pause resume timing instruction to the small window timer sub-class module. And responding to the pause resume timing instruction, and sending the pause resume timing instruction to the timer base class module corresponding to the small window by the small window timer sub-module. Responding to the time-out instruction, the timer base class module corresponding to the small window inquires the timer base class module corresponding to the large window and acquires the latest T of the large window resumegap And starts to execute the operations of correcting the total pause duration and correcting the accumulated error.
In some embodiments, the widget timer sub-module queries and obtains a widget interpolator value from the widget timer sub-module and resets its own animation differentiator according to the widget interpolator value. The timer base module corresponding to the big window executes the operation of refreshing the timing number after recording is resumed, the small window timer sub-module sets the timing number refreshed by the big window to record text, and the timer base module corresponding to the small window executes the operations of updating the timing state and refreshing the timing number.
The application also includes the following embodiments:
in some embodiments, the method for timing jump synchronization provided by the present application is applied to an electronic device, where the electronic device includes a first interface, the first interface includes a master timing and a slave timing, the master timing corresponds to a master timer, and the slave timing corresponds to a slave timer, and the method includes: querying a state of the master timer in response to the slave timer starting to count; when the state of the master timer is recording starting or recording is resumed after suspension, acquiring synchronous adjustment time length of the slave timer according to the timing parameters of the slave timer and the timing parameters of the master timer; and adjusting the timing starting time or the total pause time of the slave timer according to the synchronization adjustment time so that the slave timer and the master timer synchronously jump.
In some embodiments, when the state of the master timer is that recording is started, and the timing start time of the master timer is earlier than the timing start time of the slave timer; or when the master timer resumes timing after suspending, the slave timer starts timing, and the resume time of the master timer is earlier than the start time of the slave timer, the method specifically includes: acquiring a first synchronous adjustment time length, wherein the first synchronous adjustment time length is a difference value obtained by subtracting the timing starting time of the master timer from the timing starting time of the timer; when the first synchronization adjustment time length is smaller than one half of a jump period, increasing the timing starting time of the slave timer by the first synchronization adjustment time length to obtain the adjusted timing starting time of the timer; and when the first synchronization adjustment time length is greater than or equal to half of the jump period, reducing the timing starting time of the slave timer by the first synchronization adjustment time length so as to acquire the adjusted timing starting time of the timer.
In some embodiments, when the state of the master timer is recording start and the timing start time of the master timer is later than the timing start time of the slave timer, the method specifically includes: acquiring a second synchronous adjustment time length which is the difference value of the timing starting time of the master timer minus the timing starting time of the slave timer; when the second synchronous adjustment duration is smaller than half of the jump period, increasing the timing starting time of the slave timer by the second synchronous adjustment duration to obtain the adjusted timing starting time of the timer; and when the second synchronization adjustment time length is greater than or equal to half of the jump period, reducing the timing starting time of the slave timer by the second synchronization adjustment time length so as to acquire the adjusted timing starting time of the timer.
In some embodiments, when the master timer resumes timing after pausing, starting timing from the master timer, and the method specifically comprises: acquiring the next theoretical jump time after the main timer resumes timing; obtaining a third synchronous adjustment time length, wherein the third synchronous adjustment time length is the sum of the difference value of the next theoretical jump time and the timing starting time of the slave timer divided by the jump period; when the third synchronous adjustment duration is smaller than half of the jump period, increasing the timing starting time of the slave timer by the third synchronous adjustment duration to obtain the adjusted timing starting time of the timer; and when the third synchronous adjustment time length is greater than or equal to half of the jump period, reducing the timing starting time of the slave timer by the third synchronous adjustment time length so as to acquire the adjusted timing starting time of the timer.
In some embodiments, when the slave timer resumes counting after pausing, the master timer keeps counting, the method specifically comprises: acquiring the next theoretical jump time of the master timer relative to the recovery time of the slave timer; calculating a first gap duration from the recovery moment of the slave timer to the next theoretical jump moment; acquiring a fourth synchronous adjustment time length which is the difference value obtained by subtracting the first gap time length from the next theoretical jump time and the recovery time of the slave timer; and increasing the pause total time length of the slave timer by the fourth synchronous adjustment time length to acquire the adjusted pause total time length of the slave timer.
In some embodiments, when the master timer and the slave timer both pause and resume counting, the method specifically includes: acquiring the next theoretical jump time after the main timer resumes timing; calculating a second gap duration of the recovery moment of the master timer from the next theoretical jump moment and a third gap duration of the recovery moment of the slave timer from the next theoretical jump moment; obtaining a fifth synchronous adjustment time length, wherein the fifth synchronous adjustment time length is the difference value of the second gap time length minus the third gap time length; and increasing the pause total time length of the slave timer by the fifth synchronous adjustment time length to acquire the adjusted pause total time length of the slave timer.
In some embodiments, the method further comprises: and when the absolute value of the error between the timing time of the slave timer and the real timing time after the multiple adjustment is larger than the jump period, the timing time of the slave timer is fast or slow for a duration corresponding to the jump period.
In some embodiments, when the absolute value of the error between the counted time of the slave timer and the actual counted time after the multiple adjustments is greater than the jump period, the step of delaying the counted time of the slave timer by a duration corresponding to the jump period includes: and when the absolute value of the error between the timing time of the slave timer after the multiple adjustment and the real timing time is larger than the jump period, if the time length corresponding to one jump period is slowed down, the obtained corrected timing time is smaller than the timing time when the slave timer is not corrected, and the timing time when the slave timer is not corrected at present is maintained.
Based on the same technical concept, the embodiment of the application also provides electronic equipment, which comprises one or more processors; one or more memories; the one or more memories store one or more computer programs comprising instructions that, when executed by the one or more processors, cause the computer or processor to perform one or more steps of any of the methods described above.
Based on the same technical idea, the embodiments of the present application further provide a computer-readable storage medium having stored therein computer-executable program instructions, which when executed on a computer, cause the computer or processor to perform one or more steps of any of the methods described above.
Based on the same technical idea, an embodiment of the present application also provides a computer program product containing instructions, the computer program product comprising computer program code which, when run on a computer, causes the computer or processor to perform one or more steps of any one of the methods described above.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.
The foregoing is merely a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited to this, and any changes or substitutions within the technical scope disclosed in the embodiment of the present application should be covered in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for timing jump synchronization, characterized in that the method is applied to an electronic device, the electronic device includes a first interface, the first interface includes a master timing of a first video recording window and a slave timing of a second video recording window, the master timing corresponds to a master timer, and the slave timing corresponds to a slave timer, the method includes:
Querying a state of the first video recording window in response to the starting of the timing from the timer;
when the state of the first video recording window is recording starting or recording is resumed after suspension, acquiring synchronous adjustment duration of the slave timer according to the timing parameters of the slave timer and the timing parameters of the master timer, wherein the synchronous adjustment duration is used for adjusting the timing starting time of the slave timer or the suspension total duration of the slave timer, and aligning the timing jump of the slave timer with the timing jump of a certain time of the master timer; the timing parameters of the slave timer and the master timer include at least one of:
the timing starting time of the master timer, the timing starting time of the slave timer, the hopping time nearest to the timing starting time of the slave timer in the master timer, the hopping period, the timing recovery time of the master timer, the next theoretical hopping time after the master timer recovers timing, the next theoretical hopping time of the master timer relative to the timing recovery time of the slave timer, the timing recovery time of the slave timer and the next theoretical hopping time after the slave timer recovers timing;
Taking the timing of the master timer as a reference frame, not performing synchronous adjustment, and reducing or increasing the timing starting time of the slave timer according to the synchronous adjustment duration; or increasing the total pause duration of the slave timer according to the synchronization adjustment duration, so that the slave timer and the master timer synchronously jump.
2. The method of claim 1, wherein when the master timer remains clocked and a timing start time of the master timer is earlier than a timing start time of the slave timer; or when the master timer is resumed after being suspended, the slave timer starts to count, and the count resume time of the master timer is earlier than the count start time of the slave timer, and there is a count jump between the count resume time of the master timer and the count start time of the slave timer, the method specifically includes:
acquiring a first synchronous adjustment time length, wherein the first synchronous adjustment time length is a difference value obtained by subtracting the timing starting time of the master timer from the timing starting time of the timer;
when the first synchronization adjustment time length is smaller than one half of the jump period, increasing the timing starting time of the slave timer by the first synchronization adjustment time length to acquire the adjusted timing starting time of the slave timer;
And when the first synchronization adjustment time length is greater than or equal to half of the jump period, reducing the timing starting time of the slave timer by the first synchronization adjustment time length so as to acquire the adjusted timing starting time of the slave timer.
3. The method according to claim 1, wherein when the master timer and the slave timer start to count and the count start time of the master timer is later than the count start time of the slave timer, the method specifically comprises:
acquiring a second synchronous adjustment time length which is the difference value of the timing starting time of the master timer minus the timing starting time of the slave timer;
when the second synchronous adjustment duration is smaller than half of the jump period, increasing the timing starting time of the slave timer by the second synchronous adjustment duration to acquire the adjusted timing starting time of the slave timer;
and when the second synchronization adjustment time length is greater than or equal to half of the jump period, reducing the timing starting time of the slave timer by the second synchronization adjustment time length so as to acquire the adjusted timing starting time of the slave timer.
4. The method according to claim 1, wherein when the master timer resumes counting after suspension, the slave timer starts counting, the count-up time of the master timer is earlier than the count-up time of the slave timer, and there is no count jump between the count-up time of the master timer and the count-up time of the slave timer, the method specifically comprises:
acquiring the next theoretical jump time after the main timer resumes timing;
acquiring a third synchronous adjustment time length, wherein the third synchronous adjustment time length is the remainder of the jump period by the difference value between the next theoretical jump time and the timing starting time of the slave timer;
when the third synchronous adjustment duration is smaller than half of the jump period, increasing the timing starting time of the slave timer by the third synchronous adjustment duration to obtain the adjusted timing starting time of the slave timer;
and when the third synchronous adjustment time length is greater than or equal to half of the jump period, reducing the timing starting time of the slave timer by the third synchronous adjustment time length so as to acquire the adjusted timing starting time of the slave timer.
5. The method according to claim 1, wherein when the slave timer resumes counting after suspension, the master timer keeps counting, the method comprises in particular:
acquiring the next theoretical jump time of the master timer relative to the timing recovery time of the slave timer;
calculating a first gap duration from the timing recovery moment of the slave timer to the next theoretical jump moment;
acquiring a fourth synchronous adjustment time length which is the difference value obtained by subtracting the first gap time length from the next theoretical jump time and the timing recovery time of a slave timer;
and increasing the pause total time length of the slave timer by the fourth synchronous adjustment time length to acquire the adjusted pause total time length of the slave timer.
6. The method according to claim 1, characterized in that when the master timer and the slave timer both pause and resume counting, the method comprises in particular:
acquiring the next theoretical jump time after the main timer resumes timing;
calculating a second gap duration of the timing recovery time of the master timer from the next theoretical jump time after the master timer recovers timing, and a third gap duration of the timing recovery time of the slave timer from the next theoretical jump time after the slave timer recovers timing;
Obtaining a fifth synchronous adjustment time length, wherein the fifth synchronous adjustment time length is the difference value of the second gap time length minus the third gap time length;
and increasing the pause total time length of the slave timer by the fifth synchronous adjustment time length to acquire the adjusted pause total time length of the slave timer.
7. The method according to any one of claims 1-6, further comprising:
and when the absolute value of the accumulated error between the timing time of the slave timer and the real timing time is larger than the jump period after the timing starting time or the pause total time of the slave timer is adjusted for a plurality of times, the timing time of the slave timer is adjusted to be faster or slower by the time corresponding to the jump period.
8. The method of claim 7, wherein the method further comprises:
and if the time length corresponding to one jump period is slowed down, the obtained corrected timing time is smaller than the timing time when the time is not corrected, and the timing time when the time is not corrected currently is kept.
9. An electronic device, comprising:
one or more processors;
one or more memories;
the one or more memories store one or more computer programs comprising instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any of claims 1-8.
10. A computer readable storage medium storing computer executable program instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 8.
CN202210715521.XA 2022-05-30 2022-06-23 Timing jump synchronization method and electronic equipment Active CN116030846B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210603470 2022-05-30
CN2022106034701 2022-05-30

Publications (2)

Publication Number Publication Date
CN116030846A CN116030846A (en) 2023-04-28
CN116030846B true CN116030846B (en) 2023-10-20

Family

ID=86071033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210715521.XA Active CN116030846B (en) 2022-05-30 2022-06-23 Timing jump synchronization method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116030846B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005300255A (en) * 2004-04-08 2005-10-27 Seiko Precision Inc Clocking system for game, and time synchronization method
CN1920965A (en) * 2002-12-26 2007-02-28 株式会社日立制作所 Writing method and disk recording apparatus
CN102439857A (en) * 2009-05-21 2012-05-02 摩托罗拉移动公司 A mobile computing device and method with enhanced poling management
CN103023694A (en) * 2012-11-27 2013-04-03 中国科学院声学研究所 Cooperative start method and system for dual management boards in advanced telecom computing architecture (ATCA)
CN107155129A (en) * 2017-04-23 2017-09-12 佛山市高明区云大机械科技有限公司 A kind of video clocking method
CN110495220A (en) * 2017-03-31 2019-11-22 中兴通讯股份有限公司 The method and apparatus synchronous for low-power device
CN111367930A (en) * 2020-03-03 2020-07-03 深圳大学 Method, device, equipment and medium for synchronizing block chain transaction pool information
CN113612884A (en) * 2021-07-14 2021-11-05 荣耀终端有限公司 Method for implementing shutdown alarm clock, electronic device and computer readable storage medium
CN113949918A (en) * 2021-07-29 2022-01-18 努比亚技术有限公司 Picture-in-picture display method, terminal and storage medium
CN114302021A (en) * 2021-04-30 2022-04-08 海信视像科技股份有限公司 Display device and sound picture synchronization method
WO2022089216A1 (en) * 2020-10-28 2022-05-05 华为技术有限公司 Interface display method and electronic device
CN114510183A (en) * 2022-01-26 2022-05-17 荣耀终端有限公司 Dynamic effect duration management method and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130173742A1 (en) * 2011-12-28 2013-07-04 United Video Properties, Inc. Systems and methods for latency-based synchronized playback at multiple locations
US9654817B2 (en) * 2012-01-27 2017-05-16 Avaya Inc. System and method to synchronize video playback on mobile devices

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1920965A (en) * 2002-12-26 2007-02-28 株式会社日立制作所 Writing method and disk recording apparatus
JP2005300255A (en) * 2004-04-08 2005-10-27 Seiko Precision Inc Clocking system for game, and time synchronization method
CN102439857A (en) * 2009-05-21 2012-05-02 摩托罗拉移动公司 A mobile computing device and method with enhanced poling management
CN103023694A (en) * 2012-11-27 2013-04-03 中国科学院声学研究所 Cooperative start method and system for dual management boards in advanced telecom computing architecture (ATCA)
CN110495220A (en) * 2017-03-31 2019-11-22 中兴通讯股份有限公司 The method and apparatus synchronous for low-power device
CN107155129A (en) * 2017-04-23 2017-09-12 佛山市高明区云大机械科技有限公司 A kind of video clocking method
CN111367930A (en) * 2020-03-03 2020-07-03 深圳大学 Method, device, equipment and medium for synchronizing block chain transaction pool information
WO2022089216A1 (en) * 2020-10-28 2022-05-05 华为技术有限公司 Interface display method and electronic device
CN114302021A (en) * 2021-04-30 2022-04-08 海信视像科技股份有限公司 Display device and sound picture synchronization method
CN113612884A (en) * 2021-07-14 2021-11-05 荣耀终端有限公司 Method for implementing shutdown alarm clock, electronic device and computer readable storage medium
CN113949918A (en) * 2021-07-29 2022-01-18 努比亚技术有限公司 Picture-in-picture display method, terminal and storage medium
CN114510183A (en) * 2022-01-26 2022-05-17 荣耀终端有限公司 Dynamic effect duration management method and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
施利萍 ; 赵建宏 ; .高速跳频网络中时间同步的研究与实现.计算机工程与科学.2019,(第05期),61-67. *

Also Published As

Publication number Publication date
CN116030846A (en) 2023-04-28

Similar Documents

Publication Publication Date Title
EP4044609A1 (en) Cross-device content projection method and electronic device
WO2020108356A1 (en) Application display method and electronic device
WO2022257977A1 (en) Screen projection method for electronic device, and electronic device
US20220165191A1 (en) Frequency Adjustment Method and Apparatus Applied to Terminal, and Electronic Device
CN114089933B (en) Display parameter adjusting method, electronic device, chip and readable storage medium
CN114449599B (en) Network link switching method based on electronic equipment position and electronic equipment
US11831713B2 (en) Distributed service scheduling method and related apparatus
EP4184905A1 (en) Device recognition method and related apparatus
WO2022156721A1 (en) Photographing method and electronic device
JP7193647B2 (en) Connection establishment method and terminal device
CN116055874B (en) Focusing method and electronic equipment
WO2020142997A1 (en) Random access method and apparatus
US20230335081A1 (en) Display Synchronization Method, Electronic Device, and Readable Storage Medium
CN116030846B (en) Timing jump synchronization method and electronic equipment
WO2022166435A1 (en) Picture sharing method and electronic device
EP4246921A1 (en) Chat interaction method, electronic device, and server
CN114830608A (en) Multiplexing method and terminal for multiple HTTP channels
CN115514882A (en) Distributed shooting method, electronic device and medium
WO2023011220A1 (en) Data synchronisation method, terminal, and system
CN116723382B (en) Shooting method and related equipment
CN114845035B (en) Distributed shooting method, electronic equipment and medium
CN114630007B (en) Display synchronization method, electronic device and readable storage medium
CN113254409B (en) File sharing method, system and related equipment
WO2022111701A1 (en) Screen projection method and system
WO2023160224A9 (en) Photographing method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant