Equipment communication method, device, system, equipment, storage medium and program product

By identifying the device model and loading pre-set service description information during the device pairing process, the problem of time-consuming service queries in device pairing is solved, and fast and efficient device communication is achieved.

CN121751175APending Publication Date: 2026-03-27BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In short-range communication, the service query and description information reading steps during device pairing are time-consuming, affecting user experience.

Method used

By receiving pairing data packets broadcast by other devices, the device model is identified and the target service is determined based on the pre-stored mapping information. The pre-set target service description information is directly loaded for data interaction, avoiding the service discovery and description information reading process.

Benefits of technology

Significantly reduces pairing time, improves device communication efficiency, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121751175A_ABST
    Figure CN121751175A_ABST
Patent Text Reader

Abstract

The invention provides an equipment communication method, device and system, equipment, a storage medium and a program product. The method comprises the following steps: in response to entering a pairing state, receiving a pairing data packet broadcasted by other equipment; if the device models of the other devices are identified from the paired data packet, determining target services supported by the other devices based on pre-stored mapping information and the device models of the other devices; the mapping information is used for describing services supported by equipment belonging to different equipment models; after successfully establishing the communication connection with the other equipment, loading description information of a preset target service, and carrying out data interaction with the other equipment based on the description information of the target service; wherein the description information of the target service is used for describing an interaction mode of the target service. According to the method, the communication efficiency between the devices can be remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communication technology, and in particular to a device communication method, apparatus, system, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] In short-range communication, any two devices need to pair before they can interact with each other. Pairing refers to the process by which two devices establish a secure connection and trust relationship through a series of steps before data interaction. This pairing process involves the following steps: one device needs to query the services supported by the other device and read relevant service information in order to recognize and use the functions provided by the other device during subsequent data interaction. This step takes time and may affect user experience, causing users to wait a considerable amount of time before they can use the devices. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this disclosure provides a device communication method, apparatus, system, electronic device, computer-readable storage medium, and computer program product.

[0004] According to a first aspect of the present disclosure, a device communication method is provided, comprising:

[0005] In response to entering pairing mode, it receives pairing data packets broadcast by other devices;

[0006] If the device model of the other device is identified from the pairing data packet, the target service supported by the other device is determined based on the pre-stored mapping information and the device model of the other device; the mapping information is used to describe the services supported by devices belonging to different device models;

[0007] After successfully establishing a communication connection with the other devices, the system loads the preset description information of the target service and interacts with the other devices based on the description information of the target service; wherein, the description information of the target service is used to describe the interaction method of the target service.

[0008] According to a second aspect of the present disclosure, a device communication apparatus is provided, comprising:

[0009] The pairing data packet receiving module is used to receive pairing data packets broadcast by other devices in response to entering the pairing state;

[0010] The target service determination module is used to determine the target service supported by the other device if the device model of the other device is identified from the pairing data packet, based on pre-stored mapping information and the device model of the other device; the mapping information is used to describe the services supported by devices belonging to different device models;

[0011] The data interaction module is used to load the preset description information of the target service after successfully establishing a communication connection with the other device, and to perform data interaction with the other device based on the description information of the target service; wherein, the description information of the target service is used to describe the interaction method of the target service.

[0012] According to a third aspect of the present disclosure, a device communication system is provided, including a first device and a second device;

[0013] The first device is configured to generate and broadcast a pairing data packet in response to entering a pairing state; the pairing data packet carries at least the device model of the first device;

[0014] The second device is used to perform the device communication method described in the first aspect.

[0015] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising:

[0016] processor;

[0017] A memory for storing computer programs that can be executed by the processor;

[0018] Wherein, when the processor executes the program, it implements the steps of the method described in the first aspect.

[0019] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0020] According to a seventh aspect of the present disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the method as described in the first aspect.

[0021] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0022] In this embodiment of the present disclosure, the device can determine the target service supported by other devices based on the device model in the pairing data packet broadcast by other devices during the pairing phase. Thus, after successfully establishing a communication connection with the other devices, there is no need to perform service discovery and service description information reading processes. Instead, the device can directly load the description information of the target service pre-installed in the device and perform data interaction with the other devices based on the description information of the target service. This reduces the time required for pairing, eliminates the need for users to wait for a lengthy service query process, and can significantly improve the communication efficiency between devices.

[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0024] Figure 1 This disclosure is a schematic diagram illustrating the structure of a device communication system according to an exemplary embodiment;

[0025] Figure 2 This disclosure is a schematic diagram illustrating the interaction between a first device and a second device according to an exemplary embodiment.

[0026] Figure 3 This is another interactive schematic diagram of the first and second devices illustrated according to an exemplary embodiment of the present disclosure;

[0027] Figure 4 This is a flowchart illustrating a device communication method according to an exemplary embodiment of the present disclosure;

[0028] Figure 5 This is a structural block diagram of a device communication apparatus according to an exemplary embodiment of the present disclosure;

[0029] Figure 6 This disclosure is a structural block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0030] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0031] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0032] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0033] In the field of short-range communication, the service query and service description information reading steps involved in the pairing process between any two devices take a certain amount of time, which may affect the user experience and cause users to have to wait a long time before they can use the device.

[0034] Taking Bluetooth communication as an example, when a user wants to connect two Bluetooth devices, they first need to initiate device pairing mode. One Bluetooth device will broadcast its presence, and the other Bluetooth device will scan for and identify connectable Bluetooth devices. Once the other Bluetooth device discovers a connectable device, a pairing request will be sent, triggering the pairing process. During pairing, one Bluetooth device will query the services supported by the other Bluetooth device and read the service description information. At this stage, the two Bluetooth devices will exchange necessary attribute and functional information, including the service's UUID (Universally Unique Identifier), characteristic descriptions, and data formats for accessing these services. Through these service descriptions, the Bluetooth devices can understand and use the functions provided by the other. This step takes some time.

