Communication method, electronic device and readable storage medium

By obtaining configuration files and using adaptive SDKs, the problem of mismatch between electronic devices and IOT device application layer protocols is solved, and the rapid access ecosystem of IOT devices is realized, simplifying the access process and reducing the R&D cycle.

CN117715021BActive Publication Date: 2025-01-07HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310849580.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-11
Publication Date
2025-01-07
Estimated Expiration
2043-07-11

AI Technical Summary

Technical Problem

When the application layer protocol between electronic devices and IOT devices does not match, custom development is required, resulting in a long research and development cycle of IOT devices and difficulty in quickly accessing the ecosystem, which is particularly unfavorable to access commercially used IOT devices.

Method used

By obtaining configuration files in electronic devices, launching IOT devices based on the configuration files, and establishing connections with IOT devices using the adapted SDK, communicating using standardized interfaces, adapting to the object model of electronic devices and the protocol of IOT devices, implementing protocol specifications match.

Benefits of technology

When the electronic device does not match the application layer protocol of the IOT device, it can quickly access the ecosystem, simplify the access process of the IOT device, reduce the R&D cycle, and improve the access efficiency of the IOT device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117715021B_ABST
    Figure CN117715021B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a communication method, an electronic device and a readable storage medium, the communication method comprising: when starting a target application, obtaining a configuration file from a developer platform; after the target application scans and finds a first target IOT device, putting the first target IOT device online on the shelf of the target application; in response to the operation of the first target IOT device or a related scenario including the first target IOT device, when it is determined that a first software development kit SDK needs to be used to establish a connection with the first target IOT device, downloading the first SDK, and using the downloaded first SDK to establish a connection with the first target IOT device; using a standardized interface in the first SDK that matches the operation to communicate with the first target IOT device. This method enables the first target IOT device to quickly access the ecosystem of the electronic device when the electronic device does not match the application layer protocol specification of the first target IOT device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a communication method, an electronic device and a readable storage medium. Background Art

[0002] Mobile phones and other electronic devices can communicate with Internet of Things (IOT) devices to achieve functions such as data query, data setting, and data transmission. Related technologies When communicating, electronic devices and IOT devices usually agree on a set of application layer protocol specifications, and then both electronic devices and IOT devices follow the specifications to implement collaborative services such as device status reading, attribute setting, and behavior control. If the specifications on both sides are inconsistent, customized development is required.

[0003] In the relevant scheme, based on the physical model of electronic devices, IoT devices and electronic devices can complete business interactions based on the physical model of electronic devices. However, this development model has a relatively long device-side development cycle, which is not conducive to the rapid access of IoT devices to the ecosystem, nor is it conducive to the access of commercial IoT devices. Summary of the invention

[0004] The present application provides a communication method, an electronic device and a readable storage medium, which can enable the target IOT device to quickly access the ecosystem of the electronic device when the application layer protocol specifications of the electronic device and the target IOT device do not match.

[0005] In order to achieve the above technical objectives, this application adopts the following technical solutions:

[0006] In a first aspect, a communication method is provided, the method comprising: when starting a target application, obtaining a configuration file from a developer platform; the configuration file defines configuration information of an IOT device that can communicate with the electronic device; after the target application scans and discovers a first target IOT device, the first target IOT device is put online on the shelf of the target application according to the configuration file; in response to an operation on the first target IOT device or a related scenario including the first target IOT device, when it is determined according to the configuration file that a first software development kit SDK needs to be used to establish a connection with the first target IOT device, the first SDK is downloaded, and a connection is established with the first target IOT device using the downloaded first SDK; the first SDK is adapted to the physical model of the electronic device and the protocol of the first target IOT device; and the first target IOT device is communicated with using a standardized interface in the first SDK that matches the operation.

[0007] By adopting this technical solution, since the SDK adapts the object model of the electronic device and the protocol of the target IOT device, when the application layer protocol specification of the electronic device does not match that of the first target IOT device, the first target IOT device can quickly access the ecosystem of the electronic device.

[0008] Optionally, the configuration file includes a first configuration file, and the first configuration file corresponds to the first target IOT device; putting the first target IOT device online on the shelf of the target application according to the configuration file includes: putting the first target IOT device online at the position of the first target IOT device configured according to the first configuration file on the shelf of the target application.

