CN110532050B - Motion data refreshing method, wearable device and computer readable storage medium - Google Patents
Motion data refreshing method, wearable device and computer readable storage medium Download PDFInfo
- Publication number
- CN110532050B CN110532050B CN201910702371.7A CN201910702371A CN110532050B CN 110532050 B CN110532050 B CN 110532050B CN 201910702371 A CN201910702371 A CN 201910702371A CN 110532050 B CN110532050 B CN 110532050B
- Authority
- CN
- China
- Prior art keywords
- motion
- motion data
- interface
- data
- wearable device
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/16—Constructional details or arrangements
- G06F1/1613—Constructional details or arrangements for portable computers
- G06F1/163—Wearable computers, e.g. on a belt
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a motion data refreshing method, wearable equipment and a computer readable storage medium, wherein the method comprises the steps of starting a receiving sensor process when detecting that the motion interface process runs; the receiving sensor process acquires motion data, carries the motion data through broadcasting and sends the motion data to the motion interface process; the invention also discloses a wearable device and a computer readable storage medium, which can reduce the direct coupling of codes and realize the scheme optimization of data acquisition of a plurality of application processes by implementing the scheme.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a motion data refreshing method, a wearable device, and a computer readable storage medium.
Background
Most of the existing wearable devices are preset with motion Application (app), and can record and refresh the index features of the user motion, wherein the refresh display process comprises the following steps: the application upper layer opens two processes, namely a motion health process sA and a receiving sensor process sB, wherein the process sB is to continuously receive sensor data every second and store the sensor data (remote service); when a user opens a motion health processA process, a process B process is started through binding of binding service BindService, a process sA opens a timer, data is acquired through bind in a period of 1 second, and the interface is refreshed, so that real-time refreshing display of the motion data is realized; however, in the refresh display process described above, there are the following problems: 1. the two processes are forced to be associated, so that the expansion is not easy, for example, another application needs the motion data, a binder needs the service, and the coupling is too large.
Disclosure of Invention
The invention aims to solve the technical problem that the prior motion application has larger coupling when refreshing motion data through a bind mechanism, and provides a motion data refreshing method, wearable equipment and a computer readable storage medium.
In order to solve the technical problems, the invention provides a motion data refreshing method, which comprises the following steps:
the motion application comprises a motion interface process and a receiving sensor process;
when the motion interface process is detected to run, starting the receiving sensor process;
the receiving sensor process acquires motion data, carries the motion data through broadcasting and sends the motion data to the motion interface process;
and the motion interface process performs interface refreshing according to the motion data.
Optionally, before the receiving sensor process acquires the motion data, the method includes:
and registering the broadcast receiver of the motion interface process when the motion interface process runs or resumes running.
Optionally, after the registering the broadcast receiver of the motion interface process, the method includes:
and logging off the broadcast receiver when the motion interface process is stopping.
Optionally, the motion data refreshing method further includes:
when the logout frequency of the broadcast receiver is larger than the preset frequency, detecting that the motion interface process resumes operation again, and judging whether only the motion application requests to acquire motion data currently;
if so, the motion interface process acquires the motion data through an inter-process communication IPC mechanism.
Optionally, before the carrying of the motion data by broadcasting, the method includes:
the receiving sensor process judges whether the motion data changes or not;
if so, carrying the motion data by broadcasting.
Optionally, before the motion data is carried by broadcasting, the method further includes:
judging whether the time interval from the last time of transmitting the motion data meets a preset time threshold value or not;
if so, carrying the motion data by broadcasting.
Optionally, the carrying the motion data by broadcasting and sending the motion data to the motion interface process includes:
the receiving sensor process transmits a broadcast and carries the motion data over a medium.
Optionally, the moving interface process performs interface refreshing according to the moving data, including:
And the motion interface process broadcast receiver receives the broadcast, acquires the motion data from the medium, and invokes an interface refreshing function to refresh the interface.
Further, the invention also provides a wearable device, which comprises a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the steps in the motion data refresh method as described above.
Further, the present invention also provides a computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps in the motion data refresh method as described above.
Advantageous effects
The invention provides a motion data refreshing method, a wearable device and a computer readable storage medium, which aim at the problems of larger coupling and resource consumption and blocking when the motion data is refreshed by the existing motion application through a bind mechanism, and start a receiving sensor process when the motion interface process is detected to run; the receiving sensor process acquires motion data, carries the motion data through broadcasting and sends the motion data to the motion interface process; and the motion interface process performs interface refreshing according to the motion data, namely, information interaction among processes is realized through a broadcasting mechanism, the direct coupling of codes is reduced, and scheme optimization of data acquisition of a plurality of application processes is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a schematic hardware structure of an implementation manner of a wearable device according to an embodiment of the present invention;
fig. 2 is a hardware schematic diagram of an implementation manner of a wearable device according to an embodiment of the present invention;
fig. 3 is a hardware schematic of an implementation manner of a wearable device according to an embodiment of the present invention;
fig. 4 is a hardware schematic of an implementation manner of a wearable device according to an embodiment of the present invention;
fig. 5 is a hardware schematic of an implementation manner of a wearable device according to an embodiment of the present invention;
FIG. 6 is a basic flowchart of a method for refreshing motion data according to a first embodiment of the present invention;
FIG. 7 is a flowchart of a method for refreshing motion data according to a second embodiment of the present invention;
FIG. 8 is a flowchart of a method for refreshing motion data according to a third embodiment of the present invention;
fig. 9 is a schematic structural diagram of a wearable device according to a fourth embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
The wearable device provided by the embodiment of the invention comprises a mobile terminal such as an intelligent bracelet, an intelligent watch and an intelligent mobile phone. With the continuous development of screen technology, mobile terminals such as smart phones and the like can also be used as wearable devices due to the appearance of screen forms such as flexible screens, folding screens and the like. The wearable device provided in the embodiment of the invention can comprise: RF (Radio Frequency) unit, wiFi module, audio output unit, A/V (audio/video) input unit, sensor, display unit, user input unit, interface unit, memory, processor, and power supply.
In the following description, a wearable device will be taken as an example, please refer to fig. 1, which is a schematic hardware structure of a wearable device implementing various embodiments of the present invention, where the wearable device 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the wearable device structure shown in fig. 1 does not constitute a limitation of the wearable device, and that the wearable device may include more or fewer components than shown, or certain components in combination, or a different arrangement of components.
The following describes the various components of the wearable device in detail with reference to fig. 1:
the radio frequency unit 101 may be used to send and receive information or send signals in a call process, specifically, the radio frequency unit 101 may send uplink information to the base station, or may send downlink information sent by the base station to the processor 110 of the wearable device to process the downlink information, where the downlink information sent by the base station to the radio frequency unit 101 may be generated according to the uplink information sent by the radio frequency unit 101, or may be actively pushed to the radio frequency unit 101 after detecting that the information of the wearable device is updated, for example, after detecting that the geographic position where the wearable device is located changes, the base station may send a notification of the change of the geographic position to the radio frequency unit 101 of the wearable device, after receiving the notification of the message, the radio frequency unit 101 may send the notification of the message to the processor 110 of the wearable device to process, and the processor 110 of the wearable device may control the notification of the message to be displayed on the display panel 1061 of the wearable device; typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 may also communicate with a network and other devices through wireless communication, which may specifically include: through wireless communication with a server in a network system, for example, the wearable device can download file resources from the server through wireless communication, for example, an application program can be downloaded from the server, after the wearable device finishes downloading a certain application program, if the file resources corresponding to the application program in the server are updated, the server can push a message notification of the resource update to the wearable device through wireless communication so as to remind a user to update the application program. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication, global System for Mobile communications), GPRS (General Packet Radio Service ), CDMA2000 (Code Division Multiple Access, CDMA 2000), WCDMA (Wideband Code Division Multiple Access ), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, time Division synchronous code Division multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, frequency Division Duplex Long term evolution), and TDD-LTE (Time Division Duplexing-Long Term Evolution, time Division Duplex Long term evolution), etc.
In one embodiment, the wearable device 100 may access an existing communication network by inserting a SIM card.
In another embodiment, the wearable device 100 may access an existing communication network by setting an esim card (Embedded-SIM), and by adopting the esim card, the internal space of the wearable device may be saved and the thickness may be reduced.
It will be appreciated that although fig. 1 shows a radio frequency unit 101, it will be appreciated that the radio frequency unit 101 is not an essential component of a wearable device and may be omitted entirely as required within the scope of not changing the essence of the invention. The wearable device 100 may implement communication connection with other devices or communication networks through the wifi module 102 alone, which is not limited by the embodiment of the present invention.
WiFi belongs to a short-distance wireless transmission technology, and the wearable device can help a user to send and receive emails, browse webpages, access streaming media and the like through the WiFi module 102, so that wireless broadband Internet access is provided for the user. Although fig. 1 shows a WiFi module 102, it is understood that it does not belong to the necessary constitution of the wearable device, and can be omitted entirely as required within the scope of not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the wearable device 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output (e.g., call signal reception sound, message reception sound, etc.) related to a specific function performed by the wearable device 100. The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive an audio or video signal. The a/V input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound into audio data. The processed audio (voice) data may be converted into a format output that can be transmitted to the mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting the audio signal.
In one embodiment, the wearable device 100 includes one or more cameras, and by opening the cameras, capturing of images, photographing, video recording and other functions can be achieved, and the positions of the cameras can be set as required.
The wearable device 100 further comprises at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 1061 and/or the backlight when the wearable device 100 moves to the ear. As one type of motion sensor, the accelerometer sensor can detect the acceleration in all directions (typically three axes), and can detect the gravity and direction when stationary, and can be used for applications for recognizing the gesture of a mobile phone (such as horizontal-vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer, knocking), and the like.
In one embodiment, the wearable device 100 further comprises a proximity sensor, by employing the proximity sensor, the wearable device is able to achieve non-contact manipulation, providing more modes of operation.
In one embodiment, the wearable device 100 further comprises a heart rate sensor, which when worn, enables detection of heart rate by being in close proximity to the user.
In one embodiment, the wearable device 100 may further include a fingerprint sensor, by reading a fingerprint, security verification or the like can be achieved.
The display unit 106 is used to display information input by a user or information provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like.
In one embodiment, the display panel 1061 employs a flexible display screen, and the wearable device employing the flexible display screen is capable of bending when worn, thereby fitting more. Alternatively, the flexible display screen may be an OLED screen body and a graphene screen body, and in other embodiments, the flexible display screen may also be other display materials, which is not limited to this embodiment.
In one embodiment, the display panel 1061 of the wearable device may take a rectangular shape for ease of wrapping when worn. In other embodiments, other approaches may be taken as well.
The user input unit 107 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the wearable device. In particular, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1071 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 110, and can receive and execute commands sent from the processor 110. Further, the touch panel 1071 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 107 may include other input devices 1072 in addition to the touch panel 1071. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc., as specifically not limited herein.
In one embodiment, the sides of the wearable device 100 may be provided with one or more buttons. The button can realize a plurality of modes such as short pressing, long pressing, rotation and the like, thereby realizing a plurality of operation effects. The number of the buttons can be multiple, and different buttons can be combined for use, so that multiple operation functions are realized.
Further, the touch panel 1071 may overlay the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or thereabout, the touch panel 1071 is transferred to the processor 110 to determine the type of touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of touch event. Although in fig. 1, the touch panel 1071 and the display panel 1061 are two independent components for implementing the input and output functions of the wearable device, in some embodiments, the touch panel 1071 may be integrated with the display panel 1061 to implement the input and output functions of the wearable device, which is not limited herein. For example, when a message notification of a certain application is received through the rf unit 101, the processor 110 may control the message notification to be displayed in a certain preset area of the display panel 1061, where the preset area corresponds to a certain area of the touch panel 1071, and may control the message notification displayed in the corresponding area on the display panel 1061 by performing a touch operation on the certain area of the touch panel 1071.
The interface unit 108 serves as an interface through which at least one external device can be connected with the wearable apparatus 100. For example, the external devices may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the wearable apparatus 100 or may be used to transmit data between the wearable apparatus 100 and the external device.
In one embodiment, the interface unit 108 of the wearable device 100 adopts a contact structure, and is connected with other corresponding devices through the contact, so as to realize functions of charging, connection and the like. The contact can also be waterproof.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 110 is a control center of the wearable device, connects various parts of the entire wearable device with various interfaces and lines, performs various functions of the wearable device and processes data by running or executing software programs and/or modules stored in the memory 109, and invoking data stored in the memory 109, thereby performing overall monitoring of the wearable device. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The wearable device 100 may further include a power source 111 (such as a battery) for powering the various components, and preferably, the power source 111 may be logically connected to the processor 110 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system.
Although not shown in fig. 1, the wearable device 100 may further include a bluetooth module or the like, which is not described herein. The wearable device 100 can be connected with other terminal devices through bluetooth to realize communication and information interaction.
Fig. 2 to fig. 4 are schematic structural diagrams of a wearable device according to an embodiment of the present invention. The wearable device comprises a flexible screen. When the wearable device is unfolded, the flexible screen is in a strip shape; when the wearable device is in a wearing state, the flexible screen is bent to be annular. Fig. 2 and 3 show schematic structural diagrams of the wearable device screen when unfolded, and fig. 4 shows schematic structural diagrams of the wearable device screen when bent.
Based on the above embodiments, it can be seen that if the device is a wristwatch, a bracelet, or a wearable device, the screen of the device may not cover the watchband area of the device, or may cover the watchband area of the device. The invention proposes an alternative embodiment, in which the device may be a wristwatch, a bracelet or a wearable device, comprising a screen and a connection. The screen may be a flexible screen and the connection may be a wristband. Alternatively, the screen of the device or the display area of the screen may be partially or fully overlaid on the wristband of the device. Fig. 5 is a schematic hardware diagram of an implementation manner of a wearable device according to an embodiment of the present invention, where a screen of the device extends to two sides, and a part of the screen is covered on a watchband of the device. In other embodiments, the screen of the device may also be entirely covered on the watchband of the device, which is not limited to the embodiment of the present invention.
First embodiment
The motion data refreshing display mode in the prior art has the following problems: 1. the two processes are forced to be associated, so that the expansion is not easy, for example, another application needs the data, a binder needs the service, and the coupling is too large. 2. Because the application layer obtains data through the bind mechanism as an android IPC mechanism, the interface needs to be refreshed in real time (once per second), and problems such as anr, blocking and the like are common, and the operation is a main reason for causing serious interface blocking and severely consuming system resources. 3. The interface processA is a periodic binder that obtains data, and when the data is unchanged, it is also continuously obtained, which severely consumes system resources. 4. Because the user movement is a long-time operation, the service is required to be connected and held for a long time; when the system resources are insufficient, the receiving sensor process B is easily killed, resulting in user movement but the interface is not displayed.
In order to solve the above-mentioned problem, the present embodiment provides a method for refreshing motion data, as shown in fig. 3, fig. 6 is a basic flowchart of the method for refreshing motion data provided in the present embodiment, where the method for refreshing motion data includes:
S601, when the running of the motion interface process is detected, starting a receiving sensor process.
It will be appreciated that the motion application includes a motion interface process for displaying motion data of a user and a receiving sensor process for receiving (acceleration, gyroscope, etc.) motion data detected by the sensor; when the motion interface process runs, such as a user opens a motion application and enters a display interface, the receiving sensor process is started, and the receiving sensor process can be started through BindService binding.
S602, the receiving sensor process acquires the motion data, carries the motion data through broadcasting, and sends the motion data to the motion interface process.
In this embodiment, the receiving sensor process acquires the motion data detected by the sensor in real time, performs process-to-process decoupling through android Broadcast, and sends the motion data to the motion interface process through broadcasting and carrying the motion data. Specifically, before the receiving sensor process acquires the motion data, when the motion interface process runs or resumes running, the broadcast receiver of the motion interface process is registered. It can be understood that when the motion interface process is operated, the terminal executes onresume () once when the user normally opens the motion application software, and the resume operation is that when the user switches back to the motion application interface again, for example, switches back from other applications, switches back from a screen locking state, or the like, the terminal also executes onresume (); therefore, register receiver () can be added in onResume (), and after the registration of broadcasting is completed, data can be received and transmitted between two processes through broadcasting, wherein when the onResume method calls back, it is explained that the Activity (equivalent to an interface) is visible in the foreground, and the user can interact with the register receiver.
It should be understood that since the user's movement is a long-time operation, a service is required to be connected for a long time, in order to reduce the resources of the terminal, after registering the broadcast receiver of the movement interface process, the broadcast receiver is logged out while the movement interface process is stopping; in this embodiment, when the motion interface process is stopped, it means that the motion interface Activity is switched to another other application interface Activity, or the terminal enters a dormant state, so that onPause () is executed, so that a logout of an unregistereceiver () broadcast receiver may be added to onPause (), where when the onPause method is called back, it indicates that the Activity is being stopped (in a used form), and in general, the onStop method is called back immediately. The motion interface process cannot receive the motion data transmitted by the sensor process through broadcasting.
In some embodiments, after the broadcast receiver is logged out, when the motion interface process operates or resumes operation for multiple times, the broadcast receiver needs to be registered for multiple times, and frequent registration and logging out of the broadcast receiver will cause certain consumption to resources of the terminal, so in this embodiment, the motion data refreshing method further includes, when the number of logging out times of the broadcast receiver is greater than a preset number of times, for example, the number of logging out times is greater than the preset number of times for 5 times in a period of time, indicating frequent registration and logging out of the broadcast receiver, and then, when detecting that the motion interface process resumes operation again, judging whether only the motion application requests to acquire motion data at present, if so, the motion interface process acquires the motion data through an inter-process communication IPC mechanism; for example, when only one application needs motion data, the motion progress interface obtains the motion data through a bind mechanism. In other embodiments, of course, when it is detected that the motion interface process resumes operation again after determining that the broadcast receiver is frequently registered and logged off, the motion interface process acquires motion data through a bind mechanism.
In this embodiment, when the motion data detected by the sensor may not change, the receiving sensor still transmits repeated motion data at this time, which may cause waste of terminal resources, so when the motion interface process registers the broadcast receiver, the receiving sensor process determines whether the motion data changes before the receiving sensor carries the motion data through broadcasting, and if so, the receiving sensor process carries the motion data through broadcasting. Namely, after the motion data is acquired by the receiving sensor, judging the motion data, and sending a broadcast when the motion data is changed; when the motion data changes, the motion data can change every moment and can also change in a period of time, when the motion data changes in a sending way every moment, if the receiving sensor sends a broadcast every moment, certain consumption is caused on resources of the terminal, so in the embodiment, after the cloud data changes in a sending way, the receiving sensor can also judge whether the time interval from the last time of sending the motion data meets a preset time threshold or not, if so, the motion data is carried by broadcasting; the preset time threshold can be set by a terminal, can be set by a user, and can be flexibly adjusted according to actual demands, for example, according to the habit of using the sports application by the user, when the sports interface process runs continuously for a period of time, a smaller preset time threshold is set, for example, 8s; when the continuous running time of the motion interface process is shorter, a longer preset time threshold value, such as 15s, is set.
In some embodiments, when the motion data changes and/or the transmission time interval meets the condition, it may further be determined whether the motion data needs to be refreshed, and then a broadcast is transmitted when the refresh is needed, where it is understood that the motion data includes, but is not limited to, a motion speed, a motion position, and the like; the motion data that needs to be refreshed may be specified by the user, for example, when the receiving sensor determines that the motion speed has changed, but when the user does not need to view the motion speed, then the motion speed does not need to be refreshed, and then the broadcast is sent with the motion data that does not include the motion speed.
In this embodiment, the receiving sensor carries the motion data through broadcasting and sends the motion data to the running interface process, which specifically includes that the receiving sensor process sends the broadcasting and carries the motion data through media, for example, carries reported motion data through Intent (which is understood as "media" of communication between different components, and provides related information that the components call each other specifically).
And S603, the interface refreshing is carried out by the motion interface process according to the motion data.
After the motion interface process broadcast receiver receives the broadcast, motion data is acquired from the medium, for example, the motion data is acquired through the Intent, and then an interface refreshing function is called to refresh the interface, for example, the interface is refreshed in the thread by using a Handler or using postInvalidate ().
The embodiment provides a method for refreshing motion data, which comprises the steps of starting a receiving sensor process when a motion interface process runs, registering a broadcast receiver when a cloud interface process runs or resumes running, and logging out the broadcast receiver when the motion interface process is stopping; when the receiving sensor receives the motion data and judges that the motion data meets the conditions, the receiving sensor sends a broadcast, and the motion data is carried by a medium, so that the motion interface process broadcast receiver obtains cloud data from the medium after receiving the data broadcast, and directly calls an interface refreshing function to refresh and display; by the method, the communication between the processes reduces the coupling between codes, and the serious consumption of terminal resources is avoided.
Second embodiment
In order to facilitate understanding, the present embodiment provides a motion data refreshing method, as shown in fig. 7, fig. 7 is a detailed flowchart of a motion data refreshing method provided by a second embodiment of the present invention, where the motion data refreshing method includes:
and S701, starting a receiving sensor process when detecting that the motion interface process runs.
In this embodiment, when the motion application is started, the motion interface process runs, and the user can perform user interaction through the motion interface, and at this time, the receiving sensor is started, where other applications (such as a WeChat application) can also start the receiving sensor process.
S702, registering a broadcast receiver of the motion interface process when the motion interface process runs or resumes running.
When the user normally opens the sports application, the sports interface process runs, registering the broadcast receiver.
S703, the receiving sensor process acquires the motion data, and judges whether the motion data changes, if so, the process goes to S704, if not, the process goes to S703.
By comparing the current operational data with the last transmitted motion data, it is determined whether the motion data has changed, wherein the motion data includes a motion speed. The motion parameters such as the motion position and the like can be used for judging whether all the motion parameters change.
S704, judging whether the time interval from the last time of transmitting the motion data meets a preset time threshold, if not, turning to S705, if yes, turning to S706.
When the motion data changes, the motion interface process needs to refresh the display, but the motion process refreshes in real time, and the problem of interface jamming exists, so that whether the time interval from the last time of sending the motion data at the current moment meets a preset time threshold or not is further judged, for example, 5s.
And S705, when the time interval meets a preset time threshold, sending a broadcast and carrying the motion data through a medium.
For example, when the time interval between the current time and the last time of transmitting the motion data is 3s, the broadcast is transmitted and the motion data is carried when the time interval is 5 s.
S706, the broadcast is transmitted, and the sports data is carried through the medium.
S707, the motion interface process broadcast receiver receives the broadcast, acquires motion data from the medium and invokes an interface refreshing function to refresh the interface.
After receiving the broadcast, the broadcast receiver acquires information carried in the broadcast, and when the carried information is the motion data needing to be refreshed, an interface refreshing function is called to refresh the interface.
S708, logging off the broadcast receiver when the motion interface process is stopping.
When the user switches from the motion interface to another application interface, the broadcast receiver is logged off.
In other embodiments, when the broadcast receiver registers and logs off frequently in a period of time, and the motion interface process is detected to resume operation again, and it is determined that only the motion application currently requests to acquire motion data, that is, when other applications cannot start the process of receiving a sensor, the motion interface process acquires the binder service of the receiving sensor through the binding service, the motion interface process starts a timer, acquires the motion data through the binder for period 5s, and refreshes and displays the motion data in real time, and then, when the next motion interface process acquires the motion data, the mode of acquiring by using the broadcast can be restored.
The embodiment provides a method for refreshing motion data, which is characterized in that decoupling is carried out between processes through android Broadcast broadcasting, data is carried through broadcasting and is sent to an interface process, the interface process obtains the data and refreshes an interface in real time, wherein the scheme optimization of obtaining the data of a plurality of application processes is realized through decoupling between broadcast solution codes, the motion data is further judged, and after the motion data and the sending time meet the conditions, broadcasting and carrying are carried, so that the problems of bracelet resource consumption and clamping caused by time-consuming operation of obtaining the data by Zhong Jiemian process binder per second in the prior art are solved.
Third embodiment
For easy understanding, the present embodiment describes a motion data refreshing method as a more specific example, and as shown in fig. 8, the motion data refreshing method includes:
s801, starting a proximity sensor process B when the motion interface process A is up.
S802, adding registration of a register receiver () broadcast receiver to onresume (), and adding deregistration of an un-register receiver () broadcast receiver to onpause ().
S803, after the process for receiving the motion data process B acquires the motion data, judging the motion data, and when the motion data changes and the motion data sending time intervals all meet the requirements, sending a broadcast and reporting new motion data through an Intint carrier.
S804, after the motion data broadcast receiver receives the motion data broadcast, the motion data is acquired through the Intent, and an interface refreshing function is directly called to carry out interface refreshing.
Fourth embodiment
The present embodiment provides a wearable device, as shown in fig. 9, which includes a processor 901, a memory 902, and a communication bus 903.
The communication bus 903 in this embodiment is used to implement connection communication between the processor 901 and the memory 902, where the processor 901 is configured to execute one or more programs stored in the memory 902 to implement the following steps:
the motion application comprises a motion interface process and a receiving sensor process;
when detecting that the motion interface process runs, starting a receiving sensor process;
the method comprises the steps that a receiving sensor process obtains motion data, and the motion data are carried by broadcasting and are sent to a motion interface process;
and the motion interface process performs interface refreshing according to the motion data.
In this embodiment, before the implementation step receives the motion data acquired by the sensor process, the processor 901 may also register the broadcast receiver of the motion interface process when the motion interface process is running or resumes running. Further, after registering the broadcast receiver, the broadcast receiver is logged off while the motion interface process is stopping.
In some embodiments, the processor 901 may further determine whether only the motion application requests to acquire the motion data currently when detecting that the motion interface process resumes operation again when the number of log-off times of the broadcast receiver is greater than a preset number of times; if so, the motion interface process acquires motion data through an inter-process communication IPC mechanism.
Before the motion data are carried by broadcasting, the receiving sensor process judges whether the motion data are changed or not; if so, carrying the motion data by broadcasting, and further, after the motion data is changed, judging whether the time interval from the last time of sending the motion data meets a preset time threshold; if so, the motion data is carried by broadcast.
In this embodiment, the proximity sensor process carries the motion data through broadcasting and sends the motion data to the motion interface process, specifically including receiving the broadcast sent by the sensor process and carrying the motion data through the medium; and the motion interface process broadcast receiver receives the broadcast, acquires motion data from the medium, and invokes an interface refreshing function to refresh the interface.
It should be noted that, in order to avoid redundancy, not all examples of the first embodiment, the second embodiment, and the third embodiment are not fully described in the present embodiment, and it should be clear that all examples of the first embodiment, the second embodiment, and the third embodiment are applicable to the present embodiment.
The present embodiment also provides a computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps in the motion data refresh method as in the above embodiments.
The invention provides a wearable device and a computer readable storage medium, which are used for realizing the above-mentioned motion data refreshing method, and starting a receiving sensor process when detecting the motion interface process to run; the method comprises the steps that a receiving sensor process obtains motion data, and the motion data are carried by broadcasting and are sent to a motion interface process; the motion interface process performs interface refreshing according to the motion data, namely, information interaction among processes is realized through a broadcasting mechanism, the direct coupling of codes is reduced, and scheme optimization of data acquisition of a plurality of application processes is realized.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.
Claims (7)
1. A method of refreshing motion data applied to a wearable device, the method comprising:
the motion application comprises a motion interface process and a receiving sensor process;
when the motion interface process is detected to run, starting the receiving sensor process;
the receiving sensor process acquires motion data, carries the motion data through broadcasting and sends the motion data to the motion interface process;
the motion interface process performs interface refreshing according to the motion data;
wherein, before the receiving sensor process obtains the motion data, the method further comprises: when the motion interface process runs or resumes running, registering a broadcast receiver of the motion interface process; the broadcast receiver registering the motion interface process further comprises: logging off the broadcast receiver when the motion interface process is stopping;
the motion data refreshing method further comprises the following steps: when the logout times of the broadcast receiver is larger than the preset times, detecting that the motion interface process resumes operation again, and judging whether only the motion application requests to acquire motion data currently; if so, the motion interface process acquires the motion data through an inter-process communication IPC mechanism.
2. The method for refreshing motion data according to claim 1, wherein before said motion data is carried by broadcasting, comprising:
the receiving sensor process judges whether the motion data changes or not;
if so, carrying the motion data by broadcasting.
3. The method for refreshing motion data according to claim 2, wherein before said motion data is carried by broadcasting, comprising:
judging whether the time interval from the last time of transmitting the motion data meets a preset time threshold value or not;
if so, carrying the motion data by broadcasting.
4. The method of any one of claims 1, wherein the broadcasting carrying the motion data and sending the motion data to the motion interface process comprises:
the receiving sensor process transmits a broadcast and carries the motion data over a medium.
5. The method of claim 4, wherein the moving interface process performs interface refresh according to the moving data, comprising:
and the motion interface process broadcast receiver receives the broadcast, acquires the motion data from the medium, and invokes an interface refreshing function to refresh the interface.
6. A wearable device, characterized in that the wearable device comprises a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the steps in the motion data refresh method of any one of claims 1 to 5.
7. A computer readable storage medium storing one or more programs executable by one or more processors to implement the steps in the method of motion data refresh of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910702371.7A CN110532050B (en) | 2019-07-31 | 2019-07-31 | Motion data refreshing method, wearable device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910702371.7A CN110532050B (en) | 2019-07-31 | 2019-07-31 | Motion data refreshing method, wearable device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110532050A CN110532050A (en) | 2019-12-03 |
CN110532050B true CN110532050B (en) | 2023-08-25 |
Family
ID=68661059
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910702371.7A Active CN110532050B (en) | 2019-07-31 | 2019-07-31 | Motion data refreshing method, wearable device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110532050B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111198702A (en) * | 2019-12-23 | 2020-05-26 | 宁波港信息通信有限公司 | Interface refreshing method and device, computer equipment and storage medium |
CN115525372B (en) * | 2022-01-06 | 2023-08-18 | 荣耀终端有限公司 | Method and device for displaying interface |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102063309A (en) * | 2009-11-17 | 2011-05-18 | 英业达股份有限公司 | System for monitoring and synchronously refreshing downloading of motion program data and method thereof |
WO2016159903A1 (en) * | 2015-03-27 | 2016-10-06 | Vakif Emekli̇li̇k Anoni̇m Şi̇rketi̇ | A kind of life monitoring system used in the field of insurance |
CN107153583A (en) * | 2017-05-24 | 2017-09-12 | 努比亚技术有限公司 | A kind of striding course interaction processing method, mobile terminal and computer-readable recording medium |
CN107179950A (en) * | 2017-06-29 | 2017-09-19 | 努比亚技术有限公司 | A kind of application process processing method, mobile terminal and computer-readable recording medium |
CN109471603A (en) * | 2017-09-07 | 2019-03-15 | 华为终端(东莞)有限公司 | A kind of interface display method and device |
CN109885415A (en) * | 2019-02-25 | 2019-06-14 | 努比亚技术有限公司 | Information notice method, wearable device and computer readable storage medium |
-
2019
- 2019-07-31 CN CN201910702371.7A patent/CN110532050B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102063309A (en) * | 2009-11-17 | 2011-05-18 | 英业达股份有限公司 | System for monitoring and synchronously refreshing downloading of motion program data and method thereof |
WO2016159903A1 (en) * | 2015-03-27 | 2016-10-06 | Vakif Emekli̇li̇k Anoni̇m Şi̇rketi̇ | A kind of life monitoring system used in the field of insurance |
CN107153583A (en) * | 2017-05-24 | 2017-09-12 | 努比亚技术有限公司 | A kind of striding course interaction processing method, mobile terminal and computer-readable recording medium |
CN107179950A (en) * | 2017-06-29 | 2017-09-19 | 努比亚技术有限公司 | A kind of application process processing method, mobile terminal and computer-readable recording medium |
CN109471603A (en) * | 2017-09-07 | 2019-03-15 | 华为终端(东莞)有限公司 | A kind of interface display method and device |
CN109885415A (en) * | 2019-02-25 | 2019-06-14 | 努比亚技术有限公司 | Information notice method, wearable device and computer readable storage medium |
Non-Patent Citations (1)
Title |
---|
基于Android平台的智能模拟手环系统;杜春赛;《工业控制计算机》;20180325(第03期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110532050A (en) | 2019-12-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109982179B (en) | Audio signal output method and device, wearable device and storage medium | |
CN110262849B (en) | Application starting method, wearable device and computer readable storage medium | |
CN110299100B (en) | Display direction adjustment method, wearable device and computer readable storage medium | |
CN107734170B (en) | Notification message processing method, mobile terminal and wearable device | |
CN110096195B (en) | Sports icon display method, wearable device and computer readable storage medium | |
CN110399195B (en) | Desktop icon dynamic replacement method, equipment and computer readable storage medium | |
CN110213810B (en) | Wearable device control method, wearable device and computer-readable storage medium | |
CN109976612B (en) | Application function implementation method, wearable device, mobile phone and computer-readable storage medium | |
CN110139270B (en) | Wearable device pairing method, wearable device and computer readable storage medium | |
CN109933294B (en) | Data processing method and device, wearable device and storage medium | |
CN110532050B (en) | Motion data refreshing method, wearable device and computer readable storage medium | |
CN110098845B (en) | Message processing method, wearable device, mobile terminal and readable storage medium | |
CN109933187B (en) | Wearing equipment operation control method, wearing equipment and computer readable storage medium | |
CN110069200B (en) | Wearable device input control method, wearable device and storage medium | |
CN110149683B (en) | Application notification processing method, wearable device and computer-readable storage medium | |
CN110072071B (en) | Video recording interaction control method, equipment and computer readable storage medium | |
CN110071866B (en) | Instant messaging application control method, wearable device and storage medium | |
CN109933400B (en) | Display interface layout method, wearable device and computer readable storage medium | |
CN110213637B (en) | Method for adding watermark to video file, wearable device and readable storage medium | |
CN110083205B (en) | Page switching method, wearable device and computer-readable storage medium | |
CN110086808B (en) | Account login control method and device and computer readable storage medium | |
CN110099362A (en) | Based reminding method, wearable device and the storage medium of wearable device message | |
CN110657794A (en) | Compass calibration method of wearable device, wearable device and storage medium | |
CN109947448B (en) | Time updating method, device and computer readable storage medium | |
CN110007761B (en) | Wearable device, control method thereof and computer readable storage medium |
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 |