[0035] For example, during the pairing process between a TV and a remote control, the inventors found that querying all services supported by the remote control involved approximately 170 commands exchanged between the TV and the remote control, taking about 2.16 seconds; further reading the description information of the remote control's HID service and performing related registration operations took about 1.97 seconds.

[0036] In other words, users need to wait for the two Bluetooth devices to pair before they can use them. This waiting time may affect the user experience, especially when a quick connection is desired.

[0037] Based on this, embodiments of this disclosure provide a device communication method, apparatus, system, electronic device, computer-readable storage medium, and computer program product. This device can determine the target service supported by other devices based on the device model in the pairing data packet broadcast by other devices during the pairing phase. Thus, after successfully establishing a communication connection with the other devices, there is no need to perform service discovery and service description information reading processes. Instead, the device can directly load the description information of the target service pre-installed in the device and perform data interaction with the other devices based on the description information of the target service. Users do not need to wait for a lengthy service query process, reducing the time required for pairing and significantly improving the communication efficiency between devices.

[0038] Please see Figure 1 The diagram illustrates a device communication system, which includes a first device 10 and a second device 20. Figure 1 The example uses a first device 10 as a remote control and a second device 20 as a television, but is not limited to this. Both the first device 10 and the second device 20 are equipped with a short-range communication module. Exemplary examples include, but are not limited to, Bluetooth modules, WiFi modules, NFC modules, and infrared communication modules. Through the short-range communication module, the first device 10 and the second device 20 can quickly connect and exchange data within a certain range. It is understood that this disclosure does not impose any restrictions on the pairing distance between the first device 10 and the second device 20 during pairing; the specific settings can be made according to the actual application scenario. For example, the pairing distance between the first device 10 and the second device 20 can be 2 meters, 3 meters, or 5 meters, etc., and they do not need to be particularly close.

[0039] For example, the first device 10 includes, but is not limited to, input devices and other devices equipped with short-range communication modules. Input devices include, but are not limited to, remote controls, mice, keyboards, touch screens, handwriting tablets, voice recognition devices, gesture recognition devices, and motion controllers, etc.

[0040] The second device 20 includes, but is not limited to, at least one of home appliances, office equipment, mobile devices, and wearable devices. Home appliances include, but are not limited to, televisions, speakers, light bulbs, cameras, and robot vacuum cleaners. Office equipment includes, but is not limited to, printers, computers, tablets, projectors, smart whiteboards, and conferencing equipment. Mobile devices include, but are not limited to, mobile phones, personal digital assistants (PDAs), and laptops. Wearable devices include, but are not limited to, watches, glasses, gloves, headwear (e.g., hats, helmets, virtual reality headsets, augmented reality headsets, head-mounted devices (HMDs), headbands), pendants, armbands, leg rings, shoes, and vests.

[0041] like Figure 2As shown, in response to entering the pairing state, the first device 10 generates a pairing data packet (200) and broadcasts the pairing data packet (201); the pairing data packet carries at least the device model of the first device 10.

[0042] For example, the first device 10 can enter a pairing state in response to a user's triggering operation on any control within the first device 10 when powered on and not paired with any other device. Alternatively, the first device 10 can enter a pairing state in response to a user's triggering operation on a specified control within the first device 10 when powered on and already paired with another device. The control can be a virtual control, a physical button, a voice input control, a gesture input control, or a motion-sensing input control, etc., and this implementation does not impose any limitations on this.

[0043] The pairing data packet may include the device model of the first device 10. In addition, the pairing data packet may also include other information, such as the device address, device name, and authentication code used for authentication of the first device 10. For example, in a Bluetooth pairing scenario, the first device 10 may also generate an EDIV (Encryption Diversifier) ​​value for subsequent encryption and add it to the pairing data packet, but it is not limited to this.

[0044] The first device 10 can generate the paired data packet according to the TLV format. The TLV format represents a Type-Length-Value data structure; Type indicates the type of data; Length indicates the length of the following data (i.e., Value); Value is the actual data content, determined according to the preceding type and length. The TLV format clearly defines the type and content of each data item in the paired data packet, avoiding data confusion.

[0045] For example, the TLV structure corresponding to the device model of the first device 10 can be represented as {Type:0x01 (assuming it represents the device model); Length:0x05 (length of the model string); Value:DeviceX (actual device model)}.

[0046] Specifically, when the first device 10 enters the pairing state, it first determines the type, length and corresponding value of each data item (such as the device model, device address, device name, etc. mentioned above) to generate the corresponding TLV unit. Then, the TLV units are connected in series to form a complete pairing data packet. Next, the first device 10 broadcasts the generated pairing data packet through the wireless channel so that other devices can receive the data.

[0047] Please see Figure 2In response to entering the pairing state, the second device 20 receives a pairing data packet (202) broadcast by the first device 10. For example, after power-on, the second device 20 may enter the pairing state in response to a user's triggering operation on a specified control in the second device 20.

[0048] The second device 20 can pre-store mapping information, which is used to describe the services supported by devices belonging to different device models.