[0009] Optionally, the first configuration file includes at least one of the following information: device binding method, device authentication method, device connection method and network configuration method; before the first target IOT device is put online on the shelf of the target application according to the configuration file, it also includes: completing device registration, device binding and device authentication of the first target IOT device according to the first configuration file.

[0010] Optionally, the target application is configured with M shelves, the M shelves correspond to N target IOT devices, the N is greater than M or equal to M, and the M and N are positive integers.

[0011] Optionally, the use of a standardized interface in the first SDK that matches the operation to communicate with the first target IOT device includes: obtaining a data stream corresponding to the operation; deserializing the data stream to obtain a service list and a property list of the first target IOT device that matches the operation, calling a standardized interface, converting it into an application protocol specification supported by the target IOT device within the first SDK, and controlling the first target IOT device.

[0012] Optionally, the communication method further includes: serializing the uploaded data when the first target IOT device uploads data; parsing the serialized uploaded data to determine a state change of an attribute of the first target IOT device; and updating an attribute value of an attribute whose state has changed in the first target IOT device.

[0013] Optionally, the communicating with the first target IOT device by using a standardized interface in the first SDK that matches the operation includes: communicating with the first target IOT device through a near field communication protocol by using a standardized interface in the first SDK that matches the operation.

[0014] Optionally, the near field communication protocol includes: a Bluetooth communication protocol or a Wi-Fi communication protocol.

[0015] In the third aspect, the present application also provides an electronic device, comprising: a memory and one or more processors, wherein the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method described in the first aspect or any possible implementation manner of the first aspect.

[0016] In a fourth aspect, the present application further provides a computer-readable storage medium, comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect or any possible implementation manner of the first aspect.

[0017] It can be understood that the technical solutions provided in the above-mentioned second to fourth aspects can respectively correspond to any solution provided in the first aspect and its possible implementation, and the beneficial effects that can be achieved are similar, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1A A schematic diagram of an IOT device communicating with an electronic device in a communication method provided in an embodiment of the present application;

[0019] Figure 1B A schematic diagram of an IOT device on a shelf that communicates with an electronic device provided in an embodiment of the present application;

[0020] Figure 2 A flow chart of a communication method provided in an embodiment of the present application;

[0021] Figure 3A A schematic diagram of interaction in a communication method provided in an embodiment of the present application;

[0022] Figure 3B A schematic diagram of an interface of a communication method provided in an embodiment of the present application;

[0023] Figure 3C A schematic diagram of an interface of a communication method provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of an electronic device provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of an interactive flow of a communication method provided in an embodiment of the present application;

[0026] Figure 6 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application;

[0027] Figure 7A schematic diagram of the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0029] With the development of technology, interconnection between devices is becoming more and more common in daily use.

[0030] Users can communicate with IOT devices through mobile phones and other electronic devices to achieve tasks such as connection, reading, and writing.

[0031] It should be noted that the electronic device in the embodiment of the present application can be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, a vehicle-mounted device, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR)\virtual reality (VR) device, etc. The embodiment of the present application does not impose any special restrictions on the specific form of the electronic device. An IOT device is a device that can interact with an electronic device. The communication between an electronic device and an IOT device can be called IOT communication.

[0032] As an example, take the electronic device as a mobile phone. Figure 1A , IOT devices may include Figure 1A After the mobile phone establishes a connection with the IOT device, the IOT device logo can be displayed in the target application, such as Figure 1B As shown, the identification of the IOT device can be displayed in a page including multiple shelves. Figure 1B As shown, IOT devices may include: hearing aids, headphones, smart elliptical machines, smart treadmills, smart skipping ropes, body fat scales, blood glucose meters, blood pressure monitors, fax machines, scanners, ovens, refrigerators, air conditioners, sweepers, etc.

[0033] After the mobile phone establishes a connection with the IOT device, the IOT device logo can be displayed on different shelves in the mobile shelf page. The specific shelf can be set in the configuration file, such as Figure 1BAs shown, control-type IOT devices such as headphones and hearing aids can be located on shelf 1; health-type IOT devices such as body fat scales, blood glucose meters, and blood pressure monitors can be located on shelf 2; smart skipping ropes, smart treadmills, and smart elliptical machines can be located on shelf 3; office-type IOT devices such as fax machines and scanners can be located on shelf 4; and kitchen-type IOT devices such as refrigerators and ovens can be located on shelf 5.

