技术领域technical field
本申请涉及通信技术领域,尤其涉及一种数据传输方法、电子装置及计算机可读存储介质。The present application relates to the technical field of communication, and in particular to a data transmission method, an electronic device, and a computer-readable storage medium.
背景技术Background technique
随着计算机技术的发展,手机、平板电脑、手提电脑等计算机终端设备的普及率越来越高。由于技术发展日新月异,终端设备存储换代的速度也越来越快。在购买了新机之后,由于旧手机中存储了用户大量的个人信息,为了将这些信息发送给新机,一般需要人工控制新机搜索旧手机,然后点击选择对方,等待对方确认后,方可以进行文件传输,操作繁琐。With the development of computer technology, the penetration rate of computer terminal equipment such as mobile phones, tablet computers, and laptops is getting higher and higher. Due to the rapid development of technology, the speed of terminal device storage replacement is also getting faster and faster. After purchasing a new phone, since the old phone stores a large amount of personal information of the user, in order to send this information to the new phone, it is generally necessary to manually control the new phone to search the old phone, then click to select the other party, and wait for the other party to confirm. File transfer is cumbersome.
发明内容Contents of the invention
本申请实施例提供一种数据传输方法、电子装置及计算机可读存储介质,用于通过碰撞触发文件传输,可提高数据传输的便捷性。Embodiments of the present application provide a data transmission method, an electronic device, and a computer-readable storage medium, which are used to trigger file transmission through a collision, thereby improving the convenience of data transmission.
本申请实施例一方面提供了一种数据传输方法,包括:第一电子装置在发生碰撞时,通过预设的发送方式,向第二电子装置发送配对请求,所述配对请求中包含所述碰撞发生的时间信息,所述时间信息用于辅助所述第二电子装置确定是否返回响应信息;当接收到所述第二电子装置返回的响应信息时,与所述第二电子装置建立数据传输连接;基于建立的数据传输连接,将目标数据发送给所述第二电子装置。An embodiment of the present application provides a data transmission method on the one hand, including: when a collision occurs, the first electronic device sends a pairing request to the second electronic device through a preset sending method, and the pairing request includes the collision Occurrence time information, the time information is used to assist the second electronic device to determine whether to return response information; when receiving the response information returned by the second electronic device, establish a data transmission connection with the second electronic device ; Based on the established data transmission connection, send the target data to the second electronic device.
本申请实施例一方面还提供了一种数据传输方法,包括:第二电子装置在发生碰撞时,记录发生碰撞的时间信息;当接收到第一电子装置发送的配对请求时,根据记录的时间信息和所述配对请求中包含的所述第一电子装置发生碰撞的时间信息,得到所述第二电子装置和所述第一电子装置发生碰撞的时间差;若所述时间差处于预设时间范围之内,则向所述第一电子装置返回响应信息,所述响应信息用于与所述第一电子装置建立数据传输连接;接收所述第一电子装置通过所述数据传输连接发送的目标数据,并将所述目标数据保存在所述第二电子装置中。On the one hand, an embodiment of the present application provides a data transmission method, including: when a collision occurs, the second electronic device records the time information of the collision; when receiving the pairing request sent by the first electronic device, according to the recorded time information Information and the time information of the collision of the first electronic device included in the pairing request to obtain the time difference between the collision of the second electronic device and the first electronic device; if the time difference is within the preset time range within, return response information to the first electronic device, the response information is used to establish a data transmission connection with the first electronic device; receive the target data sent by the first electronic device through the data transmission connection, and saving the target data in the second electronic device.
本申请实施例一方面还提供了一种电子装置,应用于作为数据发送方的第一电子装置,包括:配对模块,用于在发生碰撞时,通过预设的发送方式,向第二电子装置发送配对请求,所述配对请求中包含所述碰撞发生的时间信息,所述时间信息用于辅助所述第二电子装置确定是否返回响应信息;建立模块,用于当接收到所述第二电子装置返回的响应信息时,与所述第二电子装置建立数据传输连接;数据传输模块,用于基于建立的数据传输连接,将目标数据发送给所述第二电子装置。On the one hand, the embodiment of the present application provides an electronic device, which is applied to the first electronic device as the data sender, including: a pairing module, used to send the second electronic device Send a pairing request, the pairing request includes the time information of the collision, and the time information is used to assist the second electronic device to determine whether to return a response message; establish a module for when receiving the second electronic device When the device returns the response information, establish a data transmission connection with the second electronic device; the data transmission module is configured to send the target data to the second electronic device based on the established data transmission connection.
本申请实施例一方面还提供了一种电子装置,应用于作为数据接收方的第二电子装置,包括:记录模块,用于在发生碰撞时,记录发生碰撞的时间信息;分析模块,用于当接收到第一电子装置发送的配对请求时,根据记录的时间信息和所述配对请求中包含的所述第一电子装置发生碰撞的时间信息,得到所述第二电子装置和所述第一电子装置发生碰撞的时间差,以及分析所述时间差是否处于预设时间范围之内;发送模块,用于若所述时间差处于预设时间范围之内,则向所述第一电子装置返回响应信息,所述响应信息用于与所述第一电子装置建立数据传输连接;接收模块,用于接收所述第一电子装置通过所述数据传输连接发送的目标数据,并将所述目标数据保存在所述第二电子装置中。On the one hand, an embodiment of the present application provides an electronic device, which is applied to a second electronic device as a data receiver, including: a recording module, used to record the time information of the collision when a collision occurs; an analysis module, used to When the pairing request sent by the first electronic device is received, the second electronic device and the first The time difference when the electronic device collides, and analyzing whether the time difference is within a preset time range; the sending module is configured to return a response message to the first electronic device if the time difference is within a preset time range, The response information is used to establish a data transmission connection with the first electronic device; the receiving module is configured to receive the target data sent by the first electronic device through the data transmission connection, and store the target data in the in the second electronic device.
本申请实施例一方面还提供了一种电子装置,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时,实现如上述实施例提供的数据传输方法。On the one hand, an embodiment of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor executes the When the above-mentioned computer program is used, the data transmission method provided by the above-mentioned embodiments is implemented.
本申请实施例一方面还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,实现如上述实施例提供的数据传输方法。On the one hand, the embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data transmission method provided in the above-mentioned embodiments is implemented.
上述各实施例,通过第一电子装置在发生碰撞时,按照预设的发送方式,向第二电子装置发送配对请求,第二电子装置根据该配对请求中包含的第一电子装置发生碰撞的时间信息,确定是否返回响应信息,当接收到第二电子装置返回的响应信息时,第一电子装置与第二电子装置建立数据传输连接,然后基于建立的数据传输连接,将目标数据发送给第二电子装置,实现了基于碰撞的数据传输,用户只需要将两个电子装置进行碰撞,即可完成数据交互,从而简化了操作,提高了数据传输的便捷性,进而可增强用户体验,提高产品粘性。In the above-mentioned embodiments, when a collision occurs, the first electronic device sends a pairing request to the second electronic device according to the preset sending method, and the second electronic device sends a pairing request to the second electronic device according to the time when the first electronic device collided included in the pairing request. information, to determine whether to return response information, when receiving the response information returned by the second electronic device, the first electronic device establishes a data transmission connection with the second electronic device, and then sends the target data to the second electronic device based on the established data transmission connection The electronic device realizes data transmission based on collision. Users only need to collide two electronic devices to complete data interaction, which simplifies operation and improves the convenience of data transmission, thereby enhancing user experience and improving product stickiness. .
附图说明Description of drawings
图1为本申请实施例提供的数据传输方法的应用环境示意图;FIG. 1 is a schematic diagram of the application environment of the data transmission method provided by the embodiment of the present application;
图2为本申请一实施例提供的数据传输方法的实现流程示意图;FIG. 2 is a schematic diagram of the implementation flow of a data transmission method provided by an embodiment of the present application;
图3为本申请另一实施例提供的数据传输方法的实现流程示意图;FIG. 3 is a schematic diagram of the implementation flow of a data transmission method provided by another embodiment of the present application;
图4为本申请另一实施例提供的数据传输方法的实现流程示意图;FIG. 4 is a schematic diagram of the implementation flow of a data transmission method provided by another embodiment of the present application;
图5为本申请另一实施例提供的数据传输方法的实现流程示意图;FIG. 5 is a schematic diagram of the implementation flow of a data transmission method provided by another embodiment of the present application;
图6为本申请一实施例提供的电子装置的结构示意图;FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图7为本申请另一实施例提供的电子装置的结构示意图;FIG. 7 is a schematic structural diagram of an electronic device provided by another embodiment of the present application;
图8本申请一实施例提供的电子装置的硬件结构示意图;FIG. 8 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application;
图9为一种电子设备的硬件结构示意图。FIG. 9 is a schematic diagram of a hardware structure of an electronic device.
具体实施方式Detailed ways
为使得本申请的发明目的、特征、优点能够更加的明显和易懂,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而非全部实施例。基于本申请中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described The embodiments are only some of the embodiments of the present application, but not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts belong to the scope of protection of this application.
请参阅图1,为本申请实施例提供的数据传输方法的应用环境示意图。如图1所示,第一电子装置101和第二电子装置102处于无线网络中,该无线网络可以是蓝牙、Wi-Fi(无线保真)或NFC(Near Field Communication,近距离无线通讯技术)。Please refer to FIG. 1 , which is a schematic diagram of an application environment of the data transmission method provided by the embodiment of the present application. As shown in FIG. 1, the first electronic device 101 and the second electronic device 102 are in a wireless network, which can be Bluetooth, Wi-Fi (Wireless Fidelity) or NFC (Near Field Communication, short-range wireless communication technology) .
第一电子装置101和第二电子装置102例如可以是手机,且均开启了碰撞数据传输功能。当用户需要将第一电子装置101中的目标数据传输给第二电子装置102时,将第一电子装置101与第二电子装置102进行碰撞,第一电子装置101在通过运动传感器感测到碰撞事件时,向第二电子装置102发送配对请求。该配对请求中包含第一电子装置101发生碰撞的时间信息。The first electronic device 101 and the second electronic device 102 may be, for example, mobile phones, and both of them have enabled the collision data transmission function. When the user needs to transmit the target data in the first electronic device 101 to the second electronic device 102, the first electronic device 101 is collided with the second electronic device 102, and the first electronic device 101 senses the collision through the motion sensor event, a pairing request is sent to the second electronic device 102 . The pairing request includes time information when the first electronic device 101 collides.
第二电子装置102将该配对请求中包含的第一电子装置101发生碰撞的时间信息和第二电子装置102发生碰撞的时间信息进行比较,得到二者的时间差。当该时间差处于预设时间范围之内时,确认第二电子装置102为第一电子装置101的碰撞对象,于是第二电子装置102向第一电子装置101发送响应信息。进一步的,为避免数据误传,第二电子装置102在接收到该配对请求后,判断第一电子装置101的信号强度是否大于预设强度,若大于预设强度,则说明第一电子装置101和第二电子装置102的距离很近,第一电子装置101是目标数据的传输方的可能性很大,于是再判断第一电子装置101发生碰撞的时间与第二电子装置102发生碰撞的时间差是否处于预设时间范围之内。The second electronic device 102 compares the collision time information of the first electronic device 101 contained in the pairing request with the collision time information of the second electronic device 102 to obtain a time difference between the two. When the time difference is within the preset time range, it is confirmed that the second electronic device 102 is the collision object of the first electronic device 101 , and then the second electronic device 102 sends a response message to the first electronic device 101 . Further, in order to avoid mistransmission of data, after receiving the pairing request, the second electronic device 102 judges whether the signal strength of the first electronic device 101 is greater than a preset strength, and if it is greater than the preset strength, it means that the first electronic device 101 The distance between the second electronic device 102 and the second electronic device 102 is very short, and the first electronic device 101 is very likely to be the transmission party of the target data, so judge the time difference between the collision time of the first electronic device 101 and the collision time of the second electronic device 102 within the preset time frame.
第一电子装置101根据该响应信息与第二电子装置102建立数据传输连接,并基于建立的数据传输连接将目标数据发送给第二电子装置102。然后,第二电子装置102接收第一电子装置101发送的目标数据,并存储在本机中。进一步的,为避免数据误传,提高数据传输的安全性,第一电子装置在接收到响应信息时,也可以获取第二电子装置102的信号强度,若第二电子装置102的信号强度大于预设强度,再根据该响应信息与第二电子装置102建立数据传输连接。The first electronic device 101 establishes a data transmission connection with the second electronic device 102 according to the response information, and sends the target data to the second electronic device 102 based on the established data transmission connection. Then, the second electronic device 102 receives the target data sent by the first electronic device 101 and stores it locally. Further, in order to avoid mistransmission of data and improve the security of data transmission, when the first electronic device receives the response information, it can also obtain the signal strength of the second electronic device 102, if the signal strength of the second electronic device 102 is greater than the preset Set the strength, and then establish a data transmission connection with the second electronic device 102 according to the response information.
可以理解的,在实际应用中,第一电子装置101和第二电子装置102不限于是两台手机,也可以是两台不同种类的其他电子装置,如手机与平板电脑,手机与智能电视,平板电脑与台式计算机等等。当第一电子装置101和第二电子装置102是两台不同种类的电子装置时,通过碰撞实现数据传输的过程与第一电子装置101和第二电子装置102是两台手机的场景相同,具体可参考以下各实施例。It can be understood that in practical applications, the first electronic device 101 and the second electronic device 102 are not limited to two mobile phones, but can also be two other electronic devices of different types, such as a mobile phone and a tablet computer, a mobile phone and a smart TV, Tablets vs desktop computers and more. When the first electronic device 101 and the second electronic device 102 are two different types of electronic devices, the process of realizing data transmission through collision is the same as the scenario where the first electronic device 101 and the second electronic device 102 are two mobile phones, specifically Reference can be made to the following examples.
请参阅图2,为本申请一实施例提供的数据传输方法的实现流程示意图。该方法可应用于配置运动传感器以及无线射频模块的电子终端,如:手机、平板电脑、手提电脑、智能穿戴设备(如智能手环、智能手表等)等可在移动中进行数据处理的移动电子终端,或者,液晶电视、一体机、以及台式计算机等非可在移动中进行数据处理的非移动电子终端。本实施例是从数据发送方的角度进行的说明,如图2所示,该方法主要包括:Please refer to FIG. 2 , which is a schematic diagram of an implementation flow of a data transmission method provided by an embodiment of the present application. This method can be applied to electronic terminals equipped with motion sensors and wireless radio frequency modules, such as mobile phones, tablet computers, laptop computers, smart wearable devices (such as smart bracelets, smart watches, etc.) and other mobile electronic devices that can process data while moving. Terminals, or non-mobile electronic terminals such as LCD TVs, all-in-one computers, and desktop computers that can perform data processing on the move. This embodiment is an illustration from the perspective of the data sender, as shown in Figure 2, the method mainly includes:
201、第一电子装置在发生碰撞时,通过预设的发送方式,向第二电子装置发送配对请求;201. When a collision occurs, the first electronic device sends a pairing request to the second electronic device through a preset sending method;
第一电子装置通过运动传感器获取自己的运动数据,并根据获取的运动数据判断是否发生碰撞。运动传感器例如可以但不限于包括例如:重力传感器、陀螺仪、或者加速度传感器等等。The first electronic device acquires its own motion data through the motion sensor, and judges whether a collision occurs according to the acquired motion data. The motion sensor may include, but is not limited to, a gravity sensor, a gyroscope, or an acceleration sensor, for example.
可以理解的,当发生碰撞时,电子装置在某个方向会存在突然的变向,即,运动传感器感测到的电子装置在X轴或Y轴的值会发生如180°的逆转。It can be understood that when a collision occurs, the electronic device will suddenly change direction in a certain direction, that is, the value of the electronic device sensed by the motion sensor on the X-axis or Y-axis will reverse by 180°, for example.
当发生碰撞时,第一电子装置通过预设的发送方式,向第二电子装置发送配对请求。其中,预设发送方式与第一电子装置需要与第二电子装置建立的数据传输连接的类型对应。如,若建立的是蓝牙数据连接,则预设发送方式可以为广播方式;若建立的是Wi-Fi或NFC数据连接,则预设发送方式可以为点对点的发送方式。When a collision occurs, the first electronic device sends a pairing request to the second electronic device through a preset sending method. Wherein, the preset sending mode corresponds to the type of the data transmission connection that the first electronic device needs to establish with the second electronic device. For example, if a Bluetooth data connection is established, the preset sending method may be broadcast; if a Wi-Fi or NFC data connection is established, the preset sending method may be a point-to-point sending method.
配对请求中包含第一电子装置发生碰撞的时间信息,该时间信息用于辅助第二电子装置确定是否需要返回响应信息。The pairing request includes time information when the first electronic device collides, and the time information is used to assist the second electronic device in determining whether to return response information.
在实际应用中,第一电子装置发生碰撞的时间信息可以包含在配对请求信息中,也可以包含在配对请求数据包中。In practical applications, the time information when the first electronic device collides may be included in the pairing request information or in the pairing request data packet.
202、当接收到第二电子装置返回的响应信息时,与第二电子装置建立数据传输连接;202. When receiving the response information returned by the second electronic device, establish a data transmission connection with the second electronic device;
第二电子装置包括第一电子装置的碰撞对象。第二电子装置在自身发生碰撞时记录碰撞发生的时间信息,当接收到第一电子装置发送的配对请求时,将该配对请求中包含的第一电子装置发生碰撞的时间信息与记录的自身发生碰撞的时间信息进行比较,并判断二者的时间差是否处于预设时间范围之内,若处于预设时间范围之内,则向第一电子装置返回响应信息。The second electronic device includes a collision object of the first electronic device. When the second electronic device collides with itself, it records the time information of the collision, and when it receives the pairing request sent by the first electronic device, it combines the time information of the collision of the first electronic device included in the pairing request with the recorded self-occurrence information. The collision time information is compared, and it is judged whether the time difference between the two is within a preset time range, and if it is within a preset time range, a response message is returned to the first electronic device.
可以理解的,碰撞的发生对于碰撞双方来说是同步的,碰撞双方检测到碰撞的时间相差不会太久,因此,只有碰撞对象才会返回响应信息。It can be understood that the occurrence of the collision is synchronous for the two colliding parties, and the time difference between the two colliding parties detecting the collision will not be too long. Therefore, only the colliding object will return the response information.
第一电子装置根据碰撞对象返回的响应信息,与碰撞对象完成配对,并与碰撞对象建立数据传输连接。该数据传输连接可以但不限于包括:蓝牙、Wi-Fi或者NFC连接。The first electronic device completes pairing with the collision object according to the response information returned by the collision object, and establishes a data transmission connection with the collision object. The data transmission connection may include, but is not limited to: Bluetooth, Wi-Fi or NFC connection.
203、基于建立的数据传输连接,将目标数据发送给第二电子装置。203. Based on the established data transmission connection, send the target data to the second electronic device.
第一电子装置基于建立的数据传输连接,将目标数据发送给作为碰撞对象的第二电子装置。该目标数据可以但不限于包括例如:相册中的图片数据,通讯录数据,安装的软件参数数据,系统配置参数数据等等中的一种或多种。具体可根据用户的自定义操作预先设定。Based on the established data transmission connection, the first electronic device sends the target data to the second electronic device as the collision object. The target data may include, but is not limited to, one or more of, for example, picture data in an album, address book data, installed software parameter data, system configuration parameter data, and the like. Specifically, it can be preset according to user-defined operations.
本实施例提供的数据传输方法,通过第一电子装置在发生碰撞时,按照预设的发送方式,向第二电子装置发送配对请求,第二电子装置根据该配对请求中包含的第一电子装置发生碰撞的时间信息,确定是否返回响应信息,当接收到第二电子装置返回的响应信息时,第一电子装置与第二电子装置建立数据传输连接,然后基于建立的数据传输连接,将目标数据发送给第二电子装置,实现了基于碰撞的数据传输,用户只需要将两个电子装置进行碰撞,即可完成数据交互,从而简化了操作,提高了数据传输的便捷性,进而可增强用户体验,提高产品粘性。In the data transmission method provided in this embodiment, when a collision occurs, the first electronic device sends a pairing request to the second electronic device according to the preset sending method, and the second electronic device sends a pairing request to the second electronic device according to the The time information of the collision, determine whether to return the response information, when receiving the response information returned by the second electronic device, the first electronic device establishes a data transmission connection with the second electronic device, and then based on the established data transmission connection, transfers the target data Sending to the second electronic device realizes data transmission based on collision. The user only needs to collide the two electronic devices to complete the data interaction, which simplifies the operation and improves the convenience of data transmission, thereby enhancing the user experience. , Improve product viscosity.
请参阅图3,为本申请另一实施例提供的数据传输方法的实现流程示意图。该方法可应用于配置运动传感器以及无线射频模块的电子终端,如:手机、平板电脑、手提电脑、智能穿戴设备(如智能手环、智能手表等)等可在移动中进行数据处理的移动电子终端,或者,液晶电视、一体机、以及台式计算机等非可在移动中进行数据处理的非移动电子终端。本实施例是从数据发送方的角度进行的说明,如图3所示,该方法主要包括:Please refer to FIG. 3 , which is a schematic diagram of an implementation flow of a data transmission method provided by another embodiment of the present application. This method can be applied to electronic terminals equipped with motion sensors and wireless radio frequency modules, such as mobile phones, tablet computers, laptop computers, smart wearable devices (such as smart bracelets, smart watches, etc.) and other mobile electronic devices that can process data while moving. Terminals, or non-mobile electronic terminals such as LCD TVs, all-in-one computers, and desktop computers that can perform data processing on the move. This embodiment is an explanation from the perspective of the data sender, as shown in Figure 3, the method mainly includes:
301、当监听到预设事件时,第一电子装置开启碰撞数据传输功能;301. When a preset event is detected, the first electronic device starts a collision data transmission function;
具体的,预设事件可以但不限于包括例如:用于触发开启碰撞数据传输功能的快捷图标或按钮或菜单的点击事件、快捷物理按键的按压事件、装置摇动事件等等。第一电子装置通过预设的事件监听器监听上述预设事件,并当监听到上述预设事件时,开启碰撞数据传输功能。Specifically, the preset event may include, but is not limited to, for example: a click event of a shortcut icon or button or menu for triggering the function of triggering the collision data transmission, a press event of a shortcut physical button, a device shake event, and the like. The first electronic device monitors the preset event through a preset event listener, and starts the collision data transmission function when the preset event is detected.
可以理解的,当碰撞数据传输功能开启后,执行后续步骤,以实现通过碰撞进行数据传输。在碰撞数据传输功能开启前,不执行后续步骤,用户无法通过将第一电子装置与其他电子装置进行碰撞实现数据传输。It can be understood that after the collision data transmission function is enabled, subsequent steps are performed to implement data transmission through collision. Before the colliding data transmission function is activated, the user cannot realize data transmission by colliding the first electronic device with other electronic devices without performing subsequent steps.
302、实时通过运动传感器获取第一电子装置的运动数据,并根据运动数据分析第一电子装置是否发生碰撞;302. Acquire motion data of the first electronic device in real time through the motion sensor, and analyze whether the first electronic device collides according to the motion data;
运动传感器可以但不限于包括例如重力传感器、陀螺仪、或者加速度传感器等等。可以理解的,当发生碰撞时,电子装置在某个方向会存在突然的变向,即,运动传感器感测到的电子装置在X轴或Y轴的值会发生如180°的逆转。The motion sensor may include, but is not limited to, a gravity sensor, a gyroscope, or an acceleration sensor, for example. It can be understood that when a collision occurs, the electronic device will suddenly change direction in a certain direction, that is, the value of the electronic device sensed by the motion sensor on the X-axis or Y-axis will reverse by 180°, for example.
303、当发生碰撞时,若第一电子装置为无线热点,则第一电子装置向接入该无线热点的第二电子装置发送配对请求;303. When a collision occurs, if the first electronic device is a wireless hotspot, the first electronic device sends a pairing request to a second electronic device connected to the wireless hotspot;
可以理解的,第一电子装置预先需要开启无线热点功能,第二电子装置需要接入第一电子装置。此时,第一电子装置作为数据传输的发起方以及数据发送方是主设备,第二电子装置作为数据接收方是从设备。第二电子装置包括第一电子装置的碰撞对象。It can be understood that the first electronic device needs to enable the wireless hotspot function in advance, and the second electronic device needs to access the first electronic device. At this time, the first electronic device is the initiator of data transmission and the data sender is the master device, and the second electronic device is the data receiver as the slave device. The second electronic device includes a collision object of the first electronic device.
可以理解的,在无线热点场景下,也可以根据用户的自定义将数据接收方设置为数据传输的发起方。此时,当建立数据传输连接后,由非数据传输的发起方,将目标数据发送给数据传输的发起方。Understandably, in a wireless hotspot scenario, the data receiver may also be set as the initiator of the data transmission according to the user's customization. At this time, after the data transmission connection is established, the non-data transmission initiator sends the target data to the data transmission initiator.
当发生碰撞时,若第一电子装置为无线热点,则通过该无线热点提供的网络(如:Wi-Fi网络)向接入该无线热点的所有第二电子装置发送配对请求。该配对请求中包含第一电子装置发生碰撞的时间信息。When a collision occurs, if the first electronic device is a wireless hotspot, a pairing request is sent to all second electronic devices connected to the wireless hotspot through the network provided by the wireless hotspot (such as a Wi-Fi network). The pairing request includes time information when the first electronic device collides.
可以理解的,第二电子装置若也开启了碰撞数据传输功能,则在自身发生碰撞时记录碰撞发生的时间信息,当接收到第一电子装置发送的配对请求时,将该配对请求中包含的第一电子装置发生碰撞的时间信息与记录的自身发生碰撞的时间信息进行比较,并判断二者的时间差是否处于预设时间范围之内,若处于预设时间范围之内,则向第一电子装置返回响应信息。It can be understood that if the second electronic device also turns on the collision data transmission function, it will record the time information of the collision when it collides with itself, and when receiving the pairing request sent by the first electronic device, it will The time information of the collision of the first electronic device is compared with the recorded time information of its own collision, and it is judged whether the time difference between the two is within the preset time range. If it is within the preset time range, the first electronic device The device returns a response message.
第二电子装置若没有开启碰撞数据传输功能,则在自身发生碰撞时不记录碰撞发生的时间信息,由于无时间信息记录,所以无法进行碰撞时间信息分析,不会返回响应信息。或者,第二电子装置若没有开启碰撞数据传输功能,则直接忽略第一电子装置发送的配对请求。If the second electronic device does not enable the collision data transmission function, it will not record the time information of the collision when it collides with itself. Since there is no time information record, it cannot analyze the collision time information and will not return a response message. Alternatively, if the second electronic device does not enable the collision data transmission function, it directly ignores the pairing request sent by the first electronic device.
可选的,于本申请其他一实施方式中,当数据传输任务被触发时,第一电子装置在发生碰撞时,基于蓝牙协议,向周围的第二电子装置广播配对请求。Optionally, in another implementation manner of the present application, when the data transmission task is triggered, the first electronic device broadcasts a pairing request to the surrounding second electronic devices based on the Bluetooth protocol when a collision occurs.
具体的,在利用蓝牙进行数据传输的场景下,第一电子装置与第二电子装置之间无主、从设备之分。数据传输任务在哪一个电子装置被触发,哪一个电子装置即为数据发送方,哪一个电子装置即为第一电子装置,由第一电子装置发起配对。在实际应用中,数据传输任务可基于用户点击或按压预设的快捷按钮、菜单、图标或物理快捷键触发。当数据传输任务在第一电子装置中被触发时,若检测到碰撞事件,则第一电子装置基于蓝牙协议,向周围的第二电子装置广播配对请求。在此过程中,若第一电子装置没有打开蓝牙,则先打开蓝牙,再进行配对请求的广播。Specifically, in the scenario where Bluetooth is used for data transmission, there is no distinction between the first electronic device and the second electronic device as a master device or a slave device. The electronic device on which the data transmission task is triggered is the data sender, which electronic device is the first electronic device, and the pairing is initiated by the first electronic device. In practical applications, the data transmission task can be triggered based on the user clicking or pressing a preset shortcut button, menu, icon or physical shortcut key. When the data transmission task is triggered in the first electronic device, if a collision event is detected, the first electronic device broadcasts a pairing request to the surrounding second electronic devices based on the Bluetooth protocol. During this process, if the first electronic device has not turned on the bluetooth, turn on the bluetooth first, and then broadcast the pairing request.
可选的,为避免数据误传,提高数据传输的安全性,于本申请其他一实施方式中,第一电子装置在发生碰撞时,根据运动数据分析碰撞对象是否为电子装置,若碰撞对象为电子装置,再执行通过预设的发送方式,向第二电子装置发送配对请求的步骤。Optionally, in order to avoid data mistransmission and improve the security of data transmission, in another embodiment of the present application, when the first electronic device collides, it analyzes whether the collision object is an electronic device according to the motion data, and if the collision object is The electronic device then executes the step of sending a pairing request to the second electronic device through a preset sending method.
具体的,运动数据可以但不限于包括例如:运动轨迹数据和运动速度数据。根据运动轨迹数据和运动速度数据计算得到第一电子装置在发生碰撞时的运动方向及速度,并将计算得到的运动方向和速度与预设的方向和速度进行比较,从而判断碰撞对象是否为电子装置。若碰撞对象为电子装置且开启了碰撞数据传输功能,则第一电子装置通过预设的发送方式,向第二电子装置发送配对请求。Specifically, the motion data may include, but is not limited to, for example: motion track data and motion speed data. According to the motion track data and motion speed data, the motion direction and speed of the first electronic device when a collision occurs are calculated, and the calculated motion direction and speed are compared with the preset direction and speed, so as to determine whether the collision object is an electronic device device. If the collision object is an electronic device and the collision data transmission function is turned on, the first electronic device sends a pairing request to the second electronic device through a preset sending method.
可选的,为避免数据误传,提高数据传输的安全性,于本申请其他一实施方式中,第一电子装置在发生碰撞时,根据运动数据分析发生碰撞时第一电子装置的运动方向是否为预设运动方向,若发生碰撞时第一电子装置的运动方向为预设运动方向,则执行通过预设的发送方式,向第二电子装置发送配对请求的步骤。也就是说,用户可通过沿着预设的方向让第一电子装置与第二电子装置相撞,从而触发第一电子装置与第二电子装置的配对连接及数据传输。Optionally, in order to avoid mistransmission of data and improve the security of data transmission, in another embodiment of the present application, when the first electronic device collides, analyze according to the motion data whether the direction of motion of the first electronic device at the time of the collision is is a preset moving direction, and if the moving direction of the first electronic device is the preset moving direction when a collision occurs, the step of sending a pairing request to the second electronic device through a preset sending method is executed. That is to say, the user can collide the first electronic device with the second electronic device along a preset direction, thereby triggering the pairing connection and data transmission between the first electronic device and the second electronic device.
304、当接收到第二电子装置返回的响应信息时,获取第二电子装置的信号强度,分析获取的信号强度是否大于预设强度;304. When receiving the response information returned by the second electronic device, acquire the signal strength of the second electronic device, and analyze whether the acquired signal strength is greater than a preset strength;
305、若信号强度大于预设强度,则与第二电子装置建立数据传输连接;305. If the signal strength is greater than the preset strength, establish a data transmission connection with the second electronic device;
306、基于建立的数据传输连接,将目标数据发送给第二电子装置。306. Based on the established data transmission connection, send the target data to the second electronic device.
具体的,响应信息中包含第二电子装置的标识信息,根据该标识信息,获取第二电子装置的信号强度,并分析获取的信号强度是否大于预设强度(如-50dBm(毫瓦分贝)),若大于该预设强度,则说明返回响应信息的第二电子装置与第一电子装置的距离比较接近,应当是第一电子装置的碰撞对象,即正确的数据接收方,于是与该第二电子装置建立数据传输连接。并基于建立的数据传输连接,将目标数据发送给该第二电子装置。Specifically, the response information includes the identification information of the second electronic device, and according to the identification information, obtain the signal strength of the second electronic device, and analyze whether the obtained signal strength is greater than a preset strength (such as -50dBm (decibel milliwatt)) , if it is greater than the preset strength, it means that the distance between the second electronic device that returns the response information and the first electronic device is relatively close, and it should be the collision object of the first electronic device, that is, the correct data receiver. The electronic device establishes a data transmission connection. And based on the established data transmission connection, the target data is sent to the second electronic device.
其中,该目标数据可以但不限于包括例如:相册中的图片数据,通讯录数据,安装的软件参数数据,系统配置参数数据等等中的一种或多种。具体可根据用户的自定义操作预先设定。Wherein, the target data may include, but is not limited to, one or more of, for example, picture data in an album, address book data, installed software parameter data, system configuration parameter data, and the like. Specifically, it can be preset according to user-defined operations.
本实施例提供的数据传输方法,通过第一电子装置在发生碰撞时,按照预设的发送方式,向第二电子装置发送配对请求,第二电子装置根据该配对请求中包含的第一电子装置发生碰撞的时间信息,确定是否返回响应信息,当接收到第二电子装置返回的响应信息时,第一电子装置与第二电子装置建立数据传输连接,然后基于建立的数据传输连接,将目标数据发送给第二电子装置,实现了基于碰撞的数据传输,用户只需要将两个电子装置进行碰撞,即可完成数据交互,从而简化了操作,提高了数据传输的便捷性,进而可增强用户体验,提高产品粘性。In the data transmission method provided in this embodiment, when a collision occurs, the first electronic device sends a pairing request to the second electronic device according to the preset sending method, and the second electronic device sends a pairing request to the second electronic device according to the The time information of the collision, determine whether to return the response information, when receiving the response information returned by the second electronic device, the first electronic device establishes a data transmission connection with the second electronic device, and then based on the established data transmission connection, transfers the target data Sending to the second electronic device realizes data transmission based on collision. The user only needs to collide the two electronic devices to complete the data interaction, which simplifies the operation and improves the convenience of data transmission, thereby enhancing the user experience. , Improve product viscosity.
请参阅图4,为本申请另一实施例提供的数据传输方法的实现流程示意图。该方法可应用于配置运动传感器以及无线射频模块的电子终端,如:手机、平板电脑、手提电脑、智能穿戴设备(如智能手环、智能手表等)等可在移动中进行数据处理的移动电子终端,或者,液晶电视、一体机、以及台式计算机等非可在移动中进行数据处理的非移动电子终端。本实施例是从数据接收方的角度进行的说明,如图4所示,该方法主要包括:Please refer to FIG. 4 , which is a schematic diagram of an implementation flow of a data transmission method provided by another embodiment of the present application. This method can be applied to electronic terminals equipped with motion sensors and wireless radio frequency modules, such as mobile phones, tablet computers, laptop computers, smart wearable devices (such as smart bracelets, smart watches, etc.) and other mobile electronic devices that can process data while moving. Terminals, or non-mobile electronic terminals such as LCD TVs, all-in-one computers, and desktop computers that can perform data processing on the move. This embodiment is an illustration from the perspective of the data receiver, as shown in Figure 4, the method mainly includes:
401、第二电子装置在发生碰撞时,记录发生碰撞的时间信息;401. When a collision occurs, the second electronic device records the time information of the collision;
402、当接收到第一电子装置发送的配对请求时,根据记录的时间信息和配对请求中包含的第一电子装置发生碰撞的时间信息,得到第二电子装置和第一电子装置发生碰撞的时间差;402. When receiving the pairing request sent by the first electronic device, according to the recorded time information and the time information of the collision of the first electronic device contained in the pairing request, obtain the time difference between the collision between the second electronic device and the first electronic device ;
403、若时间差处于预设时间范围之内,则向第一电子装置返回响应信息,响应信息用于与第一电子装置建立数据传输连接;403. If the time difference is within the preset time range, return response information to the first electronic device, where the response information is used to establish a data transmission connection with the first electronic device;
404、接收第一电子装置通过数据传输连接发送的目标数据,并将目标数据保存在第二电子装置中。404. Receive the target data sent by the first electronic device through the data transmission connection, and store the target data in the second electronic device.
第二电子装置检测自身是否发生碰撞的方式与第一电子装置相同,具体可参考图2和图3所示实施例中的相关描述,此处不再赘述。The manner in which the second electronic device detects whether a collision has occurred is the same as that of the first electronic device. For details, reference may be made to relevant descriptions in the embodiments shown in FIG. 2 and FIG. 3 , which will not be repeated here.
具体的,第二电子装置在发生碰撞时,记录自身发生碰撞的时间信息。当接收到第一电子装置发送的配对请求时,根据记录的自身发生碰撞的时间信息和该配对请求中包含的第一电子装置发生碰撞的时间信息,计算得到第二电子装置和第一电子装置发生碰撞的时间差。然后,分析该时间差是否处于预设时间范围(如±1秒)之内。若该时间差处于预设时间范围之内,则说明第一电子装置和第二电子装置彼此互为碰撞对象,于是第二电子装置向第一电子装置返回响应信息,以使得第一电子装置根据该响应信息完成配对,并与第二电子装置建立数据传输连接。Specifically, when a collision occurs, the second electronic device records the time information of the collision itself. When the pairing request sent by the first electronic device is received, the second electronic device and the first electronic device are calculated according to the recorded time information of the collision of the first electronic device and the time information of the first electronic device contained in the pairing request. The time difference between collisions. Then, analyze whether the time difference is within a preset time range (eg, ±1 second). If the time difference is within the preset time range, it means that the first electronic device and the second electronic device are mutual collision objects, so the second electronic device returns a response message to the first electronic device, so that the first electronic device The response information completes the pairing, and establishes a data transmission connection with the second electronic device.
第一电子装置在与第二电子装置建立数据传输连接之后,基于建立的数据传输连接将目标数据发送给第二电子装置。第二电子装置将接收第一电子装置发送的目标数据,并将目标数据保存在第二电子装置中。其中,该目标数据可以但不限于包括例如:相册中的图片数据,通讯录数据,安装的软件参数数据,系统配置参数数据等等中的一种或多种。具体可根据用户的自定义操作预先设定。After establishing the data transmission connection with the second electronic device, the first electronic device sends the target data to the second electronic device based on the established data transmission connection. The second electronic device will receive the target data sent by the first electronic device, and save the target data in the second electronic device. Wherein, the target data may include, but is not limited to, one or more of, for example, picture data in an album, address book data, installed software parameter data, system configuration parameter data, and the like. Specifically, it can be preset according to user-defined operations.
本实施例提供的数据传输方法,通过第一电子装置在发生碰撞时,按照预设的发送方式,向第二电子装置发送配对请求,第二电子装置根据该配对请求中包含的第一电子装置发生碰撞的时间信息,确定是否返回响应信息,当接收到第二电子装置返回的响应信息时,第一电子装置与第二电子装置建立数据传输连接,然后基于建立的数据传输连接,将目标数据发送给第二电子装置,实现了基于碰撞的数据传输,用户只需要将两个电子装置进行碰撞,即可完成数据交互,从而简化了操作,提高了数据传输的便捷性,进而可增强用户体验,提高产品粘性。In the data transmission method provided in this embodiment, when a collision occurs, the first electronic device sends a pairing request to the second electronic device according to the preset sending method, and the second electronic device sends a pairing request to the second electronic device according to the The time information of the collision, determine whether to return the response information, when receiving the response information returned by the second electronic device, the first electronic device establishes a data transmission connection with the second electronic device, and then based on the established data transmission connection, transfers the target data Sending to the second electronic device realizes data transmission based on collision. The user only needs to collide the two electronic devices to complete the data interaction, which simplifies the operation and improves the convenience of data transmission, thereby enhancing the user experience. , Improve product viscosity.
请参阅图5,为本申请另一实施例提供的数据传输方法的实现流程示意图。该方法可应用于配置运动传感器以及无线射频模块的电子终端,如:手机、平板电脑、手提电脑、智能穿戴设备(如智能手环、智能手表等)等可在移动中进行数据处理的移动电子终端,或者,液晶电视、一体机、以及台式计算机等非可在移动中进行数据处理的非移动电子终端。本实施例是从数据接收方的角度进行的说明,如图5所示,该方法主要包括:Please refer to FIG. 5 , which is a schematic diagram of an implementation flow of a data transmission method provided by another embodiment of the present application. This method can be applied to electronic terminals equipped with motion sensors and wireless radio frequency modules, such as mobile phones, tablet computers, laptop computers, smart wearable devices (such as smart bracelets, smart watches, etc.) and other mobile electronic devices that can process data while moving. Terminals, or non-mobile electronic terminals such as LCD TVs, all-in-one computers, and desktop computers that can perform data processing on the move. This embodiment is an illustration from the perspective of the data receiver, as shown in Figure 5, the method mainly includes:
501、当监听到预设事件时,第二电子装置开启碰撞数据传输功能;501. When a preset event is detected, the second electronic device starts a collision data transmission function;
502、实时通过运动传感器获取第二电子装置的运动数据,并根据运动数据分析第二电子装置是否发生碰撞;502. Acquire motion data of the second electronic device in real time through the motion sensor, and analyze whether the second electronic device collides according to the motion data;
503、在第二电子装置发生碰撞时,记录发生碰撞的时间信息;503. When the second electronic device collides, record the time information of the collision;
具体的,预设事件可以但不限于包括例如:用于触发开启碰撞数据传输功能的快捷图标或按钮或菜单的点击事件、快捷物理按键的按压事件、装置摇动事件(如:第二电子装置被按照预设的角度和方向摇动3次)等等。第二电子装置通过预设的事件监听器监听上述预设事件,并当监听到上述预设事件时,开启碰撞数据传输功能。Specifically, the preset events may include, but are not limited to, for example: a click event of a shortcut icon or button or menu used to trigger the start of the collision data transmission function, a press event of a shortcut physical button, a device shaking event (such as: the second electronic device is Shake 3 times according to the preset angle and direction) and so on. The second electronic device monitors the preset event through a preset event listener, and starts the collision data transmission function when the preset event is detected.
运动传感器可以但不限于包括例如重力传感器、陀螺仪、或者加速度传感器等等。可以理解的,当发生碰撞时,电子装置在某个方向会存在突然的变向,即,运动传感器感测到的电子装置在X轴或Y轴的值会发生如180°的逆转。The motion sensor may include, but is not limited to, a gravity sensor, a gyroscope, or an acceleration sensor, for example. It can be understood that when a collision occurs, the electronic device will suddenly change direction in a certain direction, that is, the value of the electronic device sensed by the motion sensor on the X-axis or Y-axis will reverse by 180°, for example.
可选的,当第二电子装置发生碰撞时,第二电子装置判断是否开启了碰撞数据传输功能,若开启了该功能,则记录发生碰撞的时间信息,否则,忽略发生的碰撞,不对发生碰撞的时间信息进行记录。Optionally, when the second electronic device collides, the second electronic device judges whether the collision data transmission function is enabled, and if the function is enabled, records the time information of the collision; otherwise, ignores the collision and does not cause a collision time information is recorded.
504、当接收到第一电子装置发送的配对请求时,获取第一电子装置的信号强度,分析获取的信号强度是否大于预设强度;504. When receiving the pairing request sent by the first electronic device, acquire the signal strength of the first electronic device, and analyze whether the acquired signal strength is greater than a preset strength;
505、若信号强度大于预设强度,则根据记录的时间信息和配对请求中包含的第一电子装置发生碰撞的时间信息,得到第二电子装置和第一电子装置发生碰撞的时间差;505. If the signal strength is greater than the preset strength, obtain the time difference between the collision of the second electronic device and the first electronic device according to the recorded time information and the time information of the collision of the first electronic device contained in the pairing request;
当接收到第一电子装置发送的配对请求时,获取第一电子装置的信号强度,分析获取的信号强度是否大于预设强度(如-50dBm),如大于预设强度,则说明是第一电子装置距离第二电子装置较近,第二电子装置有很大可能是与第一第一电子装置发生的碰撞。于是,根据之前记录的最后一次第二电子装置发生碰撞的时间信息和配对请求中包含的第一电子装置发生碰撞的时间信息,计算得到第二电子装置和第一电子装置发生碰撞的时间差,并分析该时间差是否处于预设时间范围之内。通过信号强度的判断,可以避免数据误传,进一步提高数据传输的安全性。When receiving the pairing request sent by the first electronic device, obtain the signal strength of the first electronic device, analyze whether the acquired signal strength is greater than the preset strength (such as -50dBm), if it is greater than the preset strength, it means that the first electronic device The device is relatively close to the second electronic device, and the second electronic device is likely to collide with the first and first electronic devices. Then, according to the previously recorded time information of the last collision of the second electronic device and the time information of the collision of the first electronic device contained in the pairing request, the time difference between the collision of the second electronic device and the first electronic device is calculated, and Analyze whether the time difference is within a preset time range. By judging the signal strength, data mistransmission can be avoided, and the security of data transmission can be further improved.
可选的,第二电子装置在开启碰撞数据传输功能时,默认在接收到第一电子装置发送的配对请求时,自动对该配对请求进行处理。在没有开启碰撞数据传输功能时,则忽略该配对请求。或者,于本申请其他一实施方式中,第二电子装置在接收到第一电子装置发送的配对请求时,输出选择提示框,然后根据用户在该选择提示框的操作,选择返回响应信息或不返回响应信息,以提高配对操作的灵活性。Optionally, when the second electronic device enables the collision data transmission function, by default, upon receiving the pairing request sent by the first electronic device, it automatically processes the pairing request. When the collision data transmission function is not enabled, the pairing request is ignored. Alternatively, in another embodiment of the present application, when the second electronic device receives the pairing request sent by the first electronic device, it outputs a selection prompt box, and then chooses to return a response message or not according to the user's operation in the selection prompt box. Return response information to improve the flexibility of pairing operations.
可选的,为进一步保证数据传输的安全性,于本申请其他一实施方式中,在Wi-Fi网络场景下,需要以第二电子装置接入作为无线热点的第一电子装置作为前提,当接收到第一电子装置发送的配对请求时,除了判断信号强度之外,还判断第一电子装置是否为第二电子装置接入的无线热点,若第一电子装置为接入的无线热点,则根据记录的第二电子装置最后一次发生碰撞的时间信息和配对请求中包含的第一电子装置发生碰撞的时间信息,得到第二电子装置和第一电子装置发生碰撞的时间差。Optionally, in order to further ensure the security of data transmission, in another embodiment of the present application, in a Wi-Fi network scenario, it is necessary to assume that the second electronic device accesses the first electronic device as a wireless hotspot. When receiving the pairing request sent by the first electronic device, in addition to judging the signal strength, it is also judged whether the first electronic device is a wireless hotspot accessed by the second electronic device. If the first electronic device is a wireless hotspot connected, then According to the recorded time information of the last collision of the second electronic device and the time information of the collision of the first electronic device included in the pairing request, the time difference between the collision of the second electronic device and the first electronic device is obtained.
可选的,于本申请其他一实施方式中,在蓝牙场景下,当接收到第一电子装置基于蓝牙协议广播的配对请求时,根据记录的第二电子装置最后一次发生碰撞的时间信息和配对请求中包含的第一电子装置发生碰撞的时间信息,得到第二电子装置和第一电子装置发生碰撞的时间差。Optionally, in another embodiment of the present application, in the Bluetooth scenario, when a pairing request broadcast by the first electronic device based on the Bluetooth protocol is received, according to the recorded time information and pairing time of the last collision of the second electronic device The collision time information of the first electronic device included in the request obtains the time difference between the collision of the second electronic device and the first electronic device.
可以理解的,在实际应用中,信号强度判断、时间差分析以及无线热点判断的执行顺序没有先后之分。It can be understood that in practical applications, there is no priority in the execution order of signal strength determination, time difference analysis, and wireless hotspot determination.
506、若时间差处于预设时间范围之内,则向第一电子装置返回响应信息,响应信息用于与第一电子装置建立数据传输连接;506. If the time difference is within the preset time range, return response information to the first electronic device, where the response information is used to establish a data transmission connection with the first electronic device;
507、接收第一电子装置通过数据传输连接发送的目标数据,并将目标数据保存在第二电子装置中。507. Receive the target data sent by the first electronic device through the data transmission connection, and store the target data in the second electronic device.
具体的,若第一电子装置发生碰撞与第二电子装置发生碰撞的时间之差处于预设时间范围之内,则说明第一电子装置和第二电子装置发生碰撞的时间很接近,应该互为碰撞对象,于是第二电子装置向第一电子装置返回响应信息。Specifically, if the difference between the collision time of the first electronic device and the collision time of the second electronic device is within the preset time range, it means that the collision time of the first electronic device and the second electronic device is very close, and should be mutually collides with the object, and then the second electronic device returns a response message to the first electronic device.
第一电子装置根据第二电子装置返回的响应信息,完成与第二电子装置的配对,并与第二电子装置建立数据传输连接,然后基于建立的数据传输连接将目标数据发送给第二电子装置。其中,该目标数据可以但不限于包括例如:相册中的图片数据,通讯录数据,安装的软件参数数据,系统配置参数数据等等中的一种或多种。具体可根据用户的自定义操作预先设定。The first electronic device completes the pairing with the second electronic device according to the response information returned by the second electronic device, establishes a data transmission connection with the second electronic device, and then sends the target data to the second electronic device based on the established data transmission connection . Wherein, the target data may include, but is not limited to, one or more of, for example, picture data in an album, address book data, installed software parameter data, system configuration parameter data, and the like. Specifically, it can be preset according to user-defined operations.
第二电子装置通过建立的数据传输连接,接收第一电子装置发送的目标数据,并将目标数据保存在第二电子装置中。可选的,若该目标数据中包含系统配置参数数据,则将当前系统配置参数调整为目标数据中的系统配置参数。The second electronic device receives the target data sent by the first electronic device through the established data transmission connection, and stores the target data in the second electronic device. Optionally, if the target data includes system configuration parameter data, the current system configuration parameters are adjusted to the system configuration parameters in the target data.
以一键换机为例,当用户购买了新机后,在新机和旧机中同时开启碰撞数据传输功能,然后以旧机为无线热点,将新机接入该无线热点,此时,旧机为主设备,新机为从设备。之后,将新机与旧机对撞,作为主设备的旧机就会向新机发送包含旧机记录的碰撞时间信息的配对信息,新机获取旧机的信号强度,如果旧机的信号强度大于预设强度,则根据该碰撞时间信息,确定是与旧机发生了碰撞,于是向旧机返回响应信息,旧机根据该响应信息完成与新机的配对,并与新机建立数据传输连接,之后建立的数据传输连接,将旧机中的用户个人数据发送给新机。新机接收旧机发送的用户个人数据并保存,从而完成一键换机。Take the one-button replacement as an example. After the user purchases a new phone, the collision data transmission function is enabled in both the new phone and the old phone, and then the old phone is used as a wireless hotspot, and the new phone is connected to the wireless hotspot. At this time, The old machine is the master device, and the new machine is the slave device. After that, when the new machine collides with the old machine, the old machine as the main device will send pairing information to the new machine including the collision time information recorded by the old machine, and the new machine will obtain the signal strength of the old machine. If the signal strength of the old machine If it is greater than the preset intensity, then according to the collision time information, it is determined that a collision with the old machine has occurred, and then a response message is returned to the old machine, and the old machine completes pairing with the new machine according to the response information, and establishes a data transmission connection with the new machine , and then establish a data transmission connection to send the user's personal data in the old machine to the new machine. The new machine receives and saves the user's personal data sent by the old machine, thereby completing a one-key replacement.
本实施例提供的数据传输方法,通过第一电子装置在发生碰撞时,按照预设的发送方式,向第二电子装置发送配对请求,第二电子装置根据该配对请求中包含的第一电子装置发生碰撞的时间信息,确定是否返回响应信息,当接收到第二电子装置返回的响应信息时,第一电子装置与第二电子装置建立数据传输连接,然后基于建立的数据传输连接,将目标数据发送给第二电子装置,实现了基于碰撞的数据传输,用户只需要将两个电子装置进行碰撞,即可完成数据交互,从而简化了操作,提高了数据传输的便捷性,进而可增强用户体验,提高产品粘性。In the data transmission method provided in this embodiment, when a collision occurs, the first electronic device sends a pairing request to the second electronic device according to the preset sending method, and the second electronic device sends a pairing request to the second electronic device according to the The time information of the collision, determine whether to return the response information, when receiving the response information returned by the second electronic device, the first electronic device establishes a data transmission connection with the second electronic device, and then based on the established data transmission connection, transfers the target data Sending to the second electronic device realizes data transmission based on collision. The user only needs to collide the two electronic devices to complete the data interaction, which simplifies the operation and improves the convenience of data transmission, thereby enhancing the user experience. , Improve product viscosity.
请参阅图6,为本申请一实施例提供的电子装置的结构示意图。该电子装置可用于实现上述图2所示实施例提供的数据传输方法,应用于作为数据发送方的第一电子装置。如图6所示,该电子装置主要包括:配对模块601、建立模块602以及数据传输模块603。Please refer to FIG. 6 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device can be used to implement the data transmission method provided by the embodiment shown in FIG. 2 above, and is applied to the first electronic device as a data sender. As shown in FIG. 6 , the electronic device mainly includes: a pairing module 601 , an establishment module 602 and a data transmission module 603 .
配对模块601,用于在发生碰撞时,通过预设的发送方式,向第二电子装置发送配对请求,该配对请求中包含该碰撞发生的时间信息,该时间信息用于辅助该第二电子装置确定是否返回响应信息;The pairing module 601 is configured to send a pairing request to the second electronic device through a preset sending method when a collision occurs, the pairing request includes time information of the collision, and the time information is used to assist the second electronic device Determine whether to return response information;
建立模块602,用于当接收到该第二电子装置返回的响应信息时,与该第二电子装置建立数据传输连接;An establishing module 602, configured to establish a data transmission connection with the second electronic device when receiving the response information returned by the second electronic device;
数据传输模块603,用于基于建立的数据传输连接,将目标数据发送给该第二电子装置。The data transmission module 603 is configured to send the target data to the second electronic device based on the established data transmission connection.
进一步的,配对模块601包括:Further, the pairing module 601 includes:
第一发送模块,用于当发生碰撞时,若第一电子装置为无线热点,则向接入该无线热点的第二电子装置发送配对请求;The first sending module is configured to send a pairing request to a second electronic device connected to the wireless hotspot if the first electronic device is a wireless hotspot when a collision occurs;
第二发送模块,用于当数据传输任务被触发时,在第一电子装置发生碰撞时,基于蓝牙协议,向周围的第二电子装置广播该配对请求。The second sending module is used for broadcasting the pairing request to surrounding second electronic devices based on the Bluetooth protocol when the data transmission task is triggered and when the first electronic device collides.
可选的,该电子装置还包括接入模块,用于在第一电子装置作为无线热点时,将第二电子装置接入该无线热点。Optionally, the electronic device further includes an access module, configured to connect the second electronic device to the wireless hotspot when the first electronic device serves as the wireless hotspot.
进一步的,该电子装置还包括:Further, the electronic device also includes:
控制模块,用于当监听到预设事件时,在第一电子装置中开启碰撞数据传输功能;A control module, configured to enable the collision data transmission function in the first electronic device when a preset event is monitored;
第一分析模块,用于实时通过运动传感器获取该第一电子装置的运动数据,并根据该运动数据分析该第一电子装置是否发生碰撞。The first analyzing module is used to obtain the motion data of the first electronic device through the motion sensor in real time, and analyze whether the first electronic device collides according to the motion data.
进一步的,该电子装置还包括:Further, the electronic device also includes:
第二分析模块,用于在第一电子装置发生碰撞时,根据该运动数据分析碰撞对象是否为电子装置;The second analysis module is used to analyze whether the collision object is an electronic device according to the motion data when the first electronic device collides;
配对模块601,还用于若该碰撞对象为该电子装置,则通过预设的发送方式,向第二电子装置发送配对请求。The pairing module 601 is further configured to send a pairing request to the second electronic device through a preset sending method if the collision object is the electronic device.
进一步的,该电子装置还包括:Further, the electronic device also includes:
第三分析模块,用于在该第一电子装置发生碰撞时,根据该运动数据分析发生碰撞时该第一电子装置的运动方向是否为预设运动方向;The third analysis module is used to analyze whether the movement direction of the first electronic device is a preset movement direction according to the movement data when the first electronic device collides;
配对模块601,还用于若发生碰撞时该第一电子装置的运动方向为该预设运动方向,则通过预设的发送方式,向第二电子装置发送配对请求。The pairing module 601 is further configured to send a pairing request to the second electronic device through a preset sending method if the moving direction of the first electronic device is the preset moving direction when a collision occurs.
进一步的,建立模块602包括:Further, the establishment module 602 includes:
信号分析模块,用于当接收到该第二电子装置返回的响应信息时,获取返回响应信息的第二电子装置的信号强度,分析获取的信号强度是否大于预设强度;The signal analysis module is used to obtain the signal strength of the second electronic device that returns the response information when receiving the response information returned by the second electronic device, and analyze whether the obtained signal strength is greater than the preset strength;
连接模块,用于若该信号强度大于该预设强度,则与该第二电子装置建立数据传输连接。A connection module, configured to establish a data transmission connection with the second electronic device if the signal strength is greater than the preset strength.
需要说明的是,以上图6示例的电子装置的实施方式中,各功能模块的划分仅是举例说明,实际应用中可以根据需要,例如相应硬件的配置要求或者软件的实现的便利考虑,而将上述功能分配由不同的功能模块完成,即将电子装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。而且,在实际应用中,本实施例中的相应的功能模块可以是由相应的硬件实现,也可以由相应的硬件执行相应的软件完成。本说明书提供的各个实施例都可应用上述描述原则,以下不再赘述。It should be noted that in the implementation of the electronic device illustrated in FIG. 6 above, the division of each functional module is only an example. In actual applications, it can be considered according to needs, such as the configuration requirements of corresponding hardware or the convenience of software implementation. The above function allocation is accomplished by different functional modules, that is, the internal structure of the electronic device is divided into different functional modules to complete all or part of the functions described above. Moreover, in practical applications, the corresponding functional modules in this embodiment may be realized by corresponding hardware, or may be completed by corresponding hardware executing corresponding software. Each of the embodiments provided in this specification can apply the above-mentioned description principle, which will not be described in detail below.
本实施例提供的电子装置中各功能模块实现各自功能的具体过程,请参见上述图2和图3所示实施例中描述的具体内容,此处不再赘述。For the specific process of each functional module in the electronic device provided in this embodiment to realize their respective functions, please refer to the specific content described in the embodiment shown in FIG. 2 and FIG. 3 above, and details will not be repeated here.
本实施例提供的电子装置,通过第一电子装置在发生碰撞时,按照预设的发送方式,向第二电子装置发送配对请求,第二电子装置根据该配对请求中包含的第一电子装置发生碰撞的时间信息,确定是否返回响应信息,当接收到第二电子装置返回的响应信息时,第一电子装置与第二电子装置建立数据传输连接,然后基于建立的数据传输连接,将目标数据发送给第二电子装置,实现了基于碰撞的数据传输,用户只需要将两个电子装置进行碰撞,即可完成数据交互,从而简化了操作,提高了数据传输的便捷性,进而可增强用户体验,提高产品粘性。In the electronic device provided in this embodiment, when a collision occurs, the first electronic device sends a pairing request to the second electronic device according to the preset sending method, and the second electronic device generates The time information of the collision determines whether to return the response information. When receiving the response information returned by the second electronic device, the first electronic device establishes a data transmission connection with the second electronic device, and then based on the established data transmission connection, sends the target data to For the second electronic device, the data transmission based on collision is realized. The user only needs to collide the two electronic devices to complete the data interaction, thereby simplifying the operation, improving the convenience of data transmission, and enhancing the user experience. Improve product viscosity.
请参阅图7,为本申请一实施例提供的电子装置的结构示意图。该电子装置可用于实现上述图4所示实施例提供的数据传输方法,应用于作为数据接收方的第二电子装置。如图7所示,该电子装置主要包括:记录模块701、分析模块702、发送模块703以及接收模块704。Please refer to FIG. 7 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device may be used to implement the data transmission method provided in the embodiment shown in FIG. 4 above, and be applied to a second electronic device serving as a data receiver. As shown in FIG. 7 , the electronic device mainly includes: a recording module 701 , an analyzing module 702 , a sending module 703 and a receiving module 704 .
记录模块701,用于在发生碰撞时,记录发生碰撞的时间信息;A recording module 701, configured to record the time information of the collision when a collision occurs;
分析模块702,用于当接收到第一电子装置发送的配对请求时,根据记录的时间信息和该配对请求中包含的该第一电子装置发生碰撞的时间信息,得到该第二电子装置和该第一电子装置发生碰撞的时间差,以及分析该时间差是否处于预设时间范围之内;The analysis module 702 is configured to, when receiving the pairing request sent by the first electronic device, according to the recorded time information and the time information of the collision of the first electronic device included in the pairing request, to obtain the pairing request of the second electronic device and the pairing request. The time difference when the first electronic device collides, and analyzing whether the time difference is within a preset time range;
发送模块703,用于若该时间差处于预设时间范围之内,则向该第一电子装置返回响应信息,该响应信息用于与该第一电子装置建立数据传输连接;A sending module 703, configured to return response information to the first electronic device if the time difference is within a preset time range, where the response information is used to establish a data transmission connection with the first electronic device;
接收模块704,用于接收该第一电子装置通过该数据传输连接发送的目标数据,并将该目标数据保存在该第二电子装置中。The receiving module 704 is configured to receive the target data sent by the first electronic device through the data transmission connection, and store the target data in the second electronic device.
进一步的,该电子装置还包括:Further, the electronic device also includes:
信号分析模块,用于当接收到第一电子装置发送的配对请求时,获取该第一电子装置的信号强度,分析获取的信号强度是否大于预设强度;A signal analysis module, configured to acquire the signal strength of the first electronic device when receiving the pairing request sent by the first electronic device, and analyze whether the acquired signal strength is greater than a preset strength;
分析模块702,还用于若该信号强度大于该预设强度,则根据记录的时间信息和该配对请求中包含的该第一电子装置发生碰撞的时间信息,得到该第二电子装置和该第一电子装置发生碰撞的时间差。The analysis module 702 is further configured to, if the signal strength is greater than the preset strength, obtain the second electronic device and the second electronic device according to the recorded time information and the time information of the collision of the first electronic device included in the pairing request. The time difference between a collision of an electronic device.
进一步的,该电子装置还包括:Further, the electronic device also includes:
控制模块,用于当监听到预设事件时,在该第二电子装置中开启碰撞数据传输功能;a control module, configured to enable the collision data transmission function in the second electronic device when a preset event is monitored;
碰撞分析模块,用于实时通过运动传感器获取该第二电子装置的运动数据,并根据该运动数据分析该第二电子装置是否发生碰撞。The collision analysis module is used to obtain the movement data of the second electronic device through the movement sensor in real time, and analyze whether the second electronic device collides according to the movement data.
进一步的,分析模块702包括:Further, the analysis module 702 includes:
热点分析模块,用于当接收到该第一电子装置发送的配对请求时,判断该第一电子装置是否为第二电子装置接入的无线热点;A hotspot analysis module, configured to determine whether the first electronic device is a wireless hotspot accessed by the second electronic device when receiving the pairing request sent by the first electronic device;
第一计算模块,用于若该第一电子装置为第二电子装置接入的无线热点,则根据记录的时间信息和该配对请求中包含的该第一电子装置发生碰撞的时间信息,得到该第二电子装置和该第一电子装置发生碰撞的时间差;The first computing module is configured to obtain the first electronic device according to the recorded time information and the collision time information of the first electronic device included in the pairing request if the first electronic device is a wireless hotspot connected by the second electronic device. The time difference between the collision between the second electronic device and the first electronic device;
第二计算模块,用于当接收到该第一电子装置基于蓝牙协议广播的配对请求时,根据记录的时间信息和该配对请求中包含的该第一电子装置发生碰撞的时间信息,得到该第二电子装置和该第一电子装置发生碰撞的时间差。The second calculation module is configured to obtain the first electronic device according to the recorded time information and the collision time information of the first electronic device contained in the pairing request when receiving the pairing request broadcast by the first electronic device based on the Bluetooth protocol. The time difference between the collision between the second electronic device and the first electronic device.
可选的,该电子装置还包括接入模块,用于在第一电子装置作为无线热点时,接入该无线热点。Optionally, the electronic device further includes an access module, configured to access the wireless hotspot when the first electronic device serves as the wireless hotspot.
本实施例提供的电子装置中各功能模块实现各自功能的具体过程,请参见上述图4和图5所示实施例中描述的具体内容,此处不再赘述。For the specific process of each functional module in the electronic device provided in this embodiment to realize their respective functions, please refer to the specific content described in the above embodiment shown in FIG. 4 and FIG. 5 , which will not be repeated here.
本实施例提供的电子装置,通过第一电子装置在发生碰撞时,按照预设的发送方式,向第二电子装置发送配对请求,第二电子装置根据该配对请求中包含的第一电子装置发生碰撞的时间信息,确定是否返回响应信息,当接收到第二电子装置返回的响应信息时,第一电子装置与第二电子装置建立数据传输连接,然后基于建立的数据传输连接,将目标数据发送给第二电子装置,实现了基于碰撞的数据传输,用户只需要将两个电子装置进行碰撞,即可完成数据交互,从而简化了操作,提高了数据传输的便捷性,进而可增强用户体验,提高产品粘性。In the electronic device provided in this embodiment, when a collision occurs, the first electronic device sends a pairing request to the second electronic device according to the preset sending method, and the second electronic device generates The time information of the collision determines whether to return the response information. When receiving the response information returned by the second electronic device, the first electronic device establishes a data transmission connection with the second electronic device, and then based on the established data transmission connection, sends the target data to For the second electronic device, the data transmission based on collision is realized. The user only needs to collide the two electronic devices to complete the data interaction, thereby simplifying the operation, improving the convenience of data transmission, and enhancing the user experience. Improve product viscosity.
请参阅图8,图8为本申请一实施例提供的电子装置的硬件结构示意图。Please refer to FIG. 8 . FIG. 8 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
本实施例中所描述的电子装置,包括:The electronic device described in this embodiment includes:
存储器801、处理器802及存储在存储器801上并可在处理器802上运行的计算机程序,处理器802执行该计算机程序时,实现前述图2至图5所示实施例中描述的数据传输方法。A memory 801, a processor 802, and a computer program stored in the memory 801 and operable on the processor 802. When the processor 802 executes the computer program, it realizes the data transmission method described in the embodiments shown in FIGS. 2 to 5 .
进一步的,该电子装置还包括:Further, the electronic device also includes:
至少一个输入设备803以及至少一个输出设备804。At least one input device 803 and at least one output device 804 .
上述存储器801、处理器802、输入设备803以及输出设备804,通过总线805连接。The aforementioned memory 801 , processor 802 , input device 803 and output device 804 are connected through a bus 805 .
其中,输入设备803具体可为摄像头、触控面板、物理按键等等。输出设备804具体可为显示屏。Wherein, the input device 803 may specifically be a camera, a touch panel, a physical button, and the like. The output device 804 may specifically be a display screen.
存储器801可以是高速随机存取记忆体(RAM,Random Access Memory)存储器,也可为非不稳定的存储器(non-volatile memory),例如磁盘存储器。存储器801用于存储一组可执行程序代码,处理器802与存储器801耦合。The memory 801 may be a high-speed random access memory (RAM, Random Access Memory) memory, or a non-volatile memory (non-volatile memory), such as a disk memory. The memory 801 is used to store a set of executable program codes, and the processor 802 is coupled to the memory 801 .
进一步的,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质可以是设置于上述各实施例中的电子装置中,该计算机可读存储介质可以是前述图8所示实施例中的存储器。该计算机可读存储介质上存储有计算机程序,该程序被处理器执行时实现前述图2至图5所示实施例中描述的数据传输方法。Further, the embodiment of the present application also provides a computer-readable storage medium, which can be set in the electronic device in each of the above-mentioned embodiments, and the computer-readable storage medium can be the above-mentioned FIG. 8 memory in the example embodiment. A computer program is stored on the computer-readable storage medium, and when the program is executed by a processor, the data transmission method described in the foregoing embodiments shown in FIGS. 2 to 5 is implemented.
示例性的,电子装置可以为移动或便携式并执行无线通信的各种类型的计算机系统设备中的任何一种。具体的,电子装置可以为移动电话或智能电话(例如,基于iPhoneTM,基于Android TM的电话),便携式游戏设备(例如Nintendo DS TM,PlayStationPortable TM,Gameboy Advance TM,iPhone TM)、膝上型电脑、PDA、便携式互联网设备、音乐播放器以及数据存储设备,其他手持设备以及诸如手表、耳机、吊坠、耳机等,电子装置还可以为其他的可穿戴设备(例如,诸如电子眼镜、电子衣服、电子手镯、电子项链、电子纹身、电子设备或智能手表的头戴式设备(HMD))。Exemplarily, the electronic device may be any of various types of computer system devices that are mobile or portable and perform wireless communication. Specifically, the electronic device can be a mobile phone or a smart phone (for example, based on iPhoneTM, a phone based on AndroidTM), a portable game device (such as Nintendo DSTM, PlayStationPortableTM, Gameboy AdvanceTM, iPhoneTM), a laptop, PDAs, portable Internet devices, music players and data storage devices, other handheld devices and such as watches, earphones, pendants, earphones, etc., electronic devices can also be other wearable devices (such as electronic glasses, electronic clothes, electronic bracelets, etc.) , e-necklaces, e-tattoos, head-mounted devices (HMD) for electronic devices or smart watches).
电子装置还可以是多个电子设备中的任何一个,多个电子设备包括但不限于蜂窝电话、智能电话、其他无线通信设备、个人数字助理、音频播放器、其他媒体播放器、音乐记录器、录像机、照相机、其他媒体记录器、收音机、医疗设备、车辆运输仪器、计算器、可编程遥控器、寻呼机、膝上型计算机、台式计算机、打印机、上网本电脑、个人数字助理(PDA)、便携式多媒体播放器(PMP)、运动图像专家组(MPEG-1或MPEG-2)音频层3(MP3)播放器,便携式医疗设备以及数码相机及其组合。The electronic device may also be any of a number of electronic devices including, but not limited to, cellular phones, smart phones, other wireless communication devices, personal digital assistants, audio players, other media players, music recorders, VCRs, Cameras, Other Media Recorders, Radios, Medical Equipment, Vehicle Transportation Instruments, Calculators, Programmable Remote Controls, Pagers, Laptop Computers, Desktop Computers, Printers, Netbook Computers, Personal Digital Assistants (PDAs), Portable Multimedia Players (PMP), Moving Picture Experts Group (MPEG-1 or MPEG-2) Audio Layer 3 (MP3) players, portable medical devices, and digital cameras and combinations thereof.
在一些情况下,电子装置可以执行多种功能(例如,播放音乐,显示视频,存储图片以及接收和发送电话呼叫)。如果需要,电子装置可以是诸如蜂窝电话、媒体播放器、其他手持设备、腕表设备、吊坠设备、听筒设备或其他紧凑型便携式设备的便携式设备。In some cases, an electronic device can perform multiple functions (eg, play music, display video, store pictures, and receive and send phone calls). If desired, the electronic device may be a portable device such as a cell phone, media player, other handheld device, wrist watch device, pendant device, earpiece device, or other compact portable device.
如图9所示,电子设备10可以包括控制电路,该控制电路可以包括存储和处理电路30。该存储和处理电路30可以包括存储器,例如硬盘驱动存储器,非易失性存储器(例如闪存或用于形成固态驱动器的其它电子可编程限制删除的存储器等),易失性存储器(例如静态或动态随机存取存储器等)等,本申请实施例不作限制。存储和处理电路30中的处理电路可以用于控制电子设备10的运转。该处理电路可以基于一个或多个微处理器,微控制器,数字信号处理器,基带处理器,功率管理单元,音频编解码器芯片,专用集成电路,显示驱动器集成电路等来实现。As shown in FIG. 9 , electronic device 10 may include control circuitry, which may include storage and processing circuitry 30 . The storage and processing circuitry 30 may include memory, such as hard disk drive memory, non-volatile memory (such as flash memory or other electronically programmable limited-erasable memory for forming solid-state drives, etc.), volatile memory (such as static or dynamic Random access memory, etc.), etc., are not limited in this embodiment of the present application. Processing circuitry in storage and processing circuitry 30 may be used to control the operation of electronic device 10 . The processing circuit may be implemented based on one or more microprocessors, microcontrollers, digital signal processors, baseband processors, power management units, audio codec chips, application specific integrated circuits, display driver integrated circuits, and the like.
存储和处理电路30可用于运行电子设备10中的软件,例如互联网浏览应用程序,互联网协议语音(Voice over Internet Protocol,VOIP)电话呼叫应用程序,电子邮件应用程序,媒体播放应用程序,操作系统功能等。这些软件可以用于执行一些控制操作,例如,基于照相机的图像采集,基于环境光传感器的环境光测量,基于接近传感器的接近传感器测量,基于诸如发光二极管的状态指示灯等状态指示器实现的信息显示功能,基于触摸传感器的触摸事件检测,与在多个(例如分层的)显示器上显示信息相关联的功能,与执行无线通信功能相关联的操作,与收集和产生音频信号相关联的操作,与收集和处理按钮按压事件数据相关联的控制操作,以及电子设备10中的其它功能等,本申请实施例不作限制。The storage and processing circuit 30 can be used to run software in the electronic device 10, such as Internet browsing applications, Voice over Internet Protocol (Voice over Internet Protocol, VOIP) telephone call applications, email applications, media playback applications, operating system functions Wait. These software can be used to perform control operations such as camera based image acquisition, ambient light measurement based on ambient light sensor, proximity sensor based measurement based on proximity sensor, information based on status indicators such as status indicators such as LEDs Display functions, touch sensor based touch event detection, functions associated with displaying information on multiple (e.g. layered) displays, operations associated with performing wireless communication functions, operations associated with collecting and generating audio signals , control operations associated with collecting and processing button press event data, and other functions in the electronic device 10 are not limited by this embodiment of the present application.
电子设备10还可以包括输入-输出电路42。输入-输出电路42可用于使电子设备10实现数据的输入和输出,即允许电子设备10从外部设备接收数据和也允许电子设备10将数据从电子设备10输出至外部设备。输入-输出电路42可以进一步包括传感器32。传感器32可以包括环境光传感器,基于光和电容的接近传感器,触摸传感器(例如,基于光触摸传感器和/或电容式触摸传感器,其中,触摸传感器可以是触控显示屏的一部分,也可以作为一个触摸传感器结构独立使用),加速度传感器,和其它传感器等。Electronic device 10 may also include input-output circuitry 42 . The input-output circuit 42 can be used to enable the electronic device 10 to realize data input and output, that is, allow the electronic device 10 to receive data from external devices and also allow the electronic device 10 to output data from the electronic device 10 to external devices. Input-output circuitry 42 may further include sensor 32 . The sensor 32 can include an ambient light sensor, a proximity sensor based on light and capacitance, a touch sensor (for example, based on an optical touch sensor and/or a capacitive touch sensor, wherein the touch sensor can be a part of the touch screen or can be used as a The touch sensor structure is used independently), the acceleration sensor, and other sensors, etc.
输入-输出电路42还可以包括一个或多个显示器,例如显示器14。显示器14可以包括液晶显示器,有机发光二极管显示器,电子墨水显示器,等离子显示器,使用其它显示技术的显示器中一种或者几种的组合。显示器14可以包括触摸传感器阵列(即,显示器14可以是触控显示屏)。触摸传感器可以是由透明的触摸传感器电极(例如氧化铟锡(ITO)电极)阵列形成的电容式触摸传感器,或者可以是使用其它触摸技术形成的触摸传感器,例如音波触控,压敏触摸,电阻触摸,光学触摸等,本申请实施例不作限制。Input-output circuitry 42 may also include one or more displays, such as display 14 . The display 14 may include one or a combination of liquid crystal displays, organic light emitting diode displays, electronic ink displays, plasma displays, and displays using other display technologies. Display 14 may include a touch sensor array (ie, display 14 may be a touchscreen display). The touch sensor may be a capacitive touch sensor formed from an array of transparent touch sensor electrodes such as indium tin oxide (ITO) electrodes, or may be a touch sensor formed using other touch technologies such as acoustic touch, pressure sensitive touch, resistive touch Touch, optical touch, etc. are not limited in this embodiment of the application.
电子设备10还可以包括音频组件36。音频组件36可以用于为电子设备10提供音频输入和输出功能。电子设备10中的音频组件36可以包括扬声器,麦克风,蜂鸣器,音调发生器以及其它用于产生和检测声音的组件。Electronic device 10 may also include an audio component 36 . Audio component 36 may be used to provide audio input and output functionality for electronic device 10 . Audio components 36 in electronic device 10 may include speakers, microphones, buzzers, tone generators, and other components for generating and detecting sound.
通信电路38可以用于为电子设备10提供与外部设备通信的能力。通信电路38可以包括模拟和数字输入-输出接口电路,和基于射频信号和/或光信号的无线通信电路。通信电路38中的无线通信电路可以包括射频收发器电路、功率放大器电路、低噪声放大器、开关、滤波器和天线。举例来说,通信电路38中的无线通信电路可以包括用于通过发射和接收近场耦合电磁信号来支持近场通信(Near Field Communication,NFC)的电路。例如,通信电路38可以包括近场通信天线和近场通信收发器。通信电路38还可以包括蜂窝电话收发器和天线,无线局域网收发器电路和天线等。Communication circuitry 38 may be used to provide electronic device 10 with the ability to communicate with external devices. Communications circuitry 38 may include analog and digital input-output interface circuitry, and wireless communications circuitry based on radio frequency signals and/or optical signals. Wireless communication circuitry in communication circuitry 38 may include radio frequency transceiver circuitry, power amplifier circuitry, low noise amplifiers, switches, filters, and antennas. For example, the wireless communication circuit in the communication circuit 38 may include a circuit for supporting Near Field Communication (NFC) by transmitting and receiving near field coupled electromagnetic signals. For example, communication circuitry 38 may include a near field communication antenna and a near field communication transceiver. Communication circuitry 38 may also include cellular telephone transceiver circuitry and antenna, wireless local area network transceiver circuitry and antenna, and the like.
电子设备10还可以进一步包括电池,电力管理电路和其它输入-输出单元40。输入-输出单元40可以包括按钮,操纵杆,点击轮,滚动轮,触摸板,小键盘,键盘,照相机,发光二极管和其它状态指示器等。The electronic device 10 may further include batteries, power management circuits and other input-output units 40 . The input-output unit 40 may include buttons, joysticks, click wheels, scroll wheels, touch pads, keypads, keyboards, cameras, light emitting diodes and other status indicators, and the like.
用户可以通过输入-输出电路42输入命令来控制电子设备10的操作,并且可以使用输入-输出电路42的输出数据以实现接收来自电子设备10的状态信息和其它输出。A user may input commands through the input-output circuit 42 to control the operation of the electronic device 10 , and may use the output data of the input-output circuit 42 to enable receiving status information and other output from the electronic device 10 .
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or modules may be in electrical, mechanical or other forms.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or may be distributed to multiple network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个可读存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的可读存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated modules are realized in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of software products, and the computer software products are stored in a readable memory The medium includes several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The above-mentioned readable storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk.
需要说明的是,对于前述的各方法实施例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本申请所必须的。It should be noted that, for the sake of simplicity of description, the aforementioned method embodiments are expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Depending on the application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
以上为对本申请所提供的数据传输方法、电子装置及计算机可读存储介质的描述,对于本领域的技术人员,依据本申请实施例的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。The above is the description of the data transmission method, electronic device and computer-readable storage medium provided by this application. For those skilled in the art, according to the idea of the embodiment of this application, there will be changes in the specific implementation and application scope. In summary, the contents of this specification should not be construed as limiting the application.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810789122.1ACN109067984B (en) | 2018-07-18 | 2018-07-18 | Data transmission method, electronic device, and computer-readable storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810789122.1ACN109067984B (en) | 2018-07-18 | 2018-07-18 | Data transmission method, electronic device, and computer-readable storage medium |
| Publication Number | Publication Date |
|---|---|
| CN109067984Atrue CN109067984A (en) | 2018-12-21 |
| CN109067984B CN109067984B (en) | 2020-08-28 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810789122.1AExpired - Fee RelatedCN109067984B (en) | 2018-07-18 | 2018-07-18 | Data transmission method, electronic device, and computer-readable storage medium |
| Country | Link |
|---|---|
| CN (1) | CN109067984B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112333276A (en)* | 2020-11-09 | 2021-02-05 | 珠海格力电器股份有限公司 | Network access method, system, storage medium and electronic device |
| CN112867175A (en)* | 2021-02-23 | 2021-05-28 | Oppo广东移动通信有限公司 | Device connection method, device, electronic device and storage medium |
| CN113194417A (en)* | 2021-04-30 | 2021-07-30 | 深圳市欢太科技有限公司 | Device connection method and device, computer device and storage medium |
| CN113472945A (en)* | 2021-07-12 | 2021-10-01 | 交互未来(北京)科技有限公司 | Data transmission method and system based on collision detection and mobile equipment |
| CN115250376A (en)* | 2021-04-27 | 2022-10-28 | 华为技术有限公司 | A collision interaction method between electronic devices and electronic device |
| CN115529576A (en)* | 2022-01-13 | 2022-12-27 | 荣耀终端有限公司 | Collision connection method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2003152861A (en)* | 2001-11-08 | 2003-05-23 | Namco Ltd | Portable terminal device, portable communication control device, program and information storage medium |
| CN102545964A (en)* | 2010-12-16 | 2012-07-04 | 国民技术股份有限公司 | Communication method and system for triggering information interaction by collision |
| CN102869121A (en)* | 2012-09-24 | 2013-01-09 | 东莞宇龙通信科技有限公司 | Method and device for automatically establishing wireless connection |
| CN107135476A (en)* | 2017-06-27 | 2017-09-05 | 飞天诚信科技股份有限公司 | A kind of bluetooth adapter and working method thereof |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2003152861A (en)* | 2001-11-08 | 2003-05-23 | Namco Ltd | Portable terminal device, portable communication control device, program and information storage medium |
| CN102545964A (en)* | 2010-12-16 | 2012-07-04 | 国民技术股份有限公司 | Communication method and system for triggering information interaction by collision |
| CN102869121A (en)* | 2012-09-24 | 2013-01-09 | 东莞宇龙通信科技有限公司 | Method and device for automatically establishing wireless connection |
| CN107135476A (en)* | 2017-06-27 | 2017-09-05 | 飞天诚信科技股份有限公司 | A kind of bluetooth adapter and working method thereof |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112333276A (en)* | 2020-11-09 | 2021-02-05 | 珠海格力电器股份有限公司 | Network access method, system, storage medium and electronic device |
| CN112333276B (en)* | 2020-11-09 | 2021-09-14 | 珠海格力电器股份有限公司 | Network access method, system, storage medium and electronic device |
| CN112867175A (en)* | 2021-02-23 | 2021-05-28 | Oppo广东移动通信有限公司 | Device connection method, device, electronic device and storage medium |
| CN115250376A (en)* | 2021-04-27 | 2022-10-28 | 华为技术有限公司 | A collision interaction method between electronic devices and electronic device |
| WO2022228232A1 (en)* | 2021-04-27 | 2022-11-03 | 华为技术有限公司 | Method for collision interaction between electronic devices, and electronic device |
| CN113194417A (en)* | 2021-04-30 | 2021-07-30 | 深圳市欢太科技有限公司 | Device connection method and device, computer device and storage medium |
| CN113194417B (en)* | 2021-04-30 | 2022-03-15 | 深圳市欢太科技有限公司 | Device connection method, device, computer device and storage medium |
| CN113472945A (en)* | 2021-07-12 | 2021-10-01 | 交互未来(北京)科技有限公司 | Data transmission method and system based on collision detection and mobile equipment |
| CN113472945B (en)* | 2021-07-12 | 2022-08-02 | 交互未来(北京)科技有限公司 | Data transmission method and system based on collision detection and mobile equipment |
| CN115529576A (en)* | 2022-01-13 | 2022-12-27 | 荣耀终端有限公司 | Collision connection method and device |
| Publication number | Publication date |
|---|---|
| CN109067984B (en) | 2020-08-28 |
| Publication | Publication Date | Title |
|---|---|---|
| CN109067984B (en) | Data transmission method, electronic device, and computer-readable storage medium | |
| CN108966067B (en) | Play control method and related product | |
| US12089284B2 (en) | Method for network control and related products | |
| CN109495871B (en) | Bluetooth connection control method, electronic device and computer readable storage medium | |
| CN106406892A (en) | A shortcut function display method and device for applications and a terminal apparatus | |
| CN106951170A (en) | A kind of split screen treating method and apparatus of mobile terminal, mobile terminal | |
| CN106484283A (en) | A display control method and mobile terminal | |
| CN108683444B (en) | Data transmission method and related products | |
| CN111049510B (en) | Touch key, control method and electronic equipment | |
| CN108616772B (en) | A barrage display method, terminal and server | |
| CN108833683B (en) | Dynamic antenna adjustment implementation method and related product | |
| CN107911445A (en) | A kind of information push method, mobile terminal and storage medium | |
| CN110865745A (en) | Screen capturing method and terminal equipment | |
| CN107193664A (en) | A kind of display methods of message, device and mobile terminal | |
| CN108228120A (en) | Multi-screen linkage method and system in AR scene | |
| CN111026482B (en) | Application program control method and electronic equipment | |
| CN108270853B (en) | A message processing method and mobile terminal | |
| CN108958593A (en) | A kind of method and mobile terminal of determining communication object | |
| CN109684011B (en) | Interface display control method, electronic device and computer readable storage medium | |
| CN108803983A (en) | Notification message display control method and device, electronic device and storage medium | |
| CN109348062B (en) | Emergency call implementation method, electronic device and computer-readable storage medium | |
| CN109086025B (en) | Sounding control method, device, electronic device and computer-readable medium | |
| CN108683800B (en) | Mobile terminal, position detection method and related products | |
| CN108810261B (en) | Antenna switching method in call and related product | |
| CN109257731A (en) | Emergency call implementation method, electronic device and computer-readable storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee | Granted publication date:20200828 | |
| CF01 | Termination of patent right due to non-payment of annual fee |