[0049] After receiving the pairing data packet broadcast by the first device 10, the second device 20 parses the pairing data packet to identify its contents. For example, the pairing data packet is in TLV format, typically a byte stream. The second device 20 can create a pointer to parse the packet starting from the beginning. For each TLV unit corresponding to a data item, the parsing process is as follows: One byte is read from the current pointer position as the Type; for example, if the byte pointed to by the current pointer is 0x01, it indicates the device model. Next, one byte is read forward from the current pointer position as the Length; for example, if the read byte is 0x05, it indicates the subsequent Value is 5 bytes long. Then, based on the Length, bytes of a specified length are read forward from the current pointer position as the Value; for example, if the byte read at the current pointer position is "DeviceX", the Value is the device model. After reading the TLV unit corresponding to a data item, the pointer position is updated, skipping the already parsed Type, Length, and Value portions to facilitate parsing the next TLV unit. For example, if the Type (1 byte), Length (1 byte), and Value (5 bytes) total 7 bytes, the new pointer position is the current pointer + 7. This TLV unit parsing process is repeated until the end of the paired data packet is reached (i.e., the pointer exceeds the packet length). Through these steps, the second device 20 can successfully parse the received paired data packet, identify the device model and other relevant information, and provide necessary information for subsequent device connection and data interaction.

[0050] Please see Figure 2If the second device 20 identifies the device model of the first device 10 from the pairing data packet, it can determine the target service supported by the first device 10 based on the pre-stored mapping information and the device model of the first device 10 (203). The mapping information is used to describe the services supported by devices belonging to different device models. In this embodiment, all services indicated by the first device 10 can be directly determined based on the pre-stored mapping information, without having to query the services supported by the first device 10 through the service discovery process during pairing. This shortens the pairing time, saves multiple communications for service queries, reduces data transmission volume, and saves network resources.

[0051] In one possible implementation, the mapping information includes a mapping relationship between device models and services. This means that each device model has a predefined list indicating which services the device can provide. This mapping relationship can be stored in the memory of the second device 20 and used during the pairing process. Furthermore, this direct mapping from device model to service is logically clear, easy to implement, and suitable for devices with fewer service types and relatively simple structures, such as smart bulbs and sensors.

[0052] In the actual pairing process, the second device 20 can identify the device model of the first device 10 from the pairing data packet and determine the target service supported by the first device 10 from the mapping relationship between device model and service. In this embodiment, the mapping from device model to service is logically clear and easy to implement. Through the mapping relationship between device model and service, the second device 20 can efficiently and accurately identify the target service supported by the first device 10 without going through a complex service discovery process, significantly reducing pairing time.

[0053] In another possible implementation, the mapping information includes the mapping relationship between device model and device description information, as well as the mapping relationship between device description information and services; the device description information includes at least one of the following: the device's supplier identifier, product identifier, device name, and the communication protocol used by the short-range communication module installed in the device. This provides a more detailed device description, accurately identifies services, avoids mismatches, and is suitable for multifunctional devices such as smartwatches or mobile phones, supporting a variety of services and applications.

[0054] In the actual pairing process, the second device 20 can identify the device model of the first device 10 from the pairing data packet, and determine the target device description information of the first device 10 from the mapping relationship between the device model and the device description information. Then, based on the target device description information of the first device 10, it determines the target service supported by the first device 10 from the mapping relationship between the device description information and the service. In this embodiment, through the dual mapping relationship, the second device 20 can accurately identify the services supported by the device, avoid misidentification or omission, improve the reliability of pairing, and significantly reduce pairing time without going through a complex service discovery process.

[0055] Please see Figure 2 After parsing the pairing data packet, the second device 20 and the first device 10 can proceed with the process of establishing a communication connection (204).

[0056] After determining the target service supported by the first device 10 and successfully establishing a communication connection with the first device 10, the second device 20 can directly load the pre-set description information of the target service (205). The description information of the target service describes the interaction method of the target service, such as the service characteristics, operation method, and data format. After loading, the second device 20 can perform data interaction with the first device 10 based on the description information of the target service (206). In this embodiment, it is not necessary to read the description information of the target service from the first device 10, which reduces the data exchange process. The second device 20 can pre-store the description information of the target service in its memory, and then directly perform data interaction based on the loaded description information of the target service after successfully establishing a communication connection, which can significantly reduce the waiting time and improve the communication efficiency.

[0057] The description information of any service can include its specific functions, supported operations, and related feature values ​​and descriptions. Service description information is crucial for device communication, providing the necessary context and operational guidance for inter-device interaction, thereby ensuring the effectiveness and reliability of communication.

[0058] For example, the description information of any service includes, but is not limited to: (1) Service UUID (Universally Unique Identifier), each service has a unique identifier to distinguish different services; this helps the second device 20 identify and select the correct service to interact with. (2) Service characteristics, describing the specific functions provided by the service, such as reading, writing, notification, etc.; these characteristics define how to interact with the service. (3) Data format, describing the data types and formats used in service interactions, including the length, range, and units of the data; this ensures data compatibility between devices. (4) Attribute permissions, specifying the types of operations that each characteristic can perform, such as whether it is readable, writable, or supports notifications, helping to manage data access permissions. (5) Other information, providing more information about the service and characteristics, which may include the purpose, use cases, and implementation details of the service, helping developers and users understand the functions of the service. (6) Dependencies, describing the relationship between the service and other services or characteristics, such as some services may depend on the state or data of other services.

[0059] In one possible implementation, the first device 10 and the second device 20 are used to establish a Bluetooth communication connection. The first device 10 includes an input device, and the target service includes HID service. HID (Human Interface Device) service is a specific type of service in the Bluetooth protocol stack, mainly used to support human-computer interaction devices, such as keyboards, mice, and game controllers. HID service enables these input devices to communicate wirelessly with a host (such as a computer, mobile phone, tablet, etc.) via Bluetooth.

