WO2023226744A9 - Communication method and related device - Google Patents

Communication method and related device Download PDF

Info

Publication number
WO2023226744A9
WO2023226744A9 PCT/CN2023/092908 CN2023092908W WO2023226744A9 WO 2023226744 A9 WO2023226744 A9 WO 2023226744A9 CN 2023092908 W CN2023092908 W CN 2023092908W WO 2023226744 A9 WO2023226744 A9 WO 2023226744A9
Authority
WO
WIPO (PCT)
Prior art keywords
application
wearable device
message
ams
party application
Prior art date
Application number
PCT/CN2023/092908
Other languages
French (fr)
Chinese (zh)
Other versions
WO2023226744A1 (en
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 荣耀终端有限公司
Publication of WO2023226744A1 publication Critical patent/WO2023226744A1/en
Publication of WO2023226744A9 publication Critical patent/WO2023226744A9/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • 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 terminal technology, and in particular, to a communication method and related equipment.
  • This application provides a communication method and related equipment.
  • the JS application framework in the wearable device can register the communication interface, and AMS can bind the communication interface.
  • Local applications in wearable devices can communicate with third-party applications through this communication interface. In this way, local applications and third-party applications in wearable devices can share data, expand more application scenarios, and improve user experience.
  • this application provides a communication method.
  • This method can be applied to electronic devices.
  • the method may include: the local application in the electronic device sends a first message to the capability management service AMS in the electronic device; the AMS sends the first message to a third-party application in the electronic device through the first communication interface; or, the AMS receives the third-party
  • the application sends the second message through the first communication interface; the AMS sends the second message to the local application.
  • the first communication interface is a communication interface between the AMS and the JS application framework in the electronic device.
  • the first message includes the package name of the local application, the package name of the third-party application, and the first target transmission data.
  • the second message includes the package name of the third-party application, the package name of the local application, and the second target transmission data.
  • the local application in the electronic device can send the first message to the AMS, and the AMS sends the first message to the third-party application through the first communication interface. That is to say, the local application in the electronic device can send data to the third-party application in the electronic device through the first communication interface.
  • the AMS in the electronic device may also receive a second message sent by the third-party application through the first communication interface, and send the second message to the local application. That is to say, the third-party application in the electronic device can send data to the local application in the electronic device through the first communication interface. In this way, the electronic device can realize the interaction between the local application and the third-party application through the first communication interface, thereby realizing data sharing, realizing more application scenarios and improving the user experience.
  • the first communication interface may be the interface M in the embodiments described below.
  • any local application and any third-party application in the electronic device can communicate based on the first communication interface.
  • the local application may include relevant instructions for calling the first communication interface.
  • the third-party application may include relevant instructions for calling the first communication interface.
  • the first message may be message X11 in the embodiments described later.
  • the second message may be message X12 in the embodiments described below.
  • first target transmission data and the second target transmission data please refer to the relevant description of the target transmission data in the embodiments to be described later, and the description will not be further elaborated here.
  • the local application mentioned in the claims can be any local application in the electronic device.
  • the local application mentioned in the claims may be the local application N in the embodiments described below.
  • the third-party application mentioned in the claims can be any third-party application in the electronic device.
  • the third-party application mentioned in the claims may be the third-party application T in the embodiments described below.
  • the electronic device mentioned in the claims may be a wearable device mentioned in the embodiments described below.
  • the method may also include: the electronic device starts a third-party application; the JS application framework registers the first communication interface; and the AMS binds the first communication interface.
  • the electronic device can register the first communication interface.
  • the JS application framework in the electronic device can register the first communication interface, and accordingly, the AMS can bind the first communication interface.
  • the user operation triggers the electronic device to start a third-party application, and the electronic device can start a registration process to register the first communication interface.
  • the electronic device can register the first communication interface before the local application communicates with the third-party application, and does not need to wait until the local application sends a message to the third-party application to register, or the third-party application sends a message to the local application. Registration saves communication time between local applications and third-party applications.
  • the user clicks the application icon of the third-party application, and in response to the click operation, the electronic device launches the third-party application and starts the registration process.
  • the registration process may include: the JS application framework registers the first communication interface and notifies the AMS to bind the first communication interface.
  • the user triggers the launch of a third-party application while browsing another application, and the electronic device can also initiate the registration process.
  • the registration process can be triggered to register the first communication interface.
  • the local application sends a message to the third-party application through the AMS.
  • the third-party application will be started.
  • the electronic device can start the registration process.
  • the JS application framework registers the first communication interface and notifies AMS to bind the first communication interface.
  • the method may also include: the local application sends a third message to the AMS; the AMS determines whether there is a running application in the electronic device, and In the case where there is a running application in the electronic device, compare the running application with the third-party application priority.
  • the electronic device starts a third-party application, which may specifically include: when there is no running application in the electronic device, or the priority of the running application is not higher than the priority of the third-party application, the electronic device starts the third-party application.
  • the method may further include: the AMS sends the third target transmission data to the third-party application through the first communication interface.
  • the third message includes the package name of the local application, the package name of the third-party application, and the third target transmission data.
  • the local application sends a message to the third-party application through the AMS.
  • the third-party application will be started.
  • the electronic device can start the registration process. It is worth noting that the electronic device will start a third-party application only when there is no running application, or the priority of the running application is not higher than the priority of the third-party application. This means that the electronic device will only launch third-party applications and then start the registration process if it does not affect the running status of higher-priority applications, fully considering user needs and experience.
  • the third message may be message X1 in the embodiments described below.
  • the method may further include: the JS application framework sends a fourth message to the third-party application.
  • the method may further include: the JS application framework sends a fifth message to the AMS.
  • the fourth message is used to notify the third-party application to start the registration process.
  • the fifth message is used to notify AMS that the first communication interface has been registered.
  • the fourth message may be message X8 in the embodiments described below.
  • the fifth message may be message X9 in the embodiments described below.
  • the electronic device starts a third-party application, which may specifically include: AMS sending a sixth message to the JS application framework; the JS application framework loads relevant components of the third-party application and sends them to the AMS. Seventh news. Among them, the sixth message is used to notify the JS application framework to start the third-party application; the seventh message is used to notify the AMS that the third-party application has been started.
  • the sixth message may be message X6 in the embodiments described below.
  • the seventh message may be message X7 in the embodiments described below.
  • the method may also include: AMS establishing a communication connection with the UI component in the electronic device; AMS requesting the UI component to place the original display interface in Backstage.
  • the electronic device before starting a third-party application, can first request the UI component to increase the interface resources so as to display the relevant interface of the third-party application.
  • the method may further include: the AMS receives the third-party application through the first communication interface.
  • the eighth message includes the package name of the third-party application, the package name of the local application, and the fourth target transmission data.
  • the local application in the electronic device can communicate with the third-party application as the sender of the message, and can also communicate with the third-party application as the receiver of the message.
  • the electronic device does not limit the message sender and message receiver when communicating between local applications and third-party applications, and can maximize data sharing, thereby expanding more application scenarios and improving user experience. experience.
  • the eighth message may be message X12 in the embodiments described below.
  • the method may further include: the local application sends a ninth message to the AMS; the AMS through the first communication interface The communication interface sends a ninth message to the third-party application.
  • the ninth message includes the package name of the local application, the package name of the third-party application, and the fifth target transmission data.
  • the ninth message may be message X11 in the embodiments described below.
  • the present application provides an electronic device.
  • the electronic device may include a display, memory, and one or more processors.
  • the memory may be coupled with one or more processors.
  • Memory is used to store computer programs.
  • the processor is used to call the computer program to perform any method of the first aspect.
  • the processor may be configured to: the local application sends a first message to the capability management service AMS in the electronic device; the AMS sends the first message to the third-party application through the first communication interface; or the AMS receives the third-party application through the first communication interface.
  • the first communication interface is a communication interface between the AMS and the JS application framework in the electronic device.
  • the first message includes the package name of the local application, the package name of the third-party application, and the first target transmission data.
  • the second message includes the package name of the third-party application, the package name of the local application, and the second target transmission data.
  • the processor is configured to: before the local application sends a first message to the capability management service AMS in the electronic device, or the AMS receives a message sent by a third-party application through the first communication interface Before the second message, it can also be used to: start a third-party application; JS application framework registers the first communication interface; AMS binds the first communication interface.
  • the processor before being used to launch a third-party application, can also be used to: the local application sends a third message to the AMS; the AMS determines whether there is a running application in the electronic device , and when there is a running application in the electronic device, compare the priorities of the running application and the third-party application.
  • the processor is used to launch third-party applications. Specifically, it can be used to: launch third-party applications when there is no running application in the electronic device, or the priority of the running application is not higher than the priority of the third-party application. .
  • the processor may also be configured to: the AMS sends the third target transmission data to the third-party application through the first communication interface.
  • the third message includes the package name of the local application, the package name of the third-party application, and the third target transmission data.
  • the processor before the processor is used for the JS application framework to register the first communication interface, the processor may also be used for the JS application framework to send a fourth message to the third-party application.
  • the processor can also be used by the JS application framework to send the fifth message to the AMS.
  • the fourth message is used to notify the third-party application to start the registration process.
  • the fifth message is used to notify AMS that the first communication interface has been registered.
  • the processor when used to launch a third-party application, it can be specifically used to: AMS send the sixth message to the JS application framework; the JS application framework loads relevant components of the third-party application , and sends the seventh message to AMS.
  • the sixth message is used to notify the JS application framework to start the third-party application; the seventh message is used to notify the AMS that the third-party application has been started.
  • the processor before being used to launch a third-party application, can also be used to: establish a communication connection between the AMS and the UI component in the electronic device; the AMS requests the UI component to display the original interface. Put in the background.
  • the processor may also be configured for: the AMS to receive the third-party application.
  • the eighth message is sent through the first communication interface; the AMS sends the eighth message to the third-party application.
  • the eighth message includes the package name of the third-party application, the package name of the local application, and the fourth target transmission data.
  • the processor can also be used for: the local application to send the ninth message to the AMS. ;
  • the AMS sends the ninth message to the third-party application through the first communication interface.
  • the ninth message includes the package name of the local application, the package name of the third-party application, and the fifth target transmission data.
  • the present application provides a computer storage medium that includes computer instructions.
  • the computer instructions When the computer instructions are run on an electronic device, the electronic device causes the electronic device to execute any of the possible implementations of the first aspect.
  • embodiments of the present application provide a chip that can be applied to electronic equipment.
  • the chip includes one or more processors, and the processor is used to call computer instructions to cause the electronic equipment to execute any of the above-mentioned first aspects.
  • embodiments of the present application provide a computer program product containing instructions, which when the computer program product is run on an electronic device, causes the electronic device to execute any of the possible implementations of the first aspect.
  • the electronic device provided by the second aspect the computer storage medium provided by the third aspect, the chip provided by the fourth aspect, and the computer program product provided by the fifth aspect are all used to execute any possibility of the first aspect. way of implementation. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of any possible implementation method in the first aspect, and will not be described again here.
  • Figure 1 is a schematic diagram of a communication scenario provided by an embodiment of the present application.
  • Figure 2 is a schematic structural diagram of a wearable device 100 provided by an embodiment of the present application.
  • Figure 3 is a schematic diagram of the hardware structure of a wearable device 100 provided by an embodiment of the present application.
  • Figure 4 is a schematic software structure diagram of a wearable device 100 provided by an embodiment of the present application.
  • Figure 5 is a schematic diagram of a communication process between wearable device applications provided by an embodiment of the present application.
  • Figure 6 is a flow chart of a communication method provided by an embodiment of the present application.
  • Figure 7 is a flow chart of yet another communication method provided by an embodiment of the present application.
  • Figure 8 is a schematic diagram of another communication scenario provided by an embodiment of the present application.
  • Figures 9a-9c are a set of user interface schematic diagrams provided by embodiments of the present application.
  • Figure 10 is a flow chart of yet another communication method provided by an embodiment of the present application.
  • Figure 11 is a schematic diagram of another communication scenario provided by an embodiment of the present application.
  • Figure 12 is a schematic diagram of another communication scenario provided by an embodiment of the present application.
  • Figure 13 is a schematic diagram of a user interface provided by an embodiment of the present application.
  • Figure 14 is a flow chart of yet another communication method provided by an embodiment of the present application.
  • an embodiment means that a particular feature, structure or characteristic described in connection with the embodiment may be included in at least one embodiment of the application.
  • the appearances of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
  • JS language is a lightweight, interpreted or just-in-time compiled programming language with function priority.
  • C++ is a statically typed, compiled, general-purpose, case-sensitive, irregular programming language that supports procedural programming, object-oriented programming and generic programming. Understandably, Jerryscript is a lightweight JS engine.
  • the wearable device 100 can establish a communication connection with the terminal device 200 to realize information interaction with the terminal device 200 .
  • the communication connection may be a Bluetooth connection.
  • third-party applications in wearable devices can implement information interaction with terminal devices such as mobile phones through the wearable device service wearkit service.
  • wearkit service is a communication protocol between mobile phones and watches. Its specific description Please refer to relevant technical documents.
  • the native applications in the wearable device 100 are developed based on the underlying framework of the OS. This means that the third-party application and the local application in the wearable device 100 cannot communicate, and the two cannot share data.
  • an operating system is a computer program that manages computer hardware and software resources.
  • the operating system needs to handle basic tasks such as managing and configuring memory, determining the priority of system resource supply and demand, controlling input and output devices, operating the network, and managing the file system.
  • the operating system also provides an interface for users to interact with the system.
  • the wearable device 100 can be a smart watch, a smart bracelet, or other devices, and this application does not limit the specific type of the wearable device 100 .
  • This application provides a communication method and related equipment.
  • the JS application framework in the wearable device 100 can register a communication interface, and the AMS can bind the communication interface.
  • Local applications in the wearable device 100 can communicate with third-party applications through the communication interface. In this way, local applications and third-party applications in the wearable device 100 can share data, expand more application scenarios, and improve user experience.
  • FIG. 2 is a schematic structural diagram of a wearable device 100 provided by an embodiment of the present application.
  • the wearable device 100 may include a main body part 110 and a wearable part 120 .
  • the main body component 110 may be provided with sensors, a display screen, etc.
  • the wearable device 100 can determine the user's motion status through sensors and collect the user's motion data (eg, running trajectory, number of rope skipping, exercise time, etc.) and health data (eg, heart rate, blood oxygen, pressure, etc.).
  • the wearable device 100 can also display the collected health data and exercise data through the display screen.
  • the display screen of the wearable device 100 can also display time, power, Bluetooth connection status, etc.
  • the main body part 110 may also include buttons 111 and 112 .
  • Body component 110 may also include magnetic contacts. The wearable device 100 can be charged through the magnetic contacts.
  • Wearing component 120 may be used to mount body component 110 .
  • the wearing component 120 may be a bracelet, a watch strap, or other component, which allows the main component 110 to be attached to the user's body (eg, wrist).
  • the wearable device 100 may include a processor 101, a wireless communication module 102, a sensor module 103, a charging management module 104, a power management module 1041, a battery 1042, a magnetic contact 105, an audio module 106, a speaker 106A, a receiver 106B, and a microphone 106C. , display screen 107, buttons 108 and memory 109.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the wearable device 100 .
  • the wearable device 100 may include more or less components than shown in the figures, or combine some components, or split some components, or arrange different components.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 101 may include one or more processing units.
  • the processor 101 may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing unit, GPU), and an image signal processor. (Image Signal Processor, ISP), controller, memory, video codec, digital signal processor (Digital Signal Processor, DSP), baseband processor, and/or neural network processor (Neural-network Processing Unit, NPU), etc.
  • application processor Application Processor, AP
  • modem processor a graphics processor
  • GPU Graphics Processing unit
  • image signal processor Image Signal Processor
  • ISP Image Signal Processor
  • controller memory
  • video codec digital signal processor
  • DSP Digital Signal Processor
  • baseband processor baseband processor
  • NPU neural network Processing Unit
  • different processing units can be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the wearable device 100 .
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the wearable device 100 can execute the communication method through the processor 101.
  • the processor 101 may also be provided with a memory for storing instructions and data.
  • the memory in processor 101 is a cache memory. This memory may hold instructions or data that have been recently used or recycled by the processor 101 . If the processor 101 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 101 is reduced, thus improving the efficiency of the system.
  • processor 101 may include one or more interfaces. This interface can be used to connect the wearable device 100 and peripheral devices. This interface can also be used to connect other electronic devices. For example, AR equipment, etc.
  • the wireless communication module 102 can provide applications on the wearable device 100 including Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) network), Bluetooth (Bluetooth, BT), and global navigation. Wireless communication solutions such as Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR) and other wireless communications.
  • the wireless communication module 102 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 102 can receive electromagnetic waves via an antenna, frequency modulate and filter the electromagnetic wave signals, and send the processed signals to the processor 101 .
  • the wireless communication module 102 can also receive the signal to be sent from the processor 101, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna for radiation.
  • the wireless communication module 102 may include at least a Bluetooth module.
  • the wearable device 100 can establish a communication connection with the terminal device 200 through the Bluetooth module in the wireless communication module 102 (as shown in FIG. 1 ).
  • Sensor module 103 may include one or more sensors, which may be of the same type or different types. As shown in FIG. 3 , the sensor module 103 may include a pressure sensor 103A, a gyroscope sensor 103B, an acceleration sensor 103C, a touch sensor 103D, a bone conduction sensor 103E, a light sensor 103F, and the like.
  • the pressure sensor 103A is used to sense pressure signals and can convert the pressure signals into electrical signals.
  • the pressure sensor 103A may be disposed on the display screen 107 .
  • the wearable device 100 detects the strength of the touch operation according to the pressure sensor 103A.
  • the wearable device 100 may also calculate the touched position based on the detection signal of the pressure sensor 103A.
  • touch operations acting on the same touch location but with different touch operation intensities may correspond to different operation instructions.
  • the gyro sensor 103B may be used to determine the motion posture of the wearable device 100 .
  • the angular velocity of wearable device 100 about three axes ie, x, y, and z axes
  • the acceleration sensor 103C can detect the acceleration of the wearable device 100 in various directions (generally three axes). When the wearable device 100 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor 103C can also be used to identify the posture of the wearable device 100 and be used in horizontal and vertical screen switching, pedometer and other applications.
  • Touch sensor 103D is also called a "touch panel”.
  • the touch sensor 103D can be disposed on the display screen 107.
  • the touch sensor 103D and the display screen 107 form a touch screen, which is also called a "touch screen”.
  • Touch sensor 103D is used to detect the for touch operations on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the touch event type.
  • Visual output related to the touch operation may be provided through the display screen 107 .
  • the touch sensor 103D may also be disposed on the surface of the wearable device 100 in a position different from that of the display screen 107 .
  • the bone conduction sensor 103E can acquire vibration signals. In some embodiments of the present application, the bone conduction sensor 103E can also contact the human body's pulse and receive blood pressure beating signals. In some embodiments, the application processor can analyze the heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 103E to implement the heart rate detection function.
  • Light sensor 103F may include a light emitting diode and a photoreceiver.
  • the wearable device 100 can irradiate a beam of light into the skin tissue of the human body through the light-emitting diode in the light sensor 103F, and then convert the received light signal into an electrical signal through the photoelectric receiver. Since the blood flow of the human body changes periodically with the pulse, and the proportion of oxygenated red blood cells in the blood also changes with the pulse, their absorption of incident light also changes periodically with the pulse. The change is reflected in the receiving end that the received electrical signal also changes with the pulse.
  • the light sensor 103F can obtain the heart rate in the above manner.
  • the wearable device 100 can also irradiate the finger with infrared light and red light simultaneously through the light-emitting diode, and then measure the absorption spectrum of the reflected light through the light sensor 103F. Since oxyhemoglobin in the blood absorbs more red light and less infrared light, and hemoglobin absorbs more infrared light and less red light, the wearable device 100 can measure blood oxygen content in the above manner. .
  • the sensor module 103 shown in FIG. 3 is only an exemplary division method, and other division methods are possible, and this application does not limit this.
  • the charging management module 104 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 104 may receive charging input from the wired charger through the magnetic contacts 105 .
  • the charging management module 104 may receive wireless charging input through the wireless charging coil of the wearable device 100 . While the charging management module 104 charges the battery 1042, it can also provide power to the wearable device 100 through the power management module 1041.
  • the magnetic contact 105 can also be understood as a magnetic sensor.
  • the audio module 106 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals.
  • Speaker 106A is used to convert audio electrical signals into sound signals.
  • the receiver 106B is used to convert audio electrical signals into sound signals.
  • Microphone 106C is used to convert sound signals into electrical signals.
  • the display screen 107 is used to display pictures and the like.
  • Display screen 107 may include a display panel.
  • the display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (Active-Matrix Organic Light).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • Active-matrix organic light-emitting diode Active-matrix organic light-emitting diode
  • Active-Matrix Organic Light Active-Matrix Organic Light.
  • Emitting Diode AMOLED
  • Flex Light-Emitting Diode FLED
  • Mini LED Micro LED
  • Micro-OLED Quantum Dot Light Emitting Diode
  • QLED Quantum Dot Light Emitting Diode
  • the key 108 may be a mechanical key or a touch key.
  • the wearable device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the wearable device 100 .
  • the wearable device 100 may include buttons 111 and 112 as shown in FIG. 2 .
  • Memory 109 may be used to store computer executable program code.
  • the executable program code includes instructions. deal with The processor 101 executes instructions stored in the memory 109 to execute various functional applications and data processing of the wearable device 100 .
  • the memory 109 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image video playback function, etc.), etc.
  • the storage data area may store data created during use of the wearable device 100 (such as audio data, phone book, etc.).
  • the wearable device 100 can store the collected user's health data, exercise data, etc. in the memory 109 .
  • the wearable device 100 may include a motor.
  • the motor can produce vibration cues.
  • the motor can be used to vibrate for incoming calls or for touch vibration feedback.
  • touch operations for different applications can correspond to different vibration feedback effects.
  • the motor can also respond to different vibration feedback effects for touch operations in different areas of the display screen 107 .
  • Different application scenarios such as time reminders, receiving information, alarm clocks, games, etc.
  • the touch vibration feedback effect can also be customized.
  • Wearable device 100 may also include an indicator.
  • the indicator can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
  • the wearable device 100 may include native applications, third-party applications (ie, JS applications), JS application frameworks, OS framework layers, and OS kernel layers.
  • JS applications third-party applications
  • JS application frameworks ie, JS application frameworks
  • OS framework layers ie, OS framework layers
  • OS kernel layers ie, OS kernel layers
  • Local applications can be understood as applications installed in the wearable device 100 when the operating system is installed before the wearable device 100 leaves the factory.
  • Native applications can include health applications. Users can record health data and exercise data through this health application.
  • local applications can also include applications such as gallery, Bluetooth, and music. According to the above, the local application in the wearable device 100 is developed in C++ language.
  • Third-party applications can be understood as applications downloaded through the app store.
  • third-party applications may include navigation applications, search engines, etc. downloaded from an application store. It is understandable that the third-party application in the wearable device 100 is developed using JS language and belongs to JS application.
  • the JS application framework is used to support the development of third-party applications.
  • JS application framework can include JS data binding (data binding), JS runtime (runtime) and JS framework (framework).
  • JS data binding can include binding relationships. View model instance, publisher (subject) and observer (observer).
  • the compiler compiles html and CSS into JS code and JSON objects, and uses the engine to call the JS interface to the C++ implementation. The calling process requires the participation of JS data binding.
  • JS runtime includes core libraries and virtual machines.
  • the runtime is responsible for the scheduling and management of the system.
  • the core library contains two parts: one part is the functional functions that the programming language (for example, JS language) needs to call, and the other part is the core library of the system.
  • JS applications and JS frameworks run in virtual machines.
  • the virtual machine executes programming files (eg, JS files) of JS applications and JS frameworks as binary files.
  • the virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
  • JS framework can include UI component adapter layer and application programming interface adapter layer. It is understandable that the application programming interface can be referred to as API. UI component adapter layer can include basic components, animation components, page switching components, styles Manager and text editor etc. The API adapter layer can include basic components, rendering models, style managers, etc. It is understandable that the meaning of the above components can be referred to relevant technical documents. JS framework can include some predefined functions.
  • JS framework can also include other components, and this application does not limit this.
  • the OS framework layer can include UI components (kit), OS API, capability management service (Ability Management Service, AMS), and package management service (Bundle Management Service, BMS).
  • UI components are used to start local applications.
  • UI components are also responsible for drawing and displaying on the screen, and drawing different applications by managing the context of different scenes. For example, the buttons, marquee display boxes, font colors and lines displayed on the watch all require the support of UI components.
  • OS API is the application programming interface provided by OS framework for local applications.
  • AMS is used to manage the life cycle of third-party applications. For example, starting, switching, closing, etc. of third-party applications.
  • the OS kernel layer (kernel) is the foundation of the operating system. The final functions of the operating system are completed through the kernel layer.
  • the kernel layer can include audio drivers, Bluetooth drivers, sensor drivers, display drivers, touch screen drivers, button drivers, etc. It is understandable that the OS kernel can include task management, memory management, interrupt management, exception management, system clock, semaphore, mutex lock, queue management, event management and software timer, etc. Furthermore, the OS kernel can also include C++ support, debugging components, etc.
  • the schematic software structure diagram of the wearable device 100 shown in FIG. 4 provided by the embodiment of the present application is only an example and should not be regarded as a limitation of the present application. It can be understood that the software structure of the wearable device 100 may also include more layers (for example, a hardware abstraction layer), and this application does not limit the specific module divisions in different layers of the operating system. For details, please refer to the conventional technology. An introduction to operating system software architecture.
  • FIG. 5 is a schematic diagram of a communication process between wearable device applications according to an embodiment of the present application.
  • the local application N of the wearable device can send messages to the AMS.
  • the message may include the package name of the local application N, the package name of the third-party application T, and the data that the local application N needs to send to the third-party application T.
  • the AMS can determine the priority of the third-party application T.
  • AMS can establish a communication connection with the UI component and request the UI component to put the original display interface in the background to start Third-party applications T.
  • AMS can request the JS application framework to start the third-party application T.
  • the JS framework can load related components of third-party applications T.
  • the JS application framework can send a message to AMS to notify AMS that the third-party application T has been started. After the message is sent successfully, the JS application framework can register the interface M.
  • the interface M is the communication interface between the JS application framework and AMS. After the interface M is successfully registered, AMS can send data to the third-party application T.
  • the transmission of messages between local applications and JS applications needs to go through the kernel layer.
  • S601 Local application N sends message X1 to AMS.
  • the message X1 includes the package name of the local application N and the package name of the third-party application T, as well as the target transmission data.
  • the local application N in the wearable device 100 may send a message X1 to the AMS in the wearable device 100 .
  • Reasonable Solution The message X1 may include the package name of the local application N, the package name of the third-party application T, and the target transmission data.
  • the target transmission data refers to the data that the local application N needs to transmit to the third-party application T. Understandably, the package name is used to uniquely identify the application.
  • the target transmission data may be the user's motion data or the user's health data.
  • the target transmission data can also be other types of data, and this application does not limit this.
  • the message X1 may include Bundlename/APP_index, message, messageLength and Type. It can be understood that Bundlename/APP_index, message, messageLength and Type are all fields of message X1. Among them, Bundlename/APP_index represents the package name. message transmits data to the target. That is, the data that local application N needs to transmit to third-party application T. messageLength represents the length of the message. Its unit can be bytes. Type represents the message type.
  • the message type of message X1 is music information.
  • Type is healthdata the message type of message X1 is health data.
  • Type is navigation the message type of message X1 is navigation information.
  • Type is touchinfo the message type of message X1 is touch information.
  • the local application N can be any application among local applications.
  • the third-party application T can be any of the third-party applications.
  • the AMS determines whether there is a running application in the wearable device 100, and if there is a running application in the wearable device 100, compares the priorities of the running application and the third-party application T.
  • the AMS can check whether there is a running application in the wearable device 100. If there is no running application in the wearable device 100, the wearable device 100 can continue to perform subsequent steps. If there is a running application in the wearable device 100, the AMS can compare the priorities of the running application and the third-party application T. If the priority of the running application is not higher than the priority of the third-party application T, the wearable device 100 continues to perform subsequent steps. In the case where the priority of the running application is higher than the priority of the third-party application T, the wearable device 100 will no longer perform subsequent steps until there is no longer a priority higher than the third-party application T in the wearable device 100 and the application is running before performing subsequent steps.
  • the priority list may be stored in the wearable device 100 .
  • the priority list includes priorities corresponding to each application in the wearable device 100 .
  • the application running in the wearable device 100 may be a local application or a third-party application.
  • the AMS can send the message X2 to the UI component, thereby communicating with the UI.
  • the component establishes a communication connection.
  • message X2 may be: AMS_START_CHECK_REQUEST.
  • the UI component can receive message X2 sent by AMS.
  • the UI component can determine whether to establish a communication connection with the AMS based on the current task processing situation. If the UI component is executing other processes, the UI component may temporarily not establish a communication connection with the AMS until the UI component is no longer executing other processes and then establish a communication connection with the AMS. If UI group If there is no process being executed by the software, that is, the UI component is capable of handling other tasks, the wearable device 100 can continue to perform subsequent steps.
  • S604 The UI component sends message X3 to AMS.
  • Message X3 is used to indicate that the UI component agrees to establish a communication connection with AMS.
  • the UI component can send the message X3 to the AMS.
  • Message X3 may indicate that the UI component agrees to establish a communication connection with the AMS.
  • the message X3 may be: AMS_START_CHECK_RESPONSE.
  • AMS can receive the message X3 sent by the UI component. This means that AMS has established a communication connection with the UI component.
  • AMS sends message X4 to the UI component.
  • Message X4 is used to request the UI component to put the original display interface in the background.
  • the AMS can send the message X4 to the UI component to request the UI component to place the interface originally displayed on the display screen in the background.
  • message X4 may be: LAUNCHER_BACKGROUND.
  • the UI component can receive message X4 sent by AMS.
  • S606 The UI component sends message X5 to AMS.
  • Message X5 is used to notify AMS that the original display interface has been placed in the background.
  • the UI component can put the original display interface in the background and send message X5 to AMS so that AMS can launch the third-party application T in time.
  • message X5 may be: AMS_ONBACKGROUND.
  • AMS can receive the message X5 sent by the UI component.
  • S607 AMS sends message X6 to the JS application framework. Message X6 is used to launch third-party application T.
  • the AMS can send the message X6 to the JS application framework to notify the JS application framework to start the third-party application T.
  • message X6 is used to notify the JS application framework to launch a third-party application.
  • message X6 may be: ACTIVE.
  • the JS application framework can receive message X6 sent by AMS.
  • the JS application framework can load the relevant components of the third-party application T.
  • the relevant components of T of the third-party application may include interface display components, animation components, etc.
  • the interface display component may include the position of the control, the shape of the control, and the text corresponding to the control.
  • the animation component can be used to generate startup animations for third-party applications T, as well as animation effects during interface display.
  • the relevant components of the third-party application T may include but are not limited to: general components, container components, basic components, media components, canvas components, grid components, svg components, etc.
  • the full English name of svg is Scalable Vector Graphics, which means scalable vector graphics.
  • svg is an open standard vector graphics language and a scalable vector graphics format.
  • the JS application framework can load: jsability_launch, jsability_show.
  • the third-party application T starts to start.
  • S609 The JS application framework sends message X7 to AMS.
  • Message X7 is used to notify AMS that third-party application T has been started.
  • message X7 may be: AMS_ONACTIVE.
  • AMS can receive message X7 sent by the JS application framework.
  • S610 The JS application framework sends message X8 to the third-party application T.
  • Message X8 is used to notify the third-party application T to start the registration process.
  • the registration process refers to the process of registering the communication interface.
  • message X8 may be: sunscribemessage.
  • the third-party application T can receive the message X8 sent by the JS application framework.
  • S611 JS application framework registration interface M.
  • the interface M is the communication interface between the JS application framework and AMS.
  • the interface M is the communication interface between the JS application framework and AMS.
  • the interface M can also be understood as the communication interface between JS applications and local applications.
  • the interface M may be: TriggerSuccessCallback.
  • S612 The JS application framework sends message X9 to AMS.
  • Message X9 is used to notify AMS that interface X has been registered.
  • JS application framework can send message X9 to AMS to notify AMS that the interface M has been registered.
  • message X9 may be: AMS_REGISTER.
  • AMS can bind the interface M to facilitate subsequent communication through the interface M.
  • AMS can bind TriggerSuccessCallback.
  • S614 AMS sends message X10 to third-party application T.
  • Message X10 contains target transmission data.
  • message X10 may include target transmission data.
  • target transmission data please refer to step S601, which will not be described again here.
  • S701 Local application N sends message X11 to AMS.
  • the message X11 includes the package name of the local application N and the package name of the third-party application T, as well as the target transmission data.
  • step S701 may refer to step S601, which will not be described again here.
  • the specific content of the target transmission data included in the message X11 may be different from the specific content of the target transmission data included in the message X1.
  • the message X11 may be: AMS_SENDMESSAGE.
  • the AMS can interact with the UI component and request UI resources. For details, please refer to steps S602 to S606, which will not be described again here.
  • AMS can receive message X11 sent by local application N.
  • S702 AMS sends message X11 to third-party application T through interface M.
  • the AMS can send the message X11 to the third-party application T through the interface M.
  • interface M please refer to the above and will not be repeated here.
  • the third-party application T sends the message X12 to the AMS through the interface M.
  • Message X12 includes the package name of the third-party application T and the package name of the local application N, as well as the target transmission data.
  • the specific content of the target transmission data included in the message X12 may be different from the specific content of the target transmission data included in the message X1 and the message X11.
  • the relevant description of the target transmission data can be referred to above and will not be repeated here.
  • AMS can receive the message X12 sent by the third-party application T.
  • the AMS can interact with the UI component and request UI resources. For details, please refer to steps S602 to S606, which will not be described again here.
  • S704 AMS sends message X12 to local application N.
  • the AMS can send the message X12 to the local application N.
  • the wearable device 100 may only perform step S701 and step S702.
  • the wearable device 100 may only perform step S703 and step S704.
  • the time at which the wearable device 100 performs step S703 and step S704 may be earlier than the time at which step S701 and step S702 are performed.
  • Scenario 1 During running, once the heart rate exceeds the heart rate threshold, the local application in the wearable device 100 sends the heart rate data to a third-party application, and the third-party application starts a corresponding training course.
  • Wearable device 100 may display user interface 300 as shown in Figure 9a.
  • User interface 300 may include the user's heart rate profile. As shown in Figure 9a, the user's highest heart rate is 165 beats/min, the lowest heart rate is 49 beats/min, and the user's current heart rate is 165 beats/min. The wearable device 100 may determine that the user's current heart rate exceeds the heart rate threshold of 160 beats/minute.
  • the health application in the wearable device 100 can send the user's heart rate data to the sports application, and the sports application can start a heart rate training course.
  • wearable device 100 may display user interface 400.
  • User interface 400 is the startup interface of the sports application.
  • the wearable device 100 may also display the user interface 500 as shown in Figure 9c.
  • User interface 500 is the startup interface for the heart rate training course.
  • the health application is a native application of the wearable device 100
  • the sports application is a third-party application of the wearable device 100 .
  • S1001 The wearable device 100 detects whether the user is in motion.
  • the wearable device 100 can detect whether the user is in motion through a gyroscope sensor and an acceleration sensor.
  • the gyro sensor may be the gyro sensor 103B shown in FIG. 3
  • the acceleration sensor may be the acceleration sensor 103C shown in FIG. 3 .
  • the wearable device 100 can detect the user's exercise type (for example, running, cycling, etc.). In some embodiments of the present application, users can choose the type of exercise themselves.
  • S1002 The wearable device 100 detects whether the user's heart rate exceeds the heart rate threshold.
  • the wearable device 100 can detect the user's heart rate in real time and determine whether the user's heart rate exceeds the heart rate threshold.
  • the heart rate threshold can be set according to actual needs, and this application does not limit this.
  • the wearable device 100 may set a heart rate threshold based on the user's historical heart rate data.
  • the wearable device 100 may set a heart rate threshold according to the type of exercise. In some embodiments of the present application, the heart rate threshold may be 160 beats/minute.
  • the wearable device 100 may store the corresponding relationship between the heart rate threshold and the exercise type.
  • the heart rate threshold corresponding to running is 160 beats/minute.
  • the heart rate threshold corresponding to yoga is 130 beats/minute.
  • the heart rate threshold corresponding to cycling is 165 beats/minute.
  • the health application in the wearable device 100 sends a message to the AMS in the wearable device 100.
  • the message includes the package name of the health application, the package name of the exercise application, and heart rate data.
  • Health apps can send messages to AMS.
  • the message can include the package name of the health application, the package name of the exercise application, and the user's heart rate data. It can be understood that the user's heart rate data may include the user's current heart rate.
  • the heart rate data is the target transmission data in the above embodiment.
  • S1004 AMS detects whether the sports application is started.
  • AMS can detect whether the sports application is started. That is, AMS can detect whether the application is running or placed in the background.
  • the AMS can also detect whether the sports application has been launched before.
  • step S1009 If the sports application has been started or has been started before, the wearable device 100 continues to execute step S1009 and step S1010. If the sports application has not been started and has not been started before, the wearable device 100 continues to perform subsequent steps.
  • S1005 AMS determines whether the priority of the sports application is not lower than the priority of the currently running application.
  • step S1005 may refer to step S602, which will not be described again here.
  • S1006 AMS notifies the JS application framework to start the motion application.
  • step S1006 may refer to steps S607 to step S610.
  • AMS Before AMS notifies the JS application framework to start the sports application, it can establish a communication connection with the UI component and request the UI component to put the original display interface in the background. For details, please refer to steps S603 to S606, which will not be described again here. .
  • step S1006 may refer to step S611.
  • the JS application framework can also send a message to AMS to notify AMS that the interface M has been registered.
  • step S1006 may refer to step S613.
  • AMS sends heart rate data to the sports application through interface M.
  • the heart rate data can be sent to the sports application through the interface M.
  • S1010 The sports application determines a target training course based on heart rate data and starts the target training course.
  • the sports application After the sports application receives the heart rate data, it can determine the target training course based on the user's exercise status and exercise type, and start the target training course. Correspondingly, the wearable device 100 can display the relevant interface of the target training course.
  • the target training course when the user is running, the target training course may be a running heart rate training course.
  • the target training course when the user is cycling, the target training course may be a cycling heart rate training course.
  • the target training course when the user is doing yoga, the target training course may be a yoga heart rate training course.
  • the health application of the wearable device 100 can obtain the user's heart rate data in real time and send the heart rate data to the exercise application. Once the user's heart rate is lower than the heart rate threshold or the user stops exercising, the exercise application can end the target training course. The wearable device 100 can close the exercise application.
  • the exercise application when the user's heart rate is lower than the heart rate threshold, the exercise application can end the target training session regardless of whether the user ends the exercise.
  • the exercise application in the event that the user stops exercising, may end the target training session.
  • the exercise application may end the target training session.
  • the JS framework in the wearable device 100 has already registered the interface M. Therefore, the wearable device 100 may not perform steps S1007 and S1008.
  • the wearable device 100 can also trigger corresponding training courses based on other types of health data of the user (for example, pressure, blood oxygen, etc.). For details, please refer to the above embodiments.
  • Scenario 2 There is a running application in the wearable device 100 .
  • the wearable device 100 can detect user operations on keys.
  • the local application in the wearable device 100 may send a message to the third-party application to launch the third-party application.
  • the wearable device 100 can also put running applications in the background.
  • wearable device 100 may display user interface 600.
  • User interface 600 may be an interface for a training session in a sports application.
  • User interface 600 may include the movements the user is training, the user's heart rate, and calories burned.
  • the wearable device 100 can remind the user that a new message has been received through vibration or voice.
  • the user can press and hold the button 112 on the wearable device 100.
  • the local application in the wearable device 100 can recognize the user's long press operation. Specifically, the local application can recognize the user's long press operation as a high-level signal for more than 2 seconds.
  • wearable device 100 can send a message to the communication application to launch the communication application and display the communication interface including the new message in the communication application.
  • wearable device 100 may display user interface 700.
  • User interface 700 includes new messages from friends in the messaging application.
  • the wearable device 100 can also put the sports application in the background.
  • the sports application in the wearable device 100 can prompt the user for the next training action through voice broadcast or other methods.
  • the local application in the above embodiment is an application set up to recognize the user's operation on the keys.
  • Sports applications can be local applications or third-party applications.
  • Communication applications are third-party applications.
  • the wearable device 100 detects a user operation on a key.
  • the user can press and hold the key, and the wearable device 100 can detect the long press operation on the key. It can be understood that the user operation may also include pressing a button twice, sliding to the right on the display screen, sliding upward on the display screen, etc. This application does not limit the specific form of the user operation.
  • S1402 The local application in the wearable device 100 identifies the user operation on the button and sends a signal to the AMS in the wearable device 100. This signal is used to notify the communication application to start interface J.
  • the signal sent by the local application to the AMS may be a continuous high-level signal.
  • the signal sent by the local application to the AMS can also be multiple high-level signals within a preset time. For example, two high-level signals within 3 seconds.
  • the signals sent by the local application to the AMS can also be other types of signals, and this application does not limit this.
  • the signal sent by the local application to the AMS can also be understood as a message.
  • interface J can be a communication interface including new messages in the communication application (as shown in Figure 13).
  • S1403 AMS notifies the JS application framework to start the communication application.
  • steps S1403 to S1406 may refer to steps S1006 to S1009, which will not be described again here.
  • the interface J can be displayed.
  • the third-party application in scenario two can also be other applications other than communication applications, and this application does not limit this.
  • Scenario 3 The wearable device 100 can detect user operations acting on the corresponding interface of the local application. Local applications can send messages to third-party applications, and third-party applications have been started to implement music playback, generate QR codes, etc.
  • the user can click the corresponding control on the local music application.
  • This control is used to trigger the playback of the user's favorite song.
  • the wearable device 100 can detect the click operation.
  • the local music application can send messages to the third-party music application through the interface M. This message is used to notify third-party applications to play the user's favorite songs. After receiving the message, the third-party music application can launch the corresponding interface to realize music playback.
  • the user can click on the flight information card in the local application.
  • the wearable device 100 can detect the click operation.
  • the local application can send messages to the third-party application through the interface M. This message is used to notify third-party applications to display flight specific information.
  • the third-party application can launch the corresponding interface.
  • the wearable device 100 may display flight specific information on the display screen.
  • the JS application framework in the wearable device 100 needs to register the interface M, and the AMS needs to bind the interface M.
  • the AMS needs to bind the interface M.
  • the third-party application in the wearable device 100 can also send messages to the local application, and the local application has been started to implement functions such as schedule reminders and flight reminders.
  • GUI graphical user interface
  • Controls can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. Visual interface elements.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The present application provides a communication method and a related device. According to the communication method, a JS application framework in a wearable device can register a communication interface, and an AMS can be bound to the communication interface. A local application in the wearable device may communicate with a third-party application by means of the communication interface. In this way, the local application in the wearable device and the third-party application can realize data sharing, more application scenes can be expanded, and the user experience is improved.