[0034] The mobile phone can communicate with various IOT devices to interact with the IOT devices. IOT communication can be a near field communication method, such as Bluetooth or WiFi.

[0035] Taking the IOT device as a hearing aid as an example, the mobile phone can communicate with the hearing aid via Bluetooth. Through Bluetooth, the mobile phone can also obtain the working status of the hearing aid, control the volume of the hearing aid, etc.

[0036] When the IOT device is a smart skipping rope, the mobile phone can establish IOT device communication with the smart skipping rope. Through IOT communication, the mobile phone can obtain information such as the power of the smart skipping rope. The mobile phone can also obtain exercise information from the smart skipping rope after the user uses the smart skipping rope for exercise, such as the number of skipping times, the length of skipping time, etc.

[0037] After the application in the mobile phone used to interconnect with the IOT device (i.e., the target application) is started, a configuration file can be obtained from the developer platform. The configuration file defines the configuration information of the IOT device that can communicate with the mobile phone. The configuration file includes information about the location of the IOT device on the shelf after the mobile phone is connected to the IOT device. After the mobile phone establishes a connection with the IOT device, the identification of the IOT device is displayed according to the location of the IOT device on the shelf indicated in the configuration file.

[0038] It should be noted that when mobile phones and IoT devices communicate, a set of application layer protocol specifications are sometimes agreed upon, and then both the mobile phone and the IoT device follow the specifications to implement collaborative services such as device status reading, property setting, and behavior control.

[0039] In actual applications, the application layer protocol specifications on both sides are sometimes inconsistent. In this case, custom development is usually required. The R&D cycle on the IOT device side is relatively long, which is not conducive to the rapid access of IOT devices to the ecosystem, nor is it conducive to the access of commercially available IOT devices. The technical solution provided by this application can solve this problem. Figure 1A Taking the hearing aid in the example, when the application layer protocols of the hearing aid and the mobile phone are different, the technical solution provided in the embodiment of the present application can be used for communication.

[0040] The technical solution provided in the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0041] See also Figure 2, when the electronic device communicates with the IOT device, it includes steps 201 to 204, wherein:

[0042] 201. When starting the target application, obtain a configuration file from the developer platform; the configuration file defines the configuration information of the IOT device that can communicate with the electronic device.

[0043] In some possible implementations, the configuration file includes a first configuration file, and the first configuration file corresponds to the hearing aid.

[0044] For example, if Figure 3B As shown, the third icon (icon 302) from the left on the interface 301 is the icon corresponding to the target application (smart life). Through operation 303, click icon 302 to start the target application and display interface 304. Through operation 306, click the control 305 corresponding to the add identifier to display interface 307 and perform device discovery.

[0045] 202. After the target application scans and finds the first target IOT device, the first target IOT device is put online on the shelf of the target application according to the configuration file.

[0046] The first configuration file may include at least one of the following information: device binding method, device authentication method, device connection method, and network configuration method; the electronic device completes device registration, device binding, and device authentication of the hearing aid according to the first configuration file. The hearing aid configured according to the first configuration file is put online at the location on the shelf of the target application. It should be noted that one shelf can display one or more IOT devices of the same type.

[0047] For example, if Figure 3B As shown, an automatic search icon is displayed on the interface 307, and the search results are displayed in the lower half of the interface 307, including: the identification of the searched device 3, the identification of the device 4 and the identification of the device 5. Operation 309 clicks the identification 308 corresponding to the device 3 to trigger the manual addition of the device 3. Figure 1B As shown, the identification corresponding to the hearing aid can be displayed on shelf 1 according to the configuration file.

[0048] 203. In response to operations on the first target IOT device or related scenarios including the first target IOT device, when it is determined according to the configuration file that the first software development kit SDK needs to be used to establish a connection with the first target IOT device, the first SDK is downloaded, and the downloaded first SDK is used to establish a connection with the first target IOT device; the first SDK adapts to the physical model of the electronic device and the protocol of the first target IOT device.

[0049] For example, if Figure 3AAs shown, if the first target IOT device is a hearing aid, if the first configuration file corresponding to the hearing aid determines that a first software development kit SDK needs to be used to establish a connection with the hearing aid, the first SDK can be downloaded from a cloud server (eg, a developer platform).

[0050] It should be noted that the IOT devices applicable to the technical solution of this application can be defined as control-type IOT devices. Control-type IOT devices require device manufacturers to upload SDK packages on the developer platform, and the application layer logic is implemented in the SDK package. The interface standards of electronic devices are pre-defined, and device manufacturers implement standard interfaces. The standard interfaces implemented by device manufacturers can interact with their own IOT devices.