[0060] For example, the description information of the HID service includes: (1) Service UUID, a unique identifier used to identify the HID service and ensure correct communication between devices. (2) Characteristics, including input report characteristics, output report characteristics, and control characteristics, defining the specific functions provided by the device. (3) Input report format, describing the format of the input data, such as the number of bytes, data type, and the meaning of each field, so that the second device 20 can correctly parse the input signal. (4) Output report format, describing the format of the output data sent from the second device 20 to the first device 10, defining how to control the feedback function of the first device 10 (such as LED indicators). But it is not limited to these. The description information of the HID service is an important basis for communication between devices. It provides the second device 20 with the necessary context to correctly parse and respond to the input signals from the first device 10, ensuring the smoothness and accuracy of the interaction.

[0061] After successfully establishing a communication connection with the first device 10, the second device 20 can register the description information of the pre-configured HID service into its operating system kernel. The description information of the HID service defines how to parse and process input signals from the first device 10. For example, the second device 20 registers the loaded HID service description information into its operating system kernel. This process typically involves: (1) informing the operating system of the UUID and related characteristics of the HID service; and (2) setting the format of input and output reports so that the operating system can understand the signals from the first device 10. Once the registration is successful, the operating system of the second device 20 can listen to the input signals from the first device 10 (such as key press events in the first device 10). When the second device 20 receives the input signal sent by the first device 10, it can execute the input event indicated by the input signal based on the description information of the HID service. Specifically, the second device 20 can parse these input signals according to the pre-registered description information of the HID service, and the operating system executes the corresponding input event according to the parsing result. For example, if the first device 10 is a remote control and the second device 20 is a television, then the corresponding input events could be volume up / down events, channel switching events, etc.

[0062] In this embodiment, the pre-set HID service description information is registered with the operating system kernel, eliminating the need to read the HID service description information from the first device 10. This significantly reduces waiting time and improves communication efficiency. The second device 20 can effectively receive and process input signals from the first device 10, thereby achieving fast and accurate user interaction.

[0063] In another possible implementation, in addition to HID services, the target service can also include other services, such as (1) audio streaming services, used for wireless transmission of high-quality audio streams, such as those used in Bluetooth headsets and speakers. (2) audio control services, used to control the functions of audio playback devices, such as play, pause, skip tracks, etc. (3) remote control services, used to realize remote control of devices, commonly found in smart home devices and remote controls. (4) health device services, used to monitor and transmit health-related data, such as heart rate, blood sugar, etc., commonly found in fitness trackers and smartwatches. (5) device information services, providing basic information about the device, such as manufacturer, model, firmware version, etc. (6) battery services, used to report the battery status and remaining power of the device. (7) location services, providing the location information of the device, such as those used in GPS devices or other positioning devices. (8) data transmission services, supporting data exchange between devices, suitable for file transfer and data synchronization. (9) environmental monitoring services, used to collect and transmit environmental data, such as temperature, humidity, air quality, etc., used in smart home sensors. But not limited to these.

[0064] The second device 20 can select to use one or more target services provided by the second device 20 based on the actual usage scenario. Taking battery service as an example, the second device 20 can send a battery balance query request to the first device 10 based on the description information of the battery service. The first device 10 can return a battery balance query response to the second device 20 based on the battery balance query request. The battery balance query vector includes the remaining battery power of the first device 10.

[0065] In some embodiments, in order to further shorten the pairing time, the present disclosure also improves the authentication and encryption processes during the pairing process.

[0066] The first device 10 has multiple pre-stored raw keys. After entering the pairing state, the first device 10 can randomly select a target raw key from the multiple raw keys, and then encrypt the target raw key based on a preset encryption algorithm to obtain a first authentication code. The first authentication code is then processed according to the TLV format to generate a TLV unit, which is then added to the pairing broadcast packet and broadcast to the second device 20. This embodiment avoids the security risks associated with fixed keys by using randomly selected raw keys to generate authentication codes, thus increasing the security of the pairing process.

[0067] In other words, such as Figure 3 As shown, in response to entering the pairing state, the first device 10 generates a pairing data packet (300) and broadcasts the pairing data packet (301); the pairing data packet includes at least: the device model of the first device 10, the first authentication code, and other data items. In response to entering the pairing state, the second device 20 receives the pairing data packet (302) broadcast by the first device 10 and parses the pairing data packet. If the first authentication code generated by the first device 10 is identified from the pairing data packet, multiple second authentication codes in this device are obtained; specifically, the second device 20 also pre-stores multiple original keys, and the multiple original keys pre-stored by the first device 10 and the multiple original keys pre-stored by the second device 20 are the same. The second device 20 can encrypt each of the pre-stored original keys based on the above encryption algorithm to obtain the second authentication code corresponding to each original key. After identifying the first authentication code from the pairing data packet, the second device 20 compares each second authentication code with the first authentication code generated by the first device 10. If a second authentication code that matches the first authentication code is found, the first device 10 is determined to be the device to be paired with (303). In this embodiment, since the second device 20 can directly compare the received first authentication code with the second authentication code to realize the identity verification process, the pairing time can be shortened and the pairing efficiency can be improved.

[0068] The first device 10 and the second device 20 use the same encryption algorithm. It is understood that this disclosure does not impose any restrictions on the specific encryption algorithm, and can be specifically set according to the actual application scenario; for example, the encryption algorithms include, but are not limited to, AES-128 (Advanced Encryption Standard with 128-bit key), AES-256 (Advanced Encryption Standard with 256-bit key), DES (Data Encryption Standard), and 3DES (Triple Data Encryption Standard), etc.