Description

一种通信方法及相关设备A communication method and related equipment
本申请要求于2022年05月27日提交中国专利局、申请号为202210588160.7、申请名称为“一种通信方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on May 27, 2022, with the application number 202210588160.7 and the application title "A communication method and related equipment", the entire content of which is incorporated into this application by reference. .
技术领域Technical field
本申请涉及终端技术领域,尤其涉及一种通信方法及相关设备。The present application relates to the field of terminal technology, and in particular, to a communication method and related equipment.
背景技术Background technique
目前,部分可穿戴设备中的第三方应用采用JavaScript(简称JS)语言进行开发,而本地应用基于操作系统(Operating System,OS)进行开发。可穿戴设备中的第三方应用与本地应用无法进行通信,因此二者的数据无法分享,也就无法融合使用。Currently, some third-party applications in wearable devices are developed using JavaScript (JS for short) language, while local applications are developed based on the operating system (Operating System, OS). Third-party applications in wearable devices cannot communicate with local applications, so the data between the two cannot be shared and cannot be integrated and used.
因此,如何实现可穿戴设备中的第三方应用与本地应用之间的通信是目前亟待解决的问题。Therefore, how to realize communication between third-party applications and local applications in wearable devices is an issue that needs to be solved urgently.
发明内容Contents of the invention
本申请提供了一种通信方法及相关设备。根据该通信方法,可穿戴设备中的JS应用框架可以注册通信接口,AMS可以绑定该通信接口。可穿戴设备中的本地应用可以通过该通信接口与第三方应用进行通信。通过这种方式,可穿戴设备中的本地应用和第三方应用可以实现数据共享,可以扩展更多的应用场景,提升了用户体验。This application provides a communication method and related equipment. According to this communication method, the JS application framework in the wearable device can register the communication interface, and AMS can bind the communication interface. Local applications in wearable devices can communicate with third-party applications through this communication interface. In this way, local applications and third-party applications in wearable devices can share data, expand more application scenarios, and improve user experience.
第一方面,本申请提供了一种通信方法。该方法可以应用于电子设备。该方法可以包括:电子设备中的本地应用向电子设备中的能力管理服务AMS发送第一消息;AMS通过第一通信接口向电子设备中的第三方应用发送第一消息;或者,AMS接收第三方应用通过第一通信接口发送的第二消息;AMS向本地应用发送第二消息。其中,第一通信接口为AMS与电子设备中的JS应用框架之间的通信接口。第一消息包括本地应用的包名、第三方应用的包名,以及第一目标传输数据。第二消息包括第三方应用的包名、本地应用的包名,以及第二目标传输数据。In a first aspect, this application provides a communication method. This method can be applied to electronic devices. The method may include: the local application in the electronic device sends a first message to the capability management service AMS in the electronic device; the AMS sends the first message to a third-party application in the electronic device through the first communication interface; or, the AMS receives the third-party The application sends the second message through the first communication interface; the AMS sends the second message to the local application. The first communication interface is a communication interface between the AMS and the JS application framework in the electronic device. The first message includes the package name of the local application, the package name of the third-party application, and the first target transmission data. The second message includes the package name of the third-party application, the package name of the local application, and the second target transmission data.
在本申请提供的方案中,电子设备中的本地应用可以向AMS发送第一消息,AMS再通过第一通信接口将第一消息发送给第三方应用。也就是说,电子设备中的本地应用可以通过第一通信接口向电子设备中的第三方应用发送数据。电子设备中的AMS还可以接收第三方应用通过第一通信接口发送的第二消息,并将该第二消息发送给本地应用。也就是说,电子设备中的第三方应用可以通过第一通信接口向电子设备中的本地应用发送数据。通过这种方式,电子设备可以通过第一通信接口实现本地应用和第三方应用之间的交互,从而实现数据共享,更多的应用场景得以实现,提升了用户体验。In the solution provided by this application, the local application in the electronic device can send the first message to the AMS, and the AMS sends the first message to the third-party application through the first communication interface. That is to say, the local application in the electronic device can send data to the third-party application in the electronic device through the first communication interface. The AMS in the electronic device may also receive a second message sent by the third-party application through the first communication interface, and send the second message to the local application. That is to say, the third-party application in the electronic device can send data to the local application in the electronic device through the first communication interface. In this way, the electronic device can realize the interaction between the local application and the third-party application through the first communication interface, thereby realizing data sharing, realizing more application scenarios and improving the user experience.
在本申请的一些实施例中,第一通信接口可以为后述实施例中的接口M。In some embodiments of the present application, the first communication interface may be the interface M in the embodiments described below.
需要说明的是,电子设备中的任一本地应用和任一第三方应用均可以基于第一通信接口来进行通信。在本申请的一些实施例中,本地应用中可以包括调用第一通信接口的相关指令。类似的,第三方应用中可以包括调用第一通信接口的相关指令。 It should be noted that any local application and any third-party application in the electronic device can communicate based on the first communication interface. In some embodiments of the present application, the local application may include relevant instructions for calling the first communication interface. Similarly, the third-party application may include relevant instructions for calling the first communication interface.
在本申请的一些实施例中,第一消息可以为后述实施例中的消息X11。In some embodiments of the present application, the first message may be message X11 in the embodiments described later.
在本申请的一些实施例中,第二消息可以为后述实施例中的消息X12。In some embodiments of the present application, the second message may be message X12 in the embodiments described below.
可理解,关于第一目标传输数据和第二目标传输数据的具体含义可以参见后述实施例中对目标传输数据的相关描述,在此不展开说明。It can be understood that for the specific meaning of the first target transmission data and the second target transmission data, please refer to the relevant description of the target transmission data in the embodiments to be described later, and the description will not be further elaborated here.
需要说明的是,权利要求中所提及的本地应用可以为电子设备中的任一本地应用。在本申请的一些实施例中,权利要求中所提及的本地应用可以为后述实施例中的本地应用N。It should be noted that the local application mentioned in the claims can be any local application in the electronic device. In some embodiments of this application, the local application mentioned in the claims may be the local application N in the embodiments described below.
类似的,还需要说明的是,权利要求中所提及的第三方应用可以为电子设备中的任一第三方应用。在本申请的一些实施例中,权利要求中所提及的第三方应用可以为后述实施例中的第三方应用T。Similarly, it should be noted that the third-party application mentioned in the claims can be any third-party application in the electronic device. In some embodiments of this application, the third-party application mentioned in the claims may be the third-party application T in the embodiments described below.
还需要说明的是,权利要求中所提及的电子设备可以为后述实施例中所提及的可穿戴设备。It should also be noted that the electronic device mentioned in the claims may be a wearable device mentioned in the embodiments described below.
结合第一方面,在一种可能的实现方式中,电子设备中的本地应用向电子设备中的能力管理服务AMS发送第一消息之前,或者,AMS接收第三方应用通过第一通信接口发送的第二消息之前,该方法还可以包括:电子设备启动第三方应用;JS应用框架注册第一通信接口;AMS绑定第一通信接口。In connection with the first aspect, in a possible implementation manner, before the local application in the electronic device sends the first message to the capability management service AMS in the electronic device, or the AMS receives the third message sent by the third-party application through the first communication interface. Before sending the second message, the method may also include: the electronic device starts a third-party application; the JS application framework registers the first communication interface; and the AMS binds the first communication interface.
在本申请提供的方案中,在基于第一通信接口实现本地应用和第三方应用之间的通信之间,电子设备可以注册第一通信接口。具体的,电子设备启动第三方应用之后,电子设备中的JS应用框架可以注册第一通信接口,相应的,AMS可以绑定第一通信接口。In the solution provided by this application, between realizing communication between the local application and the third-party application based on the first communication interface, the electronic device can register the first communication interface. Specifically, after the electronic device starts the third-party application, the JS application framework in the electronic device can register the first communication interface, and accordingly, the AMS can bind the first communication interface.
在本申请的一些实施例中,用户操作触发电子设备启动第三方应用,电子设备可以启动注册流程来注册第一通信接口。通过这种方式,电子设备可以在本地应用和第三方应用进行通信之前就注册第一通信接口,无需等到本地应用向第三方应用发送消息时才注册,或者第三方应用向本地应用发送消息时才注册,节省了本地应用和第三方应用之间的通信时间。In some embodiments of the present application, the user operation triggers the electronic device to start a third-party application, and the electronic device can start a registration process to register the first communication interface. In this way, the electronic device can register the first communication interface before the local application communicates with the third-party application, and does not need to wait until the local application sends a message to the third-party application to register, or the third-party application sends a message to the local application. Registration saves communication time between local applications and third-party applications.
示例性的,用户点击第三方应用的应用图标,响应于该点击操作,电子设备启动第三方应用,并启动注册流程。注册流程可以包括:JS应用框架注册第一通信接口,并通知AMS绑定第一通信接口。For example, the user clicks the application icon of the third-party application, and in response to the click operation, the electronic device launches the third-party application and starts the registration process. The registration process may include: the JS application framework registers the first communication interface and notifies the AMS to bind the first communication interface.
示例性的,用户在浏览另一应用中触发启动了第三方应用,电子设备也可以启动注册流程。For example, the user triggers the launch of a third-party application while browsing another application, and the electronic device can also initiate the registration process.
需要说明的是,在本申请的一些实施例中,电子设备开机后,第三方应用第一次启动之后,就可以触发启动注册流程来注册第一通信接口。It should be noted that in some embodiments of the present application, after the electronic device is turned on and the third-party application is started for the first time, the registration process can be triggered to register the first communication interface.
在本申请的又一些实施例中,本地应用通过AMS向第三方应用发送消息,在这个过程中,第三方应用会启动,在第三方应用启动之后,电子设备可以启动注册流程。进一步的,JS应用框架注册第一通信接口,并通知AMS绑定第一通信接口。In some embodiments of the present application, the local application sends a message to the third-party application through the AMS. During this process, the third-party application will be started. After the third-party application is started, the electronic device can start the registration process. Further, the JS application framework registers the first communication interface and notifies AMS to bind the first communication interface.
结合第一方面,在一种可能的实现方式中,电子设备启动第三方应用之前,该方法还可以包括:本地应用向AMS发送第三消息;AMS确定电子设备中是否存在正在运行的应用,并在电子设备中存在正在运行的应用的情况下,比较正在运行的应用与第三方应用的 优先级。电子设备启动第三方应用,具体可以包括:在电子设备中不存在正在运行的应用,或者,正在运行的应用的优先级不高于第三方应用的优先级的情况下,电子设备启动第三方应用。AMS绑定第一通信接口之后,该方法还可以包括:AMS通过第一通信接口向第三方应用发送第三目标传输数据。其中,第三消息包括本地应用的包名、第三方应用的包名,以及第三目标传输数据。Combined with the first aspect, in one possible implementation, before the electronic device starts the third-party application, the method may also include: the local application sends a third message to the AMS; the AMS determines whether there is a running application in the electronic device, and In the case where there is a running application in the electronic device, compare the running application with the third-party application priority. The electronic device starts a third-party application, which may specifically include: when there is no running application in the electronic device, or the priority of the running application is not higher than the priority of the third-party application, the electronic device starts the third-party application. . After the AMS binds the first communication interface, the method may further include: the AMS sends the third target transmission data to the third-party application through the first communication interface. The third message includes the package name of the local application, the package name of the third-party application, and the third target transmission data.
在本申请提供的方案中,本地应用通过AMS向第三方应用发送消息,在这个过程中,第三方应用会启动,在第三方应用启动之后,电子设备可以启动注册流程。值得注意的是,电子设备只有在不存在正在运行的应用,或者,正在运行的应用的优先级不高于第三方应用的优先级的情况下才会启动第三方应用。这也就意味着,电子设备只有在不影响更高优先级的应用运行状况的情况下才启动第三方应用,进而启动注册流程,充分考虑了用户需求和体验。In the solution provided by this application, the local application sends a message to the third-party application through the AMS. During this process, the third-party application will be started. After the third-party application is started, the electronic device can start the registration process. It is worth noting that the electronic device will start a third-party application only when there is no running application, or the priority of the running application is not higher than the priority of the third-party application. This means that the electronic device will only launch third-party applications and then start the registration process if it does not affect the running status of higher-priority applications, fully considering user needs and experience.
在本申请的一些实施例中,第三消息可以为后述实施例中的消息X1。In some embodiments of the present application, the third message may be message X1 in the embodiments described below.
可理解,关于第三目标传输数据的具体含义可以参见后述实施例中对目标传输数据的相关描述,在此不展开说明。It can be understood that for the specific meaning of the third target transmission data, please refer to the relevant description of the target transmission data in the embodiments to be described later, and will not be described here.
结合第一方面,在一种可能的实现方式中,JS应用框架注册第一通信接口之前,该方法还可以包括:JS应用框架向第三方应用发送第四消息。JS应用框架注册第一通信接口之后,该方法还可以包括:JS应用框架向AMS发送第五消息。其中,第四消息用于通知第三方应用启动注册流程。第五消息用于通知AMS第一通信接口已注册。Combined with the first aspect, in a possible implementation manner, before the JS application framework registers the first communication interface, the method may further include: the JS application framework sends a fourth message to the third-party application. After the JS application framework registers the first communication interface, the method may further include: the JS application framework sends a fifth message to the AMS. Among them, the fourth message is used to notify the third-party application to start the registration process. The fifth message is used to notify AMS that the first communication interface has been registered.
在本申请的一些实施例中,第四消息可以为后述实施例中的消息X8。In some embodiments of the present application, the fourth message may be message X8 in the embodiments described below.
在本申请的一些实施例中,第五消息可以为后述实施例中的消息X9。In some embodiments of the present application, the fifth message may be message X9 in the embodiments described below.
结合第一方面,在一种可能的实现方式中,电子设备启动第三方应用,具体可以包括:AMS向JS应用框架发送第六消息;JS应用框架加载第三方应用的相关组件,并向AMS发送第七消息。其中,第六消息用于通知JS应用框架启动第三方应用;第七消息用于通知AMS第三方应用已启动。Combined with the first aspect, in a possible implementation manner, the electronic device starts a third-party application, which may specifically include: AMS sending a sixth message to the JS application framework; the JS application framework loads relevant components of the third-party application and sends them to the AMS. Seventh news. Among them, the sixth message is used to notify the JS application framework to start the third-party application; the seventh message is used to notify the AMS that the third-party application has been started.
在本申请的一些实施例中,第六消息可以为后述实施例中的消息X6。In some embodiments of the present application, the sixth message may be message X6 in the embodiments described below.
在本申请的一些实施例中,第七消息可以为后述实施例中的消息X7。In some embodiments of the present application, the seventh message may be message X7 in the embodiments described below.
可理解,JS应用框架加载第三方应用的相关组件的具体方式可以参见后述实施例,在此不展开说明。It can be understood that the specific manner in which the JS application framework loads relevant components of third-party applications can be found in the embodiments described later, and will not be described here.
结合第一方面,在一种可能的实现方式中,电子设备启动第三方应用之前,该方法还可以包括:AMS与电子设备中的UI组件建立通信连接;AMS请求UI组件将原显示界面置于后台。Combined with the first aspect, in a possible implementation manner, before the electronic device starts the third-party application, the method may also include: AMS establishing a communication connection with the UI component in the electronic device; AMS requesting the UI component to place the original display interface in Backstage.
在本申请提供的方案中,电子设备启动第三方应用之前,可以先请求UI组件提高界面资源,以便显示第三方应用的相关界面。In the solution provided by this application, before starting a third-party application, the electronic device can first request the UI component to increase the interface resources so as to display the relevant interface of the third-party application.
可理解,AMS与电子设备中的UI组件建立通信连接的具体方式可以参见后述实施例,在此不展开说明。 It can be understood that the specific method for establishing a communication connection between the AMS and the UI component in the electronic device can be referred to the embodiments described later, and will not be described here.
结合第一方面,在一种可能的实现方式中,AMS通过第一通信接口向电子设备中的第三方应用发送第一消息之后,该方法还可以包括:AMS接收第三方应用通过第一通信接口发送的第八消息;AMS向第三方应用发送第八消息。其中,第八消息包括第三方应用的包名、本地应用的包名,以及第四目标传输数据。In conjunction with the first aspect, in one possible implementation, after the AMS sends the first message to the third-party application in the electronic device through the first communication interface, the method may further include: the AMS receives the third-party application through the first communication interface. The eighth message sent; AMS sends the eighth message to the third-party application. Among them, the eighth message includes the package name of the third-party application, the package name of the local application, and the fourth target transmission data.
在本申请提供的方案中,电子设备中的本地应用可以作为消息的发送方来与第三方应用进行通信,也可以作为消息的接收方来与第三方应用进行通信。也就是说,注册通信接口之后,电子设备不限制本地应用和第三方应用之间通信时的消息发送方和消息接收方,可以最大化实现数据共享,从而扩展更多的应用场景,提升了用户体验。In the solution provided by this application, the local application in the electronic device can communicate with the third-party application as the sender of the message, and can also communicate with the third-party application as the receiver of the message. In other words, after registering the communication interface, the electronic device does not limit the message sender and message receiver when communicating between local applications and third-party applications, and can maximize data sharing, thereby expanding more application scenarios and improving user experience. experience.
在本申请的一些实施例中,第八消息可以为后述实施例中的消息X12。In some embodiments of the present application, the eighth message may be message X12 in the embodiments described below.
可理解,关于第四目标传输数据的具体含义可以参见后述实施例中对目标传输数据的相关描述,在此不展开说明。It can be understood that for the specific meaning of the fourth target transmission data, please refer to the relevant description of the target transmission data in the embodiments to be described later, and will not be described here.
结合第一方面,在一种可能的实现方式中,AMS接收第三方应用通过第一通信接口发送的第二消息之后,该方法还可以包括:本地应用向AMS发送第九消息;AMS通过第一通信接口向第三方应用发送第九消息。其中,第九消息包括本地应用的包名、第三方应用的包名,以及第五目标传输数据。In conjunction with the first aspect, in a possible implementation manner, after the AMS receives the second message sent by the third-party application through the first communication interface, the method may further include: the local application sends a ninth message to the AMS; the AMS through the first communication interface The communication interface sends a ninth message to the third-party application. Among them, the ninth message includes the package name of the local application, the package name of the third-party application, and the fifth target transmission data.
在本申请的一些实施例中,第九消息可以为后述实施例中的消息X11。In some embodiments of the present application, the ninth message may be message X11 in the embodiments described below.
可理解,关于第五目标传输数据的具体含义可以参见后述实施例中对目标传输数据的相关描述,在此不展开说明。It can be understood that for the specific meaning of the fifth target transmission data, please refer to the relevant description of the target transmission data in the embodiments to be described later, and will not be described here.
第二方面,本申请提供了一种电子设备。该电子设备可以包括显示屏、存储器,以及一个或多个处理器。其中,存储器可以与一个或多个处理器耦合。存储器用于存储计算机程序。处理器用于调用计算机程序,使得第一方面任一项方法。具体的,处理器可以用于:本地应用向电子设备中的能力管理服务AMS发送第一消息;AMS通过第一通信接口向第三方应用发送第一消息;或者,AMS接收第三方应用通过第一通信接口发送的第二消息;AMS向本地应用发送第二消息。其中,第一通信接口为AMS与电子设备中的JS应用框架之间的通信接口。第一消息包括本地应用的包名、第三方应用的包名,以及第一目标传输数据。第二消息包括第三方应用的包名、本地应用的包名,以及第二目标传输数据。In a second aspect, the present application provides an electronic device. The electronic device may include a display, memory, and one or more processors. Wherein, the memory may be coupled with one or more processors. Memory is used to store computer programs. The processor is used to call the computer program to perform any method of the first aspect. Specifically, the processor may be configured to: the local application sends a first message to the capability management service AMS in the electronic device; the AMS sends the first message to the third-party application through the first communication interface; or the AMS receives the third-party application through the first communication interface. The second message sent by the communication interface; the AMS sends the second message to the local application. The first communication interface is a communication interface between the AMS and the JS application framework in the electronic device. The first message includes the package name of the local application, the package name of the third-party application, and the first target transmission data. The second message includes the package name of the third-party application, the package name of the local application, and the second target transmission data.
结合第二方面,在一种可能的实现方式中,处理器在用于:本地应用向电子设备中的能力管理服务AMS发送第一消息之前,或者,AMS接收第三方应用通过第一通信接口发送的第二消息之前,还可以用于:启动第三方应用;JS应用框架注册第一通信接口;AMS绑定第一通信接口。Combined with the second aspect, in a possible implementation manner, the processor is configured to: before the local application sends a first message to the capability management service AMS in the electronic device, or the AMS receives a message sent by a third-party application through the first communication interface Before the second message, it can also be used to: start a third-party application; JS application framework registers the first communication interface; AMS binds the first communication interface.
结合第二方面,在一种可能的实现方式中,处理器在用于启动第三方应用之前,还可以用于:本地应用向AMS发送第三消息;AMS确定电子设备中是否存在正在运行的应用,并在电子设备中存在正在运行的应用的情况下,比较正在运行的应用与第三方应用的优先级。处理器用于启动第三方应用,具体可以用于:在电子设备中不存在正在运行的应用,或者,正在运行的应用的优先级不高于第三方应用的优先级的情况下,启动第三方应用。 AMS绑定第一通信接口之后,处理器还可以用于:AMS通过第一通信接口向第三方应用发送第三目标传输数据。其中,第三消息包括本地应用的包名、第三方应用的包名,以及第三目标传输数据。Combined with the second aspect, in a possible implementation, before being used to launch a third-party application, the processor can also be used to: the local application sends a third message to the AMS; the AMS determines whether there is a running application in the electronic device , and when there is a running application in the electronic device, compare the priorities of the running application and the third-party application. The processor is used to launch third-party applications. Specifically, it can be used to: launch third-party applications when there is no running application in the electronic device, or the priority of the running application is not higher than the priority of the third-party application. . After the AMS binds the first communication interface, the processor may also be configured to: the AMS sends the third target transmission data to the third-party application through the first communication interface. The third message includes the package name of the local application, the package name of the third-party application, and the third target transmission data.
结合第二方面,在一种可能的实现方式中,处理器在用于:JS应用框架注册第一通信接口之前,处理器还可以用于:JS应用框架向第三方应用发送第四消息。处理器在用于:JS应用框架注册第一通信接口之后,处理器还可以用于:JS应用框架向AMS发送第五消息。其中,第四消息用于通知第三方应用启动注册流程。第五消息用于通知AMS第一通信接口已注册。Combined with the second aspect, in a possible implementation manner, before the processor is used for the JS application framework to register the first communication interface, the processor may also be used for the JS application framework to send a fourth message to the third-party application. After the processor is used by the JS application framework to register the first communication interface, the processor can also be used by the JS application framework to send the fifth message to the AMS. Among them, the fourth message is used to notify the third-party application to start the registration process. The fifth message is used to notify AMS that the first communication interface has been registered.
结合第二方面,在一种可能的实现方式中,处理器在用于启动第三方应用时,具体可以用于:AMS向JS应用框架发送第六消息;JS应用框架加载第三方应用的相关组件,并向AMS发送第七消息。其中,第六消息用于通知JS应用框架启动第三方应用;第七消息用于通知AMS第三方应用已启动。Combined with the second aspect, in one possible implementation, when the processor is used to launch a third-party application, it can be specifically used to: AMS send the sixth message to the JS application framework; the JS application framework loads relevant components of the third-party application , and sends the seventh message to AMS. Among them, the sixth message is used to notify the JS application framework to start the third-party application; the seventh message is used to notify the AMS that the third-party application has been started.
结合第二方面,在一种可能的实现方式中,处理器在用于启动第三方应用之前,还可以用于:AMS与电子设备中的UI组件建立通信连接;AMS请求UI组件将原显示界面置于后台。Combined with the second aspect, in one possible implementation, before being used to launch a third-party application, the processor can also be used to: establish a communication connection between the AMS and the UI component in the electronic device; the AMS requests the UI component to display the original interface. Put in the background.
结合第二方面,在一种可能的实现方式中,处理器在用于:AMS通过第一通信接口向电子设备中的第三方应用发送第一消息之后,还可以用于:AMS接收第三方应用通过第一通信接口发送的第八消息;AMS向第三方应用发送第八消息。其中,第八消息包括第三方应用的包名、本地应用的包名,以及第四目标传输数据。In conjunction with the second aspect, in a possible implementation manner, after the processor is configured for: the AMS to send the first message to the third-party application in the electronic device through the first communication interface, the processor may also be configured for: the AMS to receive the third-party application. The eighth message is sent through the first communication interface; the AMS sends the eighth message to the third-party application. Among them, the eighth message includes the package name of the third-party application, the package name of the local application, and the fourth target transmission data.
结合第二方面,在一种可能的实现方式中,处理器在用于:AMS接收第三方应用通过第一通信接口发送的第二消息之后,还可以用于:本地应用向AMS发送第九消息;AMS通过第一通信接口向第三方应用发送第九消息。其中,第九消息包括本地应用的包名、第三方应用的包名,以及第五目标传输数据。Combined with the second aspect, in a possible implementation manner, after the processor is used for: the AMS to receive the second message sent by the third-party application through the first communication interface, the processor can also be used for: the local application to send the ninth message to the AMS. ; The AMS sends the ninth message to the third-party application through the first communication interface. Among them, the ninth message includes the package name of the local application, the package name of the third-party application, and the fifth target transmission data.
第三方面,本申请提供一种计算机存储介质,包括计算机指令,当该计算机指令在电子设备上运行时,使得该电子设备执行上述第一方面中任一种可能的实现方式。In a third aspect, the present application provides a computer storage medium that includes computer instructions. When the computer instructions are run on an electronic device, the electronic device causes the electronic device to execute any of the possible implementations of the first aspect.
第四方面,本申请实施例提供一种芯片,该芯片可以应用于电子设备,该芯片包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行上述第一方面中任一种可能的实现方式。In a fourth aspect, embodiments of the present application provide a chip that can be applied to electronic equipment. The chip includes one or more processors, and the processor is used to call computer instructions to cause the electronic equipment to execute any of the above-mentioned first aspects. One possible implementation.
第五方面,本申请实施例提供一种包含指令的计算机程序产品,当该计算机程序产品在电子设备上运行时,使得该电子设备执行上述第一方面任一种可能的实现方式。In a fifth aspect, embodiments of the present application provide a computer program product containing instructions, which when the computer program product is run on an electronic device, causes the electronic device to execute any of the possible implementations of the first aspect.
可理解,上述第二方面提供的电子设备、第三方面提供的计算机存储介质、第四方面提供的芯片,以及第五方面提供的计算机程序产品均用于执行上述第一方面中任一种可能的实现方式。因此,其所能达到的有益效果可参考上述第一方面中任一种可能的实现方式的有益效果,此处不再赘述。It can be understood that the electronic device provided by the second aspect, the computer storage medium provided by the third aspect, the chip provided by the fourth aspect, and the computer program product provided by the fifth aspect are all used to execute any possibility of the first aspect. way of implementation. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of any possible implementation method in the first aspect, and will not be described again here.
附图说明Description of drawings
图1为本申请实施例提供的一种通信场景示意图; Figure 1 is a schematic diagram of a communication scenario provided by an embodiment of the present application;
图2为本申请实施例提供的一种可穿戴设备100的结构示意图;Figure 2 is a schematic structural diagram of a wearable device 100 provided by an embodiment of the present application;
图3为本申请实施例提供的一种可穿戴设备100的硬件结构示意图;Figure 3 is a schematic diagram of the hardware structure of a wearable device 100 provided by an embodiment of the present application;
图4为本申请实施例提供的一种可穿戴设备100的软件结构示意图;Figure 4 is a schematic software structure diagram of a wearable device 100 provided by an embodiment of the present application;
图5为本申请实施例提供的一种可穿戴设备应用间通信过程的示意图;Figure 5 is a schematic diagram of a communication process between wearable device applications provided by an embodiment of the present application;
图6为本申请实施例提供的一种通信方法的流程图;Figure 6 is a flow chart of a communication method provided by an embodiment of the present application;
图7为本申请实施例提供的又一种通信方法的流程图;Figure 7 is a flow chart of yet another communication method provided by an embodiment of the present application;
图8为本申请实施例提供的又一种通信场景示意图;Figure 8 is a schematic diagram of another communication scenario provided by an embodiment of the present application;
图9a-图9c为本申请实施例提供的一组用户界面示意图;Figures 9a-9c are a set of user interface schematic diagrams provided by embodiments of the present application;
图10为本申请实施例提供的又一种通信方法的流程图;Figure 10 is a flow chart of yet another communication method provided by an embodiment of the present application;
图11为本申请实施例提供的又一种通信场景示意图;Figure 11 is a schematic diagram of another communication scenario provided by an embodiment of the present application;
图12为本申请实施例提供的又一种通信场景示意图;Figure 12 is a schematic diagram of another communication scenario provided by an embodiment of the present application;
图13为本申请实施例提供的一种用户界面示意图;Figure 13 is a schematic diagram of a user interface provided by an embodiment of the present application;
图14为本申请实施例提供的又一种通信方法的流程图。Figure 14 is a flow chart of yet another communication method provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Among them, in the description of the embodiments of this application, unless otherwise stated, "/" means or, for example, A/B can mean A or B; "and/or" in the text is only a way to describe related objects. The association relationship means that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiment of the present application , "plurality" means two or more than two.
应当理解,本申请的说明书和权利要求书及附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be understood that the terms "first", "second", etc. in the description, claims and drawings of this application are used to distinguish different objects, rather than describing a specific sequence. Furthermore, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes Other steps or units inherent to such processes, methods, products or devices.
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本申请所描述的实施例可以与其它实施例相结合。Reference in this application to "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
目前,可穿戴设备中的第三方应用采用JS语言进行开发,底层通过Jerryscript调用C++接口。可理解,JS语言是一种具有函数优先的轻量级,解释型或即时编译型的编程语言。C++是一种静态类型的、编译式的、通用的、大小写敏感的、不规则的编程语言,支持过程化编程、面向对象编程和泛型编程。可理解,Jerryscript是一个轻量级的JS引擎。Currently, third-party applications in wearable devices are developed using JS language, and the underlying layer calls C++ interfaces through Jerryscript. It is understandable that the JS language is a lightweight, interpreted or just-in-time compiled programming language with function priority. C++ is a statically typed, compiled, general-purpose, case-sensitive, irregular programming language that supports procedural programming, object-oriented programming and generic programming. Understandably, Jerryscript is a lightweight JS engine.
如图1所示,可穿戴设备100可以与终端设备200建立通信连接,从而实现和终端设备200之间的信息交互。可理解,该通信连接可以为蓝牙连接。在本申请的一些实施例中,可穿戴设备中的第三方应用可以通过穿戴设备服务wearkit service实现和手机等终端设备之间的信息交互。可理解,wearkit service是手机和手表之间的一种通信协议,其具体说明 可参考相关技术文档。As shown in FIG. 1 , the wearable device 100 can establish a communication connection with the terminal device 200 to realize information interaction with the terminal device 200 . It is understood that the communication connection may be a Bluetooth connection. In some embodiments of this application, third-party applications in wearable devices can implement information interaction with terminal devices such as mobile phones through the wearable device service wearkit service. It can be understood that wearkit service is a communication protocol between mobile phones and watches. Its specific description Please refer to relevant technical documents.
然而,可穿戴设备100中的本地应用基于OS的底层框架进行开发。这也就意味着,可穿戴设备100中的第三方应用与本地应用之间无法进行通信,二者无法实现数据共享。However, the native applications in the wearable device 100 are developed based on the underlying framework of the OS. This means that the third-party application and the local application in the wearable device 100 cannot communicate, and the two cannot share data.
可理解,操作系统(即OS)是管理计算机硬件与软件资源的计算机程序。操作系统需要处理如管理与配置内存、决定系统资源供需的优先次序、控制输入设备与输出设备、操作网络与管理文件系统等基本事务。操作系统也提供一个让用户与系统交互操作的界面。It can be understood that an operating system (OS) is a computer program that manages computer hardware and software resources. The operating system needs to handle basic tasks such as managing and configuring memory, determining the priority of system resource supply and demand, controlling input and output devices, operating the network, and managing the file system. The operating system also provides an interface for users to interact with the system.
可理解,可穿戴设备100可以为智能手表、智能手环等设备,本申请对可穿戴设备100的具体类型不作限制。It can be understood that the wearable device 100 can be a smart watch, a smart bracelet, or other devices, and this application does not limit the specific type of the wearable device 100 .
本申请提供了一种通信方法及相关设备。根据该通信方法,可穿戴设备100中的JS应用框架可以注册通信接口,AMS可以绑定该通信接口。可穿戴设备100中的本地应用可以通过该通信接口与第三方应用进行通信。通过这种方式,可穿戴设备100中的本地应用和第三方应用可以实现数据共享,可以扩展更多的应用场景,提升了用户体验。This application provides a communication method and related equipment. According to this communication method, the JS application framework in the wearable device 100 can register a communication interface, and the AMS can bind the communication interface. Local applications in the wearable device 100 can communicate with third-party applications through the communication interface. In this way, local applications and third-party applications in the wearable device 100 can share data, expand more application scenarios, and improve user experience.
下面首先介绍本申请涉及的装置。The device involved in this application is first introduced below.
请参阅图2,图2为本申请实施例提供的一种可穿戴设备100的结构示意图。Please refer to FIG. 2 , which is a schematic structural diagram of a wearable device 100 provided by an embodiment of the present application.
如图2所示,可穿戴设备100可以包括主体部件110和穿戴部件120。As shown in FIG. 2 , the wearable device 100 may include a main body part 110 and a wearable part 120 .
其中,主体部件110可以设置有传感器、显示屏等。可穿戴设备100可以通过传感器判断用户的运动状态,并采集用户的运动数据(例如,跑步轨迹、跳绳数量、运动时间等)和健康数据(例如,心率、血氧、压力等)。可穿戴设备100还可以将采集到的健康数据、运动数据通过显示屏进行显示。当然,可穿戴设备100的显示屏还可以显示时间、电量、蓝牙连接状态等。主体部件110还可以包括按键111和按键112。主体部件110还可以包括磁吸触点。可穿戴设备100可以通过该磁吸触点进行充电。Among them, the main body component 110 may be provided with sensors, a display screen, etc. The wearable device 100 can determine the user's motion status through sensors and collect the user's motion data (eg, running trajectory, number of rope skipping, exercise time, etc.) and health data (eg, heart rate, blood oxygen, pressure, etc.). The wearable device 100 can also display the collected health data and exercise data through the display screen. Of course, the display screen of the wearable device 100 can also display time, power, Bluetooth connection status, etc. The main body part 110 may also include buttons 111 and 112 . Body component 110 may also include magnetic contacts. The wearable device 100 can be charged through the magnetic contacts.
穿戴部件120可以用于安装主体部件110。如图2所示,穿戴部件120可以是手环带或表带等部件,可以使得主体部件110附着在用户的身体(例如,手腕)上。Wearing component 120 may be used to mount body component 110 . As shown in FIG. 2 , the wearing component 120 may be a bracelet, a watch strap, or other component, which allows the main component 110 to be attached to the user's body (eg, wrist).
下面结合图3具体介绍本申请实施例提供的一种可穿戴设备100的硬件结构。The following is a detailed introduction to the hardware structure of a wearable device 100 provided by an embodiment of the present application with reference to FIG. 3 .
可穿戴设备100可以包括处理器101、无线通信模块102、传感器模块103、充电管理模块104、电源管理模块1041、电池1042、磁吸触点105、音频模块106、扬声器106A、受话器106B、麦克风106C、显示屏107、按键108和存储器109。The wearable device 100 may include a processor 101, a wireless communication module 102, a sensor module 103, a charging management module 104, a power management module 1041, a battery 1042, a magnetic contact 105, an audio module 106, a speaker 106A, a receiver 106B, and a microphone 106C. , display screen 107, buttons 108 and memory 109.
可以理解的是,本发明实施例示意的结构并不构成对可穿戴设备100的具体限定。在本申请另一些实施例中,可穿戴设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the wearable device 100 . In other embodiments of the present application, the wearable device 100 may include more or less components than shown in the figures, or combine some components, or split some components, or arrange different components. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
处理器101可以包括一个或多个处理单元,例如:处理器101可以包括应用处理器(Application Processor,AP),调制解调处理器,图形处理器(Graphics Processing unit,GPU),图像信号处理器(Image Signal Processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(Digital Signal Processor,DSP),基带处理器,和/或神经网络处理器 (Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 101 may include one or more processing units. For example, the processor 101 may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing unit, GPU), and an image signal processor. (Image Signal Processor, ISP), controller, memory, video codec, digital signal processor (Digital Signal Processor, DSP), baseband processor, and/or neural network processor (Neural-network Processing Unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors.
其中,控制器可以是可穿戴设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the wearable device 100 . The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
在本申请提供的实施例中,可穿戴设备100可以通过处理器101执行所述通信方法。In the embodiment provided in this application, the wearable device 100 can execute the communication method through the processor 101.
处理器101中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器101中的存储器为高速缓冲存储器。该存储器可以保存处理器101刚用过或循环使用的指令或数据。如果处理器101需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器101的等待时间,因而提高了系统的效率。The processor 101 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 101 is a cache memory. This memory may hold instructions or data that have been recently used or recycled by the processor 101 . If the processor 101 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 101 is reduced, thus improving the efficiency of the system.
在本申请的一些实施例中,处理器101可以包括一个或多个接口。该接口可以用于连接可穿戴设备100和外围设备。该接口还可以用于连接其他电子设备。例如,AR设备等。In some embodiments of the present application, processor 101 may include one or more interfaces. This interface can be used to connect the wearable device 100 and peripheral devices. This interface can also be used to connect other electronic devices. For example, AR equipment, etc.
无线通信模块102可以提供应用在可穿戴设备100上的包括无线局域网(Wireless Local Area Networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络),蓝牙(Bluetooth,BT),全球导航卫星系统(Global Navigation Satellite System,GNSS),调频(Frequency Modulation,FM),近距离无线通信技术(Near Field Communication,NFC),红外技术(Infrared,IR)等无线通信的解决方案。无线通信模块102可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块102可以经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器101。无线通信模块102还可以从处理器101接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。The wireless communication module 102 can provide applications on the wearable device 100 including Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) network), Bluetooth (Bluetooth, BT), and global navigation. Wireless communication solutions such as Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR) and other wireless communications. The wireless communication module 102 may be one or more devices integrating at least one communication processing module. The wireless communication module 102 can receive electromagnetic waves via an antenna, frequency modulate and filter the electromagnetic wave signals, and send the processed signals to the processor 101 . The wireless communication module 102 can also receive the signal to be sent from the processor 101, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna for radiation.
在本申请的一些实施例中,无线通信模块102可以至少包括蓝牙模块。可穿戴设备100可以通过无线通信模块102中的蓝牙模块与终端设备200建立通信连接(如图1所示)。In some embodiments of the present application, the wireless communication module 102 may include at least a Bluetooth module. The wearable device 100 can establish a communication connection with the terminal device 200 through the Bluetooth module in the wireless communication module 102 (as shown in FIG. 1 ).
传感器模块103可以包括一个或多个传感器,这些传感器可以为相同类型或不同类型。如图3所示,传感器模块103可以包括压力传感器103A、陀螺仪传感器103B、加速度传感器103C、触摸传感器103D、骨传导传感器103E和光传感器103F等。Sensor module 103 may include one or more sensors, which may be of the same type or different types. As shown in FIG. 3 , the sensor module 103 may include a pressure sensor 103A, a gyroscope sensor 103B, an acceleration sensor 103C, a touch sensor 103D, a bone conduction sensor 103E, a light sensor 103F, and the like.
压力传感器103A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器103A可以设置于显示屏107。当有触摸操作作用于显示屏107,可穿戴设备100根据压力传感器103A检测所述触摸操作强度。可穿戴设备100也可以根据压力传感器103A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。The pressure sensor 103A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 103A may be disposed on the display screen 107 . When a touch operation is performed on the display screen 107, the wearable device 100 detects the strength of the touch operation according to the pressure sensor 103A. The wearable device 100 may also calculate the touched position based on the detection signal of the pressure sensor 103A. In some embodiments, touch operations acting on the same touch location but with different touch operation intensities may correspond to different operation instructions.
陀螺仪传感器103B可以用于确定可穿戴设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器103B确定可穿戴设备100围绕三个轴(即,x,y和z轴)的角速度。The gyro sensor 103B may be used to determine the motion posture of the wearable device 100 . In some embodiments, the angular velocity of wearable device 100 about three axes (ie, x, y, and z axes) may be determined by gyro sensor 103B.
加速度传感器103C可检测可穿戴设备100在各个方向上(一般为三轴)加速度的大小。当可穿戴设备100静止时可检测出重力的大小及方向。加速度传感器103C还可以用于识别可穿戴设备100的姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 103C can detect the acceleration of the wearable device 100 in various directions (generally three axes). When the wearable device 100 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor 103C can also be used to identify the posture of the wearable device 100 and be used in horizontal and vertical screen switching, pedometer and other applications.
触摸传感器103D,也称“触控面板”。触摸传感器103D可以设置于显示屏107,由触摸传感器103D与显示屏107组成触摸屏,也称“触控屏”。触摸传感器103D用于检测作 用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏107提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器103D也可以设置于可穿戴设备100的表面,与显示屏107所处的位置不同。Touch sensor 103D is also called a "touch panel". The touch sensor 103D can be disposed on the display screen 107. The touch sensor 103D and the display screen 107 form a touch screen, which is also called a "touch screen". Touch sensor 103D is used to detect the for touch operations on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through the display screen 107 . In other embodiments, the touch sensor 103D may also be disposed on the surface of the wearable device 100 in a position different from that of the display screen 107 .
骨传导传感器103E可以获取振动信号。在本申请的一些实施例中,骨传导传感器103E也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,应用处理器可以基于骨传导传感器103E获取的血压跳动信号解析心率信息,实现心率检测功能。The bone conduction sensor 103E can acquire vibration signals. In some embodiments of the present application, the bone conduction sensor 103E can also contact the human body's pulse and receive blood pressure beating signals. In some embodiments, the application processor can analyze the heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 103E to implement the heart rate detection function.
光传感器103F可以包括发光二极管和光电接收器。可穿戴设备100可以通过光传感器103F中的发光二极管将一束光照射进入人体的皮肤组织,然后通过光电接收器来将接收到的光信号转换为电信号。由于人体的血液流量随着脉搏发生周期性的变化,并且血液中的含氧血红细胞的比例也随着脉搏的变化而变化,因此它们对入射光的吸收程度也随着脉搏而呈现周期性的变化,体现在接收端就是接收到的电信号也随着脉搏而变化。光传感器103F可以通过上述方式得到心率。可穿戴设备100还可以通过发光二极管将红外光和红光同时照射手指,然后通过光传感器103F测量反射光的吸收光谱。由于血液里的氧合血红蛋白对红光吸收量较多,对红外光吸收较少,而血红蛋白对红外光吸收较多,对红光吸收较少,可穿戴设备100可以通过上述方式测量血氧含量。Light sensor 103F may include a light emitting diode and a photoreceiver. The wearable device 100 can irradiate a beam of light into the skin tissue of the human body through the light-emitting diode in the light sensor 103F, and then convert the received light signal into an electrical signal through the photoelectric receiver. Since the blood flow of the human body changes periodically with the pulse, and the proportion of oxygenated red blood cells in the blood also changes with the pulse, their absorption of incident light also changes periodically with the pulse. The change is reflected in the receiving end that the received electrical signal also changes with the pulse. The light sensor 103F can obtain the heart rate in the above manner. The wearable device 100 can also irradiate the finger with infrared light and red light simultaneously through the light-emitting diode, and then measure the absorption spectrum of the reflected light through the light sensor 103F. Since oxyhemoglobin in the blood absorbs more red light and less infrared light, and hemoglobin absorbs more infrared light and less red light, the wearable device 100 can measure blood oxygen content in the above manner. .
可理解,图3所示的传感器模块103仅为一种示例性的划分方式,还可能有其他划分方式,本申请对此不作限制。It can be understood that the sensor module 103 shown in FIG. 3 is only an exemplary division method, and other division methods are possible, and this application does not limit this.
充电管理模块104用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块104可以通过磁吸触点105接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块104可以通过可穿戴设备100的无线充电线圈接收无线充电输入。充电管理模块104为电池1042充电的同时,还可以通过电源管理模块1041为可穿戴设备100供电。其中,磁吸触点105也可以理解为磁传感器。The charging management module 104 is used to receive charging input from the charger. Among them, the charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 104 may receive charging input from the wired charger through the magnetic contacts 105 . In some wireless charging embodiments, the charging management module 104 may receive wireless charging input through the wireless charging coil of the wearable device 100 . While the charging management module 104 charges the battery 1042, it can also provide power to the wearable device 100 through the power management module 1041. Among them, the magnetic contact 105 can also be understood as a magnetic sensor.
音频模块106用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。扬声器106A,用于将音频电信号转换为声音信号。受话器106B,用于将音频电信号转换成声音信号。麦克风106C,用于将声音信号转换为电信号。The audio module 106 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Speaker 106A is used to convert audio electrical signals into sound signals. The receiver 106B is used to convert audio electrical signals into sound signals. Microphone 106C is used to convert sound signals into electrical signals.
显示屏107用于显示画面等。显示屏107可以包括显示面板。显示面板可以采用液晶显示屏(Liquid Crystal Display,LCD),有机发光二极管(Organic Light-Emitting Diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(Active-Matrix Organic Light Emitting Diode,AMOLED),柔性发光二极管(Flex Light-Emitting Diode,FLED),Mini LED,Micro LED,Micro-OLED,量子点发光二极管(Quantum Dot Light Emitting Diodes,QLED)等。The display screen 107 is used to display pictures and the like. Display screen 107 may include a display panel. The display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (Active-Matrix Organic Light). Emitting Diode (AMOLED), Flex Light-Emitting Diode (FLED), Mini LED, Micro LED, Micro-OLED, Quantum Dot Light Emitting Diode (QLED), etc.
按键108可以是机械按键,也可以是触摸式按键。可穿戴设备100可以接收按键输入,产生与可穿戴设备100的用户设置以及功能控制有关的键信号输入。在本申请的一些实施例中,可穿戴设备100可以包括如图2所示的按键111和按键112。The key 108 may be a mechanical key or a touch key. The wearable device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the wearable device 100 . In some embodiments of the present application, the wearable device 100 may include buttons 111 and 112 as shown in FIG. 2 .
存储器109可以用于存储计算机可执行程序代码。该可执行程序代码包括指令。处理 器101通过运行存储在存储器109的指令,从而执行可穿戴设备100的各种功能应用以及数据处理。存储器109可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像视频播放功能等)等。存储数据区可存储可穿戴设备100使用过程中所创建的数据(比如音频数据,电话本等)等。Memory 109 may be used to store computer executable program code. The executable program code includes instructions. deal with The processor 101 executes instructions stored in the memory 109 to execute various functional applications and data processing of the wearable device 100 . The memory 109 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image video playback function, etc.), etc. The storage data area may store data created during use of the wearable device 100 (such as audio data, phone book, etc.).
在本申请的一些实施例中,可穿戴设备100可以将采集的用户的健康数据、运动数据等存储在存储器109中。In some embodiments of the present application, the wearable device 100 can store the collected user's health data, exercise data, etc. in the memory 109 .
可理解,在本申请的一些实施例中,可穿戴设备100可以包括马达。马达可以产生振动提示。例如,马达可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏107不同区域的触摸操作,马达也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。可穿戴设备100还可以包括指示器。指示器可以是指示灯,可以用于指示充电状态、电量变化,也可以用于指示消息、未接来电、通知等。It is understood that in some embodiments of the present application, the wearable device 100 may include a motor. The motor can produce vibration cues. For example, the motor can be used to vibrate for incoming calls or for touch vibration feedback. For example, touch operations for different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. The motor can also respond to different vibration feedback effects for touch operations in different areas of the display screen 107 . Different application scenarios (such as time reminders, receiving information, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized. Wearable device 100 may also include an indicator. The indicator can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
下面结合图4具体介绍本申请实施例提供的一种可穿戴设备100的软件结构。The software structure of the wearable device 100 provided by the embodiment of the present application will be introduced in detail below with reference to FIG. 4 .
可穿戴设备100可以包括本地应用、第三方应用(即JS应用)、JS应用框架、OS框架层和OS内核层。The wearable device 100 may include native applications, third-party applications (ie, JS applications), JS application frameworks, OS framework layers, and OS kernel layers.
本地应用可以理解为在可穿戴设备100出厂前,安装操作系统时安装在可穿戴设备100中的应用。本地应用可以包括健康应用。用户可以通过该健康应用记录健康数据和运动数据。当然,本地应用还可以包括图库、蓝牙、音乐等应用。根据上文,可穿戴设备100中的本地应用采集C++语言开发。Local applications can be understood as applications installed in the wearable device 100 when the operating system is installed before the wearable device 100 leaves the factory. Native applications can include health applications. Users can record health data and exercise data through this health application. Of course, local applications can also include applications such as gallery, Bluetooth, and music. According to the above, the local application in the wearable device 100 is developed in C++ language.
第三方应用可以理解为通过应用商店下载的应用。例如,第三方应用可以包括从应用商店下载的导航应用、搜索引擎等。可理解,可穿戴设备100中的第三方应用是采用JS语言开发的,属于JS应用。Third-party applications can be understood as applications downloaded through the app store. For example, third-party applications may include navigation applications, search engines, etc. downloaded from an application store. It is understandable that the third-party application in the wearable device 100 is developed using JS language and belongs to JS application.
JS应用框架用于支持第三方应用的开发。JS应用框架可以包括JS数据绑定(data binding)、JS运行时(runtime)和JS框架(framework)。The JS application framework is used to support the development of third-party applications. JS application framework can include JS data binding (data binding), JS runtime (runtime) and JS framework (framework).
其中,JS data binding可以包括绑定关系。视图模型实例(view model instance)、发布者(subject)和观察者(observer)。在可穿戴设备100中,编译器把html和CSS编译成JS代码和JSON对象,利用引擎使得JS接口调用到C++实现,调用的过程需要JS data binding的参与。Among them, JS data binding can include binding relationships. View model instance, publisher (subject) and observer (observer). In the wearable device 100, the compiler compiles html and CSS into JS code and JSON objects, and uses the engine to call the JS interface to the C++ implementation. The calling process requires the participation of JS data binding.
JS runtime包括核心库和虚拟机。runtime负责系统的调度和管理。核心库包含两部分:一部分是编程语言(例如,JS语言)需要调用的功能函数,另一部分是系统的核心库。JS应用和JS框架运行在虚拟机中。虚拟机将JS应用和JS框架的编程文件(例如,JS文件)执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。JS runtime includes core libraries and virtual machines. The runtime is responsible for the scheduling and management of the system. The core library contains two parts: one part is the functional functions that the programming language (for example, JS language) needs to call, and the other part is the core library of the system. JS applications and JS frameworks run in virtual machines. The virtual machine executes programming files (eg, JS files) of JS applications and JS frameworks as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
JS framework可以包括UI组件适配器层(UI component adapter layer)和应用编程接口适配器层(application programming interface adapter layer)。可理解,应用编程接口可以简称为API。UI component adapter layer可以包括基础组件、动画组件、页面切换组件、风格 管理器和文本编辑器等。API adapter layer可以包括基础组件、渲染模型和风格管理器等。可理解,上述组件的含义可以参考相关技术文档。JS framework可以包括一些预先定义的函数。JS framework can include UI component adapter layer and application programming interface adapter layer. It is understandable that the application programming interface can be referred to as API. UI component adapter layer can include basic components, animation components, page switching components, styles Manager and text editor etc. The API adapter layer can include basic components, rendering models, style managers, etc. It is understandable that the meaning of the above components can be referred to relevant technical documents. JS framework can include some predefined functions.
当然,JS framework还可以包括其他组件,本申请对此不作限制。Of course, the JS framework can also include other components, and this application does not limit this.
OS框架层(framework)可以包括UI组件(kit)、OS API、能力管理服务(Ability Management Service,AMS)、包管理服务(Bundle Management Service,BMS)。其中,UI组件用于启动本地应用。另外,UI组件还负责绘制和上屏,并通过管理不同场景的上下文来绘制不同的应用。例如,手表显示的按钮、跑马灯显示框、字体颜色和线条等都需要UI组件的支持。OS API为OS framework为本地应用提供的应用编程接口。AMS用于管理第三方应用的生命周期。例如,第三方应用的启动、切换、关闭等。The OS framework layer (framework) can include UI components (kit), OS API, capability management service (Ability Management Service, AMS), and package management service (Bundle Management Service, BMS). Among them, the UI component is used to start local applications. In addition, UI components are also responsible for drawing and displaying on the screen, and drawing different applications by managing the context of different scenes. For example, the buttons, marquee display boxes, font colors and lines displayed on the watch all require the support of UI components. OS API is the application programming interface provided by OS framework for local applications. AMS is used to manage the life cycle of third-party applications. For example, starting, switching, closing, etc. of third-party applications.
OS内核层(kernel)是操作系统的基础。操作系统最终的功能都是通过内核层完成。内核层可以包含音频驱动、蓝牙驱动、传感器驱动、显示驱动、触屏驱动和按键驱动等。可理解,OS kernel可以包括任务管理、内存管理、中断管理、异常管理、系统时钟、信号量、互斥锁、队列管理、事件管理和软件定时器等。进一步的,OS kernel还可以包括C++支持、调测组件等。The OS kernel layer (kernel) is the foundation of the operating system. The final functions of the operating system are completed through the kernel layer. The kernel layer can include audio drivers, Bluetooth drivers, sensor drivers, display drivers, touch screen drivers, button drivers, etc. It is understandable that the OS kernel can include task management, memory management, interrupt management, exception management, system clock, semaphore, mutex lock, queue management, event management and software timer, etc. Furthermore, the OS kernel can also include C++ support, debugging components, etc.
需要说明的是,本申请实施例提供的图4所示的可穿戴设备100的软件结构示意图仅为一种示例,不应视为对本申请的限制。可理解,可穿戴设备100的软件结构还可以包括更多的分层(例如,硬件抽象层),并且本申请并不限定操作系统不同分层中的具体模块划分,具体可以参考常规技术中对操作系统软件结构的介绍。It should be noted that the schematic software structure diagram of the wearable device 100 shown in FIG. 4 provided by the embodiment of the present application is only an example and should not be regarded as a limitation of the present application. It can be understood that the software structure of the wearable device 100 may also include more layers (for example, a hardware abstraction layer), and this application does not limit the specific module divisions in different layers of the operating system. For details, please refer to the conventional technology. An introduction to operating system software architecture.
请参阅图5,图5为本申请实施例提供的一种可穿戴设备应用间通信过程的示意图。Please refer to FIG. 5 , which is a schematic diagram of a communication process between wearable device applications according to an embodiment of the present application.
如图5所示,可穿戴设备的本地应用N可以向AMS发送消息。该消息可以包括该本地应用N的包名、第三方应用T的包名,以及本地应用N需要发送给第三方应用T的数据。AMS接收本地应用N发送的消息之后,可以判断第三方应用T的优先级。在不存在正在运行的应用,或者正在运行的应用比第三方应用T的优先级低的情况下,AMS可以与UI组件建立通信连接,并向UI组件请求将原显示界面置于后台,以启动第三方应用T。然后,AMS可以向JS应用框架请求启动第三方应用T。JS框架可以加载第三方应用T的相关组件。进一步的,JS应用框架可以向AMS发送消息以通知AMS——第三方应用T已启动。该消息发送成功后,JS应用框架可以注册接口M。接口M为JS应用框架与AMS之间的通信接口。接口M注册成功后,AMS可以向第三方应用T发送数据。As shown in Figure 5, the local application N of the wearable device can send messages to the AMS. The message may include the package name of the local application N, the package name of the third-party application T, and the data that the local application N needs to send to the third-party application T. After receiving the message sent by the local application N, the AMS can determine the priority of the third-party application T. When there is no running application, or the running application has a lower priority than the third-party application T, AMS can establish a communication connection with the UI component and request the UI component to put the original display interface in the background to start Third-party applications T. Then, AMS can request the JS application framework to start the third-party application T. The JS framework can load related components of third-party applications T. Further, the JS application framework can send a message to AMS to notify AMS that the third-party application T has been started. After the message is sent successfully, the JS application framework can register the interface M. The interface M is the communication interface between the JS application framework and AMS. After the interface M is successfully registered, AMS can send data to the third-party application T.
需要说明的是,在本申请的一些实施例中,本地应用与JS应用之间的消息的传输,需要经过内核层。It should be noted that in some embodiments of the present application, the transmission of messages between local applications and JS applications needs to go through the kernel layer.
基于图5所示的可穿戴设备应用间通信过程,结合图6具体本申请实施例提供的一种通信方法。Based on the communication process between wearable device applications shown in Figure 5, a communication method provided by the embodiment of the present application is concretely combined with Figure 6.
S601:本地应用N向AMS发送消息X1。消息X1包括本地应用N的包名和第三方应用T的包名,以及目标传输数据。S601: Local application N sends message X1 to AMS. The message X1 includes the package name of the local application N and the package name of the third-party application T, as well as the target transmission data.
可穿戴设备100中的本地应用N可以向可穿戴设备100中的AMS发送消息X1。可理 解,消息X1中可以包括本地应用N的包名、第三方应用T的包名,以及目标传输数据。其中,目标传输数据指的是本地应用N需要传输给第三方应用T的数据。可理解,包名用于唯一标识应用。The local application N in the wearable device 100 may send a message X1 to the AMS in the wearable device 100 . Reasonable Solution: The message X1 may include the package name of the local application N, the package name of the third-party application T, and the target transmission data. Among them, the target transmission data refers to the data that the local application N needs to transmit to the third-party application T. Understandably, the package name is used to uniquely identify the application.
在本申请的一些实施例中,目标传输数据可以是用户的运动数据,还可以是用户的健康数据。当然,目标传输数据还可以为其他类型的数据,本申请对此不作限制。In some embodiments of the present application, the target transmission data may be the user's motion data or the user's health data. Of course, the target transmission data can also be other types of data, and this application does not limit this.
在本申请的一些实施例中,消息X1可以包括Bundlename/APP_index、message、messageLength和Type。可理解,Bundlename/APP_index、message、messageLength和Type均为消息X1的字段。其中,Bundlename/APP_index表示的是包名。message为目标传输数据。即本地应用N需要向第三方应用T传输的数据。messageLength表示的是消息长度。其单位可以为字节。Type表示的是消息类型。In some embodiments of the present application, the message X1 may include Bundlename/APP_index, message, messageLength and Type. It can be understood that Bundlename/APP_index, message, messageLength and Type are all fields of message X1. Among them, Bundlename/APP_index represents the package name. message transmits data to the target. That is, the data that local application N needs to transmit to third-party application T. messageLength represents the length of the message. Its unit can be bytes. Type represents the message type.
示例性的,Type为music时,消息X1的消息类型为音乐信息。Type为healthdata时,消息X1的消息类型为健康数据。Type为navigation时,消息X1的消息类型为导航信息。Type为touchinfo时,消息X1的消息类型为触摸信息。For example, when Type is music, the message type of message X1 is music information. When Type is healthdata, the message type of message X1 is health data. When Type is navigation, the message type of message X1 is navigation information. When Type is touchinfo, the message type of message X1 is touch information.
可理解,本地应用N可以为本地应用中的任一应用。同样的,第三方应用T可以为第三方应用中的任一应用。It can be understood that the local application N can be any application among local applications. Similarly, the third-party application T can be any of the third-party applications.
S602:AMS确定可穿戴设备100中是否存在正在运行的应用,并在可穿戴设备100中存在正在运行的应用的情况下,比较正在运行的应用和第三方应用T的优先级。S602: The AMS determines whether there is a running application in the wearable device 100, and if there is a running application in the wearable device 100, compares the priorities of the running application and the third-party application T.
AMS接收消息X1之后,可以查看可穿戴设备100中是否存在正在运行的应用。若可穿戴设备100中不存在正在运行的应用,可穿戴设备100可以继续执行后续步骤。若可穿戴设备100中存在正在运行的应用,AMS可以比较正在运行的应用和第三方应用T的优先级。在该正在运行的应用的优先级不高于第三方应用T的优先级的情况下,可穿戴设备100继续执行后续步骤。而在该正在运行的应用的优先级高于第三方应用T的优先级的情况下,可穿戴设备100不再执行后续步骤,直到可穿戴设备100中不再存在优先级高于第三方应用T且正在运行的应用时再执行后续步骤。After receiving the message X1, the AMS can check whether there is a running application in the wearable device 100. If there is no running application in the wearable device 100, the wearable device 100 can continue to perform subsequent steps. If there is a running application in the wearable device 100, the AMS can compare the priorities of the running application and the third-party application T. If the priority of the running application is not higher than the priority of the third-party application T, the wearable device 100 continues to perform subsequent steps. In the case where the priority of the running application is higher than the priority of the third-party application T, the wearable device 100 will no longer perform subsequent steps until there is no longer a priority higher than the third-party application T in the wearable device 100 and the application is running before performing subsequent steps.
可理解,可穿戴设备100中可以存储有优先级列表。该优先级列表包括可穿戴设备100中的各个应用所对应的优先级。It can be understood that the priority list may be stored in the wearable device 100 . The priority list includes priorities corresponding to each application in the wearable device 100 .
可理解,可穿戴设备100中正在运行的应用可以为本地应用,也可以为第三方应用。It can be understood that the application running in the wearable device 100 may be a local application or a third-party application.
S603:在可穿戴设备100中不存在正在运行的应用,或者,正在运行的应用的优先级不高于第三方应用T的优先级的情况下,AMS向UI组件发送消息X2。消息X2用于建立UI组件和AMS之间的通信连接。S603: When there is no running application in the wearable device 100, or the priority of the running application is not higher than the priority of the third-party application T, the AMS sends the message X2 to the UI component. Message X2 is used to establish the communication connection between the UI component and AMS.
可理解,若AMS确定可穿戴设备100中不存在正在运行的应用,或者,正在运行的应用的优先级不高于第三方应用T的优先级,AMS可以向UI组件发送消息X2,从而与UI组件建立通信连接。It can be understood that if the AMS determines that there is no running application in the wearable device 100, or the priority of the running application is not higher than the priority of the third-party application T, the AMS can send the message X2 to the UI component, thereby communicating with the UI. The component establishes a communication connection.
在本申请的一些实施例中,消息X2可以为:AMS_START_CHECK_REQUEST。In some embodiments of the present application, message X2 may be: AMS_START_CHECK_REQUEST.
相应的,UI组件可以接收AMS发送的消息X2。UI组件可以根据当前的任务处理情况来确定是否与AMS建立通信连接。若UI组件正在执行其他流程,UI组件可以暂时不与AMS建立通信连接,直到UI组件不再执行其他流程时再与AMS建立通信连接。若UI组 件没有正在执行的流程,即UI组件有能力处理其他的任务,则可穿戴设备100可以继续执行后续步骤。Correspondingly, the UI component can receive message X2 sent by AMS. The UI component can determine whether to establish a communication connection with the AMS based on the current task processing situation. If the UI component is executing other processes, the UI component may temporarily not establish a communication connection with the AMS until the UI component is no longer executing other processes and then establish a communication connection with the AMS. If UI group If there is no process being executed by the software, that is, the UI component is capable of handling other tasks, the wearable device 100 can continue to perform subsequent steps.
S604:UI组件向AMS发送消息X3。消息X3用于表明UI组件同意与AMS建立通信连接。S604: The UI component sends message X3 to AMS. Message X3 is used to indicate that the UI component agrees to establish a communication connection with AMS.
可理解,UI组件接收AMS发送的消息X2之后,可以向AMS发送消息X3。消息X3可以表明UI组件同意与AMS建立通信连接。It is understandable that after receiving the message X2 sent by the AMS, the UI component can send the message X3 to the AMS. Message X3 may indicate that the UI component agrees to establish a communication connection with the AMS.
在本申请的一些实施例中,消息X3可以为:AMS_START_CHECK_RESPONSE。In some embodiments of the present application, the message X3 may be: AMS_START_CHECK_RESPONSE.
相应的,AMS可以接收UI组件发送的消息X3。这也就意味着,AMS与UI组件建立了通信连接。Correspondingly, AMS can receive the message X3 sent by the UI component. This means that AMS has established a communication connection with the UI component.
S605:AMS向UI组件发送消息X4。消息X4用于请求UI组件将原显示界面置于后台。S605: AMS sends message X4 to the UI component. Message X4 is used to request the UI component to put the original display interface in the background.
可理解,AMS和UI组价建立通信连接之后,AMS可以向UI组件发送消息X4,以请求UI组件将原本显示在显示屏上的界面置于后台。It is understandable that after the AMS and the UI component establish a communication connection, the AMS can send the message X4 to the UI component to request the UI component to place the interface originally displayed on the display screen in the background.
在本申请的一些实施例中,消息X4可以为:LAUNCHER_BACKGROUND。In some embodiments of the present application, message X4 may be: LAUNCHER_BACKGROUND.
相应的,UI组件可以接收AMS发送的消息X4。Correspondingly, the UI component can receive message X4 sent by AMS.
S606:UI组件向AMS发送消息X5。消息X5用于通知AMS原显示界面已置于后台。S606: The UI component sends message X5 to AMS. Message X5 is used to notify AMS that the original display interface has been placed in the background.
可理解,UI组件接收AMS发送的消息X4之后,确定AMS即将启动第三方应用T,可以将原显示界面置于后台,并发送消息X5给AMS,以便AMS及时启动第三方应用T。It is understandable that after the UI component receives the message X4 sent by AMS and determines that AMS is about to launch the third-party application T, it can put the original display interface in the background and send message X5 to AMS so that AMS can launch the third-party application T in time.
在本申请的一些实施例中,消息X5可以为:AMS_ONBACKGROUND。In some embodiments of the present application, message X5 may be: AMS_ONBACKGROUND.
相应的,AMS可以接收UI组件发送的消息X5。Correspondingly, AMS can receive the message X5 sent by the UI component.
S607:AMS向JS应用框架发送消息X6。消息X6用于启动第三方应用T。S607: AMS sends message X6 to the JS application framework. Message X6 is used to launch third-party application T.
可理解,AMS接收UI组件发送的消息X5之后,AMS可以向JS应用框架发送消息X6,以通知JS应用框架启动第三方应用T。It is understandable that after AMS receives the message X5 sent by the UI component, the AMS can send the message X6 to the JS application framework to notify the JS application framework to start the third-party application T.
在本申请的一些实施例中,消息X6用于通知JS应用框架启动第三方应用。In some embodiments of the present application, message X6 is used to notify the JS application framework to launch a third-party application.
在本申请的一些实施例中,消息X6可以为:ACTIVE。In some embodiments of the present application, message X6 may be: ACTIVE.
相应的,JS应用框架可以接收AMS发送的消息X6。Correspondingly, the JS application framework can receive message X6 sent by AMS.
S608:JS应用框架加载第三方应用T的相关组件。S608: The JS application framework loads the relevant components of the third-party application T.
可理解,JS应用框架接收AMS发送的消息X6之后,可以加载第三方应用T的相关组件。可理解,第三方应用的T的相关组件可以包括界面显示组件、动画组件等。其中,界面显示组件可以包括控件位置、控件形状,以及控件对应的文字等。动画组件可以用于生成第三方应用T的启动动画,以及界面显示过程中的动画效果。可理解,第三方应用T的相关组件可以包括但不限于:通用组件、容器组件、基础组件、媒体组件、画布组件、栅格组件和svg组件等。其中,svg的英文全称为Scalable Vector Graphics,意思为可缩放的矢量图形。svg是一种开放标准的矢量图形语言,是可缩放的矢量图形格式。It is understandable that after the JS application framework receives the message X6 sent by the AMS, it can load the relevant components of the third-party application T. It can be understood that the relevant components of T of the third-party application may include interface display components, animation components, etc. Among them, the interface display component may include the position of the control, the shape of the control, and the text corresponding to the control. The animation component can be used to generate startup animations for third-party applications T, as well as animation effects during interface display. It can be understood that the relevant components of the third-party application T may include but are not limited to: general components, container components, basic components, media components, canvas components, grid components, svg components, etc. Among them, the full English name of svg is Scalable Vector Graphics, which means scalable vector graphics. svg is an open standard vector graphics language and a scalable vector graphics format.
在本申请的一些实施例中,JS应用框架可以加载:jsability_launch,jsability_show。In some embodiments of this application, the JS application framework can load: jsability_launch, jsability_show.
相应的,JS应用框架加载第三方应用T的相关组件之后,第三方应用T开始启动。Correspondingly, after the JS application framework loads the relevant components of the third-party application T, the third-party application T starts to start.
S609:JS应用框架向AMS发送消息X7。消息X7用于通知AMS第三方应用T已启动。 S609: The JS application framework sends message X7 to AMS. Message X7 is used to notify AMS that third-party application T has been started.
在本申请的一些实施例中,消息X7可以为:AMS_ONACTIVE。In some embodiments of the present application, message X7 may be: AMS_ONACTIVE.
相应的,AMS可以接收JS应用框架发送的消息X7。Correspondingly, AMS can receive message X7 sent by the JS application framework.
S610:JS应用框架向第三方应用T发送消息X8。消息X8用于通知第三方应用T启动注册流程。S610: The JS application framework sends message X8 to the third-party application T. Message X8 is used to notify the third-party application T to start the registration process.
可理解,JS应用框架向AMS发送消息X7之后,可以向第三方应用T发送消息X8,以通知第三方应用T启动注册流程。其中,注册流程指的是注册通信接口的流程。It is understandable that after the JS application framework sends message X7 to AMS, it can send message X8 to third-party application T to notify third-party application T to start the registration process. Among them, the registration process refers to the process of registering the communication interface.
在本申请的一些实施例中,消息X8可以为:sunscribemessage。In some embodiments of the present application, message X8 may be: sunscribemessage.
相应的,第三方应用T可以接收JS应用框架发送的消息X8。Correspondingly, the third-party application T can receive the message X8 sent by the JS application framework.
S611:JS应用框架注册接口M。接口M为JS应用框架与AMS之间的通信接口。S611: JS application framework registration interface M. The interface M is the communication interface between the JS application framework and AMS.
可理解,JS应用框架向第三方应用T发送消息X8之后,可以注册接口M。接口M为JS应用框架与AMS之间的通信接口。接口M也可以理解为JS应用和本地应用之间的通信接口。It is understandable that after the JS application framework sends the message X8 to the third-party application T, the interface M can be registered. The interface M is the communication interface between the JS application framework and AMS. The interface M can also be understood as the communication interface between JS applications and local applications.
在本申请的一些实施例中,接口M可以为:TriggerSuccessCallback。In some embodiments of this application, the interface M may be: TriggerSuccessCallback.
S612:JS应用框架向AMS发送消息X9。消息X9用于通知AMS接口X已注册。S612: The JS application framework sends message X9 to AMS. Message X9 is used to notify AMS that interface X has been registered.
可理解,JS应用框架注册接口M之后,可以向AMS发送消息X9以通知AMS接口M已注册。It is understandable that after the JS application framework registers the interface M, it can send message X9 to AMS to notify AMS that the interface M has been registered.
在本申请的一些实施例中,消息X9可以为:AMS_REGISTER。In some embodiments of the present application, message X9 may be: AMS_REGISTER.
S613:AMS绑定接口M。S613: AMS binds interface M.
可理解,JS应用框架注册接口M之后,AMS可以绑定接口M,以便后续通过接口M进行通信。It is understandable that after the JS application framework registers the interface M, AMS can bind the interface M to facilitate subsequent communication through the interface M.
在本申请的一些实施例中,AMS可以绑定TriggerSuccessCallback。In some embodiments of this application, AMS can bind TriggerSuccessCallback.
S614:AMS向第三方应用T发送消息X10。消息X10包括目标传输数据。S614: AMS sends message X10 to third-party application T. Message X10 contains target transmission data.
可理解,AMS绑定接口M之后,可以通过接口M向第三方应用T发送消息X10。其中,消息X10可以包括目标传输数据。目标传输数据的相关描述可参考步骤S601,在此不再赘述。It can be understood that after AMS binds interface M, it can send message X10 to third-party application T through interface M. Among them, message X10 may include target transmission data. For relevant description of the target transmission data, please refer to step S601, which will not be described again here.
需要说明的是,图6所示的通信方法可以包括更多或更少的步骤,本申请对此不作限制。It should be noted that the communication method shown in Figure 6 may include more or fewer steps, which is not limited by this application.
基于图5所示的可穿戴设备应用间通信过程,结合图7具体本申请实施例提供的又一种通信方法。Based on the communication process between wearable device applications shown in Figure 5, another communication method provided by the embodiment of the present application is concretely combined with Figure 7.
S701:本地应用N向AMS发送消息X11。消息X11包括本地应用N的包名和第三方应用T的包名,以及目标传输数据。S701: Local application N sends message X11 to AMS. The message X11 includes the package name of the local application N and the package name of the third-party application T, as well as the target transmission data.
可理解,步骤S701的相关描述可以参考步骤S601,在此不再赘述。It can be understood that the relevant description of step S701 may refer to step S601, which will not be described again here.
需要说明的是,消息X11所包括的目标传输数据的具体内容与消息X1所包括的目标传输数据的具体内容可以不相同。It should be noted that the specific content of the target transmission data included in the message X11 may be different from the specific content of the target transmission data included in the message X1.
在本申请的一些实施例中,消息X11可以为:AMS_SENDMESSAGE。In some embodiments of the present application, the message X11 may be: AMS_SENDMESSAGE.
可理解,本地应用N向AMS发送消息X11之后,AMS可以与UI组件进行交互,请求UI资源,具体可以参考步骤S602-步骤S606,在此不再赘述。 It can be understood that after the local application N sends the message X11 to the AMS, the AMS can interact with the UI component and request UI resources. For details, please refer to steps S602 to S606, which will not be described again here.
相应的,AMS可以接收本地应用N发送的消息X11。Correspondingly, AMS can receive message X11 sent by local application N.
S702:AMS通过接口M向第三方应用T发送消息X11。S702: AMS sends message X11 to third-party application T through interface M.
可理解,AMS接收本地应用N发送的消息X11之后,可以将消息X11通过接口M发送给第三方应用T。关于接口M的描述可以参考上文,在此不再赘述。It can be understood that after receiving the message X11 sent by the local application N, the AMS can send the message X11 to the third-party application T through the interface M. For the description of interface M, please refer to the above and will not be repeated here.
S703:第三方应用T通过接口M向AMS发送消息X12。消息X12包括第三方应用T的包名和本地应用N的包名,以及目标传输数据。S703: The third-party application T sends the message X12 to the AMS through the interface M. Message X12 includes the package name of the third-party application T and the package name of the local application N, as well as the target transmission data.
可理解,消息X12所包括的目标传输数据的具体内容与消息X1和消息X11所包括的目标传输数据的具体内容可以不相同。目标传输数据的相关描述可以参考上文,在此不再赘述。It can be understood that the specific content of the target transmission data included in the message X12 may be different from the specific content of the target transmission data included in the message X1 and the message X11. The relevant description of the target transmission data can be referred to above and will not be repeated here.
相应的,AMS可以接收第三方应用T发送的消息X12。Correspondingly, AMS can receive the message X12 sent by the third-party application T.
可理解,第三方应用T向AMS发送消息X12之后,AMS可以与UI组件进行交互,请求UI资源,具体可以参考步骤S602-步骤S606,在此不再赘述。It can be understood that after the third-party application T sends the message X12 to the AMS, the AMS can interact with the UI component and request UI resources. For details, please refer to steps S602 to S606, which will not be described again here.
S704:AMS向本地应用N发送消息X12。S704: AMS sends message X12 to local application N.
可理解,AMS接收第三方应用T通过接口M发送的消息X12之后,可以将消息X12发送给本地应用N。It can be understood that after AMS receives the message X12 sent by the third-party application T through the interface M, the AMS can send the message X12 to the local application N.
在本申请的一些实施例中,可穿戴设备100可以只执行步骤S701和步骤S702。In some embodiments of the present application, the wearable device 100 may only perform step S701 and step S702.
在本申请的一些实施例中,可穿戴设备100可以只执行步骤S703和步骤S704。In some embodiments of the present application, the wearable device 100 may only perform step S703 and step S704.
在本申请的一些实施例中,可穿戴设备100执行步骤S703和步骤S704的时间可以早于执行步骤S701和步骤S702的时间。In some embodiments of the present application, the time at which the wearable device 100 performs step S703 and step S704 may be earlier than the time at which step S701 and step S702 are performed.
需要说明的是,图7所示的通信方法可以包括更多或更少的步骤,本申请对此不作限制。It should be noted that the communication method shown in Figure 7 may include more or fewer steps, which is not limited by this application.
下面介绍本申请提供的一些通信场景。Some communication scenarios provided by this application are introduced below.
场景一:在跑步过程中,一旦心率超过心率阈值,可穿戴设备100中的本地应用将心率数据发送给第三方应用,第三方应用启动相应的训练课程。Scenario 1: During running, once the heart rate exceeds the heart rate threshold, the local application in the wearable device 100 sends the heart rate data to a third-party application, and the third-party application starts a corresponding training course.
如图8所示,用户在佩戴可穿戴设备100的情况下跑步。可穿戴设备100可以显示如图9a所示的用户界面300。用户界面300可以包括用户的心率曲线。如图9a所示,用户的最高心率为165次/分,最低心率为49次/分,用户的当前心率为165次/分。可穿戴设备100可以确定用户当前的心率超过心率阈值——160次/分。可穿戴设备100中的健康应用可以将用户的心率数据发送给运动应用,运动应用可以启动心率训练课程。如图9b所示,可穿戴设备100可以显示用户界面400。用户界面400是运动应用的启动界面。然后,可穿戴设备100还可以显示如图9c所示的用户界面500。用户界面500是心率训练课程的启动界面。As shown in FIG. 8 , the user is running while wearing the wearable device 100 . Wearable device 100 may display user interface 300 as shown in Figure 9a. User interface 300 may include the user's heart rate profile. As shown in Figure 9a, the user's highest heart rate is 165 beats/min, the lowest heart rate is 49 beats/min, and the user's current heart rate is 165 beats/min. The wearable device 100 may determine that the user's current heart rate exceeds the heart rate threshold of 160 beats/minute. The health application in the wearable device 100 can send the user's heart rate data to the sports application, and the sports application can start a heart rate training course. As shown in Figure 9b, wearable device 100 may display user interface 400. User interface 400 is the startup interface of the sports application. Then, the wearable device 100 may also display the user interface 500 as shown in Figure 9c. User interface 500 is the startup interface for the heart rate training course.
可理解,健康应用为可穿戴设备100的本地应用,而运动应用为可穿戴设备100的第三方应用。It can be understood that the health application is a native application of the wearable device 100 , and the sports application is a third-party application of the wearable device 100 .
下面结合图10具体介绍本申请实施例提供的一种通信方法在场景一中的应用。The following is a detailed introduction to the application of a communication method provided by the embodiment of the present application in scenario one with reference to Figure 10.
S1001:可穿戴设备100检测用户是否处于运动状态。 S1001: The wearable device 100 detects whether the user is in motion.
可穿戴设备100可以通过陀螺仪传感器和加速度传感器来检测用户是否处于运动状态。其中,陀螺仪传感器可以为图3所示的陀螺仪传感器103B,加速度传感器可以为图3所示的加速度传感器103C。The wearable device 100 can detect whether the user is in motion through a gyroscope sensor and an acceleration sensor. The gyro sensor may be the gyro sensor 103B shown in FIG. 3 , and the acceleration sensor may be the acceleration sensor 103C shown in FIG. 3 .
需要说明的是,可穿戴设备100可以检测用户的运动类型(例如,跑步、自行车骑行等)。在本申请的一些实施例中,用户可以自行选择运动类型。It should be noted that the wearable device 100 can detect the user's exercise type (for example, running, cycling, etc.). In some embodiments of the present application, users can choose the type of exercise themselves.
S1002:可穿戴设备100检测用户心率是否超过心率阈值。S1002: The wearable device 100 detects whether the user's heart rate exceeds the heart rate threshold.
可穿戴设备100可以实时检测用户心率,并判断用户心率是否超过心率阈值。The wearable device 100 can detect the user's heart rate in real time and determine whether the user's heart rate exceeds the heart rate threshold.
可理解,心率阈值可以根据实际需求进行设置,本申请对此不作限制。例如,可穿戴设备100可以根据用户的历史心率数据来设置心率阈值。再例如,可穿戴设备100可以根据运动类型来设置心率阈值。在本申请的一些实施例中,心率阈值可以为160次/分。It can be understood that the heart rate threshold can be set according to actual needs, and this application does not limit this. For example, the wearable device 100 may set a heart rate threshold based on the user's historical heart rate data. As another example, the wearable device 100 may set a heart rate threshold according to the type of exercise. In some embodiments of the present application, the heart rate threshold may be 160 beats/minute.
在本申请的一些实施例中,可穿戴设备100可以存储心率阈值与运动类型的对应关系。例如,跑步对应的心率阈值是160次/分钟。再例如,瑜伽对应的心率阈值是130次/分钟。再例如,自行车骑行对应的心率阈值是165次/分钟。In some embodiments of the present application, the wearable device 100 may store the corresponding relationship between the heart rate threshold and the exercise type. For example, the heart rate threshold corresponding to running is 160 beats/minute. For another example, the heart rate threshold corresponding to yoga is 130 beats/minute. For another example, the heart rate threshold corresponding to cycling is 165 beats/minute.
S1003:可穿戴设备100中的健康应用向可穿戴设备100中的AMS发送消息。该消息包括健康应用的包名、运动应用的包名,以及心率数据。S1003: The health application in the wearable device 100 sends a message to the AMS in the wearable device 100. The message includes the package name of the health application, the package name of the exercise application, and heart rate data.
健康应用可以向AMS发送消息。该消息可以包括健康应用的包名、运动应用的包名,以及用户的心率数据。可理解,用户的心率数据可以包括用户当前的心率。心率数据即为上述实施例中的目标传输数据。Health apps can send messages to AMS. The message can include the package name of the health application, the package name of the exercise application, and the user's heart rate data. It can be understood that the user's heart rate data may include the user's current heart rate. The heart rate data is the target transmission data in the above embodiment.
S1004:AMS检测运动应用是否启动。S1004: AMS detects whether the sports application is started.
可理解,AMS可以检测运动应用是否启动。即AMS可以检测运用应用是否正在运行,或者置于后台。It is understandable that AMS can detect whether the sports application is started. That is, AMS can detect whether the application is running or placed in the background.
在本申请的一些实施例中,AMS还可以检测运动应用之前是否启动过。In some embodiments of the present application, the AMS can also detect whether the sports application has been launched before.
若运动应用已启动或者之前启动过,可穿戴设备100继续执行步骤S1009和步骤S1010。若运动应用未启动且之前也未启动过,可穿戴设备100继续执行后续步骤。If the sports application has been started or has been started before, the wearable device 100 continues to execute step S1009 and step S1010. If the sports application has not been started and has not been started before, the wearable device 100 continues to perform subsequent steps.
S1005:AMS判断运动应用的优先级是否不低于当前正在运行的应用的优先级。S1005: AMS determines whether the priority of the sports application is not lower than the priority of the currently running application.
可理解,步骤S1005的相关描述可以参考步骤S602,在此不再赘述。It can be understood that the relevant description of step S1005 may refer to step S602, which will not be described again here.
S1006:AMS通知JS应用框架启动运动应用。S1006: AMS notifies the JS application framework to start the motion application.
可理解,步骤S1006的相关描述可以参考步骤S607-步骤S610。It can be understood that the relevant description of step S1006 may refer to steps S607 to step S610.
可理解,AMS通知JS应用框架启动运动应用之前,可以建立与UI组件之间的通信连接,并请求UI组件将原显示界面置于后台,具体可以参考步骤S603-步骤S606,在此不再赘述。It is understandable that before AMS notifies the JS application framework to start the sports application, it can establish a communication connection with the UI component and request the UI component to put the original display interface in the background. For details, please refer to steps S603 to S606, which will not be described again here. .
S1007:JS应用框架注册接口M。S1007: JS application framework registration interface M.
可理解,步骤S1006的相关描述可以参考步骤S611。It can be understood that the relevant description of step S1006 may refer to step S611.
可理解,JS应用框架注册接口M之后,还可以向AMS发送消息以通知AMS接口M已注册。It is understandable that after the JS application framework registers the interface M, it can also send a message to AMS to notify AMS that the interface M has been registered.
S1008:AMS绑定接口M。S1008: AMS is bound to interface M.
可理解,步骤S1006的相关描述可以参考步骤S613。It can be understood that the relevant description of step S1006 may refer to step S613.
S1009:AMS通过接口M将心率数据发送给运动应用。 S1009: AMS sends heart rate data to the sports application through interface M.
可理解,AMS绑定接口M之后,可以通过接口M向运动应用发送心率数据。It can be understood that after the AMS is bound to the interface M, the heart rate data can be sent to the sports application through the interface M.
S1010:运动应用基于心率数据确定目标训练课程,并启动该目标训练课程。S1010: The sports application determines a target training course based on heart rate data and starts the target training course.
运动应用接收心率数据之后,可以结合用户的运动状态和运动类型来确定目标训练课程,并启动该目标训练课程。相应的,可穿戴设备100可以显示目标训练课程的相关界面。After the sports application receives the heart rate data, it can determine the target training course based on the user's exercise status and exercise type, and start the target training course. Correspondingly, the wearable device 100 can display the relevant interface of the target training course.
例如,用户正在跑步时,目标训练课程可以为跑步心率训练课程。再例如,用户正在自行车骑行时,目标训练课程可以为自行车骑行心率训练课程。再例如,用户正在做瑜伽时,目标训练课程可以为瑜伽心率训练课程。For example, when the user is running, the target training course may be a running heart rate training course. For another example, when the user is cycling, the target training course may be a cycling heart rate training course. For another example, when the user is doing yoga, the target training course may be a yoga heart rate training course.
S1011:在心率低于心率阈值或者用户停止运动的情况下,运动应用结束目标训练课程。S1011: When the heart rate is lower than the heart rate threshold or the user stops exercising, the sports application ends the target training session.
可理解,可穿戴设备100的健康应用可以实时获取用户的心率数据并将该心率数据发送给运动应用,一旦用户的心率低于心率阈值或者用户停止运动,运动应用可以结束目标训练课程。可穿戴设备100可以关闭运动应用。It can be understood that the health application of the wearable device 100 can obtain the user's heart rate data in real time and send the heart rate data to the exercise application. Once the user's heart rate is lower than the heart rate threshold or the user stops exercising, the exercise application can end the target training course. The wearable device 100 can close the exercise application.
在本申请的一些实施例中,在用户的心率低于心率阈值的情况下,无论用户是否结束运动,运动应用都可以结束目标训练课程。In some embodiments of the present application, when the user's heart rate is lower than the heart rate threshold, the exercise application can end the target training session regardless of whether the user ends the exercise.
在本申请的一些实施例中,在用户停止运动的情况下,运动应用可以结束目标训练课程。In some embodiments of the present application, in the event that the user stops exercising, the exercise application may end the target training session.
在本申请的一些实施例中,在用户的心率低于心率阈值且用户停止运动的情况下,运动应用可以结束目标训练课程。In some embodiments of the present application, when the user's heart rate is lower than the heart rate threshold and the user stops exercising, the exercise application may end the target training session.
在本申请的一些实施例中,可穿戴设备100中的JS框架已经注册过接口M。因此,可穿戴设备100可以不执行步骤S1007和步骤S1008。In some embodiments of the present application, the JS framework in the wearable device 100 has already registered the interface M. Therefore, the wearable device 100 may not perform steps S1007 and S1008.
需要说明的是,可穿戴设备100还可以根据用户其他类型的健康数据(例如,压力、血氧等)来触发相应的训练课程,具体可参考上述实施例。It should be noted that the wearable device 100 can also trigger corresponding training courses based on other types of health data of the user (for example, pressure, blood oxygen, etc.). For details, please refer to the above embodiments.
场景二:可穿戴设备100中存在正在运行的应用。可穿戴设备100可以检测到作用在按键上的用户操作。响应于该用户操作,可穿戴设备100中的本地应用可以向第三方应用发送消息以启动第三方应用。同时,可穿戴设备100还可以将正在运行的应用置于后台。Scenario 2: There is a running application in the wearable device 100 . The wearable device 100 can detect user operations on keys. In response to the user operation, the local application in the wearable device 100 may send a message to the third-party application to launch the third-party application. At the same time, the wearable device 100 can also put running applications in the background.
如图11所示,用户在佩戴可穿戴设备100的情况下进行锻炼。可穿戴设备100中正在运行运动应用。如图12所示,可穿戴设备100可以显示用户界面600。用户界面600可以为运动应用中的训练课程的界面。用户界面600可以包括用户正在训练的动作、用户的心率和消耗的卡路里。可穿戴设备100此时可以通过振动或语音来提醒用户接收到了新消息。如图12所示,用户可以长按可穿戴设备100上的按键112。可穿戴设备100中的本地应用可以对用户的长按按键操作进行识别。具体地,本地应用可以将用户的长按按键操作识别为2秒以上的高电平信号。然后,可穿戴设备100中的本地应用可以向通讯应用发送消息,以启动通讯应用并显示通讯应用中包括新消息的通讯界面。如图13所示,可穿戴设备100可以显示用户界面700。用户界面700包括通讯应用中的好友发来的新消息。同时,可穿戴设备100还可以将运动应用置于后台。可穿戴设备100中的运动应用可以通过语音播报等方式提示用户接下来的训练动作。As shown in FIG. 11 , the user exercises while wearing the wearable device 100 . A sports application is running in the wearable device 100 . As shown in Figure 12, wearable device 100 may display user interface 600. User interface 600 may be an interface for a training session in a sports application. User interface 600 may include the movements the user is training, the user's heart rate, and calories burned. At this time, the wearable device 100 can remind the user that a new message has been received through vibration or voice. As shown in Figure 12, the user can press and hold the button 112 on the wearable device 100. The local application in the wearable device 100 can recognize the user's long press operation. Specifically, the local application can recognize the user's long press operation as a high-level signal for more than 2 seconds. Then, the local application in the wearable device 100 can send a message to the communication application to launch the communication application and display the communication interface including the new message in the communication application. As shown in Figure 13, wearable device 100 may display user interface 700. User interface 700 includes new messages from friends in the messaging application. At the same time, the wearable device 100 can also put the sports application in the background. The sports application in the wearable device 100 can prompt the user for the next training action through voice broadcast or other methods.
可理解,上述实施例中的本地应用是为了识别用户作用在按键上的操作而设置的应用。 运动应用可以为本地应用,也可以为第三方应用。通讯应用为第三方应用。It can be understood that the local application in the above embodiment is an application set up to recognize the user's operation on the keys. Sports applications can be local applications or third-party applications. Communication applications are third-party applications.
下面结合图14具体介绍本申请实施例提供的一种通信方法在场景二中的应用。The application of a communication method provided by the embodiment of the present application in scenario two will be introduced in detail below with reference to Figure 14.
S1401:可穿戴设备100检测到作用在按键上的用户操作。S1401: The wearable device 100 detects a user operation on a key.
用户可以长按按键,可穿戴设备100可以检测到作用在按键上的长按操作。可理解,该用户操作还可以包括按两次按键、在显示屏上向右滑动、在显示屏上向上滑动等,本申请对用户操作的具体形式不作限制。The user can press and hold the key, and the wearable device 100 can detect the long press operation on the key. It can be understood that the user operation may also include pressing a button twice, sliding to the right on the display screen, sliding upward on the display screen, etc. This application does not limit the specific form of the user operation.
S1402:可穿戴设备100中的本地应用对作用在按键上的用户操作进行识别,并向可穿戴设备100中的AMS发送信号。该信号用于通知通讯应用启动界面J。S1402: The local application in the wearable device 100 identifies the user operation on the button and sends a signal to the AMS in the wearable device 100. This signal is used to notify the communication application to start interface J.
在本申请的一些实施例中,本地应用向AMS发送的信号可以为持续高电平信号。本地应用向AMS发送的信号还可以为预设时间内的多次高电平信号。例如,3秒内的两次高电平信号。当然,本地应用向AMS发送的信号还可以为其他类型的信号,本申请对此不作限制。In some embodiments of the present application, the signal sent by the local application to the AMS may be a continuous high-level signal. The signal sent by the local application to the AMS can also be multiple high-level signals within a preset time. For example, two high-level signals within 3 seconds. Of course, the signals sent by the local application to the AMS can also be other types of signals, and this application does not limit this.
在本申请的一些实施例中,本地应用向AMS发送的信号也可以理解为消息。In some embodiments of the present application, the signal sent by the local application to the AMS can also be understood as a message.
可理解,界面J可以为通讯应用中包括新消息的通讯界面(如图13所示)。It is understandable that interface J can be a communication interface including new messages in the communication application (as shown in Figure 13).
S1403:AMS通知JS应用框架启动通讯应用。S1403: AMS notifies the JS application framework to start the communication application.
S1404:JS应用框架注册接口M。S1404: JS application framework registration interface M.
S1405:AMS绑定接口M。S1405: AMS binds interface M.
S1406:AMS通过接口M将信号发送给通讯应用。S1406: AMS sends the signal to the communication application through interface M.
可理解,步骤S1403-步骤S1406的相关描述可以参考步骤S1006-步骤S1009,在此不再赘述。It can be understood that the relevant description of steps S1403 to S1406 may refer to steps S1006 to S1009, which will not be described again here.
S1407:通讯应用显示界面J。S1407: Communication application display interface J.
可理解,通讯应用接收AMS发送的信号之后,可以显示界面J。It is understandable that after the communication application receives the signal sent by the AMS, the interface J can be displayed.
需要说明的是,场景二中的第三方应用还可以为通讯应用以外的其他应用,本申请对此不作限制。It should be noted that the third-party application in scenario two can also be other applications other than communication applications, and this application does not limit this.
场景三:可穿戴设备100可以检测到作用在本地应用的相应界面上的用户操作。本地应用可以向第三方应用发送消息,已启动第三方应用实现音乐播放、生成二维码等。Scenario 3: The wearable device 100 can detect user operations acting on the corresponding interface of the local application. Local applications can send messages to third-party applications, and third-party applications have been started to implement music playback, generate QR codes, etc.
示例性的,用户可以点击本地音乐应用上的相应控件。该控件用于触发播放用户最喜欢的歌曲。可穿戴设备100可以检测到该点击操作。相应的,本地音乐应用可以通过接口M向第三方音乐应用发送消息。该消息用于通知第三方应用播放用户最喜欢的歌曲。第三方音乐应用接收该消息之后,可以启动相应界面,从而实现音乐播放。For example, the user can click the corresponding control on the local music application. This control is used to trigger the playback of the user's favorite song. The wearable device 100 can detect the click operation. Correspondingly, the local music application can send messages to the third-party music application through the interface M. This message is used to notify third-party applications to play the user's favorite songs. After receiving the message, the third-party music application can launch the corresponding interface to realize music playback.
示例性的,用户可以点击本地应用中的航班信息卡片。可穿戴设备100可以检测到该点击操作。相应的,本地应用可以通过接口M向第三方应用发送消息。该消息用于通知第三方应用显示航班的具体信息。第三方应用接收该消息之后,可以启动相应界面。可穿戴设备100可以在显示屏上显示航班的具体信息。For example, the user can click on the flight information card in the local application. The wearable device 100 can detect the click operation. Correspondingly, the local application can send messages to the third-party application through the interface M. This message is used to notify third-party applications to display flight specific information. After receiving the message, the third-party application can launch the corresponding interface. The wearable device 100 may display flight specific information on the display screen.
可理解,上述示例中,本地应用通过接口M向第三方应用发送消息之前,可穿戴设备100中的JS应用框架需要注册接口M,且AMS需要绑定接口M,具体描述可以参考上文, 在此不再赘述。It can be understood that in the above example, before the local application sends a message to the third-party application through the interface M, the JS application framework in the wearable device 100 needs to register the interface M, and the AMS needs to bind the interface M. For detailed description, please refer to the above. I won’t go into details here.
需要说明的是,场景三中的本地应用和第三方应用还可以为其他应用,本申请对此不作限制。It should be noted that the local applications and third-party applications in scenario three can also be other applications, and this application does not limit this.
类似的,可穿戴设备100中的第三方应用也可以向本地应用发送消息,已启动本地应用实现日程提醒、航班提醒等功能。Similarly, the third-party application in the wearable device 100 can also send messages to the local application, and the local application has been started to implement functions such as schedule reminders and flight reminders.
可理解,本申请的说明书和权利要求书及附图中的术语“界面”和“用户界面”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的一个图标、窗口、控件等界面元素,其中控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。It can be understood that the terms "interface" and "user interface" in the description, claims and drawings of this application are media interfaces for interaction and information exchange between application programs or operating systems and users, which implement the internal Conversion between a form and a form acceptable to users. The commonly used form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed graphically. It can be an icon, window, control and other interface elements displayed on the display screen of an electronic device. Controls can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. Visual interface elements.
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。 The above embodiments are only used to illustrate the technical solutions of the present application, but are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments. Modifications may be made to the recorded technical solutions, or equivalent substitutions may be made to some of the technical features; however, these modifications or substitutions do not cause the essence of the corresponding technical solutions to depart from the scope of the technical solutions of the embodiments of the present application.

Claims (18)

  1. 一种通信方法,其特征在于,应用于可穿戴设备,所述方法包括:A communication method, characterized in that it is applied to wearable devices, and the method includes:
    所述可穿戴设备检测到作用于第一界面的操作;所述第一界面为所述可穿戴设备中的本地应用的界面;The wearable device detects an operation acting on a first interface; the first interface is an interface of a local application in the wearable device;
    响应于所述作用于第一界面的操作,所述可穿戴设备通过所述本地应用基于第一通信接口向所述可穿戴设备中的第三方应用发送第一消息;所述第一消息包括所述本地应用的包名、所述第三方应用的包名,以及第一目标传输数据;In response to the operation on the first interface, the wearable device sends a first message to the third-party application in the wearable device based on the first communication interface through the local application; the first message includes the The package name of the local application, the package name of the third-party application, and the first target transmission data;
    所述可穿戴设备通过所述第三方应用基于所述第一消息显示第二界面;所述第二界面为所述第三方应用的界面。The wearable device displays a second interface based on the first message through the third-party application; the second interface is the interface of the third-party application.
  2. 如权利要求1所述的方法,其特征在于,所述第一界面包括航班信息卡片;所述第一消息用于通知所述第三方应用显示航班的具体信息;所述第二界面包括所述航班的具体信息;所述可穿戴设备检测到作用于第一界面的操作,具体包括:所述可穿戴设备检测到作用于所述航班信息卡片上的操作。The method of claim 1, wherein the first interface includes a flight information card; the first message is used to notify the third-party application to display specific information about the flight; and the second interface includes the Specific information of the flight; the wearable device detects an operation acting on the first interface, specifically including: the wearable device detects an operation acting on the flight information card.
  3. 如权利要求1所述的方法,其特征在于,所述本地应用为本地音乐应用;所述第三方应用为第三方音乐应用;所述方法还包括:所述第三方音乐应用接收所述第一消息之后,所述可穿戴设备通过所述第三方音乐应用基于所述第一消息播放音乐。The method of claim 1, wherein the local application is a local music application; the third-party application is a third-party music application; the method further includes: the third-party music application receives the first After the message, the wearable device plays music based on the first message through the third-party music application.
  4. 如权利要求3所述的方法,其特征在于,所述可穿戴设备检测到作用于第一界面的操作,具体包括:所述可穿戴设备检测到作用于所述第一界面上的相应控件的操作;所述相应控件用于触发所述可穿戴设备播放用户最喜欢的歌曲。The method of claim 3, wherein the wearable device detects an operation acting on the first interface, specifically including: the wearable device detects an operation acting on a corresponding control on the first interface. Operation; the corresponding control is used to trigger the wearable device to play the user's favorite song.
  5. 如权利要求1所述的方法,其特征在于,所述可穿戴设备通过所述第三方应用基于所述第一消息显示第二界面,具体包括:所述可穿戴设备通过所述第三方应用基于所述第一消息生成二维码,并显示第二界面;所述第二界面包括所述二维码。The method of claim 1, wherein the wearable device displays the second interface based on the first message through the third-party application, specifically including: the wearable device displays the second interface based on the third-party application through the third-party application. The first message generates a QR code and displays a second interface; the second interface includes the QR code.
  6. 如权利要求1-5中任一项所述的方法,其特征在于,所述可穿戴设备通过所述本地应用基于第一通信接口向所述可穿戴设备中的第三方应用发送第一消息,具体包括:所述可穿戴设备通过所述本地应用向所述可穿戴设备中的能力管理服务AMS发送所述第一消息;所述可穿戴设备通过所述AMS基于所述第一通信接口向所述第三方应用发送所述第一消息;所述第一通信接口为所述AMS与所述可穿戴设备中的JS应用框架之间的通信接口。The method according to any one of claims 1 to 5, wherein the wearable device sends the first message to the third-party application in the wearable device based on the first communication interface through the local application, Specifically: the wearable device sends the first message to the capability management service AMS in the wearable device through the local application; the wearable device sends the first message to the capability management service AMS through the AMS based on the first communication interface. The third-party application sends the first message; the first communication interface is a communication interface between the AMS and the JS application framework in the wearable device.
  7. 如权利要求6所述的方法,其特征在于,所述方法还包括:所述可穿戴设备通过所述AMS接收所述第三方应用通过所述第一通信接口发送的第二消息;所述第二消息包括所述第三方应用的包名、所述本地应用的包名,以及第二目标传输数据;The method of claim 6, further comprising: the wearable device receiving, through the AMS, a second message sent by the third-party application through the first communication interface; The second message includes the package name of the third-party application, the package name of the local application, and the second target transmission data;
    所述可穿戴设备通过所述AMS向所述本地应用发送所述第二消息。The wearable device sends the second message to the local application through the AMS.
  8. 如权利要求6或7所述的方法,其特征在于,所述可穿戴设备通过所述本地应用向所述可穿戴设备中的能力管理服务AMS发送所述第一消息之前,所述方法还包括:The method of claim 6 or 7, wherein before the wearable device sends the first message to the capability management service AMS in the wearable device through the local application, the method further includes :
    所述可穿戴设备启动所述第三方应用;The wearable device launches the third-party application;
    所述可穿戴设备通过所述JS应用框架注册所述第一通信接口;The wearable device registers the first communication interface through the JS application framework;
    所述可穿戴设备通过所述AMS绑定所述第一通信接口。The wearable device is bound to the first communication interface through the AMS.
  9. 如权利要求8所述的方法,其特征在于,所述可穿戴设备启动所述第三方应用之前, 所述方法还包括:The method of claim 8, wherein before the wearable device starts the third-party application, The method also includes:
    所述可穿戴设备通过所述本地应用向所述AMS发送第三消息;所述第三消息包括所述本地应用的包名、所述第三方应用的包名,以及第三目标传输数据;The wearable device sends a third message to the AMS through the local application; the third message includes the package name of the local application, the package name of the third-party application, and the third target transmission data;
    所述可穿戴设备通过所述AMS确定所述可穿戴设备中是否存在正在运行的应用,并在所述可穿戴设备中存在正在运行的应用的情况下,比较正在运行的应用与所述第三方应用的优先级;The wearable device determines whether there is a running application in the wearable device through the AMS, and if there is a running application in the wearable device, compares the running application with the third party application priority;
    所述可穿戴设备启动所述第三方应用,具体包括:The wearable device starts the third-party application, specifically including:
    在所述可穿戴设备中不存在正在运行的应用,或者,正在运行的应用的优先级不高于所述第三方应用的优先级的情况下,所述可穿戴设备启动所述第三方应用;When there is no running application in the wearable device, or the priority of the running application is not higher than the priority of the third-party application, the wearable device starts the third-party application;
    所述可穿戴设备通过所述AMS绑定所述第一通信接口之后,所述方法还包括:After the wearable device binds the first communication interface through the AMS, the method further includes:
    所述可穿戴设备通过所述AMS基于所述第一通信接口向所述第三方应用发送所述第三目标传输数据。The wearable device sends the third target transmission data to the third-party application based on the first communication interface through the AMS.
  10. 如权利要求8所述的方法,其特征在于,所述可穿戴设备通过所述JS应用框架注册所述第一通信接口之前,所述方法还包括:The method of claim 8, wherein before the wearable device registers the first communication interface through the JS application framework, the method further includes:
    所述可穿戴设备通过所述JS应用框架向所述第三方应用发送第四消息;所述第四消息用于通知所述第三方应用启动注册流程;The wearable device sends a fourth message to the third-party application through the JS application framework; the fourth message is used to notify the third-party application to start the registration process;
    所述可穿戴设备通过所述JS应用框架注册所述第一通信接口之后,所述方法还包括:After the wearable device registers the first communication interface through the JS application framework, the method further includes:
    所述可穿戴设备通过所述JS应用框架向所述AMS发送第五消息;所述第五消息用于通知所述AMS所述第一通信接口已注册。The wearable device sends a fifth message to the AMS through the JS application framework; the fifth message is used to notify the AMS that the first communication interface has been registered.
  11. 如权利要求8-10任一项所述的方法,其特征在于,所述可穿戴设备启动所述第三方应用,具体包括:The method according to any one of claims 8-10, wherein the wearable device starts the third-party application, specifically including:
    所述可穿戴设备通过所述AMS向所述JS应用框架发送第六消息;所述第六消息用于通知所述JS应用框架启动所述第三方应用;The wearable device sends a sixth message to the JS application framework through the AMS; the sixth message is used to notify the JS application framework to start the third-party application;
    所述可穿戴设备通过所述JS应用框架加载所述第三方应用的相关组件,并向所述AMS发送第七消息;所述第七消息用于通知所述AMS所述第三方应用已启动。The wearable device loads relevant components of the third-party application through the JS application framework, and sends a seventh message to the AMS; the seventh message is used to notify the AMS that the third-party application has been started.
  12. 如权利要求11所述的方法,其特征在于,所述可穿戴设备启动所述第三方应用之前,所述方法还包括:The method of claim 11, wherein before the wearable device starts the third-party application, the method further includes:
    所述可穿戴设备通过所述AMS与所述可穿戴设备中的UI组件建立通信连接;The wearable device establishes a communication connection with the UI component in the wearable device through the AMS;
    所述可穿戴设备通过所述AMS请求所述UI组件将原显示界面置于后台。The wearable device requests the UI component to place the original display interface in the background through the AMS.
  13. 如权利要求6-10、12中任一项所述的方法,其特征在于,所述可穿戴设备通过所述AMS基于所述第一通信接口向所述第三方应用发送所述第一消息之后,所述方法还包括:The method according to any one of claims 6-10 and 12, characterized in that after the wearable device sends the first message to the third-party application based on the first communication interface through the AMS, , the method also includes:
    所述可穿戴设备通过所述AMS接收所述第三方应用通过所述第一通信接口发送的第八消息;所述第八消息包括所述第三方应用的包名、所述本地应用的包名,以及第四目标传输数据;The wearable device receives an eighth message sent by the third-party application through the first communication interface through the AMS; the eighth message includes the package name of the third-party application and the package name of the local application. , and the fourth target transmits data;
    所述可穿戴设备通过所述AMS向所述第三方应用发送所述第八消息。The wearable device sends the eighth message to the third-party application through the AMS.
  14. 如权利要求11所述的方法,其特征在于,所述可穿戴设备通过所述AMS基于所述第一通信接口向所述第三方应用发送所述第一消息之后,所述方法还包括: The method of claim 11, wherein after the wearable device sends the first message to the third-party application through the AMS based on the first communication interface, the method further includes:
    所述可穿戴设备通过所述AMS接收所述第三方应用通过所述第一通信接口发送的第八消息;所述第八消息包括所述第三方应用的包名、所述本地应用的包名,以及第四目标传输数据;The wearable device receives an eighth message sent by the third-party application through the first communication interface through the AMS; the eighth message includes the package name of the third-party application and the package name of the local application. , and the fourth target transmits data;
    所述可穿戴设备通过所述AMS向所述第三方应用发送所述第八消息。The wearable device sends the eighth message to the third-party application through the AMS.
  15. 如权利要求7所述的方法,其特征在于,所述可穿戴设备通过所述AMS接收所述第三方应用通过所述第一通信接口发送的第二消息之后,所述方法还包括:The method of claim 7, wherein after the wearable device receives the second message sent by the third-party application through the first communication interface through the AMS, the method further includes:
    所述可穿戴设备通过所述本地应用向所述AMS发送第九消息;所述第九消息包括所述本地应用的包名、所述第三方应用的包名,以及第五目标传输数据;The wearable device sends a ninth message to the AMS through the local application; the ninth message includes the package name of the local application, the package name of the third-party application, and fifth target transmission data;
    所述可穿戴设备通过所述AMS基于所述第一通信接口向所述第三方应用发送所述第九消息。The wearable device sends the ninth message to the third-party application based on the first communication interface through the AMS.
  16. 如权利要求11所述的方法,其特征在于,所述可穿戴设备通过所述AMS接收所述第三方应用通过所述第一通信接口发送的第二消息之后,所述方法还包括:The method of claim 11, wherein after the wearable device receives the second message sent by the third-party application through the first communication interface through the AMS, the method further includes:
    所述可穿戴设备通过所述本地应用向所述AMS发送第九消息;所述第九消息包括所述本地应用的包名、所述第三方应用的包名,以及第五目标传输数据;The wearable device sends a ninth message to the AMS through the local application; the ninth message includes the package name of the local application, the package name of the third-party application, and fifth target transmission data;
    所述可穿戴设备通过所述AMS基于所述第一通信接口向所述第三方应用发送所述第九消息。The wearable device sends the ninth message to the third-party application based on the first communication interface through the AMS.
  17. 一种可穿戴设备,包括显示屏、存储器,以及一个或多个处理器,其特征在于,所述存储器用于存储计算机程序;所述处理器用于调用所述计算机程序,使得所述可穿戴设备执行权利要求1-16中任一项所述的方法。A wearable device includes a display screen, a memory, and one or more processors, characterized in that the memory is used to store a computer program; the processor is used to call the computer program so that the wearable device Carry out the method of any one of claims 1-16.
  18. 一种计算机存储介质,其特征在于,包括:计算机指令;当所述计算机指令在可穿戴设备上运行时,使得所述可穿戴设备执行权利要求1-16中任一项所述的方法。 A computer storage medium, characterized in that it includes: computer instructions; when the computer instructions are run on a wearable device, the wearable device is caused to execute the method described in any one of claims 1-16.
PCT/CN2023/092908 2022-05-27 2023-05-09 Communication method and related device WO2023226744A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210588160.7 2022-05-27
CN202210588160.7A CN115033396B (en) 2022-05-27 2022-05-27 Communication method and related equipment

Publications (2)

Publication Number Publication Date
WO2023226744A1 WO2023226744A1 (en) 2023-11-30
WO2023226744A9 true WO2023226744A9 (en) 2024-01-04

Family

ID=83121621

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/092908 WO2023226744A1 (en) 2022-05-27 2023-05-09 Communication method and related device

Country Status (2)

Country Link
CN (2) CN115033396B (en)
WO (1) WO2023226744A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033396B (en) * 2022-05-27 2023-05-02 荣耀终端有限公司 Communication method and related equipment

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104008436A (en) * 2013-02-26 2014-08-27 中国移动通信集团浙江有限公司 Content management integration method and system
US10257141B2 (en) * 2015-03-13 2019-04-09 Cola, Inc. System and method for delivering inline interactive objects encapsulated in a message
US10033702B2 (en) * 2015-08-05 2018-07-24 Intralinks, Inc. Systems and methods of secure data exchange
CN105867980A (en) * 2016-04-19 2016-08-17 青岛海信电器股份有限公司 Method and device for processing keys of terminals
CN107220076B (en) * 2016-09-27 2018-10-30 华为技术有限公司 A kind of method for recovering internal storage and device
CN107169904A (en) * 2017-03-31 2017-09-15 西藏喜年通讯科技有限公司 Method, mobile device and the device of the information interaction of different application platforms
CN108111676B (en) * 2017-12-14 2021-06-08 维沃移动通信有限公司 Application program control method, mobile terminal and computer readable storage medium
CN110086930A (en) * 2019-04-22 2019-08-02 努比亚技术有限公司 A kind of voice interactive method, wearable device and computer readable storage medium
CN110569130B (en) * 2019-07-29 2021-12-14 华为技术有限公司 Cross-process communication method, device and equipment
CN112399264B (en) * 2019-08-18 2022-06-14 聚好看科技股份有限公司 Projection hall service management method and application
CN112579191A (en) * 2019-09-29 2021-03-30 华为终端有限公司 Component loading method, device and system
CN111669621B (en) * 2020-04-30 2022-04-12 聚好看科技股份有限公司 Media asset data issuing method, server and display device
US11615392B2 (en) * 2020-05-01 2023-03-28 Capital One Services, Llc Systems and methods for using information from wearable devices
CN112114913B (en) * 2020-07-27 2022-08-09 广东太平洋互联网信息服务有限公司 Application program interface updating method and device, computer equipment and storage medium
CN114124980B (en) * 2020-08-29 2022-11-25 荣耀终端有限公司 Method, device, system, terminal and storage medium for starting application
CN114428618A (en) * 2020-10-28 2022-05-03 华为技术有限公司 Cross-device application interaction method, electronic device and server
CN114443277A (en) * 2020-10-31 2022-05-06 华为终端有限公司 Memory management method and device, electronic equipment and computer readable storage medium
CN113301546B (en) * 2021-04-25 2022-07-01 荣耀终端有限公司 Method and device for searching wearable device
CN113887264B (en) * 2021-06-07 2022-06-21 荣耀终端有限公司 Code scanning method, system and related device
CN113703641A (en) * 2021-06-28 2021-11-26 深圳市爱都科技有限公司 Message preview method and device, wearable device and computer readable storage medium
CN114237464B (en) * 2021-11-11 2022-11-04 荣耀终端有限公司 Data sharing method and electronic equipment
CN115033396B (en) * 2022-05-27 2023-05-02 荣耀终端有限公司 Communication method and related equipment

Also Published As

Publication number Publication date
CN117112251B (en) 2024-06-14
WO2023226744A1 (en) 2023-11-30
CN115033396A (en) 2022-09-09
CN115033396B (en) 2023-05-02
CN117112251A (en) 2023-11-24

Similar Documents

Publication Publication Date Title
KR102470275B1 (en) Voice control method and electronic device
WO2021052263A1 (en) Voice assistant display method and device
WO2021036735A1 (en) User interface display method and electronic device
JP6553328B2 (en) GUI transition in wearable electronic devices
CN109445572A (en) The method, graphical user interface and terminal of wicket are quickly recalled in full screen display video
CN110910872A (en) Voice interaction method and device
CN109814766A (en) A kind of application display method and electronic equipment
CN110119296A (en) Switch method, the relevant apparatus of parent page and subpage frame
WO2021196970A1 (en) Method for creating application shortcuts, electronic device, and system
CN111459586B (en) Remote assistance method, device, storage medium and terminal
CN113132526B (en) Page drawing method and related device
US11198154B2 (en) Method and apparatus for providing vibration in electronic device
WO2021175272A1 (en) Method for displaying application information and related device
WO2023226744A1 (en) Communication method and related device
CN115460469B (en) Processing method and device for multi-video playing, computer equipment and storage medium
CN113220176A (en) Display method and device based on widget, electronic equipment and readable storage medium
WO2022127130A1 (en) Method for adding operation sequence, electronic device, and system
WO2020103091A9 (en) Touch operation locking method and electronic device
KR20180058419A (en) Mobile device for providing exercise contents and wearable device connected therewith
CN115016697A (en) Screen projection method, computer device, readable storage medium, and program product
CN112966798A (en) Information display method and device, electronic equipment and storage medium
WO2023130931A1 (en) Service anomaly warning method, electronic device and storage medium
WO2022117002A1 (en) Wireless charging method between electronic devices, storage medium, and electronic devices therefor
WO2021104000A1 (en) Screen display method and electronic device
WO2022143094A1 (en) Window page interaction method and apparatus, electronic device, and readable storage medium

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: 23810817

Country of ref document: EP

Kind code of ref document: A1