WO2018113119A1 - 一种数据同步方法、装置以及终端设备 - Google Patents

一种数据同步方法、装置以及终端设备 Download PDF

Info

Publication number
WO2018113119A1
WO2018113119A1 PCT/CN2017/078278 CN2017078278W WO2018113119A1 WO 2018113119 A1 WO2018113119 A1 WO 2018113119A1 CN 2017078278 W CN2017078278 W CN 2017078278W WO 2018113119 A1 WO2018113119 A1 WO 2018113119A1
Authority
WO
WIPO (PCT)
Prior art keywords
sleep
time
time period
synchronization
period
Prior art date
Application number
PCT/CN2017/078278
Other languages
English (en)
French (fr)
Inventor
陆晨曦
张俪耀
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201780009105.5A priority Critical patent/CN108601559B/zh
Priority to US16/472,896 priority patent/US10791517B2/en
Publication of WO2018113119A1 publication Critical patent/WO2018113119A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0212Power saving arrangements in terminal devices managed by the network, e.g. network or access point is master and terminal is slave
    • H04W52/0216Power saving arrangements in terminal devices managed by the network, e.g. network or access point is master and terminal is slave using a pre-established activity schedule, e.g. traffic indication frame
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/48Other medical applications
    • A61B5/4806Sleep evaluation
    • A61B5/4809Sleep detection, i.e. determining whether a subject is asleep or not
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/38Services specially adapted for particular environments, situations or purposes for collecting sensor information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • 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

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a data synchronization method, apparatus, and terminal device.
  • Sleep monitoring is an important technology in today's sleep medicine. During sleep, depending on the depth of sleep, sleep state can be divided into fast eye movement period and non-rapid eye movement period.
  • the first terminal device may collect feature data such as physiological data or motion data of the user for sleep staging analysis to obtain a sleep stage of the user, that is, determine a sleep state of the user at different time periods.
  • the first terminal device is portable and small in size, but the computing power of the processor included in the first terminal device and the storage space of the memory included in the first terminal device are often insufficient to support sleep staging analysis.
  • the first terminal device may synchronize the feature data to a second terminal device such as a smart phone or a computer, and perform sleep stage analysis on the feature data through the second terminal device to obtain a refined sleep staging.
  • a second terminal device such as a smart phone or a computer
  • sleep stage analysis of the second terminal device if the received sleep time period corresponding to the feature data sent by the first terminal device is short, for example, the feature data is collected in a sleep period less than 1 hour, then The second terminal device cannot acquire the sleep stage of the user.
  • the embodiment of the invention discloses a data synchronization method, device and terminal device, which can avoid the feature data that cannot support the effective sleep staging by synchronization, and improve the data synchronization efficiency.
  • the embodiment of the present invention provides a data synchronization method, where a first terminal device can receive time interval information sent by a second terminal device, where time interval information includes a synchronization start time and a synchronization termination time, where the first terminal device is And storing, in the stored sleep time information, a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization end time, the time period set includes at least one sleep time period, and the first terminal device determines that the sleep duration is greater than the first time in the time period set.
  • the sleep period is four preset thresholds, and the first terminal device sends the feature data collected in the determined sleep period to the second terminal device.
  • the first terminal device determines, in the time period set, a sleep time period in which the sleep duration is greater than the fourth preset threshold, and further sends the feature data collected in the determined sleep time period to the second terminal device,
  • the traditional data synchronization method sends the feature data collected in the sleep period of the time period to the second terminal device.
  • the embodiment of the present invention can avoid the feature data that cannot support the effective sleep staging and improve the data synchronization efficiency. .
  • the feature data may include physiological data or motion data of the user.
  • the physiological data may include the user's heart rate information, the degree of snoring, the blood pressure value, or the respiratory airflow, and the like.
  • the motion data may include the magnitude, frequency, or time of displacement of the user's limbs, and the user's limbs may include the chest, abdomen, hands, feet, or eyes, and the like.
  • the time period set may further include at least one time of entering and leaving the sleep period, where the first terminal device acquires a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization end time in the stored sleep time information.
  • the sleep time period of the time period set that satisfies the preset rule and the adjacent sleep time period may be combined to obtain the updated sleep time period.
  • the first terminal device determines, in the time period set, that the sleep duration is greater than the fourth pre-
  • the sleep period of the threshold may be specifically: determining, in the updated sleep period, a sleep period in which the sleep duration is greater than a fourth preset threshold.
  • the sleep time period may indicate a time period in which the user is in the awake state, and the first terminal device may change the sleep time of the user from the sleep state to the awake state as the sleep start time of the sleep time period, and the user is awake.
  • the sleep time in which the state transitions to the sleep state is the sleep-out time of the entry and exit sleep period.
  • the user transitions from the sleep state to the awake state due to external factors during sleep, the sleep time period in the awake state is short, and the sleep time period continues to enter the sleep state (ie, the night), for example,
  • the user hears the alarm ringing while sleeping, and then goes to sleep after turning off the alarm ringing; and if the user gets up in the toilet because of the emergency, he goes to sleep after going to the toilet.
  • the first terminal device may combine the sleep-out time period that satisfies the preset rule with the sleep time period adjacent to the sleep-sleeping period, so that the second terminal device performs sleep staging analysis based on the combined sleep time period, which can be improved. The accuracy of sleep staging analysis.
  • the first terminal device combines the falling and falling time period of the time period set that meets the preset rule and the adjacent sleep time period to obtain the updated sleep time period, which may be: when the time period set is When the sleep time of the sleep time period is less than the first preset threshold, the first terminal device may determine that the sleep time period satisfies the preset rule, and enters the sleep time period, the previous sleep time period adjacent to the sleep time period, and The next sleep period adjacent to the sleep period is combined to obtain an updated sleep period.
  • the sleep time period may indicate a time period in which the user is in a sleep state, and the first terminal device may change the sleep time of the user from the awake state to the sleep state as the sleep start time of the sleep period, and convert the user from the sleep state to the awake state.
  • the state of sleep time is the sleep end time of the sleep period.
  • the first terminal device may determine that the user is changed from the sleep state to the awake state due to external factors, and remains short-lived. After the awake state continues to enter the sleep state, in order to prevent the second terminal device from going to the previous sleep period adjacent to the sleep period, and the next sleep period adjacent to the sleep period as two different sleeps, the first terminal device may Combining the sleep time period, the previous sleep time period adjacent to the sleep time period, and the next sleep time period adjacent to the sleep time period to obtain an updated sleep time period, so that the second terminal device is based on the updated sleep.
  • the analysis of sleep stages during the time period can improve the accuracy of sleep stage analysis.
  • the first terminal device determines that the sleep time period satisfies the preset rule when the sleep time of the sleep time period is less than the first preset threshold, where the first terminal device determines that the first terminal device determines The sleep time period is in the first preset time range, and when the sleep time of the sleep time period is less than the second preset threshold corresponding to the first preset time range, the first terminal device determines that the sleep time period satisfies the preset rule.
  • the night time of the user is different in different preset time ranges, for example, the user has a short start time in the daytime, and the user has a long night time in the night, and the first terminal device can establish the pre-time.
  • the corresponding relationship between the time range and the preset threshold is set, for example, the preset threshold corresponding to the first preset time range is a second preset threshold, and the preset threshold corresponding to the second preset time range is a third preset threshold, then After the terminal device determines that the sleep time period is within the first preset time range, when the sleep time of the sleep time period is less than the second preset threshold corresponding to the first preset time range, the first terminal device may determine The sleep time period satisfies the preset rules.
  • the embodiment of the invention can effectively identify whether the previous sleep time period adjacent to the sleep time period and the next sleep time period adjacent to the sleep time period are the same sleep period, and can improve the precision of the combination of the sleep time period.
  • the first terminal device may determine the sleep start time in the sleep and fall time information according to the synchronization start time, and determine the sleep time information according to the synchronization termination time. Sleep termination time. Further, the first terminal device obtains a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization termination time in the stored sleep time information, which may be: the first terminal device obtains the sleep time information A set of time periods greater than or equal to the sleep start time and less than or equal to the sleep end time.
  • the first terminal device determines the sleep start time in the sleep time information according to the synchronization start time, where the first terminal device may use the synchronization start time as the sleep start time or the sleep time information.
  • the first sleep time in the sleep time is the sleep start time in the sleep time.
  • the first terminal device determines, according to the synchronization start time, the sleep start time in the sleep time information, which may be: when the synchronization start time is earlier than the first sleep time in the sleep time information, A terminal device may use the first sleep time as the sleep start time; when the synchronization start time is later than the first sleep time in the sleep time information, the first terminal device may use the synchronization start time as the sleep start time. time.
  • the first terminal device determines the sleep start time in the sleep and fall time information according to the synchronization termination time. Specifically, the first terminal device uses the last sleep time in the sleep time information as the sleep termination time.
  • the first terminal device determines the sleep start time in the sleep and fall time information according to the synchronization termination time, where the first terminal may be: when the synchronization termination time is earlier than the last sleep time in the sleep time information, the first terminal The device may use the synchronization termination time as the sleep termination time; when the synchronization termination time is later than the last sleepout time in the sleep-out time information, the first terminal device may use the last sleep-out time as the sleep start time.
  • an embodiment of the present invention provides a computer storage medium, where the computer storage medium stores a program, and the program includes all or part of the steps of the data synchronization method provided by the first aspect of the embodiment of the present invention.
  • an embodiment of the present invention provides a data synchronization apparatus, where the data synchronization apparatus includes a module for performing the data synchronization method disclosed in the first aspect of the embodiment of the present invention.
  • an embodiment of the present invention provides a terminal device, including: a processor, a memory, and a transceiver, wherein the memory stores a set of program codes, and the processor calls the program code stored in the memory, and is configured to execute the following: operating:
  • time interval information sent by the second terminal device, where the time interval information includes a synchronization start time and a synchronization termination time;
  • the feature data collected during the determined sleep time period is sent to the second terminal device, and the feature data includes physiological data or motion data of the user.
  • FIG. 1 is a schematic structural diagram of a data synchronization system according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a data synchronization method according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an interface for entering and going to sleep time information according to another embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a data synchronization apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
  • FIG. 1 is a schematic structural diagram of a data synchronization system according to an embodiment of the present invention.
  • the data synchronization system may include at least one first terminal device 10 and a second terminal device 20.
  • the first terminal device 10 can establish a wired communication connection with the second terminal device 20 through a twisted pair or a universal serial bus (USB), etc.
  • the first terminal device 10 can also be connected via Bluetooth or A radio communication connection is established between the radio frequency identification (RFID) and the like and the second terminal device 20.
  • RFID radio frequency identification
  • the first terminal device 10 can be configured with a sensor and a Photo Plethysmo Graph (PPG) module.
  • the sensor may be used to collect motion data of the user. For example, when the displacement amplitude, frequency or time of the user's limb collected by the sensor is greater than a preset threshold, the user may be determined to be in a state of being asleep (ie, awake state); When the displacement amplitude, frequency or time is less than or equal to the preset threshold, it can be determined that the user is in a sleep state.
  • the first terminal device 10 can control the LED light contained in the PPG module, the light penetrates the human blood vessel and reflects the light, and the regular contraction of the blood vessel caused by the pulse of the human body changes the intensity of the reflected light, thereby Obtain physiological data such as heart rate information.
  • the first terminal device 10 can be a wearable, patched or implantable terminal device. If the first terminal device 10 is a wearable terminal device, the first terminal device 10 can be worn to a part of the human body, such as a wrist, an arm, an ankle or a waist. If the first terminal device 10 is a patch terminal device, the first terminal device 10 can be attached to a part of the human body, such as an arm, abdomen, a neck or a head. If the first terminal device 10 is an implantable terminal device, the first terminal device 10 can be implanted into a part of the human body, such as a wrist, an arm, a head or a back, by invasive means such as injection.
  • the second terminal device 20 may include a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, or a personal computer.
  • a smart phone such as an Android mobile phone, an iOS mobile phone, etc.
  • a tablet computer such as an iPad, Samsung Galaxy Tab, etc.
  • a personal computer such as an Apple MacBook Air, etc.
  • FIG. 2 is a schematic diagram of a data synchronization method according to an embodiment of the present invention. The method includes, but is not limited to, the following steps:
  • Step S201 The second terminal device sends time interval information to the first terminal device, where the time interval information includes a synchronization start time and a synchronization termination time.
  • the time interval information may be sent to the first terminal device, where the time interval information may include a synchronization start time and a synchronization termination time.
  • the time interval information may be generated, where the time interval information includes a synchronization start time of 3:00.
  • the interval termination time included in the interval information is 8:00.
  • the second terminal device may use the end time point of the sleep time segment corresponding to the feature data as the synchronization start time in the current data synchronization process.
  • the current system time is used as the synchronization termination time in the current data synchronization process
  • the synchronization termination time submitted in the previous data synchronization process is used as the synchronization start time in the current data synchronization process.
  • the terminal device misses the feature data that needs to be synchronized to ensure that the first terminal device feeds back all the met characteristic data in the time interval indicated by the time interval information to the second terminal device.
  • the first terminal device may determine the sleep start time in the sleep and fall time information according to the synchronization start time, and determine the sleep time information according to the synchronization termination time. Sleep termination time.
  • the first terminal device can determine the sleep time from the awake state to the sleep state and the sleep time from the sleep state to the awake state according to the sleep and fall time information.
  • the sleep start time is determined in the sleep-in time information according to the synchronization start time
  • the sleep end time is determined in the sleep-sleep time information according to the synchronization end time.
  • the first terminal device may use the synchronization start time as the sleep start time; or use the first sleep time in the sleep time information as the sleep start time.
  • the first terminal device can compare the synchronization start time with each sleep-sleeping time, and take the sleep time with the smallest difference from the synchronization start time as the exit time.
  • the starting point of the sleep time information that is, the first sleep time included in the sleep time information is the sleep time with the smallest difference from the synchronization start time, and the first terminal device can enter the sleep time information.
  • a sleep time is used as the sleep start time.
  • the first terminal device can also directly use the synchronization start time as the sleep start time.
  • the first terminal device may use the first sleep time as the sleep start time; when the synchronization start time is later than the sleep time When the first sleep time in the time information, the first terminal device can use the synchronization start time as the sleep start time.
  • the first terminal device can use the sleep time that minimizes the difference between the synchronization start time as the starting point of the outgoing sleep time information, that is, the sleep time information.
  • the first sleep time included is the sleep time with the smallest difference from the synchronization start time.
  • the first terminal device can determine that the synchronization start time is earlier than The first sleep time, and then the first sleep time as the sleep start time; when the synchronization start time is after the first sleep time, the first terminal device can determine that the synchronization start time is later than the first sleep time And then the synchronization start time is taken as the sleep start time.
  • the first terminal device may use the last sleep time in the sleep time information as the sleep end time.
  • the first terminal device can compare the synchronization termination time with each sleep time, and use the sleep time with the smallest difference between the synchronization termination times as the output.
  • the end point of the sleep time information that is, the last sleep time included in the sleep time information is the sleep time with the smallest difference from the synchronization end time, and the first terminal device can use the last sleep time as sleep. stop the time.
  • the first terminal device may use the synchronization termination time as the sleep termination time; when the synchronization termination time is later than the last in the sleep time information
  • the first terminal device can use the last sleep time as the sleep start time.
  • the first terminal device can use the sleep time that minimizes the difference between the synchronization termination time as the termination point of the outgoing sleep time information, when the synchronization termination time is located.
  • the first terminal device may determine that the synchronization termination time is earlier than the last sleep time, and then use the synchronization termination time as the sleep termination time; when the synchronization termination time is after the last sleep time, the first terminal device may determine that the synchronization termination time is late. At the last sleep time, the last sleep time is taken as the sleep termination time.
  • the first terminal device may delete the last acquired sleep time information, so that the stored sleep time information is the latest one.
  • the sleep time information can expand the storage space of the first terminal device.
  • Step S202 The first terminal device acquires, in the stored sleep and fall time information, a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization termination time.
  • the first terminal device may acquire, in the stored sleep and fall time information, a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization termination time.
  • the time period set may include at least one sleep time period.
  • the first terminal device can obtain a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization termination time in the sleep time information, and the time period set includes
  • the sleep period may include: a time period between the synchronization start time and the first sleep time, a time period between the second sleep time and the second sleep time, and a third sleep time and the third The time period between the three sleep periods.
  • the first terminal device determines the sleep start time in the sleep and fall time information according to the synchronization start time, and after determining the sleep termination time in the sleep and fall time information according to the synchronization termination time, may be in the sleep and fall time information, A set of time periods greater than or equal to the sleep start time and less than or equal to the sleep end time is obtained.
  • the first terminal device uses the synchronization start time as the sleep start time, and uses the last sleep time as the sleep termination time, and can be in the sleep time information.
  • Obtaining a time period set that is greater than or equal to the sleep start time and less than or equal to the sleep end time, and the sleep time period included in the time period set may include: a time period between the synchronization start time time and the first sleep time, The time period between the two sleep time and the second sleep time, and the time period between the third sleep time and the third sleep time.
  • the time period set may further include at least one sleep time period.
  • the time period of the sleep period included in the time set may include: the first sleep The time period between the time and the second sleep time, and the time period between the second sleep time and the third sleep time.
  • the first terminal device may satisfy the preset sleep time period in the time period set.
  • the adjacent sleep time periods are combined to obtain an updated sleep time period. For example, during the sleep process, the user changes from the sleep state to the awake state due to external factors, the sleep time period in the awake state is short, and the sleep time period continues to enter the sleep state after the sleep time period arrives, and the first terminal device passes the pre-configured state.
  • the sensor detects that the user has two sleep periods, but in fact, the user has a short sleep time period in the awake state, and the two sleep periods can be considered as the same sleep period. Based on this, the first terminal device can take time.
  • the outgoing sleep period that satisfies the preset rule in the segment set and its adjacent sleep time period are combined to obtain the updated sleep time period.
  • the first terminal device may determine that the sleep time period satisfies the preset rule, and then enters the sleep time period and the out The previous sleep time period adjacent to the sleep period and the next sleep time period adjacent to the sleep time period are combined to obtain an updated sleep time period.
  • the first preset threshold may be a preset duration, such as 20 min or 1 h, and the like.
  • the first preset threshold is 20 minutes, and the first terminal device can determine that the time period between the first sleep time and the second sleep time is the sleep time period.
  • the first sleep time is 3:00, and the second sleep time is 3:10, the first terminal device can determine that the sleep time of the sleep time period is the difference between the second sleep time and the first sleep time.
  • the first terminal device may determine that the sleep time of the sleep time period is less than a first preset threshold, and further determine that the sleep time period meets a preset rule, and the sleep time period and the sleep time a previous sleep time period adjacent to the time period (ie, a time period between the sleep start time and the first sleep time), and a subsequent sleep time period adjacent to the sleep time period (ie, the second sleep time and the second time)
  • the time periods between the sleep periods are combined to obtain an updated sleep time period, wherein the sleep time of the updated sleep time period is the same as the sleep start time in the sleep time information, and the updated sleep The time between the sleep period and a sleep time information in the same second sleep time.
  • the first preset threshold is 20 minutes
  • the first terminal device can determine that the time period between the second sleep time and the third sleep time is the sleep time period.
  • the second sleep time is 7:00
  • the third sleep time is 9:00
  • the first terminal device can determine that the sleep time of the sleep time period is the difference between the third sleep time and the second sleep time.
  • the value, that is, 2h the first terminal device can determine that the sleep time of the sleep time period is greater than the first preset threshold, and further determine that the sleep time period does not satisfy the preset rule, the first terminal device can keep the sleep.
  • the sleep period adjacent to the time period is unchanged, that is, the sleep time period adjacent to the sleep period is not updated.
  • the first terminal device may determine that the sleep time period is within a first preset time range, and determine that when the sleep time of the sleep time period is less than a second preset threshold corresponding to the first preset time range.
  • the sleep time period satisfies the preset rules.
  • the first terminal device may determine that the sleep time period is within a second preset time range, and determine that when the sleep time of the sleep time period is less than a third preset threshold corresponding to the second preset time range.
  • the sleep time period satisfies the preset rules.
  • the length of the night time of the user in different time ranges is different.
  • the user has a small duration in the daytime and a long time in the night.
  • the first terminal device can be configured with the first pre-preparation.
  • the time range and the corresponding second preset threshold, and the second preset time range and the corresponding third preset threshold are set.
  • the first terminal device can configure the first preset time range to be 20:00-6: 00, the second preset threshold is 1h, the second preset time range is 6:00 to 20:00, and the third preset threshold is 20 minutes.
  • the time period between the first sleep time and the second sleep time is the sleep time period
  • the first sleep time is 3:00
  • the second sleep time is If the ratio is 3:10
  • the first terminal device can determine that the sleep time period is within the first preset time range, and the sleep time of the sleep time period is the difference between the second sleep time and the first sleep time.
  • the value, that is, 10 minutes the first terminal device may determine that the sleep time of the sleep time period is less than a second preset threshold, and further determine that the sleep time period satisfies the preset rule.
  • the time period between the second sleep time and the third sleep time is the sleep time period
  • the second sleep time is 7:00
  • the third sleep time is 9:00
  • the first terminal device can determine that the sleep time period is within a second preset time range
  • the sleep time of the sleep time period is the difference between the third sleep time and the second sleep time.
  • the value, that is, 2h the first terminal device may determine that the sleep time of the sleep time period is greater than a third preset threshold, and further determine that the sleep time period does not satisfy the preset rule.
  • Step S203 The first terminal device determines, in the time period set, the sleep time that the sleep duration is greater than the fourth preset threshold. segment.
  • the first terminal device may determine, in the time period set, the sleep time that the sleep duration is greater than the fourth preset threshold. segment.
  • the fourth preset threshold may be a preset duration, such as 3h or 4h.
  • the fourth preset threshold is 2h, and the first terminal device can determine that the time period between the sleep start time and the first sleep time is a sleep time period.
  • the sleep duration of the sleep period is 1 h, and the first terminal device may determine that the sleep duration of the sleep period is less than a fourth preset threshold.
  • the first terminal device may further determine that the time period between the second sleep time and the second sleep time is a sleep time period, and the sleep time of the sleep time period is 3 hours, and the first terminal device may determine the sleep of the sleep time period.
  • the duration is greater than the fourth preset threshold.
  • the first terminal device may further determine that the time period between the third sleep time and the third sleep time is a sleep time period, and the sleep time of the sleep time period is 0.5 h, the first terminal device may determine the sleep time period.
  • the sleep duration is less than the fourth preset threshold.
  • the first terminal device combines the falling and falling time period of the time period set that meets the preset rule and the adjacent sleep time period, and after obtaining the updated sleep time period, may be in the updated sleep time period.
  • a sleep period in which the sleep duration is greater than a fourth predetermined threshold is determined. Taking the schematic diagram of the sleep and fall time information shown in FIG. 3 as an example, the first terminal device determines that the time period between the first sleep time and the second sleep time is the sleep time period, and the sleep time period satisfies the preset rule.
  • the first terminal device may combine the sleep time period, the previous sleep time period adjacent to the sleep time period, and the next sleep time period adjacent to the sleep time period to obtain a new sleep time period;
  • the first terminal device determines that the time period between the second sleep time and the third sleep time is a sleep time period, and the sleep time period does not satisfy the preset rule, and the first terminal device can maintain the sleep time
  • the sleep time period adjacent to the segment is unchanged, and the first terminal device can determine that the updated sleep time period includes a time period between the sleep start time and the second sleep time, and the third sleep time and the third time
  • the time interval between sleep time, the fourth preset threshold is 2h
  • the sleep duration between the sleep start time and the second sleep time is 4.17h
  • the time period between the sleep time is 0.5h
  • the first terminal device can determine that the sleep duration of the time period between the sleep start time and the second sleep time is greater than a fourth preset threshold
  • the third sleep time is The sleep duration of the time period between
  • Step S204 The first terminal device sends the feature data collected in the determined sleep time period to the second terminal device.
  • the feature data collected in the determined sleep time period may be sent to the second terminal device.
  • the first terminal device determines that the sleep duration of the time period between the sleep start time and the first sleep time is less than a fourth preset threshold.
  • the first terminal device may further determine that the time period between the second sleep time and the second sleep time is a sleep time period, and the sleep time of the sleep time period is 3 hours, the first terminal device may determine that the sleep time period is greater than the first time Four preset thresholds are sent to the second terminal device for the feature data collected during the sleep period.
  • the first terminal device may further determine that the time period between the third sleep time and the third sleep time is a sleep time period, and the sleep time of the sleep time period is 0.5 h, the first terminal device may determine that the sleep time period is smaller than
  • the fourth preset threshold is configured to send the feature data collected during the sleep period to the second terminal device.
  • the time interval information sent by the second terminal device is received, where the time interval information includes a synchronization start time and a synchronization termination time, and in the stored sleep time information, the synchronization start time is greater than or equal to And the time period set that is less than or equal to the synchronization termination time, the sleep time period in which the sleep duration is greater than the fourth preset threshold is determined in the time period set, and the feature data collected in the determined sleep time period is sent to the second terminal device, where Avoid synchronization feature data that cannot support effective sleep staging, and improve data synchronization efficiency.
  • FIG. 4 is a schematic structural diagram of a data synchronization apparatus according to an embodiment of the present invention.
  • the data synchronization apparatus may include an interval information receiving module 401, a set obtaining module 402, a time period determining module 403, and a feature data sending module. 404, wherein the detailed description of each module is as follows.
  • the interval information receiving module 401 is configured to receive time interval information sent by the second terminal device, where the time interval information includes a synchronization start time and a synchronization termination time.
  • the set obtaining module 402 is configured to obtain, in the stored outgoing sleep time information, a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization end time, and the time period set includes at least one sleep time period.
  • the time period determining module 403 is configured to determine, in the time period set, a sleep time period in which the sleep duration is greater than a fourth preset threshold.
  • the feature data sending module 404 is configured to send the feature data collected in the determined sleep time period to the second terminal device, where the feature data includes physiological data or motion data of the user.
  • the time period set further includes at least one sleep time period
  • the device may further include:
  • a time period merging module 405, configured to: after the time interval set that is greater than or equal to the synchronization start time and less than or equal to the synchronization termination time, the set obtaining module 402 acquires the time period The outgoing sleep period that satisfies the preset rule in the segment set and its adjacent sleep time period are combined to obtain the updated sleep time period.
  • time period determining module 403 is specifically configured to:
  • a sleep period in which the sleep duration is greater than the fourth preset threshold is determined in the updated sleep period.
  • time period merging module 405 is specifically configured to:
  • the outgoing sleep time period, the previous sleep time period adjacent to the outgoing sleep time period, and the next sleep time period adjacent to the outgoing sleep time period are combined to obtain the updated sleep time period.
  • the time period merging module 405 determines that the sleep time period meets the preset rule when the sleep time of the sleep time period in the time period set is less than a first preset threshold, to:
  • the sleep time period is within a first preset time range.
  • the device may further include:
  • a time determining module 406 after the interval information receiving module 401 receives the time interval information sent by the second terminal device, determining a sleep start time in the outgoing sleep time information according to the synchronization start time, and A sleep end time is determined in the sleep-in time information according to the synchronization end time.
  • collection obtaining module 402 is specifically configured to:
  • a time period set equal to or greater than the sleep start time and less than or equal to the sleep end time is acquired.
  • the time determining module 406 determines, in the sleep and fall time information, the sleep start time according to the synchronization start time, which may be specifically:
  • the synchronization start time is taken as the sleep start time, or the first sleep time in the sleep time information is taken as the sleep start time.
  • the time determining module 406 determines a sleep start time in the stored sleep time information according to the synchronization start time, specifically for:
  • the first sleep time is taken as the sleep start time.
  • the synchronization start time is taken as the sleep start time.
  • the time determining module 406 determines a sleep start time in the outgoing sleep time information according to the synchronization termination time, specifically for:
  • the last sleep time in the sleep time information is taken as the sleep end time.
  • the time determining module 406 determines a sleep start time in the outgoing sleep time information according to the synchronization termination time, specifically for:
  • the synchronization termination time is taken as the sleep termination time.
  • the last sleep time is taken as the sleep start time.
  • the interval information receiving module 401 receives time interval information sent by the second terminal device, where the time interval information includes a synchronization start time and a synchronization termination time, and the set acquisition module 402 stores the sleep time in the sleep.
  • a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization termination time is obtained, and the time period determining module 403 determines, in the time period set, a sleep time period in which the sleep duration is greater than the fourth preset threshold, and the feature data sending module 404
  • the feature data collected in the determined sleep time period is sent to the second terminal device, so that the feature data that cannot support the effective sleep staging can be avoided, and the data synchronization efficiency is improved.
  • FIG. 5 is a terminal device, which includes a processor 501, a memory 502, a transceiver 503, a sensor 504, and a PPG module 505.
  • the processor 501 and the memory 502 are provided.
  • the transceiver 503, the sensor 504, and the PPG module 505 are connected to each other through a bus.
  • the memory 502 includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an Erasable Programmable Read Only Memory (EPROM), or A Compact Disc Read-Only Memory (CD-ROM) for storing related commands and data, such as sleep time information and feature data.
  • the transceiver 503 is configured to receive and send data, for example, receive time interval information sent by the second terminal device, or send feature data and the like collected in the determined sleep time period to the second terminal device.
  • the processor 501 can be one or more Central Processing Units (CPUs), or one Or multiple Microcontroller Units (MCUs). In the case where the processor 501 is a CPU, the CPU may be a single core CPU or a multi-core CPU.
  • CPUs Central Processing Units
  • MCUs Microcontroller Units
  • the sensor 504 can be an accelerometer, a gyroscope or a vibration sensor, etc., and can acquire the motion state of the associated part of the user.
  • the PPG module 505 can emit light through the LED, the light penetrates the human blood vessel and reflects the light, and the regular contraction of the blood vessel generated by the human pulse changes the intensity of the reflected light, thereby obtaining physiological data such as heart rate information.
  • the processor 501 in the terminal device is configured to read the program code stored in the memory 502, and perform the following operations:
  • the time interval information sent by the second terminal device is received by the transceiver 503, where the time interval information includes a synchronization start time and a synchronization termination time.
  • a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization end time is acquired, and the time period set includes at least one sleep time period.
  • a sleep period in which the sleep duration is greater than a fourth preset threshold is determined in the set of time periods.
  • the feature data collected during the determined sleep period is transmitted to the second terminal device by the transceiver 503, and the feature data includes physiological data or motion data of the user.
  • the time period set further includes at least one sleep time period
  • the processor 501 acquires, in the stored sleep time information, a time greater than or equal to the synchronization start time and less than or equal to the synchronization end time.
  • the processor 501 determines, in the time period set, a sleep time period in which the sleep duration is greater than the fourth preset threshold, which may be specifically:
  • a sleep period in which the sleep duration is greater than the fourth preset threshold is determined in the updated sleep period.
  • the processor 501 combines the sleep-sleeping time period that satisfies the preset rule in the time-segment set and the adjacent sleep time period to obtain the updated sleep time period, which may be:
  • the outgoing sleep time period, the previous sleep time period adjacent to the outgoing sleep time period, and the next sleep time period adjacent to the outgoing sleep time period are combined to obtain the updated sleep time period.
  • the processor 501 determines that the falling and falling time period satisfies the preset rule when the sleep time of the sleep time period in the time period set is less than a first preset threshold, which may be:
  • the sleep time period is within a first preset time range.
  • the processor 501 receives the time interval information sent by the second terminal device by using the transceiver 503, the following operations may also be performed:
  • the processor 501 obtains, in the stored sleep time information, a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization termination time, and may be specifically:
  • a time period set equal to or greater than the sleep start time and less than or equal to the sleep end time is acquired.
  • the processor 501 determines, in the sleep and fall time information, the sleep start time according to the synchronization start time, which may be specifically:
  • the synchronization start time is taken as the sleep start time, or the first sleep time in the sleep time information is taken as the sleep start time.
  • the processor 501 determines, in the sleep and fall time information, the sleep start time according to the synchronization start time, which may be specifically:
  • the first sleep time is taken as the sleep start time.
  • the synchronization start time is taken as the sleep start time.
  • the processor 501 determines, in the sleep and fall time information, the sleep start time according to the synchronization termination time, which may be specifically:
  • the last sleep time in the sleep time information is taken as the sleep end time.
  • the processor 501 determines, in the sleep and fall time information, the sleep start time according to the synchronization termination time, which may be specifically:
  • the synchronization termination time is taken as the sleep termination time.
  • the last sleep time is taken as the sleep start time.
  • the processor 501 receives the time interval information sent by the second terminal device by using the transceiver 503, where the time interval information includes a synchronization start time and a synchronization termination time.
  • the stored sleep time information Obtaining a time period set that is greater than or equal to the synchronization start time and less than or equal to the synchronization termination time, and determining, in the time period set, a sleep time period in which the sleep duration is greater than a fourth preset threshold, and the transceiver 503 collects the determined sleep time period.
  • the feature data is sent to the second terminal device, which avoids synchronizing the feature data that cannot support the effective sleep staging, and improves the data synchronization efficiency.
  • the program can be stored in a computer readable storage medium, when the program is executed
  • the flow of the method embodiments as described above may be included.
  • the foregoing storage medium includes various media that can store program codes, such as a ROM or a random access memory RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Animal Behavior & Ethology (AREA)
  • Biomedical Technology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Medical Informatics (AREA)
  • Biophysics (AREA)
  • Surgery (AREA)
  • Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Physics & Mathematics (AREA)
  • Anesthesiology (AREA)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)
  • Telephone Function (AREA)