[0069] Please continue reading. Figure 3 If the second device 20 identifies the device model of the first device 10 from the pairing data packet, it can determine the target service supported by the first device 10 based on the pre-stored mapping information and the device model of the first device 10 (304); the mapping information is used to describe the services supported by devices belonging to different device models.

[0070] During the process of establishing a communication connection with the first device 10, the second device 20 first sends a connection creation request (305) to the first device 10; if it receives a connection creation response (306) returned by the first device 10 based on the connection creation request, it generates an encryption key for communicating with the first device 10 and sends an encryption key generation request to the first device 10; the encryption key generation request is used to instruct the first device 10 to generate an encryption key for communicating with the second device; wherein, the encryption key generated by the second device 20 is the same as the encryption key generated by the first device 10.

[0071] Specifically, please refer to Figure 3 The pairing data packet sent by the first device 10 may also include the device address of the first device 10. Furthermore, for example in the field of Bluetooth communication, the pairing data packet sent by the first device 10 may also include an EDIV value generated by the first device 10. During Bluetooth pairing, the EDIV (Encryption Diversifier) ​​value is a random number used for encryption, which can be used to generate a session key, thereby ensuring the security of data transmission during pairing. EDIV helps prevent replay attacks by ensuring that the key for each pairing is unique, thus improving security. The first device 10 can generate an EDIV value according to the Bluetooth protocol specification after entering the pairing state and add it to the pairing broadcast packet.

[0072] Please continue reading. Figure 3 After receiving the connection creation response (306) returned by the first device 10, the second device 20 can generate a random number based on a preset random number generation algorithm. The second device 20 can also determine the target original key corresponding to the second authentication code that matches the first authentication code from multiple original keys stored in the device. It can also obtain the device address of the first device 10 and the EDIV value generated by the first device 10 from the pairing data packet. Furthermore, it can encrypt the information to be encrypted, which includes at least one of the target original key, the device address of the first device 10, the EDIV value, and the random number, to obtain the encryption key (307).

[0073] This embodiment uses EDIV values ​​and random numbers to generate session keys, effectively preventing replay attacks, ensuring the uniqueness of encryption keys for each connection, and improving overall security. It is understood that this embodiment does not impose any restrictions on the specific encryption algorithm used to generate the encryption keys; specific settings can be made according to the actual application scenario.

[0074] For example, the second device 20 can add the second coefficient to the product of the information to be encrypted and the first coefficient to obtain an intermediate result; wherein both the first and second coefficients are prime numbers; then, based on the data length of the information to be encrypted, a modulo operation is performed on the intermediate result to obtain the encryption key; the modulo operation means dividing the intermediate result by the length of the information to be encrypted to obtain the remainder, thereby ensuring that the generated encryption key will not exceed a specific range; this encryption process uses prime numbers and modulo operations to increase the complexity of the encryption process, improve security, reduce the risk of being attacked, and the encryption process is simple, easy to implement, and suitable for use in devices with limited resources.

[0075] Please continue reading. Figure 3After generating a random number, the second device 20 can send an encryption key generation request carrying the random number to the first device 10 (308). Upon receiving the encryption key generation request carrying the random number, the first device 10, since the target original key, the device address of the first device 10, and the EDIV value are all known, can encrypt the information to be encrypted, which includes at least one of the target original key used to generate the first authentication code, the device address of the first device 10, the EDIV value, and the random number, to obtain an encryption key (309). After generating the encryption key, the first device 10 can return an encryption key generation response to the second device 20 (310). In this embodiment, the EDIV value and random number are used to generate the session key when generating the encryption key, which can effectively prevent replay attacks, ensure the uniqueness of the encryption key for each connection, and improve overall security. The first device 10 can use the same encryption algorithm as the second device 20 to encrypt the information to be encrypted, so that the encryption key generated by the second device 20 is the same as the encryption key generated by the first device 10.

[0076] If the second device 20 receives an encryption key generation response returned by the first device 10 after generating the encryption key, it determines that a communication connection has been successfully established with the first device 10. This embodiment replaces the traditional SMP (Security Manager Protocol)-based encryption process with the aforementioned authentication and encryption steps. Traditional SMP-based encryption typically involves multiple steps, including key negotiation, encryption, and confirmation, each of which can lead to delays. In this application, by directly carrying the authentication code and other necessary information in the pairing data packet, the second device 20 can quickly generate the encryption key, eliminating multiple rounds of interaction. This allows both parties to reach an agreement and establish encrypted communication more quickly.

[0077] Please see Figure 3 After successfully establishing a communication connection with the first device 10, the second device 20 can load the pre-set description information of the target service (311) and can interact with the first device 10 based on the encryption key and the description information of the target service (312). Specifically, based on the encryption key generated by both parties, the second device 20 can securely encrypt the sent data to ensure that the data is not stolen or tampered with during transmission. Using the description information of the target service, the second device 20 can understand how to communicate effectively with the first device 10 and perform specific operations or responses. In this embodiment, protecting data transmission with an encryption key improves communication security, and directly loading the service description information reduces query time and speeds up response.

[0078] For example, in the pairing process between a TV and a remote control, the inventors discovered that in the traditional Android system, the entire process of establishing a Bluetooth Low Energy pairing between the two devices takes about 5 seconds. However, by applying the solution mentioned in this disclosure, the Bluetooth Low Energy pairing process can be completed in 1 second, significantly reducing the pairing time and improving communication efficiency.