[0051] After the device manufacturer implements the standard interface according to the interface standard pre-defined by the electronic device, it is uploaded to the developer platform in the form of SDK. When the electronic device retrieves the first target IOT device, the SDK corresponding to the first IOT device is downloaded to the electronic device. Since the interface is defined by the electronic device and the manufacturer of the first target IOT device implements the interface, the electronic device can call the standard interface to control the first target IOT device, such as adjusting the volume of the hearing aid, making personalized settings, controlling switches, and achieving interface rendering effects. Figure 3C As shown, in interface 310, by operating 312 and clicking on the mark 311 corresponding to device 3, interface 313 can be displayed, and operable tabs 314 are displayed in interface 313, including: a tab for "setting automatic start working time" and a tab for "setting working hours", and by operating 315 and clicking on the tab 314 for "setting automatic start working time", the automatic start working time of device 3 can be set.

[0052] 204. Communicate with the first target IOT device using a standardized interface in the first SDK that matches the operation.

[0053] Taking the electronic device as a mobile phone and the first target IOT device as a hearing aid as an example, the developer can define the product model Profile of the hearing aid based on the product characteristics of the hearing aid and the object model specifications of the mobile phone. The Profile abstracts a service list for the hearing aid. Each service defines an attribute list, which contains the specific attribute definitions of the service. For example, the left ear volume access is 5, indicating that the volume can be set and read, and the value is 0, indicating that the current left ear volume value is 0.

[0054] Developers define the object model according to the specifications set by the electronic device, which is equivalent to abstracting what services and attributes a device has. After abstraction, a profile Jackson file is formed, such as the file below, which includes some setting properties. After definition, upload it to the developer platform, and the device will have a model.

[0055] For example, the physical model of the xx hearing aid can be set up as follows:

[0056]

[0057]

[0058]

[0059] After the first target IOT device is put on the shelf, the first target IOT device can be displayed on the shelf in the form of a card. The card can be operated to achieve interaction with the first target IOT device, where the card can be an H5 page. If it is found that the SDK package has not been downloaded, the corresponding SDK package is downloaded, and the SDK environment, some interfaces, and some internal variables and environment initialization may be initialized. After initialization, the SDK package is in the mobile phone, and the electronic device has the ability to call the first target IOT device. Properties can be queried or set through read or write operations.

[0060] like Figure 4 As shown, a virtual device can be abstracted in the mobile application to communicate with the real device. The abstract virtual connection intercepts the data stream sent from the mobile phone and sends it to the virtual device. The mobile phone can convert the input of the card into a data stream. After the virtual device deserializes the data stream, it obtains the service list and attribute list of the first target IOT device communication, and passes it to the standardized interface. The control shelf SDK implements the standardized interface and adapts the physical model of the electronic device and the protocol of the first target IOT device; it can complete the communication between the electronic device physical model business and the existing business capabilities of the first target IOT device, and realize access to the electronic device ecosystem.

[0061] By adopting the technical solution provided in the embodiment of the present application, the developer of the first target IOT device only needs to abstract the electronic device object model according to the product function definition, provide a shelf SDK package, and implement a standardized interface. The SDK is uploaded to the developer platform for management, and the electronic device downloads the SDK on demand when the business is triggered.

[0062] like Figure 5 As shown, the electronic device can not only control the first target IOT device, but the first target IOT device can also report some status / events to the electronic device to refresh the status of the first target IOT device in the electronic device. Specifically, when the first target IOT device communicates with the electronic device, the following steps can be included:

[0063] 401.IOT device developers abstract the object model definition based on product functions.

[0064] 402. Configure the first target IOT device on the developer platform and upload the SDK.

[0065] 403. After launching the target application, the electronic device downloads or updates the configuration file from the developer platform.

[0066] The configuration file is downloaded from the developer platform and saved to the electronic device.

[0067] 404. The electronic device discovers the first target IOT device through a near field discovery method.

[0068] Then, operations such as registration, binding, and device authentication of the first target IOT device are implemented.

[0069] 405. Trigger connection with the first target IOT device.