Abstract

本发明实施例公开了一种数据同步方法、装置及相关设备,所述方法包括:接收第二终端设备发送的时间区间信息,时间区间信息包括同步起始时间和同步终止时间,在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合,时间段集合包括至少一个睡眠时间段,在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段,将在确定的睡眠时间段采集到的特征数据发送给第二终端设备。采用本发明实施例,可避免同步无法支持有效睡眠分期的特征数据,提高数据同步效率。

Description

一种数据同步方法、装置以及终端设备 技术领域
本申请涉及通信技术领域,尤其涉及一种数据同步方法、装置以及终端设备。
背景技术
睡眠监测是当今睡眠医学中的一项重要技术,在睡眠过程中,根据睡眠深度的不同,可以将睡眠状态划分为快速眼动期与非快速眼动期。第一终端设备可以采集用户的生理数据或者运动数据等特征数据进行睡眠分期分析,以获取用户的睡眠分期,即确定用户在不同时间段的睡眠状态。第一终端设备便于携带且体积较小,但是第一终端设备所包含的处理器的运算能力以及第一终端设备所包含的存储器的存储空间往往不足以支撑睡眠分期分析。为了避免上述缺陷,第一终端设备可以将特征数据同步到智能手机或者计算机等第二终端设备中,通过第二终端设备对特征数据进行睡眠分期分析,获得精细化的睡眠分期。第二终端设备进行睡眠分期分析的过程中,如果接收到的第一终端设备发送的特征数据对应的睡眠时间段较短,例如,特征数据是在小于1小时的睡眠时间段采集到的,则第二终端设备无法获取用户的睡眠分期。
发明内容
本发明实施例公开了一种数据同步方法、装置以及终端设备,可避免同步无法支持有效睡眠分期的特征数据,提高数据同步效率。
第一方面,本发明实施例提供了一种数据同步方法,第一终端设备可以接收第二终端设备发送的时间区间信息,时间区间信息包括同步起始时间和同步终止时间,第一终端设备在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合,时间段集合包括至少一个睡眠时间段,第一终端设备在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段,进而第一终端设备将在确定的睡眠时间段采集到的特征数据发送给第二终端设备。
在该技术方案中,第一终端设备在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段,进而将在确定的睡眠时间段采集到的特征数据发送给第二终端设备,相对传统的数据同步方法将在该时间段集合所包含的所有睡眠时间段采集到的特征数据发送给第二终端设备,本发明实施例可避免同步无法支持有效睡眠分期的特征数据,提高数据同步效率。
其中,特征数据可以包括用户的生理数据或者运动数据。例如,生理数据可以包括用户的心率信息、鼾声程度、血压值或者呼吸气流等。运动数据可以包括用户肢体的位移幅度、频率或者时间等,用户肢体可以包括胸、腹、手、脚或者眼睛等。
可选的,时间段集合还可以包括至少一个出入睡时间段,则第一终端设备在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合之后,可以将时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段。进一步的,第一终端设备在时间段集合中确定睡眠时长大于第四预 设阈值的睡眠时间段,具体可以为:在更新后的睡眠时间段中确定睡眠时长大于第四预设阈值的睡眠时间段。
其中,出入睡时间段可以表示用户处于清醒状态的时间段,第一终端设备可以将用户由睡眠状态转换为清醒状态的出睡时间作为出入睡时间段的出入睡起始时间,将用户由清醒状态转换为睡眠状态的入睡时间作为该出入睡时间段的出入睡终止时间。
在该技术方案中,用户在睡眠过程中因为外界因素由睡眠状态转换为清醒状态,处于清醒状态的出入睡时间段较短,出入睡时间段到达之后继续进入睡眠状态(即起夜),例如用户在睡觉时听到闹钟铃声,关闭闹钟铃声之后继续睡觉;又如用户因为内急起床上厕所,在上完厕所之后继续睡觉。基于此,第一终端设备可以将满足预置规则的出入睡时间段和该出入睡时间段相邻的睡眠时间段进行合并,以便第二终端设备基于合并后的睡眠时间段进行睡眠分期分析,可提高睡眠分期分析的精准度。
可选的,第一终端设备将时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段,具体可以为:当时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,第一终端设备可以确定出入睡时间段满足预置规则,将出入睡时间段、与出入睡时间段相邻的前一个睡眠时间段、与出入睡时间段相邻的后一个睡眠时间段进行合并,得到更新后的睡眠时间段。
其中,睡眠时间段可以表示用户处于睡眠状态的时间段,第一终端设备可以将用户由清醒状态转换为睡眠状态的入睡时间作为睡眠时间段的睡眠起始时间,将用户由睡眠状态转换为清醒状态的出睡时间作为该睡眠时间段的睡眠终止时间。
在该技术方案中,当时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,第一终端设备可以确定用户是因为外界因素由睡眠状态转换为清醒状态,且保持短暂的清醒状态之后继续进入睡眠状态的,为了避免第二终端设备将出入睡时间段相邻的前一个睡眠时间段,以及出入睡时间段相邻的后一个睡眠时间段作为两段不同的睡眠,第一终端设备可以将出入睡时间段、与出入睡时间段相邻的前一个睡眠时间段、与出入睡时间段相邻的后一个睡眠时间段进行合并,得到更新后的睡眠时间段,以便第二终端设备基于更新后的睡眠时间段进行睡眠分期分析,可提高睡眠分期分析的精准度。
可选的,当时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,第一终端设备确定出入睡时间段满足所述预置规则,具体可以为:第一终端设备确定出入睡时间段位于第一预设时间范围内,当出入睡时间段的出入睡时长小于第一预设时间范围对应的第二预设阈值时,第一终端设备确定出入睡时间段满足预置规则。
在该技术方案中,不同预设时间范围内用户的起夜时间各不相同,例如用户在白天的起夜时间较短,用户在晚上的起夜时间较长,则第一终端设备可以建立预设时间范围和预设阈值的对应关系,例如第一预设时间范围对应的预设阈值为第二预设阈值,第二预设时间范围对应的预设阈值为第三预设阈值,则第一终端设备确定出入睡时间段位于第一预设时间范围内之后,当出入睡时间段的出入睡时长小于第一预设时间范围对应的第二预设阈值时,第一终端设备可以确定出入睡时间段满足预置规则。本发明实施例可有效识别出入睡时间段相邻的前一个睡眠时间段,以及出入睡时间段相邻的后一个睡眠时间段是否为同一段睡眠,可提高睡眠时间段合并的精准度。
可选的,第一终端设备接收第二终端设备发送的时间区间信息之后,可以根据同步起始时间在出入睡时间信息中确定睡眠起始时间,并根据同步终止时间在出入睡时间信息中确定睡眠终止时间。进一步的,第一终端设备在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合,具体可以为:第一终端设备在出入睡时间信息中,获取大于等于睡眠起始时间且小于等于睡眠终止时间的时间段集合。
可选的,第一终端设备根据同步起始时间在出入睡时间信息中确定睡眠起始时间,具体可以为:第一终端设备将同步起始时间作为睡眠起始时间,或者将出入睡时间信息中的第一个入睡时间作为睡眠起始时间。
可选的,第一终端设备根据同步起始时间在出入睡时间信息中确定睡眠起始时间,具体可以为:当同步起始时间早于出入睡时间信息中的第一个入睡时间时,第一终端设备可以将第一个入睡时间作为睡眠起始时间;当同步起始时间晚于出入睡时间信息中的第一个入睡时间时,第一终端设备可以将同步起始时间作为睡眠起始时间。
可选的,第一终端设备根据同步终止时间在出入睡时间信息中确定睡眠起始时间,具体可以为:第一终端设备将出入睡时间信息中的最后一个出睡时间作为睡眠终止时间。
可选的,第一终端设备根据同步终止时间在出入睡时间信息中确定睡眠起始时间,具体可以为:当同步终止时间早于出入睡时间信息中的最后一个出睡时间时,第一终端设备可以将同步终止时间作为睡眠终止时间;当同步终止时间晚于出入睡时间信息中的最后一个出睡时间时,第一终端设备可以将最后一个出睡时间作为睡眠起始时间。
第二方面,本发明实施例提供一种计算机存储介质,所述计算机存储介质存储有程序,所述程序执行时包括本发明实施例第一方面提供的数据同步方法中全部或部分的步骤。
第三方面,本发明实施例提供一种数据同步装置,该数据同步装置包括用于执行本发明实施例第一方面公开的数据同步方法的模块。
第四方面,本发明实施例提供一种终端设备,其特征在于,包括处理器、存储器以及收发器,存储器中存储一组程序代码,且处理器调用存储器中存储的程序代码,用于执行以下操作:
接收第二终端设备发送的时间区间信息,时间区间信息包括同步起始时间和同步终止时间;
在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合,时间段集合包括至少一个睡眠时间段;
在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段;
将在确定的睡眠时间段采集到的特征数据发送给第二终端设备,特征数据包括用户的生理数据或者运动数据。
附图说明
为了更清楚地说明本发明实施例或背景技术中的技术方案,下面将对本发明实施例或 背景技术中所需要使用的附图进行说明。
图1是本发明实施例公开的一种数据同步系统的架构示意图;
图2是本发明实施例公开的一种数据同步方法的流程示意图;
图3是本发明另一实施例公开的一种出入睡时间信息的界面示意图;
图4是本发明实施例公开的一种数据同步装置的结构示意图;
图5是本发明实施例公开的一种终端设备的结构示意图。
具体实施方式
下面结合本发明实施例中的附图对本发明实施例进行描述。
请参见图1,图1是本发明实施例提供的一种数据同步系统的架构示意图,该数据同步系统可以包括至少一个第一终端设备10以及第二终端设备20。第一终端设备10可以通过双绞线或者通用串行总线(Universal Serial Bus,USB)等和第二终端设备20之间建立有线通信连接,可选的,第一终端设备10也可以通过蓝牙或者无线射频识别(Radio Frequency Identification,RFID)等和第二终端设备20之间建立无线通信连接。
第一终端设备10可以配置有传感器和光电容积描记(Photo Plethysmo Graph,PPG)模组。具体实现中,传感器可以用于采集用户的运动数据,例如通过传感器采集到用户肢体的位移幅度、频率或者时间大于预设门限时,可以确定用户处于出睡状态(即苏醒状态);当用户肢体的位移幅度、频率或者时间小于等于预设门限时,可以确定用户处于入睡状态。当用户处于入睡状态时,第一终端设备10可以控制PPG模组所包含的LED发光,光线穿透人体血管并反射光,人体脉搏产生的血管规律性收缩会使反射光的强度产生变化,从而获得心率信息等生理数据。
第一终端设备10可以为穿戴式、贴片式或者植入式终端设备。若第一终端设备10为穿戴式终端设备,则第一终端设备10可用以佩戴至人体的一部位上,例如手腕、手臂、脚踝或者腰部等。若第一终端设备10为贴片式终端设备,则第一终端设备10可用以贴附至人体的一部位上,例如手臂、腹部、颈部或者头部等。若第一终端设备10为植入式终端设备,则第一终端设备10可透过例如注射等侵入方式植入至人体的一部位中,例如手腕、手臂、头部或者背部等。
第二终端设备20可以包括智能手机(如Android手机、iOS手机等)、平板电脑或个人计算机等。
基于图1所示的数据同步系统的架构示意图,请参见图2,图2是本发明实施例提供的一种数据同步方法,该方法包括但不限于如下步骤:
步骤S201:第二终端设备向第一终端设备发送时间区间信息,时间区间信息包括同步起始时间和同步终止时间。
具体实现中,第二终端设备需要获取用户的特征数据时,可以向第一终端设备发送时间区间信息,时间区间信息可以包括同步起始时间和同步终止时间。例如,第二终端设备需要获取用户在3:00~8:00这一时间段的特征数据时,可以生成时间区间信息,其中时间区间信息所包含的同步起始时间为3:00,该时间区间信息所包含的同步终止时间为8:00。
可选的,第二终端设备在上一次接收到第一终端设备发送的特征数据之后,可以将该特征数据对应的睡眠时间段的结束时间点作为本次数据同步过程中的同步起始时间,将当前系统时间作为本次数据同步过程中的同步终止时间,相对将上一次数据同步过程中提交的同步终止时间作为本次数据同步过程中的同步起始时间,本发明实施例可避免第一终端设备遗漏需要同步的特征数据,以确保第一终端设备将时间区间信息所指示的时间区间内的所有满足要求的特征数据反馈给第二终端设备。
可选的,第一终端设备接收第二终端设备发送的时间区间信息之后,可以根据同步起始时间在出入睡时间信息中确定睡眠起始时间,并根据同步终止时间在出入睡时间信息中确定睡眠终止时间。以图3所示的出入睡时间信息的示意图为例,第一终端设备可以根据出入睡时间信息确定由清醒状态转换为睡眠状态的入睡时间,以及由睡眠状态转换为清醒状态的出睡时间,进而根据同步起始时间在该出入睡时间信息中确定睡眠起始时间,根据同步终止时间在出入睡时间信息中确定睡眠终止时间。
可选的,第一终端设备可以将同步起始时间作为睡眠起始时间;或者将出入睡时间信息中的第一个入睡时间作为睡眠起始时间。以图3所示的出入睡时间信息的示意图为例,第一终端设备可以将同步起始时间与各个入睡时间进行比较,将与同步起始时间之间的差值最小的入睡时间作为该出入睡时间信息的起始点,即出入睡时间信息所包含的第一个入睡时间为与同步起始时间之间的差值最小的入睡时间,进而第一终端设备可以将出入睡时间信息中的第一个入睡时间作为睡眠起始时间,可选的,第一终端设备也可以直接将同步起始时间作为睡眠起始时间。
可选的,当同步起始时间早于出入睡时间信息中的第一个入睡时间时,第一终端设备可以将第一个入睡时间作为睡眠起始时间;当同步起始时间晚于出入睡时间信息中的第一个入睡时间时,第一终端设备可以将同步起始时间作为睡眠起始时间。以图3所示的出入睡时间信息的示意图为例,第一终端设备可以将与同步起始时间之间的差值最小的入睡时间作为该出入睡时间信息的起始点,即出入睡时间信息所包含的第一个入睡时间为与同步起始时间之间的差值最小的入睡时间,当同步起始时间位于第一个入睡时间之前时,第一终端设备可以确定同步起始时间早于第一个入睡时间,进而将第一个入睡时间作为睡眠起始时间;当同步起始时间位于第一个入睡时间之后时,第一终端设备可以确定同步起始时间晚于第一个入睡时间,进而将同步起始时间作为睡眠起始时间。
可选的,第一终端设备可以将出入睡时间信息中的最后一个出睡时间作为睡眠终止时间。以图3所示的出入睡时间信息的示意图为例,第一终端设备可以将同步终止时间与各个出睡时间进行比较,将与同步终止时间之间的差值最小的出睡时间作为该出入睡时间信息的终止点,即出入睡时间信息所包含的最后一个出睡时间为与同步终止时间之间的差值最小的出睡时间,进而第一终端设备可以将最后一个出睡时间作为睡眠终止时间。
可选的,当同步终止时间早于出入睡时间信息中的最后一个出睡时间时,第一终端设备可以将同步终止时间作为睡眠终止时间;当同步终止时间晚于出入睡时间信息中的最后一个出睡时间时,第一终端设备可以将最后一个出睡时间作为睡眠起始时间。以图3所示的出入睡时间信息的示意图为例,第一终端设备可以将与同步终止时间之间的差值最小的出睡时间作为该出入睡时间信息的终止点,当同步终止时间位于最后一个出睡时间之前时, 第一终端设备可以确定同步终止时间早于最后一个出睡时间,进而将同步终止时间作为睡眠终止时间;当同步终止时间位于最后一个出睡时间之后时,第一终端设备可以确定同步终止时间晚于最后一个出睡时间,进而将最后一个出睡时间作为睡眠终止时间。
可选的,第二终端设备在上一次接收到第一终端设备发送的特征数据之后,第一终端设备可以删除上一次获取到的出入睡时间信息,以便存储的出入睡时间信息为最新的出入睡时间信息,可扩大第一终端设备的存储空间。
步骤S202:第一终端设备在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合。
具体实现中,第一终端设备接收到第二终端设备发送的时间区间信息之后,可以在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合。其中,时间段集合可以包括至少一个睡眠时间段。以图3所示的出入睡时间信息的示意图为例,第一终端设备可以在出入睡时间信息中获取大于等于同步起始时间且小于等于同步终止时间的时间段集合,该时间段集合所包含的睡眠时间段可以包括:同步起始时间与第一个出睡时间之间的时间段,第二个入睡时间与第二个出睡时间之间的时间段,以及第三个入睡时间与第三个出睡时间之间的时间段。
可选的,第一终端设备根据同步起始时间在出入睡时间信息中确定睡眠起始时间,并根据同步终止时间在出入睡时间信息中确定睡眠终止时间之后,可以在出入睡时间信息中,获取大于等于睡眠起始时间且小于等于睡眠终止时间的时间段集合。以图3所示的出入睡时间信息的示意图为例,第一终端设备将同步起始时间作为睡眠起始时间,并将最后一个出睡时间作为睡眠终止时间之后,可以在出入睡时间信息中获取大于等于睡眠起始时间且小于等于睡眠终止时间的时间段集合,该时间段集合所包含的睡眠时间段可以包括:同步起始时间时间与第一个出睡时间之间的时间段,第二个入睡时间与第二个出睡时间之间的时间段,以及第三个入睡时间与第三个出睡时间之间的时间段。
可选的,时间段集合还可以包括至少一个出入睡时间段,以图3所示的出入睡时间信息的示意图为例,时间段集合所包含的出入睡时间段可以包括:第一个出睡时间与第二个入睡时间之间的时间段,以及第二个出睡时间与第三个入睡时间之间的时间段。
进一步的,第一终端设备在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合之后,可以将时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段。举例来说,用户在睡眠过程中因为外界因素由睡眠状态转换为清醒状态,处于清醒状态的出入睡时间段较短,出入睡时间段到达之后继续进入睡眠状态,第一终端设备通过预先配置的传感器检测到用户对应有两个睡眠时间段,但实际上用户处于清醒状态的出入睡时间段较短,可以认为上述两个睡眠时间段为同一段睡眠,基于此,第一终端设备可以将时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段。
可选的,当时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,第一终端设备可以确定出入睡时间段满足预置规则,进而将出入睡时间段、与该出入睡时间段相邻的前一个睡眠时间段、与该出入睡时间段相邻的后一个睡眠时间段进行合并,得到更新后的睡眠时间段。第一预设阈值可以为预先设定的时长,例如20min或者1h等。
以图3所示的出入睡时间信息的示意图为例,第一预设阈值为20min,第一终端设备可以确定第一出睡时间与第二入睡时间之间的时间段为出入睡时间段,第一出睡时间为3:00,第二入睡时间为3:10,则第一终端设备可以确定该出入睡时间段的出入睡时长为第二入睡时间与第一出睡时间之间的差值,即10min,第一终端设备可以确定该出入睡时间段的出入睡时长小于第一预设阈值,进而确定该出入睡时间段满足预置规则,将该出入睡时间段、与该出入睡时间段相邻的前一个睡眠时间段(即睡眠起始时间与第一个出睡时间之间的时间段)、与该出入睡时间段相邻的后一个睡眠时间段(即第二个入睡时间与第二个出睡时间之间的时间段)进行合并,得到更新后的睡眠时间段,其中更新后的睡眠时间段的入睡时间与出入睡时间信息中的睡眠起始时间相同,更新后的睡眠时间段的出睡时间与出入睡时间信息中的第二个出睡时间相同。
以图3所示的出入睡时间信息的示意图为例,第一预设阈值为20min,第一终端设备可以确定第二出睡时间与第三入睡时间之间的时间段为出入睡时间段,第二出睡时间为7:00,第三入睡时间为9:00,则第一终端设备可以确定该出入睡时间段的出入睡时长为第三入睡时间与第二出睡时间之间的差值,即2h,第一终端设备可以确定该出入睡时间段的出入睡时长大于第一预设阈值,进而确定该出入睡时间段不满足预置规则,则第一终端设备可以保持该出入睡时间段相邻的睡眠时间段不变,即不对该出入睡时间段相邻的睡眠时间段进行更新。
可选的,第一终端设备可以确定出入睡时间段位于第一预设时间范围内,当出入睡时间段的出入睡时长小于第一预设时间范围对应的第二预设阈值时,确定出入睡时间段满足预置规则。
可选的,第一终端设备可以确定出入睡时间段位于第二预设时间范围内,当出入睡时间段的出入睡时长小于第二预设时间范围对应的第三预设阈值时,确定出入睡时间段满足预置规则。
举例来说,用户在不同时间范围内的起夜时长各不相同,例如用户在白天的起夜时长较小,在晚上的起夜时长较大,基于此,第一终端设备可以配置第一预设时间范围及其对应的第二预设阈值,以及第二预设时间范围及其对应的第三预设阈值,例如第一终端设备可以配置第一预设时间范围为20:00~6:00,第二预设阈值为1h,第二预设时间范围为6:00~20:00,第三预设阈值为20min。以图3所示的出入睡时间信息的示意图为例,第一出睡时间与第二入睡时间之间的时间段为出入睡时间段,第一出睡时间为3:00,第二入睡时间为3:10,则第一终端设备可以确定该出入睡时间段位于第一预设时间范围内,该出入睡时间段的出入睡时长为第二入睡时间与第一出睡时间之间的差值,即10min,则第一终端设备可以确定该出入睡时间段的出入睡时长小于第二预设阈值,进而确定该出入睡时间段满足预置规则。以图3所示的出入睡时间信息的示意图为例,第二出睡时间与第三入睡时间之间的时间段为出入睡时间段,第二出睡时间为7:00,第三入睡时间为9:00,则第一终端设备可以确定该出入睡时间段位于第二预设时间范围内,该出入睡时间段的出入睡时长为第三入睡时间与第二出睡时间之间的差值,即2h,则第一终端设备可以确定该出入睡时间段的出入睡时长大于第三预设阈值,进而确定该出入睡时间段不满足预置规则。
步骤S203:第一终端设备在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间 段。
第一终端设备在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合之后,可以在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段。第四预设阈值可以为预先设定的时长,例如3h或者4h。以图3所示的出入睡时间信息的示意图为例,第四预设阈值为2h,第一终端设备可以确定睡眠起始时间与第一出睡时间之间的时间段为睡眠时间段,该睡眠时间段的睡眠时长为1h,则第一终端设备可以确定该睡眠时间段的睡眠时长小于第四预设阈值。第一终端设备还可以确定第二入睡时间与第二出睡时间之间的时间段为睡眠时间段,该睡眠时间段的睡眠时长为3h,则第一终端设备可以确定该睡眠时间段的睡眠时长大于第四预设阈值。第一终端设备还可以确定第三入睡时间与第三出睡时间之间的时间段为睡眠时间段,该睡眠时间段的睡眠时长为0.5h,则第一终端设备可以确定该睡眠时间段的睡眠时长小于第四预设阈值。
可选的,第一终端设备将时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段之后,可以在更新后的睡眠时间段中确定睡眠时长大于第四预设阈值的睡眠时间段。以图3所示的出入睡时间信息的示意图为例,第一终端设备确定第一出睡时间与第二入睡时间之间的时间段为出睡时间段,该出睡时间段满足预置规则,则第一终端设备可以将该出睡时间段,与该出睡时间段相邻的前一个睡眠时间段,以及与该出睡时间段相邻的后一个睡眠时间段进行合并,得到新的睡眠时间段;另外,第一终端设备确定第二出睡时间与第三入睡时间之间的时间段为出睡时间段,该出睡时间段不满足预置规则,则第一终端设备可以保持该出睡时间段相邻的睡眠时间段不变,进而第一终端设备可以确定更新后的睡眠时间段包括睡眠起始时间与第二个出睡时间之间的时间段,以及第三个入睡时间与第三个出睡时间之间的时间段,第四预设阈值为2h,睡眠起始时间与第二个出睡时间之间的时间段的睡眠时长为4.17h,第三个入睡时间与第三个出睡时间之间的时间段为0.5h,则第一终端设备可以确定睡眠起始时间与第二个出睡时间之间的时间段的睡眠时长大于第四预设阈值,第三个入睡时间与第三个出睡时间之间的时间段的睡眠时长小于第四预设阈值。
步骤S204:第一终端设备将在确定的睡眠时间段采集到的特征数据发送给第二终端设备。
第一终端设备在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段之后,可以将在确定的睡眠时间段采集到的特征数据发送给第二终端设备。以图3所示的出入睡时间信息的示意图为例,第一终端设备确定睡眠起始时间与第一出睡时间之间的时间段的睡眠时长小于第四预设阈值。第一终端设备还可以确定第二入睡时间与第二出睡时间之间的时间段为睡眠时间段,该睡眠时间段的睡眠时长为3h,则第一终端设备可以确定该睡眠时间段大于第四预设阈值,将在该睡眠时间段采集到的特征数据发送给第二终端设备。第一终端设备还可以确定第三入睡时间与第三出睡时间之间的时间段为睡眠时间段,该睡眠时间段的睡眠时长为0.5h,则第一终端设备可以确定该睡眠时间段小于第四预设阈值,拒绝将在该睡眠时间段采集到的特征数据发送给第二终端设备。
在图2所描述的方法中,接收第二终端设备发送的时间区间信息,时间区间信息包括同步起始时间和同步终止时间,在存储的出入睡时间信息中,获取大于等于同步起始时间 且小于等于同步终止时间的时间段集合,在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段,将在确定的睡眠时间段采集到的特征数据发送给第二终端设备,可避免同步无法支持有效睡眠分期的特征数据,提高数据同步效率。
上述详细阐述了本发明实施例的方法,下面提供了本发明实施例的装置。
请参见图4,图4是本发明实施例提供的一种数据同步装置的结构示意图,该数据同步装置可以包括区间信息接收模块401、集合获取模块402、时间段确定模块403以及特征数据发送模块404,其中,各个模块的详细描述如下。
区间信息接收模块401,用于接收第二终端设备发送的时间区间信息,所述时间区间信息包括同步起始时间和同步终止时间。
集合获取模块402,用于在存储的出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合,所述时间段集合包括至少一个睡眠时间段。
时间段确定模块403,用于在所述时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段。
特征数据发送模块404,用于将在所述确定的睡眠时间段采集到的特征数据发送给所述第二终端设备,所述特征数据包括用户的生理数据或者运动数据。
可选的,所述时间段集合还包括至少一个出入睡时间段,则所述装置还可以包括:
时间段合并模块405,用于所述集合获取模块402在所述出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合之后,将所述时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段。
进一步的,所述时间段确定模块403,具体用于:
在所述更新后的睡眠时间段中确定睡眠时长大于所述第四预设阈值的睡眠时间段。
可选的,所述时间段合并模块405,具体用于:
当所述时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,确定所述出入睡时间段满足所述预置规则。
将所述出入睡时间段、与所述出入睡时间段相邻的前一个睡眠时间段、与所述出入睡时间段相邻的后一个睡眠时间段进行合并,得到所述更新后的睡眠时间段。
可选的,所述时间段合并模块405在所述时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,确定所述出入睡时间段满足所述预置规则,具体用于:
确定所述出入睡时间段位于第一预设时间范围内。
当所述出入睡时间段的出入睡时长小于所述第一预设时间范围对应的第二预设阈值时,确定所述出入睡时间段满足所述预置规则。
可选的,所述装置还可以包括:
时间确定模块406,用于所述区间信息接收模块401接收所述第二终端设备发送的时间区间信息之后,根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,并根据所述同步终止时间在所述出入睡时间信息中确定睡眠终止时间。
进一步的,所述集合获取模块402,具体用于:
在所述出入睡时间信息中,获取大于等于所述睡眠起始时间且小于等于所述睡眠终止时间的时间段集合。
可选的,所述时间确定模块406根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,具体可以为:
将所述同步起始时间作为所述睡眠起始时间,或者将所述出入睡时间信息中的第一个入睡时间作为所述睡眠起始时间。
可选的,所述时间确定模块406根据所述同步起始时间在存储的出入睡时间信息中确定睡眠起始时间,具体用于:
当所述同步起始时间早于所述出入睡时间信息中的第一个入睡时间时,将所述第一个入睡时间作为所述睡眠起始时间。
当所述同步起始时间晚于所述出入睡时间信息中的第一个入睡时间时,将所述同步起始时间作为所述睡眠起始时间。
可选的,所述时间确定模块406根据所述同步终止时间在所述出入睡时间信息中确定睡眠起始时间,具体用于:
将所述出入睡时间信息中的最后一个出睡时间作为所述睡眠终止时间。
可选的,所述时间确定模块406根据所述同步终止时间在所述出入睡时间信息中确定睡眠起始时间,具体用于:
当所述同步终止时间早于所述出入睡时间信息中的最后一个出睡时间时,将所述同步终止时间作为所述睡眠终止时间。
当所述同步终止时间晚于所述出入睡时间信息中的最后一个出睡时间时,将所述最后一个出睡时间作为所述睡眠起始时间。
在图4所描述的数据同步装置中,区间信息接收模块401接收第二终端设备发送的时间区间信息,时间区间信息包括同步起始时间和同步终止时间,集合获取模块402在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合,时间段确定模块403在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段,特征数据发送模块404将在确定的睡眠时间段采集到的特征数据发送给第二终端设备,可避免同步无法支持有效睡眠分期的特征数据,提高数据同步效率。
请参见图5,图5是本发明实施例提供的一种终端设备,该终端设备包括处理器501、存储器502、收发器503、传感器504以及PPG模组505,所述处理器501、存储器502、收发器503、传感器504以及PPG模组505通过总线相互连接。
存储器502包括但不限于是随机存储记忆体(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、或便携式只读存储器(Compact Disc Read-Only Memory,CD-ROM),该存储器502用于存储相关指令及数据,例如出入睡时间信息以及特征数据等。收发器503用于接收和发送数据,例如接收第二终端设备发送的时间区间信息,或者向第二终端设备发送在确定的睡眠时间段采集到的特征数据等。
处理器501可以是一个或多个中央处理器(Central Processing Unit,CPU),或者一个 或多个微控制单元(Microcontroller Unit,MCU)。在处理器501是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。
传感器504可以为加速度计、陀螺仪或者震动传感器等,可以获取用户相关联部位的运动状态。
PPG模组505可以通过LED发光,光线穿透人体血管并反射光,人体脉搏产生的血管规律性收缩会使反射光的强度产生变化,从而获得心率信息等生理数据。
该终端设备中的处理器501用于读取所述存储器502中存储的程序代码,执行以下操作:
通过收发器503接收第二终端设备发送的时间区间信息,所述时间区间信息包括同步起始时间和同步终止时间。
在存储的出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合,所述时间段集合包括至少一个睡眠时间段。
在所述时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段。
通过收发器503将在所述确定的睡眠时间段采集到的特征数据发送给所述第二终端设备,所述特征数据包括用户的生理数据或者运动数据。
可选的,所述时间段集合还包括至少一个出入睡时间段,则处理器501在存储的出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合之后,还可以执行以下操作:
将所述时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段。
进一步的,处理器501在所述时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段,具体可以为:
在所述更新后的睡眠时间段中确定睡眠时长大于所述第四预设阈值的睡眠时间段。
可选的,所述处理器501将所述时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段,具体可以为:
当所述时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,确定所述出入睡时间段满足所述预置规则。
将所述出入睡时间段、与所述出入睡时间段相邻的前一个睡眠时间段、与所述出入睡时间段相邻的后一个睡眠时间段进行合并,得到所述更新后的睡眠时间段。
可选的,所述当所述时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,处理器501确定所述出入睡时间段满足所述预置规则,具体可以为:
确定所述出入睡时间段位于第一预设时间范围内。
当所述出入睡时间段的出入睡时长小于所述第一预设时间范围对应的第二预设阈值时,确定所述出入睡时间段满足所述预置规则。
可选的,处理器501通过收发器503接收第二终端设备发送的时间区间信息之后,还可以执行以下操作:
根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,并根据所述同步终止时间在所述出入睡时间信息中确定睡眠终止时间。
进一步的,处理器501在存储的出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合,具体可以为:
在所述出入睡时间信息中,获取大于等于所述睡眠起始时间且小于等于所述睡眠终止时间的时间段集合。
可选的,处理器501根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,具体可以为:
将所述同步起始时间作为所述睡眠起始时间,或者将所述出入睡时间信息中的第一个入睡时间作为所述睡眠起始时间。
可选的,处理器501根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,具体可以为:
当所述同步起始时间早于所述出入睡时间信息中的第一个入睡时间时,将所述第一个入睡时间作为所述睡眠起始时间。
当所述同步起始时间晚于所述出入睡时间信息中的第一个入睡时间时,将所述同步起始时间作为所述睡眠起始时间。
可选的,处理器501根据所述同步终止时间在所述出入睡时间信息中确定睡眠起始时间,具体可以为:
将所述出入睡时间信息中的最后一个出睡时间作为所述睡眠终止时间。
可选的,处理器501根据所述同步终止时间在所述出入睡时间信息中确定睡眠起始时间,具体可以为:
当所述同步终止时间早于所述出入睡时间信息中的最后一个出睡时间时,将所述同步终止时间作为所述睡眠终止时间。
当所述同步终止时间晚于所述出入睡时间信息中的最后一个出睡时间时,将所述最后一个出睡时间作为所述睡眠起始时间。
在图5所描述的终端设备中,处理器501通过收发器503接收第二终端设备发送的时间区间信息,时间区间信息包括同步起始时间和同步终止时间,在存储的出入睡时间信息中,获取大于等于同步起始时间且小于等于同步终止时间的时间段集合,在时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段,通过收发器503将在确定的睡眠时间段采集到的特征数据发送给第二终端设备,可避免同步无法支持有效睡眠分期的特征数据,提高数据同步效率。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。

Claims (19)

  1. 一种数据同步方法,其特征在于,所述方法包括:
    接收第二终端设备发送的时间区间信息,所述时间区间信息包括同步起始时间和同步终止时间;
    在存储的出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合,所述时间段集合包括至少一个睡眠时间段;
    在所述时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段;
    将在所述确定的睡眠时间段采集到的特征数据发送给所述第二终端设备,所述特征数据包括用户的生理数据或者运动数据。
  2. 如权利要求1所述的方法,其特征在于,所述时间段集合还包括至少一个出入睡时间段,则所述在存储的出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合之后,还包括:
    将所述时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段;
    所述在所述时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段,包括:
    在所述更新后的睡眠时间段中确定睡眠时长大于所述第四预设阈值的睡眠时间段。
  3. 如权利要求2所述的方法,其特征在于,所述将所述时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段,包括:
    当所述时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,确定所述出入睡时间段满足所述预置规则;
    将所述出入睡时间段、与所述出入睡时间段相邻的前一个睡眠时间段、与所述出入睡时间段相邻的后一个睡眠时间段进行合并,得到所述更新后的睡眠时间段。
  4. 如权利要求3所述的方法,其特征在于,所述当所述时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,确定所述出入睡时间段满足所述预置规则,包括:
    确定所述出入睡时间段位于第一预设时间范围内;
    当所述出入睡时间段的出入睡时长小于所述第一预设时间范围对应的第二预设阈值时,确定所述出入睡时间段满足所述预置规则。
  5. 如权利要求1所述的方法,其特征在于,所述接收第二终端设备发送的时间区间信息之后,还包括:
    根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,并根据所述同步终止时间在所述出入睡时间信息中确定睡眠终止时间;
    所述在存储的出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合,包括:
    在所述出入睡时间信息中,获取大于等于所述睡眠起始时间且小于等于所述睡眠终止 时间的时间段集合。
  6. 如权利要求5所述的方法,其特征在于,所述根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,包括:
    将所述同步起始时间作为所述睡眠起始时间;或者
    将所述出入睡时间信息中的第一个入睡时间作为所述睡眠起始时间。
  7. 如权利要求5所述的方法,其特征在于,所述根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,包括:
    当所述同步起始时间早于所述出入睡时间信息中的第一个入睡时间时,将所述第一个入睡时间作为所述睡眠起始时间;
    当所述同步起始时间晚于所述出入睡时间信息中的第一个入睡时间时,将所述同步起始时间作为所述睡眠起始时间。
  8. 如权利要求5所述的方法,其特征在于,所述根据所述同步终止时间在所述出入睡时间信息中确定睡眠起始时间,包括:
    将所述出入睡时间信息中的最后一个出睡时间作为所述睡眠终止时间。
  9. 如权利要求5所述的方法,其特征在于,所述根据所述同步终止时间在所述出入睡时间信息中确定睡眠起始时间,包括:
    当所述同步终止时间早于所述出入睡时间信息中的最后一个出睡时间时,将所述同步终止时间作为所述睡眠终止时间;
    当所述同步终止时间晚于所述出入睡时间信息中的最后一个出睡时间时,将所述最后一个出睡时间作为所述睡眠起始时间。
  10. 一种数据同步装置,其特征在于,所述方法包括:
    区间信息接收模块,用于接收第二终端设备发送的时间区间信息,所述时间区间信息包括同步起始时间和同步终止时间;
    集合获取模块,用于在存储的出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合,所述时间段集合包括至少一个睡眠时间段;
    时间段确定模块,用于在所述时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段;
    特征数据发送模块,用于将在所述确定的睡眠时间段采集到的特征数据发送给所述第二终端设备,所述特征数据包括用户的生理数据或者运动数据。
  11. 如权利要求10所述的装置,其特征在于,所述时间段集合还包括至少一个出入睡时间段,则所述装置还包括:
    时间段合并模块,用于所述集合获取模块在所述出入睡时间信息中,获取大于等于所 述同步起始时间且小于等于所述同步终止时间的时间段集合之后,将所述时间段集合中满足预置规则的出入睡时间段及其相邻的睡眠时间段进行合并,得到更新后的睡眠时间段;
    所述时间段确定模块,具体用于:
    在所述更新后的睡眠时间段中确定睡眠时长大于所述第四预设阈值的睡眠时间段。
  12. 如权利要求11所述的装置,其特征在于,所述时间段合并模块,具体用于:
    当所述时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,确定所述出入睡时间段满足所述预置规则;
    将所述出入睡时间段、与所述出入睡时间段相邻的前一个睡眠时间段、与所述出入睡时间段相邻的后一个睡眠时间段进行合并,得到所述更新后的睡眠时间段。
  13. 如权利要求12所述的装置,其特征在于,所述时间段合并模块在所述时间段集合中出入睡时间段的出入睡时长小于第一预设阈值时,确定所述出入睡时间段满足所述预置规则,具体用于:
    确定所述出入睡时间段位于第一预设时间范围内;
    当所述出入睡时间段的出入睡时长小于所述第一预设时间范围对应的第二预设阈值时,确定所述出入睡时间段满足所述预置规则。
  14. 如权利要求10所述的装置,其特征在于,所述装置还包括:
    时间确定模块,用于所述区间信息接收模块接收所述第二终端设备发送的时间区间信息之后,根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,并根据所述同步终止时间在所述出入睡时间信息中确定睡眠终止时间;
    所述集合获取模块,具体用于:
    在所述出入睡时间信息中,获取大于等于所述睡眠起始时间且小于等于所述睡眠终止时间的时间段集合。
  15. 如权利要求14所述的装置,其特征在于,所述时间确定模块根据所述同步起始时间在所述出入睡时间信息中确定睡眠起始时间,包括:
    将所述同步起始时间作为所述睡眠起始时间;或者
    将所述出入睡时间信息中的第一个入睡时间作为所述睡眠起始时间。
  16. 如权利要求14所述的装置,其特征在于,所述时间确定模块根据所述同步起始时间在存储的出入睡时间信息中确定睡眠起始时间,具体用于:
    当所述同步起始时间早于所述出入睡时间信息中的第一个入睡时间时,将所述第一个入睡时间作为所述睡眠起始时间;
    当所述同步起始时间晚于所述出入睡时间信息中的第一个入睡时间时,将所述同步起始时间作为所述睡眠起始时间。
  17. 如权利要求14所述的装置,其特征在于,所述时间确定模块根据所述同步终止时间在所述出入睡时间信息中确定睡眠起始时间,具体用于:
    将所述出入睡时间信息中的最后一个出睡时间作为所述睡眠终止时间。
  18. 如权利要求14所述的装置,其特征在于,所述时间确定模块根据所述同步终止时间在所述出入睡时间信息中确定睡眠起始时间,具体用于:
    当所述同步终止时间早于所述出入睡时间信息中的最后一个出睡时间时,将所述同步终止时间作为所述睡眠终止时间;
    当所述同步终止时间晚于所述出入睡时间信息中的最后一个出睡时间时,将所述最后一个出睡时间作为所述睡眠起始时间。
  19. 一种终端设备,其特征在于,所述终端设备包括处理器、存储器以及收发器,其中,所述存储器中存储一组程序代码,且所述处理器用于调用存储器中存储的程序代码,用于执行以下操作:
    接收第二终端设备发送的时间区间信息,所述时间区间信息包括同步起始时间和同步终止时间;
    在存储的出入睡时间信息中,获取大于等于所述同步起始时间且小于等于所述同步终止时间的时间段集合,所述时间段集合包括至少一个睡眠时间段;
    在所述时间段集合中确定睡眠时长大于第四预设阈值的睡眠时间段;
    将在所述确定的睡眠时间段采集到的特征数据发送给所述第二终端设备,所述特征数据包括用户的生理数据或者运动数据。
PCT/CN2017/078278 2016-12-23 2017-03-27 一种数据同步方法、装置以及终端设备 WO2018113119A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201780009105.5A CN108601559B (zh) 2016-12-23 2017-03-27 一种数据同步方法、装置以及终端设备
US16/472,896 US10791517B2 (en) 2016-12-23 2017-03-27 Data synchronization method and apparatus, and terminal device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611213342 2016-12-23
CN201611213342.7 2016-12-23

Publications (1)

Publication Number Publication Date
WO2018113119A1 true WO2018113119A1 (zh) 2018-06-28

Family

ID=62624624

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/078278 WO2018113119A1 (zh) 2016-12-23 2017-03-27 一种数据同步方法、装置以及终端设备

Country Status (3)

Country Link
US (1) US10791517B2 (zh)
CN (1) CN108601559B (zh)
WO (1) WO2018113119A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111193568A (zh) * 2019-12-19 2020-05-22 北汽福田汽车股份有限公司 时间同步方法、装置、系统、存储介质及车辆
WO2021135932A1 (zh) * 2019-12-30 2021-07-08 华为技术有限公司 一种数据采集方法、终端设备及存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110495220B (zh) * 2017-03-31 2021-11-02 中兴通讯股份有限公司 用于低功率装置同步的方法和设备
CN114073493B (zh) * 2020-08-18 2023-12-29 华为终端有限公司 生理数据采集方法、装置及可穿戴设备
CN113891448B (zh) * 2021-09-15 2024-02-27 国网福建省电力有限公司福州供电公司 一种自组网通信方法及终端

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150367097A1 (en) * 2014-06-24 2015-12-24 Yazmonit Ltd. System and Method for Inducing Sleep
CN105640508A (zh) * 2016-03-30 2016-06-08 安徽华米信息科技有限公司 实时睡眠监测方法及装置、智能可穿戴设备
CN105764409A (zh) * 2015-10-27 2016-07-13 深圳还是威健康科技有限公司 一种睡眠状态判断方法及智能可穿戴设备

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8948861B2 (en) * 2011-03-31 2015-02-03 Toyota Motor Engineering & Manufacturing North America, Inc. Methods and systems for determining optimum wake time
US20130205311A1 (en) 2012-02-07 2013-08-08 Arun Ramaswamy Methods and apparatus to control a state of data collection devices
US9125209B2 (en) * 2012-07-18 2015-09-01 Qualcomm Incorporated Method to report CQI in connected-mode DRX and reduce UE wake up time for 3GPP long term evolution (LTE) systems
CN103686615B (zh) * 2012-09-21 2017-12-01 北京信威通信技术股份有限公司 一种集群终端睡眠唤醒的方法
CN103619056B (zh) * 2013-12-02 2018-01-12 华为终端(东莞)有限公司 一种上报传感器数据的方法和终端
CN105610508B (zh) 2014-11-24 2019-03-15 普天信息技术有限公司 Lte小区合并的下行光纤时延补偿方法及装置
CN104720753B (zh) * 2015-03-07 2018-06-15 郝磊 一种睡眠监控系统及其方法
CN105380600A (zh) 2015-11-04 2016-03-09 北京握奇数据系统有限公司 一种基于穿戴式智能设备的自动睡眠侦测方法及系统
CN105877701B (zh) 2016-03-24 2019-02-19 安徽华米信息科技有限公司 实时睡眠周期分析方法及装置、智能可穿戴设备
CN106108843A (zh) 2016-06-17 2016-11-16 美的集团股份有限公司 一种确定用户睡眠时长的方法及系统
CN105902257B (zh) 2016-06-27 2019-06-04 安徽华米信息科技有限公司 睡眠状态分析方法及装置、智能可穿戴设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150367097A1 (en) * 2014-06-24 2015-12-24 Yazmonit Ltd. System and Method for Inducing Sleep
CN105764409A (zh) * 2015-10-27 2016-07-13 深圳还是威健康科技有限公司 一种睡眠状态判断方法及智能可穿戴设备
CN105640508A (zh) * 2016-03-30 2016-06-08 安徽华米信息科技有限公司 实时睡眠监测方法及装置、智能可穿戴设备

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111193568A (zh) * 2019-12-19 2020-05-22 北汽福田汽车股份有限公司 时间同步方法、装置、系统、存储介质及车辆
WO2021135932A1 (zh) * 2019-12-30 2021-07-08 华为技术有限公司 一种数据采集方法、终端设备及存储介质
CN113116357A (zh) * 2019-12-30 2021-07-16 华为技术有限公司 一种数据采集方法、终端设备及存储介质
EP4066730A4 (en) * 2019-12-30 2023-01-25 Huawei Technologies Co., Ltd. DATA ACQUISITION METHOD, TERMINAL DEVICE AND STORAGE MEDIA

Also Published As

Publication number Publication date
US10791517B2 (en) 2020-09-29
CN108601559B (zh) 2021-01-29
CN108601559A (zh) 2018-09-28
US20200092806A1 (en) 2020-03-19

Similar Documents

Publication Publication Date Title
WO2018113119A1 (zh) 一种数据同步方法、装置以及终端设备
US9594354B1 (en) Smart watch extended system
US7306567B2 (en) Easy wake wrist watch
CN106556424B (zh) 一种智能可穿戴设备及其节能运行方法
US10478589B2 (en) Wearable device for sleep assistance
KR102407564B1 (ko) 생체 정보를 판단하는 전자 장치 및 이의 동작 방법
EP3199197A1 (en) Sleep awakening system and method
TWI643041B (zh) 智慧鬧鈴控制系統及方法
US20150119726A1 (en) Electronic apparatus and communication control method
CN105279636A (zh) 生物体信息处理系统及生物体信息处理系统的控制方法
CN105232010A (zh) 生物体信息处理系统及生物体信息处理系统的控制方法
US10022086B1 (en) Extended band system
CN104932855B (zh) 一种亮度控制的方法和终端
WO2019205145A1 (zh) 一种闹钟的响铃时刻的设置方法、装置和电子设备
WO2022127477A1 (zh) 控制智能播放终端方法、装置、存储介质和智能穿戴设备
CN109498026A (zh) 可实时监测与预防颈椎疾病的可穿戴装置
CN107802251A (zh) 一种基于穿戴设备的健康监控方法及穿戴设备
KR102584353B1 (ko) 알람 출력 방법 및 이를 지원하는 전자 장치
WO2017049477A1 (zh) 一种运动提醒方法及智能手环
CN111657855A (zh) 睡眠评估和睡眠唤醒方法及装置和电子设备
WO2022100407A1 (zh) 智能眼罩、终端设备、健康管理方法与系统
CN105725969B (zh) 用于可穿戴设备的闹铃控制方法及闹铃控制装置
CN203759437U (zh) 多功能睡眠腕带手表
WO2018120859A1 (zh) 一种唤醒方法及唤醒装置
US20160081615A1 (en) Sleep awaking system and method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17882435

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17882435

Country of ref document: EP

Kind code of ref document: A1