[0079] The various technical features in the above embodiments can be combined arbitrarily, as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, the arbitrary combination of various technical features in the above embodiments is also within the scope of this specification.

[0080] Based on the same inventive concept, please refer to Figure 4 This disclosure also provides a device communication method applied to the second device described above, the method comprising:

[0081] In S401, in response to entering the pairing state, a pairing data packet broadcast by another device is received.

[0082] In S402, if the device model of other devices is identified from the pairing data packet, the target service supported by other devices is determined based on the pre-stored mapping information and the device models of other devices; the mapping information is used to describe the services supported by devices belonging to different device models.

[0083] In S403, after successfully establishing a communication connection with other devices, the pre-set description information of the target service is loaded, and data interaction with other devices is performed based on the description information of the target service; wherein, the description information of the target service is used to describe the interaction method of the target service.

[0084] In one implementation, the mapping information includes the mapping relationship between the device model and the device description information, as well as the mapping relationship between the device description information and the service; the device description information includes at least one of the following: the device's supplier identifier, product identifier, device name, and the communication protocol applied by the short-range communication module installed in the device.

[0085] Based on pre-stored mapping information and the device models of other devices, determine the target services supported by other devices, including: based on the device models of other devices, determine the target device description information of other devices from the mapping relationship between device models and device description information; based on the target device description information of other devices, determine the target services supported by other devices from the mapping relationship between device description information and services.

[0086] In one implementation, other devices include input devices, and the target service includes HID services.

[0087] Load the description information of the preset target service and interact with other devices based on the description information of the target service, including: registering the description information of the preset HID service into the operating system kernel of this device so that when an input signal is received from another device, the input event indicated by the input signal is executed based on the description information of the input signal.

[0088] In one implementation, the method further includes: if a first authentication code generated by another device is identified from the pairing data packet, obtaining multiple second authentication codes in the device; comparing each second authentication code with the first authentication code generated by the other device; if there is a second authentication code that matches the first authentication code, determining that the other device is the device to be paired with the device, and establishing a communication connection with the other device.

[0089] In one implementation, other devices pre-store multiple original keys. The first authentication code is obtained by other devices encrypting the target original key based on a preset encryption algorithm. The target original key is randomly selected by other devices from multiple original keys.

[0090] This device has multiple pre-stored original keys; each second authentication code is obtained by encrypting each pre-stored original key based on an encryption algorithm.

[0091] In one implementation, establishing a communication connection with another device includes: sending a connection creation request to the other device; if a connection creation response is received from the other device based on the connection creation request, generating an encryption key in this device for communicating with the other device, and sending an encryption key generation request to the other device; the encryption key generation request instructs the other device to generate an encryption key for communicating with this device; wherein the encryption key generated by this device is the same as the encryption key generated by the other device; if an encryption key generation response is received from the other device after generating the encryption key, it is determined that a communication connection has been successfully established with the other device.

[0092] Data interaction with other devices based on the description information of the target service includes: data interaction with other devices based on the encryption key and the description information of the target service.

[0093] In one implementation, before sending the encryption key generation request to other devices, the method further includes: generating a random number based on a preset random number generation algorithm; wherein the encryption key generation request carries the random number.

[0094] The device generates an encryption key for communication with other devices, including: determining a target original key from a plurality of pre-stored original keys in the device that corresponds to a second authentication code that matches the first authentication code; obtaining the device address of other devices and the EDIV value generated by other devices from the pairing data packet; encrypting the information to be encrypted, which contains at least one of the target original key, the device address of other devices, the EDIV value, and a random number, to obtain an encryption key; wherein, the encryption key generation request is used to instruct other devices to encrypt the information to be encrypted, which contains at least one of the target original key used to generate the first authentication code, the device address of other devices, the EDIV value, and a random number, to obtain an encryption key.

[0095] In one implementation, the information to be encrypted, which includes at least one of the following: a target original key, a device address of another device, an EDIV value, and a random number, is encrypted to obtain an encryption key. This includes: adding a second coefficient to the product of the information to be encrypted and a first coefficient to obtain an intermediate result; wherein the first coefficient and the second coefficient are both prime numbers; and performing a modulo operation on the intermediate result based on the data length of the information to be encrypted to obtain the encryption key.

[0096] In one implementation, the data format of the paired data packets includes the TLV format.

[0097] The communication connection includes at least a Bluetooth communication connection.

[0098] The device communication method is applied to at least one of home devices, office devices, mobile devices, and wearable devices. Home devices include at least a television set, and other devices include at least one input device among a remote control, a mouse, and a keyboard.

[0099] Based on the same inventive concept, this disclosure also provides a device communication apparatus, such as... Figure 5 As shown, Figure 5 This is a structural block diagram of a device communication apparatus according to an exemplary embodiment of the present disclosure. The apparatus 500 includes:

[0100] The pairing data packet receiving module 501 is used to receive pairing data packets broadcast by other devices in response to entering the pairing state;

[0101] The target service determination module 502 is used to determine the target service supported by the other device based on pre-stored mapping information and the device model of the other device if the device model of the other device is identified from the pairing data packet; the mapping information is used to describe the services supported by devices belonging to different device models.

[0102] The data interaction module 503 is used to load the preset description information of the target service after successfully establishing a communication connection with the other device, and to perform data interaction with the other device based on the description information of the target service; wherein, the description information of the target service is used to describe the interaction method of the target service.

[0103] In one implementation, the mapping information includes the mapping relationship between the device model and the device description information, as well as the mapping relationship between the device description information and the service; the device description information includes at least one of the following: the device's supplier identifier, product identifier, device name, and the communication protocol applied by the short-range communication module installed in the device.