[0070] The protocol management module of the virtual device in the electronic device loads the SDK package, reflects the call, initializes the resources, then calls the connection standard interface to connect to the first target device, the first target device responds according to the connection request, and the SDK returns a connection response. Then the connection status of the first target IOT device is refreshed through the target application.

[0071] 406. Query the properties of the first target IOT device, set properties, perform control and other operations.

[0072] Deserialize the data stream of the operation and perform Profile semantic analysis.

[0073] The electronic device communication protocol specifies the coding specifications for IOT device control. For example, when setting the volume of the left and right ears of the hearing aid service, the communication protocol specification can be coded as follows:

[0074]

[0075] 407. Call the business standardized interface to issue commands.

[0076] The first target IOT device is controlled, the first target IOT device responds, and the SDK returns a business response.

[0077] When the first target IOT device reports a status / event, step 408 is executed.

[0078] 408. Use standardized interfaces to process reported status / events.

[0079] The profile specification serializes the reported status / events, and the target application handles the reported events and writes the device status.

[0080] As an example, Figure 6A schematic diagram of the structure of an electronic device is shown.

[0081] Figure 6 600 is a schematic diagram of the structure of an electronic device 600 provided in an embodiment of the present application, which may specifically be a mobile phone, a tablet computer, or other device. Figure 6 The electronic device 600 may include a processor 610, an external memory interface 620, an internal memory 621, a universal serial bus (USB) interface 630, a charging management module 640, a power management module 641, a battery 642, an antenna 1, an antenna 2, a mobile communication module 650, a wireless communication module 660, an audio module 670, a speaker 670A, a receiver 670B, a microphone 670C, an earphone interface 670D, a sensor module 680, a button 690, a motor 691, an indicator 692, a camera 693, a screen 694, and a subscriber identification module (SIM) card interface 695, etc. Among them, the sensor module 680 may include a pressure sensor 680A, a gyroscope sensor 680B, an air pressure sensor 680C, a magnetic sensor 680D, an acceleration sensor 680E, a distance sensor 680F, a proximity light sensor 680G, a fingerprint sensor 680H, a temperature sensor 680J, a touch sensor 680K, an ambient light sensor 680L, a bone conduction sensor 680M, etc.

[0082] The processor 610 may include one or more processing units, for example, the processor 610 may include an AP, a CP, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0083] The controller may be the nerve center and command center of the electronic device 600. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0084] The processor 610 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 610 is a cache memory. The memory may store instructions or data that the processor 610 has just used or circulated. If the processor 610 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 610 is reduced, and the efficiency of the system is improved. The processor may also be provided with a low-power memory (e.g., Island low power consumption, etc.) to reduce power consumption.

[0085] The electronic device 600 implements the display function through a GPU, a screen 694, and an application processor. The GPU is a microprocessor for image processing, which connects the screen 694 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 610 may include one or more GPUs, which execute program instructions to generate or change display information.

[0086] The screen 694 is used to display images, videos, etc. The screen 694 includes a display panel. The display panel can be 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 (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-OLED, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 600 may include 1 or N screens 694, where N is an integer greater than 1.

[0087] The electronic device 600 can realize the shooting function through ISP, camera 693, video codec, GPU, screen 694 and application processor.

[0088] ISP is used to process the data fed back by camera 693. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 693.

[0089] The camera 693 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 600 may include 1 or N cameras 693, where N is an integer greater than 1.

[0090] The external memory interface 620 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 600. The external memory card communicates with the processor 610 through the external memory interface 620 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0091] The internal memory 621 can be used to store computer executable program codes, which include instructions. The processor 610 executes various functional applications and data processing of the electronic device 600 by running the instructions stored in the internal memory 621. The internal memory 621 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data (such as audio data, a phone book, etc.) created by the electronic device 600 during use. In addition, the internal memory 621 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0092] The acceleration sensor 680E can detect the magnitude of the acceleration of the electronic device 600 in all directions (generally three axes). When the electronic device 600 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor 680E can also be used to identify the posture of the electronic device 600, and is applied to applications such as horizontal and vertical screen switching and pedometers. Of course, the acceleration sensor 680E can also be combined with the gyroscope sensor 680B to identify the posture of the electronic device 600, and is applied to horizontal and vertical screen switching.

[0093] The gyroscope sensor 680B can be used to determine the motion posture of the electronic device 400. In some embodiments, the angular velocity of the electronic device 600 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 680B. The gyroscope sensor 680B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 680B detects the angle of the electronic device 600 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 600 through reverse movement to achieve anti-shake. The gyroscope sensor 680B can also be used for horizontal and vertical screen switching, navigation, and somatosensory game scenes.