[0104] The target service determination module 502 is specifically used to determine the target device description information of other devices based on the device model and the mapping relationship between device model and device description information; and to determine the target services supported by other devices based on the target device description information and the mapping relationship between device description information and services.

[0105] In one implementation, other devices include input devices, and the target service includes HID services. The data interaction module 503 is specifically used to register the description information of a pre-configured HID service into the operating system kernel of this device, so that when an input signal is received from another device, the input event indicated by the input signal is executed based on the description information of the HID service.

[0106] In one implementation, the system further includes an authentication module and a connection module. The authentication module is used to obtain multiple second authentication codes from the device itself if a first authentication code generated by another device is identified from the pairing data packet; compare each second authentication code with the first authentication code generated by the other device; and if a second authentication code that matches the first authentication code exists, determine that the other device is the device to be paired with the device. The connection module is used to establish a communication connection with other devices.

[0107] In one implementation, other devices pre-store multiple raw keys. The first authentication code is obtained by encrypting the target raw key using a preset encryption algorithm. The target raw key is randomly selected by the other devices from the multiple raw keys. This device pre-stores multiple raw keys; each second authentication code is obtained by encrypting the respective raw key pre-stored by this device using an encryption algorithm.

[0108] In one implementation, the connection module is specifically used to send a connection creation request to other devices; if a connection creation response is received from another device based on the connection creation request, the module generates an encryption key for communicating with other devices and sends an encryption key generation request to other devices; the encryption key generation request is used to instruct other devices to generate an encryption key for communicating with the module; wherein the encryption key generated by the module is the same as the encryption key generated by other devices; if an encryption key generation response is received from another device after generating the encryption key, it is determined that a communication connection has been successfully established with other devices.

[0109] The data interaction module 503 is specifically used to interact with other devices based on the encryption key and the description information of the target service.

[0110] In one implementation, the connection module is specifically used to generate random numbers based on a preset random number generation algorithm; wherein, the encryption key generation request carries the random number; from multiple original keys pre-stored in the device, a target original key corresponding to a second authentication code that matches the first authentication code is determined; the device address of other devices and the EDIV value generated by other devices are obtained from the pairing data packet; the information to be encrypted, which includes at least one of the target original key, the device address of other devices, the EDIV value, and the random number, is encrypted to obtain an encryption key; wherein, the encryption key generation request is used to instruct other devices to encrypt the information to be encrypted, which includes at least one of the target original key used to generate the first authentication code, the device address of other devices, the EDIV value, and the random number, to obtain an encryption key.

[0111] In one implementation, the connection module is specifically used to add a second coefficient to the product of the information to be encrypted and a first coefficient to obtain an intermediate result; wherein both the first and second coefficients are prime numbers; and to perform a modulo operation on the intermediate result based on the data length of the information to be encrypted to obtain the encryption key.

[0112] In one implementation, the data format of the paired data packets includes the TLV format.

[0113] The communication connection includes at least a Bluetooth communication connection.

[0114] The device communication method is applied to at least one of home devices, office devices, mobile devices, and wearable devices. Home devices include at least a television set, and other devices include at least one input device among a remote control, a mouse, and a keyboard.

[0115] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0116] For the apparatus embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The apparatus embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units.

[0117] Based on the same inventive concept, this disclosure also provides an electronic device, the electronic device comprising:

[0118] processor;

[0119] A memory for storing computer programs that can be executed by the processor;

[0120] When the processor executes the program, it implements the device communication method described in any of the above embodiments.

[0121] like Figure 6 As shown, Figure 6 This disclosure is a structural block diagram of an electronic device for a jump rope data processing apparatus according to an exemplary embodiment. The electronic device 600 may include one or more of the following components: a processing component 601, a memory 602, a power supply component 603, a multimedia component 604, an audio component 605, an input / output (I / O) interface 606, a sensor component 607, and a communication component 608.

[0122] Processing component 601 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 601 may include one or more processors 609 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 601 may include one or more modules to facilitate interaction between processing component 601 and other components. For example, processing component 601 may include a multimedia module to facilitate interaction between multimedia component 604 and processing component 601.

[0123] Memory 602 is configured to store various types of data to support the operation of electronic device 600. Examples of such data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 602 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0124] Power supply component 603 provides power to various components of electronic device 600. Power supply component 603 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 600.

[0125] Multimedia component 604 includes a screen that provides an output interface between the electronic device 600 and the user. The screen may include a touch panel (TP), implemented as a touchscreen, to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 604 includes a front-facing camera and / or a rear-facing camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0126] Audio component 605 is configured to output and / or input audio signals. For example, audio component 605 includes a microphone (MIC) configured to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 602 or transmitted via communication component 608. In some embodiments, audio component 605 also includes a speaker for outputting audio signals.

[0127] I / O interface 606 provides an interface between processing component 601 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0128] Sensor assembly 607 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 607 can detect the on / off state of electronic device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 607 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 607 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 607 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, temperature sensor, photoelectric sensor, or GPS sensor.

[0129] Communication component 608 is configured to facilitate wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G LTE, 6G NR (6G NewRadio), or combinations thereof. In one exemplary embodiment, communication component 608 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 608 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0130] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0131] The specific implementation process of the functions and roles of each component in the above-mentioned equipment can be found in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0132] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0133] Based on the same inventive concept, this disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by the processor 509 of the above-described electronic device, implements the steps of the device communication method described in any of the above embodiments.

[0134] This disclosure can take the form of a computer program product implemented on one or more storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0135] Based on the same inventive concept, this disclosure also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described device communication method.

[0136] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0137] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

[0138] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A device communication method, characterized in that, include: In response to entering pairing mode, it receives pairing data packets broadcast by other devices; If the device model of the other device is identified from the pairing data packet, the target service supported by the other device is determined based on the pre-stored mapping information and the device model of the other device; the mapping information is used to describe the services supported by devices belonging to different device models; After successfully establishing a communication connection with the other devices, the system loads the preset description information of the target service and interacts with the other devices based on the description information of the target service; wherein, the description information of the target service is used to describe the interaction method of the target service.

2. The method according to claim 1, characterized in that, The mapping information includes the mapping relationship between device model and device description information, as well as the mapping relationship between device description information and services; the device description information includes at least one of the following: the device's supplier identifier, product identifier, device name, and the communication protocol applied by the short-range communication module installed in the device; The determination of the target services supported by the other devices based on pre-stored mapping information and the device models of the other devices includes: Based on the device model of the other devices, the target device description information of the other devices is determined from the mapping relationship between the device model and the device description information; Based on the target device description information, the target services supported by the other devices are determined from the mapping relationship between the device description information and services.

3. The method according to claim 1, characterized in that, The other devices include input devices, and the target service includes HID service; The loading of the pre-set description information of the target service, and the data interaction with the other devices based on the description information of the target service, includes: The pre-configured description information of the HID service is registered in the operating system kernel of this device so that when an input signal is received from another device, the input event indicated by the input signal is executed based on the description information of the HID service.

4. The method according to claim 1, characterized in that, The method further includes: If a first authentication code generated by the other device is identified from the paired data packet, multiple second authentication codes in this device are obtained; Each of the second authentication codes is compared with the first authentication codes generated by the other devices; If a second authentication code that matches the first authentication code exists, the other device is identified as the device to be paired with this device, and a communication connection is established with the other device.

5. The method according to claim 4, characterized in that, The other devices have multiple pre-stored original keys. The first authentication code is obtained by the other devices encrypting the target original key based on a preset encryption algorithm. The target original key is randomly selected by the other devices from the multiple original keys. and, This device has the aforementioned multiple original keys pre-stored; each of the second authentication codes is obtained by encrypting each of the aforementioned original keys pre-stored in this device based on the encryption algorithm.

6. The method according to claim 4 or 5, characterized in that, Establishing a communication connection with the other devices includes: Send connection creation requests to the other devices; If a connection creation response is received from the other device based on the connection creation request, this device generates an encryption key for communicating with the other device and sends an encryption key generation request to the other device; the encryption key generation request is used to instruct the other device to generate an encryption key for communicating with this device; wherein, the encryption key generated by this device is the same as the encryption key generated by the other device; If an encryption key generation response is received from the other device after generating the encryption key, it is determined that a communication connection has been successfully established with the other device. The data interaction with other devices based on the description information of the target service includes: Based on the encryption key and the description information of the target service, data interaction is performed with the other devices.

7. The method according to claim 6, characterized in that, Before sending the encryption key generation request to the other devices, the method further includes: A random number is generated based on a preset random number generation algorithm; wherein, the encryption key generation request carries the random number; The generation of the encryption key in this device for communicating with the other devices includes: From the multiple original keys pre-stored in this device, determine the target original key corresponding to the second authentication code that matches the first authentication code; Obtain the device address of the other device and the EDIV value generated by the other device from the pairing data packet; The encryption key is obtained by encrypting the information to be encrypted, which includes at least one of the target original key, the device address of the other device, the EDIV value, and the random number; wherein, the encryption key generation request is used to instruct the other device to encrypt the information to be encrypted, which includes at least one of the target original key used to generate the first authentication code, the device address of the other device, the EDIV value, and the random number.

8. The method according to claim 7, characterized in that, The step of encrypting the information to be encrypted, which includes at least one of the target original key, the device address of the other device, the EDIV value, and the random number, to obtain the encryption key, includes: The intermediate result is obtained by adding the product of the information to be encrypted and the first coefficient to the second coefficient; wherein, both the first coefficient and the second coefficient are prime numbers. The encryption key is obtained by performing a modulo operation on the intermediate result based on the data length of the information to be encrypted.

9. The method according to claim 1, characterized in that, The data format of the paired data packet includes TLV format; And / or, the communication connection includes at least a Bluetooth communication connection; And / or, the device communication method is applied to at least one of home devices, office devices, mobile devices, and wearable devices, wherein the home devices include at least a television set, and the other devices include at least one input device selected from remote control, mouse, and keyboard.

10. A device communication apparatus, characterized in that, include: The pairing data packet receiving module is used to receive pairing data packets broadcast by other devices in response to entering the pairing state; The target service determination module is used to determine the target service supported by the other device if the device model of the other device is identified from the pairing data packet, based on pre-stored mapping information and the device model of the other device; the mapping information is used to describe the services supported by devices belonging to different device models; The data interaction module is used to load the preset description information of the target service after successfully establishing a communication connection with the other device, and to perform data interaction with the other device based on the description information of the target service; wherein, the description information of the target service is used to describe the interaction method of the target service.

11. A device communication system, characterized in that, Including the first device and the second device; The first device is configured to generate and broadcast a pairing data packet in response to entering a pairing state; the pairing data packet carries at least the device model of the first device; The second device is used to perform the device communication method according to any one of claims 1 to 7.

12. An electronic device, characterized in that, include: processor; A memory for storing computer programs that can be executed by the processor; Wherein, when the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.

14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1-9.