[0094] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 600. In other embodiments of the present application, the electronic device 600 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0095] The electronic device provided in the embodiment of the present application may be a user equipment (UE), such as a mobile terminal (such as a mobile phone), a tablet computer, or other device.

[0096] In addition, an operating system runs on the above components, such as the Android open source operating system developed by Google.

[0097] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. In order to more clearly illustrate the touch operation recognition method provided in the embodiment of the present application, the embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software system of the electronic device.

[0098] Above Figure 6 This is just an example of the composition of an electronic device. Figure 7 , which is another composition example of an electronic device provided in an embodiment of the present application.

[0099] In this example, the software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device is illustrated.

[0100] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. The system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime (ART) and native C / C++ library, hardware abstraction layer (HAL) and kernel layer.

[0101] The application layer can include a series of application packages.

[0102] like Figure 7 As shown, the electronic device may include a hardware layer and a software layer, wherein the Android system of the layered architecture may include an application layer, an application framework layer, a system library layer and a kernel layer. In some optional embodiments, the system of the electronic device may also include a layer not mentioned in the above technical architecture, such as Android Runtime. The application layer may include a series of application packages, such as navigation applications, music applications, video applications, and knuckle tapping screen applications. The application package may include applications such as video, chat, and a system user interface (SystemUI), and the knuckle tapping screen application may be used for screenshots, screen recordings, long screenshots, regional screenshots, etc. In this example, the application package also includes applications such as smart life for controlling IOT devices.

[0103] Video, chat and other applications are used to provide corresponding services to users. For example, users use video applications to watch videos, use chat applications to chat with other users, use music applications to listen to music, and use video synthesis to generate memory videos using existing images and videos.

[0104] SystemUI is used to manage the human-computer interaction interface (user interface, UI) of the electronic device. In the embodiment of the present application, SystemUI is used to monitor the touch operation on the touch screen.

[0105] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. The application framework layer can include window management service module (window manage service, WMS), display rotation module (also known as DisplayRotation), application management service module (activity manage service, AMS), input management module (also known as Input) and image processing module, etc.

[0106] WMS is used to manage window programs. The window manager can obtain the screen size, determine whether there is a status bar, cut out the image on the screen, capture the screen, etc. In the embodiment of the present application, WMS can create and manage the window corresponding to the application.

[0107] The display rotation module is used to control the screen rotation so that the screen presents a vertical or horizontal layout. For example, when it is determined that the screen needs to be rotated, Surfaceflinger is notified to switch the horizontal and vertical screens of the application interface.

[0108] AMS is used to start specific applications based on user operations. For example, when the image is synthesized, the image is triggered to be displayed on the main screen. After the image is displayed, the image that needs to be cut out is triggered to perform a cutout operation, and an application stack corresponding to the video application is created so that the video application can run normally.

[0109] The system library layer can include multiple functional modules, such as sensor module (also known as sensor) and SurfaceFlinger.

[0110] The sensor module is used to obtain data collected by the sensor, such as collecting ambient light under the screen. Collecting the gravity direction information of the electronic device. Alternatively, the sensor module can also adjust the brightness of the screen according to the ambient light, and determine the horizontal or vertical screen state information of the electronic device according to the gravity direction information of the electronic device. The horizontal or vertical screen state information is used to indicate whether the electronic device is in the horizontal screen state or the vertical screen state.

[0111] Surfaceflinger is a system service used for layer creation, control, and management.

[0112] In addition, the system library layer can also include: surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.

[0113] The kernel layer is a layer between hardware and software. In the embodiment of the present application, the kernel layer at least includes a touch driver module and a display driver module.

[0114] The display driver module is used to display the synthesized image on the screen according to the image data provided by the modules of the application framework layer and the application program of the application layer. For example, the video application passes the image data of a frame of the video to the display driver module, and the display driver module displays the image of a frame in the video on the touch screen according to the image data. SystemUI passes the image data to the display driver module, and the display driver module displays the synthesized image on the screen.

[0115] The touch driver module is used to monitor the capacitance data of each area of ​​the touch screen. When the user clicks or slides on the touch screen, the capacitance value of the clicked or slid area will change. The touch driver module can monitor the change of the capacitance value of each area on the touch screen and send a capacitance value change message to the input management module. The capacitance value data change message carries information such as the change amplitude of the capacitance value of each area of ​​the touch screen and the time of change.

[0116] The input management module can determine the touch operation based on the reported capacitance value change message, and then send the identified touch operation to other modules. The touch operation here can include knuckle tapping, clicking, dragging, and specific gesture operations (such as swiping up, swiping sideways, etc.).

[0117] The hardware layer includes the screen and ambient light sensor, etc. The ambient light sensor is used to detect the ambient light information under the screen, etc. The application processor monitors the touch operation on the touch screen, the baseband processor monitors the acceleration data and stores the monitored acceleration data in the storage module, when the AP monitors the touch operation, the CP identifies whether the touch operation is a knuckle tapping action based on the acceleration data stored in the storage module; the CP sends the identification result to the AP.

[0118] The above technical architecture lists the modules and devices that may be involved in this application in the electronic device. In practical applications, the electronic device may include all or part of the modules and devices of the above technical architecture, as well as other modules and devices not mentioned in the above technical architecture. Of course, it may also include only the modules and devices of the above technical architecture, which is not limited in this embodiment.

[0119] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0120] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0121] The present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to a camera / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0122] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0123] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0124] In the embodiments provided in the present application, it should be understood that the disclosed methods and electronic devices can be implemented in other ways. For example, the device / network device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0125] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0126] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0127] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0128] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0129] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A communication method, characterized in that: The method is applied to the case where the application layer protocols of the electronic device and the IoT device are different, and the method includes: When starting the target application, a configuration file is obtained from the developer platform; the configuration file defines the configuration information of the IOT device that can communicate with the electronic device; After the target application scans and finds the first target IOT device, the first target IOT device is put online on the shelf of the target application according to the configuration file; In response to an operation on the first target IOT device or a related scenario including the first target IOT device, when it is determined according to the configuration file that a first software development kit SDK needs to be used to establish a connection with the first target IOT device, the first SDK is downloaded, and the downloaded first SDK is used to establish a connection with the first target IOT device; the first SDK is adapted to the object model of the electronic device and the protocol of the first target IOT device; Communicate with the first target IOT device by using a standardized interface in the first SDK that matches the operation, so that the electronic device can call the first target IOT device; The communicating with the first target IOT device by using a standardized interface in the first SDK that matches the operation includes: Obtaining a data stream corresponding to the operation; Deserialize the data stream to obtain a service list and a property list of the first target IOT device that matches the operation, call a standardized interface, convert it into an application protocol specification supported by the first target IOT device within the first SDK, and control the first target IOT device.

2. The method according to claim 1, characterized in that: The configuration file includes a first configuration file, and the first configuration file corresponds to the first target IOT device; Putting the first target IOT device online on the shelf of the target application according to the configuration file includes: putting the first target IOT device online at a position on the shelf of the target application according to the first target IOT device configured according to the first configuration file.

3. The method according to claim 2, characterized in that The first configuration file includes at least one of the following information: a device binding method, a device authentication method, a device connection method, and a network configuration method; Before launching the first target IOT device on the shelf of the target application according to the configuration file, the method further includes: Device registration, device binding and device authentication of the first target IOT device are completed according to the first configuration file.

4. The method according to claim 1, characterized in that The target application is configured with M shelves, the M shelves correspond to N target IOT devices, the N is greater than M or equal to M, and the M and N are positive integers.

5. The method according to claim 1, characterized in that Also includes: When the first target IOT device uploads data, serializing the uploaded data; Parsing the serialized uploaded data to determine a state change of the first target IOT device attribute; Update the attribute value of the attribute whose state has changed in the first target IOT device.

6. The method according to any one of claims 1 to 5, characterized in that The communicating with the first target IOT device by using a standardized interface in the first SDK that matches the operation includes: Communicate with the first target IOT device through a near field communication protocol using a standardized interface in the first SDK that matches the operation.

7. The method according to claim 6, characterized in that The near field communication protocol includes: Bluetooth communication protocol or Wi-Fi communication protocol.

8. An electronic device, characterized in that: include: A memory and one or more processors, wherein the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Application method for communication terminal and intelligent family system

    CN104683193A

  • Configuration method and device of Internet of Things equipment, equipment and storage medium

    CN114257624A

  • Protocol access method, communication method, development device, gateway and storage medium

    CN115442913A