WO2021160084A1 - File transmission method and apparatus, electronic device, and readable storage medium - Google Patents
File transmission method and apparatus, electronic device, and readable storage medium Download PDFInfo
- Publication number
- WO2021160084A1 WO2021160084A1 PCT/CN2021/075987 CN2021075987W WO2021160084A1 WO 2021160084 A1 WO2021160084 A1 WO 2021160084A1 CN 2021075987 W CN2021075987 W CN 2021075987W WO 2021160084 A1 WO2021160084 A1 WO 2021160084A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- communication connection
- password
- information
- scanned
- connection
- Prior art date
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 63
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000004891 communication Methods 0.000 claims abstract description 270
- 238000004590 computer program Methods 0.000 claims description 8
- 238000012790 confirmation Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Definitions
- This application relates to the field of communication technology, and specifically, to a file transmission method, device, electronic device, and readable storage medium.
- one electronic device when two electronic devices are transferring files, one electronic device generally obtains connection parameters directly from the other electronic device, and then establishes a communication connection between the two electronic devices based on the connection parameters, and finally passes the file through the Communication connection for transmission. In the above process, there are security risks in connection parameters and file transmission.
- the purpose of this application is to provide a file transmission method, device, electronic device and readable storage medium.
- an embodiment of the present application provides a file transmission method, which is applied to an electronic device, and the method includes:
- the second information is encrypted according to the second password to obtain second encrypted information, and the second encrypted information is sent to the first device through the second communication connection, so that the first device is After decrypting the second encrypted information according to the second password, the target file in the second information is obtained.
- an embodiment of the present application provides a file transmission method, which is applied to a sending device and a receiving device, and the method includes:
- the sending device encrypts the first information according to the first password to obtain the first encrypted information, and sends the first encrypted information to the receiving device through the first communication connection, wherein the first One piece of information includes a second password and connection parameters of a second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission speed of the second communication connection is higher than a second preset value;
- the receiving device establishes a second communication connection with the sending device according to the connection parameters of the second communication connection;
- the sending device encrypts the second information according to the second password to obtain second encrypted information, and sends the second encrypted information to the receiving device through the second communication connection, so that the receiving device The device obtains the target file in the second information after decrypting the second encrypted information according to the second password.
- an embodiment of the present application provides a file transmission device, which is applied to an electronic device, and the device includes:
- the first communication module is configured to establish a first communication connection with a first device, and obtain the first password stored by the first device through the first communication connection;
- the first encryption module is configured to encrypt first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first device through the first communication connection to Establish a second communication connection with the first device, wherein the first information includes a second password and connection parameters of the second communication connection, and the power consumption of the first communication connection is lower than a first preset value, so The transmission speed of the second communication connection is higher than the second preset value;
- the second encryption module is configured to encrypt second information according to the second password to obtain second encrypted information, and send the second encrypted information to the first device through the second communication connection to Enabling the first device to obtain the target file in the second information after decrypting the second encrypted information according to the second password.
- an embodiment of the present application provides an electronic device, including a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions In order to realize the file transmission method described in any one of the foregoing embodiments.
- an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the file transmission method according to any one of the foregoing embodiments.
- a first communication connection is first established with a first device, and then the first password stored by the first device is obtained through the first communication connection. Then encrypt the first information including the second password and the connection parameters of the second communication connection according to the first password to obtain the first encrypted information, and send the first encrypted information to the first device through the first communication connection, To establish a second communication connection with the first device.
- the power consumption of the first communication connection is lower than the first preset value, and the transmission speed of the second communication connection is higher than the second preset value.
- the second information including the target file is encrypted according to the second password to obtain the second encrypted information, and the second encrypted information is sent to the first device through the second communication connection, so that the first device can pair according to the second password
- the target file is obtained.
- various passwords and second communication connection parameters can be transmitted through the first communication connection with relatively low power consumption, and the encrypted target file can be transmitted through the second communication connection with relatively high transmission speed, thereby reducing the possibility of information leakage , While ensuring the transmission efficiency of the target file.
- FIG. 1 is a schematic block diagram of an electronic device provided by an embodiment of the present application.
- FIG. 2 is one of the schematic flowcharts of the file transmission method provided by the embodiment of the present application.
- FIG. 3 is a schematic flowchart of the sub-steps included in step S110 in FIG. 2;
- FIG. 4 is a second schematic flowchart of a file transmission method provided by an embodiment of the present application.
- FIG. 5 is the third schematic flowchart of a file transmission method provided by an embodiment of the present application.
- FIG. 6 is one of the block diagrams of the file transmission device provided by the embodiment of the present application.
- FIG. 7 is the second block diagram of the file transmission device provided by the embodiment of the present application.
- Icon 100-electronic equipment; 110-storage; 120-processor; 130-communication unit; 200-file transmission device; 210-first communication module; 220-first encryption module; 230-second encryption module; 250- Broadcast module; 260-second communication module; 270-first decryption module; 280-second decryption module.
- first and “second” and other relational terms are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply one of these entities or operations. There is any such actual relationship or order between.
- the terms “include”, “include” or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes those that are not explicitly listed Other elements of, or also include elements inherent to this process, method, article or equipment. If there are no more restrictions, the element defined by the sentence “including a" does not exclude the existence of other identical elements in the process, method, article, or equipment that includes the element.
- FIG. 1 is a block diagram of an electronic device 100 according to an embodiment of the present application.
- the electronic device 100 may be, but is not limited to, a smart phone, a personal computer (PC), or the like.
- An electronic device 100 can be used as both a sending device and a receiving device.
- the electronic device 100 includes a memory 110, a processor 120 and a communication unit 130.
- the components of the memory 110, the processor 120, and the communication unit 130 are directly or indirectly electrically connected to each other to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
- the memory 110 is used to store programs or data.
- the memory 110 may be, but is not limited to, a random access memory (Random Access Memory, RAM), a read only memory (Read Only Memory, ROM), and a programmable read-only memory (Programmable Read-Only Memory, PROM). Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), etc.
- RAM Random Access Memory
- ROM read only memory
- PROM programmable read-only memory
- PROM Programmable Read-Only Memory
- EPROM Erasable Programmable Read-Only Memory
- EEPROM Electric Erasable Programmable Read-Only Memory
- the processor 120 is used to read/write data or programs stored in the memory 110 and execute corresponding functions.
- a file transfer device 200 is stored in the memory 110, and the file transfer device 200 includes at least one software function module that can be stored in the memory 110 in the form of software or firmware.
- the processor 120 executes various functional applications and data processing by running software programs and modules stored in the memory 110, such as the file transmission device 200 in the embodiment of the present application, and realizes the file transmission in the embodiment of the present application. method.
- the communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network, and is used to send and receive data through the network.
- FIG. 1 is only a schematic structural diagram of the electronic device 100, and the electronic device 100 may also include more or fewer components than those shown in FIG. Configuration.
- the components shown in FIG. 1 can be implemented by hardware, software, or a combination thereof.
- FIG. 2 is one of the flowcharts of the file transmission method provided by the embodiment of the present application. The method is applied to the electronic device 100. The specific process of the file transfer method is described in detail below.
- Step S110 Establish a first communication connection with a first device, and obtain a first password stored by the first device through the first communication connection.
- Step S120 Encrypt the first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first device through the first communication connection to communicate with the first device.
- a device establishes a second communication connection.
- the first information includes a second password and connection parameters of a second communication connection
- the power consumption of the first communication connection is lower than a first preset value
- the transmission speed of the second communication connection is higher than that of the second communication connection. default value.
- Step S130 Encrypt second information according to the second password to obtain second encrypted information, and send the second encrypted information to the first device through the second communication connection, so that the first A device obtains the target file in the second information after decrypting the second encrypted information according to the second password.
- the electronic device 100 when it needs to send a file to the first device, it may first establish a first communication connection with the first device, and then obtain the first password stored by the first device from the first device. Wherein, at this time, the electronic device 100 serves as a file sending device, and the first device serves as a file receiving device. Then, the electronic device 100 encrypts the second information according to the first password to obtain second encrypted information, and sends the second encrypted information to the first device through the first communication connection.
- the second information includes connection parameters of the electronic device 100 regarding the second communication connection. For example, if the second communication connection is a WiFi (Wireless Fidelity, wireless fidelity) connection, the second information may include WiFi. Name and WiFi password, etc.
- the power consumption of the first communication connection is lower than a first preset value
- the transmission speed of the second communication connection is higher than a second preset value.
- the first preset value and the second preset value may be set according to actual requirements.
- the first communication connection may be, but not limited to, based on BLE (Bluetooth Low Energy, Bluetooth Low Energy), LTE Direct, NFC (Near Field Communication) with low power consumption and high scanning speed. Distance wireless communication technology), iBeacon, etc.
- the second communication connection may be, but not limited to, a WiFi connection.
- the first device may decrypt the first encrypted information according to the first password to obtain a connection parameter that includes the second communication connection First information.
- the first device may establish a second communication connection with the electronic device 100 according to the connection parameters of the second communication connection.
- the first device may send a connection request for establishing a second communication connection to the electronic device 100 according to the connection parameters of the second communication connection, and the connection request may include a WiFi password; the electronic device 100 passes through By comparison, it is determined that the WiFi password in the connection request is the same as its own WiFi password, and then a second communication connection with the first device is established.
- the first password and the password used when decrypting the first encrypted information are symmetric passwords. That is, the electronic device 100 uses the first password to encrypt the first information to obtain the first encrypted information; the first device uses the first password to decrypt the first encrypted information to obtain the first information.
- the first password is a public key
- the password used when decrypting the first encrypted information is the private key corresponding to the public key. That is, the electronic device 100 obtains the public key of the first device from the first device, then uses the public key to encrypt the first information, and sends the encrypted first encrypted information to the The first device, wherein the electronic device 100 does not obtain the private key corresponding to the first password as the public key from the first device; the first device uses the private key corresponding to the third password as the public key Decrypt the first encrypted information to obtain the first information.
- the first device may first display a prompt message for prompting the user whether to receive the file. If the first device receives the user's confirmation to receive the file, it can establish the second communication connection with the electronic device 100 according to the connection parameters of the second communication connection.
- the first information may also include a second password, and the second password is used to encrypt files to be subsequently transmitted.
- the first information may also include file description information of the target file to be transferred.
- the first device may display the file description information so that the user can determine whether to receive the file.
- the file description information may include, but is not limited to, the total number of target files (for example, 10 files), the total size of target files (for example, 10M), and so on.
- the electronic device 100 may encrypt the second information according to the second password to obtain the second encrypted information.
- the second information may include the target file to be sent, preview data of the target file to be sent, and the like.
- the electronic device 100 may send the second encrypted information to the first device through the second communication connection.
- the first device decrypts the second encrypted information according to the second password to obtain the second information.
- the target file can be transferred in an encrypted manner.
- the second password and the password used when decrypting the second encrypted information are symmetric passwords. That is, the electronic device 100 uses the second password to encrypt the second information to obtain the second encrypted information; the first device uses the second password to decrypt the second encrypted information to obtain the Second information.
- the first communication connection with lower power consumption can be used to transmit various passwords and connection parameters of the second communication connection, and the second communication connection with faster transmission speed can be used to transmit files that need to be transmitted, thereby reducing the first device.
- the power consumption to establish the first communication connection and ensure the file transfer speed. Since the connection parameters and files of the second communication connection are encrypted, the possibility of leakage can also be reduced.
- the first communication connection is an NFC-based communication connection
- the electronic device 100 when the electronic device 100 is close to a device that needs to receive files, it can be determined that the device is the first device and communicate with the The first device establishes a first communication connection.
- FIG. 3 is a schematic flowchart of the sub-steps included in step S110 in FIG. 2.
- Step S110 may include sub-step S111 to sub-step S115.
- sub-step S111 at least one broadcast packet is obtained by scanning, and the signal strength of each broadcast packet is obtained.
- the electronic device 100 can scan for the device supporting the first communication connection according to a certain frequency, so as to obtain at least one broadcast packet and obtain the signal strength of each broadcast packet at the same time.
- the signal strength may be RSSI (Received Signal Strength Indication).
- the scanning speed corresponding to the first communication connection is higher than a third preset value, and the third preset value can be set according to actual requirements.
- the third preset value is the scanning speed corresponding to the second communication connection.
- the device supporting the first communication connection After the device supporting the first communication connection starts the first communication connection function, it will send a broadcast packet about the connection parameters of the first communication connection at a certain frequency.
- the connection parameters of the first communication connection are determined by the actual connection mode. For example, if the first communication connection is a Bluetooth connection, after the device turns on the Bluetooth function, the device will send a BLE broadcast packet at a certain frequency.
- the BLE broadcast packet may include the connection parameters of the first communication connection.
- the connection parameters of may include MAC (Media Access Control, media access control) address information of the device.
- a candidate broadcast package whose service identifier is a preset service identifier is screened out from the at least one broadcast package.
- the service identifier in each broadcast package including the service identifier can be compared with the preset service identifier to determine whether the broadcast package includes the service identifier. Whether the service identifier is the same as the preset service identifier. If they are the same, use the broadcast packet as a candidate broadcast packet.
- the service identifier indicates a certain service supported by the device. If the service is different, the service identifier is different.
- the electronic device 100 may also include the preset service identifier.
- the candidate broadcast package may also include the device identification, device name, and connection parameters of the first communication connection of the scanned device.
- the device identifier represents the unique identifier of the electronic device 100, and may be generated by a GUID (Globally Unique Identifier) algorithm; the device name may be a name set by a user.
- Sub-step S113 according to the signal strength of each candidate broadcast packet, sort the device names corresponding to the selected candidate broadcast packets to obtain a scan list.
- sub-step S114 the scan list is displayed, and the scanned device corresponding to the received selection operation is taken as the first device.
- the device names corresponding to each candidate broadcast package obtained after screening are sorted according to the signal strength corresponding to each candidate broadcast package, thereby obtaining a scan list. Wherein, if the same device name is included in the scan list, the device identifiers corresponding to the same device name are different. Then, the scan list is displayed, so that the user can determine a certain scanned device as the first device according to the scan list.
- the device names in the scan list can be arranged in descending order of signal strength, so that the device name of the scanned device that is most likely to be determined by the user as the first device can be displayed in the highest priority. Location, so that the user can quickly select the first device.
- Sub-step S115 establishing a first communication connection with the first device according to the connection parameters of the first communication connection in the broadcast packet of the first device.
- the scan list that has been obtained is updated according to the newly obtained broadcast packet and the corresponding signal strength.
- a new broadcast package When a new broadcast package is obtained, it may first be determined whether the new broadcast package includes a service identifier and whether the included service identifier is the preset service identifier. If the new broadcast package does not include the service identifier, or the service identifier in the new broadcast package is not the preset service identifier, it is determined that there is no newly-added scanned device, and there is no need to perform a scan on the obtained scan list. renew.
- the service identifier in the new broadcast package is the preset service identifier, it is determined whether the device identifier included in the new broadcast package is the device identifier corresponding to the device name in the obtained scan list. If it is, it is determined that there is no newly-added scanned device, and the obtained scan list does not need to be updated.
- the device name of the newly-added scanned device can be added to the obtained scan list according to the signal strength corresponding to the newly-added scanned device.
- the device names in the obtained scan list are sorted according to the signal strength from largest to smallest.
- the obtained scan list includes the following content: device 1, device 2, device 3; if the newly-added scanned device 4 corresponds to The signal strength is between the signal strengths of device 1 and device 2, and the device name of the scanned device 4 can be recorded between device 1 and device 2, without modifying the original order, so that the device name order is Scan list of device 1, device 4, device 2, and device 3.
- the scan list includes the device name of the scanned device that has not been scanned for the preset number of consecutive times
- the device name of the scanned device that has not been scanned for the preset number of consecutive times is deleted from the scan list. This prevents useless device names from being included in the scan list.
- the preset number of times can be set according to actual needs, for example, set to 3 times.
- FIG. 4 is a second schematic flowchart of a file transmission method provided by an embodiment of the present application.
- the method may further include step S150 to step S190.
- step S150 the broadcast packet is sent.
- the electronic device 100 when the electronic device 100 is used as a file receiving device and the second device is used as a file sending device, the electronic device 100 may send broadcast packets at a certain frequency after enabling the function of the first communication connection .
- the broadcast package may include a service identifier, a device identifier, and connection parameters of the first communication connection.
- the service identifier in the broadcast package may be a preset service identifier.
- the broadcast package may also include the device name.
- the power consumption of the first communication connection is lower than the first preset value, thereby ensuring that the electronic device 100 as a file receiving device uses low power consumption for sending broadcast packets, thereby reducing the need for the electronic device 100 to establish the first communication connection. Power consumption used by a communication connection. In other words, this method can reduce the power consumption of the electronic device 100 to maintain the state discovered by the second device.
- Step S160 When a connection request sent by the second device according to the connection parameters of the first communication connection is received, establish a first communication connection with the second device, so that the second device can pass through the first communication
- the third password stored in the electronic device 100 is obtained by connecting.
- Step S170 After receiving the third encrypted information obtained by encrypting the third information according to the third password and sent by the second device through the first communication connection, perform the The third encrypted information is decrypted, the third information in the third encrypted information is obtained, and the user is prompted whether to receive the file.
- the third password and the password used when decrypting the third encrypted information are symmetric passwords.
- the third password is a public key, that is to say, the third encrypted information is used by the second device to pair the third password as the public key.
- the third information is encrypted and obtained.
- the electronic device 100 can decrypt the third encrypted information according to the private key corresponding to the third password, so as to obtain the third information.
- the electronic device 100 may pre-store a digital certificate using a public encryption technology, and use the public key of the digital certificate as the third password.
- the third information may include a fourth password and connection parameters of the second communication connection.
- the third information may also include file description information of the target file to be transferred.
- Step S180 If the user confirms the file reception operation, establish a second communication connection with the second device according to the connection parameters of the second communication connection.
- Step S190 Receive fourth encrypted information obtained by encrypting fourth information according to the fourth password sent by the second device through the second communication connection, and encrypt the fourth information according to the fourth password The information is decrypted to obtain the target file in the fourth information.
- step S150 to step S190 please refer to the specific description of step S110 to step S130 above, which will not be repeated here.
- FIG. 5 is the third flowchart of the file transmission method provided by the embodiment of the present application. The method is applied to sending equipment and receiving equipment. The following describes the flow of the file transmission method for the sending device and the receiving device.
- Step S210 The sending device establishes a first communication connection with the receiving device, and obtains a first password stored by the receiving device through the first communication connection.
- Step S220 The sending device encrypts the first information according to the first password to obtain first encrypted information, and sends the first encrypted information to the receiving device through the first communication connection.
- the first information includes a second password and connection parameters of a second communication connection
- the power consumption of the first communication connection is lower than a first preset value
- the transmission speed of the second communication connection is higher than that of the second communication connection. default value.
- Step S230 The receiving device establishes a second communication connection with the sending device according to the connection parameters of the second communication connection.
- Step S240 The sending device encrypts the second information according to the second password to obtain second encrypted information, and sends the second encrypted information to the receiving device through the second communication connection, so that The receiving device obtains the target file in the second information after decrypting the second encrypted information according to the second password.
- the file transmission apparatus 200 may use the components of the electronic device 100 shown in FIG. 1 structure. Further, please refer to FIG. 6, which is one of the block diagrams of the file transmission apparatus 200 provided in an embodiment of the present application.
- the file transmission apparatus 200 is applied to the electronic device 100. It should be noted that the basic principles and technical effects of the file transmission device 200 provided in this embodiment are the same as those of the above-mentioned embodiment. For a brief description, for parts not mentioned in this embodiment, please refer to the above-mentioned embodiment.
- the file transmission device 200 may include: a first communication module 210, a first encryption module 220, and a second encryption module 230.
- the first communication module 210 is configured to establish a first communication connection with a first device, and obtain a first password stored by the first device through the first communication connection.
- the first encryption module 220 is configured to encrypt first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first encrypted information through the first communication connection.
- Device to establish a second communication connection with the first device.
- the first information includes a second password and connection parameters of a second communication connection
- the power consumption of the first communication connection is lower than a first preset value
- the transmission speed of the second communication connection is higher than that of the second communication connection. default value.
- the second encryption module 230 is configured to encrypt second information according to the second password to obtain second encrypted information, and send the second encrypted information to the first through the second communication connection. Device, so that the first device obtains the target file in the second information after decrypting the second encrypted information according to the second password.
- FIG. 7 is the second block diagram of the file transmission apparatus 200 provided by an embodiment of the present application.
- the file transmission device 200 may further include: a broadcasting module 250, a second communication module 260, a first decryption module 270, and a second decryption module 280.
- the broadcast module 250 is used to send broadcast packets.
- the broadcast package includes a service identifier, a device identifier, and connection parameters of the first communication connection.
- the second communication module 260 is configured to establish a first communication connection with the second device when receiving a connection request sent by the second device according to the connection parameters of the first communication connection, so that the second device The device obtains the third password stored by the electronic device 100 through the first communication connection.
- the first decryption module 270 is configured to decrypt the third encrypted information according to the third password after receiving the third encrypted information sent by the second device through the first communication connection to obtain The third information in the third encrypted information, and prompts the user whether to receive the file.
- the third information includes a fourth password and connection parameters of the second communication connection.
- the second communication module 260 is further configured to establish a second communication connection with the second device according to the connection parameters of the second communication connection when receiving the user's confirmation to receive the file.
- the second decryption module 280 is configured to receive fourth encrypted information obtained by encrypting fourth information according to the fourth password sent by the second device through the second communication connection, and according to the fourth The password decrypts the fourth encrypted information to obtain the target file in the fourth information.
- the above-mentioned modules can be stored in the memory 110 shown in FIG. 1 in the form of software or firmware (Firmware) or solidified in the operating system (OS) of the electronic device 100, and can be processed by the processing shown in FIG. 1 ⁇ 120 executes.
- data, program codes, etc. required to execute the above-mentioned modules may be stored in the memory 110.
- the embodiment of the present application also provides a readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the file transmission method described in the item is implemented.
- the embodiments of the present application provide a file transmission method, device, electronic device, and readable storage medium.
- First establish a first communication connection with the first device, and then obtain the first password stored by the first device through the first communication connection. Then encrypt the first information including the second password and the connection parameters of the second communication connection according to the first password to obtain the first encrypted information, and send the first encrypted information to the first device through the first communication connection,
- the power consumption of the first communication connection is lower than the first preset value
- the transmission speed of the second communication connection is higher than the second preset value.
- the second information including the target file is encrypted according to the second password to obtain the second encrypted information, and the second encrypted information is sent to the first device through the second communication connection, so that the first device can pair according to the second password After the second encrypted information is decrypted, the target file is obtained.
- various passwords and second communication connection parameters can be transmitted through the first communication connection with relatively low power consumption, and the encrypted target file can be transmitted through the second communication connection with relatively high transmission speed, thereby reducing the possibility of information leakage , And ensure the transmission efficiency of the target file.
- each block in the flowchart or block diagram may represent a module, program segment, or part of the code, and the module, program segment, or part of the code contains one or more functions for realizing the specified logical function. Executable instructions.
- the functions marked in the block may also occur in a different order from the order marked in the drawings.
- each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions.
- the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
- the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer readable storage medium.
- the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mobile Radio Communication Systems (AREA)
- Telephone Function (AREA)
Abstract
Provided are a file transmission method and apparatus, an electronic device, and a readable storage medium, relating to the technical field of communications. The method comprises: first, acquiring, by means of a first communication connection with a first device, a first password stored by the first device; then encrypting first information, which comprises a second password and connection parameters of a second communication connection, according to the first password, and sending obtained first encrypted information to the first device by means of the first communication connection to establish the second communication connection with the first device, wherein the power consumption of the first communication connection is lower than a first preset value, and the transmission speed of the second communication connection is higher than a second preset value; and finally, encrypting, according to the second password, second information comprising a target file, and sending obtained second encrypted information to the first device by means of the second communication connection, such that the first device obtains the target file. Therefore, transmitting encrypted connection parameters of a second communication connection and an encrypted target file can prevent information leakage.
Description
本申请涉及通信技术领域,具体而言,涉及一种文件传输方法、装置、电子设备及可读存储介质。This application relates to the field of communication technology, and specifically, to a file transmission method, device, electronic device, and readable storage medium.
目前,两个电子设备在进行文件传输时,一般都是一个电子设备直接从另一个电子设备处获得连接参数,然后基于该连接参数建立两个电子设备之间的通信连接,最后将文件通过该通信连接进行传输。在上述过程中,连接参数、文件的传输均存在安全隐患。At present, when two electronic devices are transferring files, one electronic device generally obtains connection parameters directly from the other electronic device, and then establishes a communication connection between the two electronic devices based on the connection parameters, and finally passes the file through the Communication connection for transmission. In the above process, there are security risks in connection parameters and file transmission.
【发明内容】[Summary of the invention]
有鉴于此,本申请的目的在于提供一种文件传输方法、装置、电子设备及可读存储介质。In view of this, the purpose of this application is to provide a file transmission method, device, electronic device and readable storage medium.
为了实现上述目的,本申请实施例采用的技术方案如下:In order to achieve the foregoing objectives, the technical solutions adopted in the embodiments of the present application are as follows:
第一方面,本申请实施例提供一种文件传输方法,应用于电子设备,所述方法包括:In the first aspect, an embodiment of the present application provides a file transmission method, which is applied to an electronic device, and the method includes:
与第一设备建立第一通信连接,并通过所述第一通信连接获取所述第一设备存储的第一密码;Establish a first communication connection with the first device, and obtain the first password stored by the first device through the first communication connection;
根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述第一设备,以与所述第一设备建立第二通信连接,其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值;Encrypt the first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first device through the first communication connection to establish a connection with the first device A second communication connection, wherein the first information includes a second password and connection parameters of the second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission of the second communication connection The speed is higher than the second preset value;
根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述第一设备,以使所述第一设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。The second information is encrypted according to the second password to obtain second encrypted information, and the second encrypted information is sent to the first device through the second communication connection, so that the first device is After decrypting the second encrypted information according to the second password, the target file in the second information is obtained.
第二方面,本申请实施例提供一种文件传输方法,应用于发送设备及接收设备,所述方法包括:In the second aspect, an embodiment of the present application provides a file transmission method, which is applied to a sending device and a receiving device, and the method includes:
所述发送设备与所述接收设备建立第一通信连接,并通过所述第一通信连接获取所述接收设备存储的第一密码;Establishing a first communication connection between the sending device and the receiving device, and obtaining the first password stored by the receiving device through the first communication connection;
所述发送设备根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述接收设备,其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值;The sending device encrypts the first information according to the first password to obtain the first encrypted information, and sends the first encrypted information to the receiving device through the first communication connection, wherein the first One piece of information includes a second password and connection parameters of a second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission speed of the second communication connection is higher than a second preset value;
所述接收设备根据所述第二通信连接的连接参数与所述发送设备建立第二通信连接;The receiving device establishes a second communication connection with the sending device according to the connection parameters of the second communication connection;
所述发送设备根据所述第二密码对第二信息进行加密,得到第二加密信息, 并将所述第二加密信息通过所述第二通信连接发送给所述接收设备,以使所述接收设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。The sending device encrypts the second information according to the second password to obtain second encrypted information, and sends the second encrypted information to the receiving device through the second communication connection, so that the receiving device The device obtains the target file in the second information after decrypting the second encrypted information according to the second password.
第三方面,本申请实施例提供一种文件传输装置,应用于电子设备,所述装置包括:In a third aspect, an embodiment of the present application provides a file transmission device, which is applied to an electronic device, and the device includes:
第一通信模块,用于与第一设备建立第一通信连接,并通过所述第一通信连接获取所述第一设备存储的第一密码;The first communication module is configured to establish a first communication connection with a first device, and obtain the first password stored by the first device through the first communication connection;
第一加密模块,用于根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述第一设备,以与所述第一设备建立第二通信连接,其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值;The first encryption module is configured to encrypt first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first device through the first communication connection to Establish a second communication connection with the first device, wherein the first information includes a second password and connection parameters of the second communication connection, and the power consumption of the first communication connection is lower than a first preset value, so The transmission speed of the second communication connection is higher than the second preset value;
第二加密模块,用于根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述第一设备,以使所述第一设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。The second encryption module is configured to encrypt second information according to the second password to obtain second encrypted information, and send the second encrypted information to the first device through the second communication connection to Enabling the first device to obtain the target file in the second information after decrypting the second encrypted information according to the second password.
第四方面,本申请实施例提供一种电子设备,包括处理器和存储器,所述存储器存储有能够被所述处理器执行的机器可执行指令,所述处理器可执行所述机器可执行指令以实现前述实施方式中任意一项所述的文件传输方法。In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions In order to realize the file transmission method described in any one of the foregoing embodiments.
第五方面,本申请实施例提供一种可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如前述实施方式中任意一项所述的文件传输方法。In a fifth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the file transmission method according to any one of the foregoing embodiments.
本申请实施例提供的文件传输方法、装置、电子设备及可读存储介质,首先与第一设备建立第一通信连接,然后通过该第一通信连接获取第一设备存储的第一密码。接着根据该第一密码对包括第二密码、第二通信连接的连接参数的第一信息进行加密,得到第一加密信息,并将该第一加密信息通过第一通信连接发送给第一设备,以与第一设备建立第二通信连接。其中,第一通信连接的功耗低于第一预设值,第二通信连接的传输速度高于第二预设值。最后根据第二密码对包括目标文件的第二信息进行加密,得到第二加密信息,并将第二加密信息通过第二通信连接发送给第一设备,以使第一设备在根据第二密码对第二加密信息解密后得到目标文件。由此,可通过功耗比较低的第一通信连接传输各种密码及第二通信连接参数,并通过传输速度比较高的第二通信连接传输加密后的目标文件,从而降低信息泄露的可能性,同时保证目标文件的传输效率。In the file transmission method, device, electronic device, and readable storage medium provided by the embodiments of the present application, a first communication connection is first established with a first device, and then the first password stored by the first device is obtained through the first communication connection. Then encrypt the first information including the second password and the connection parameters of the second communication connection according to the first password to obtain the first encrypted information, and send the first encrypted information to the first device through the first communication connection, To establish a second communication connection with the first device. Wherein, the power consumption of the first communication connection is lower than the first preset value, and the transmission speed of the second communication connection is higher than the second preset value. Finally, the second information including the target file is encrypted according to the second password to obtain the second encrypted information, and the second encrypted information is sent to the first device through the second communication connection, so that the first device can pair according to the second password After the second encrypted information is decrypted, the target file is obtained. As a result, various passwords and second communication connection parameters can be transmitted through the first communication connection with relatively low power consumption, and the encrypted target file can be transmitted through the second communication connection with relatively high transmission speed, thereby reducing the possibility of information leakage , While ensuring the transmission efficiency of the target file.
为使本申请的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objectives, features and advantages of the present application more obvious and understandable, preferred embodiments are specifically described below in conjunction with the accompanying drawings.
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例, 因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings that need to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore do not It should be regarded as a limitation of the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative work.
图1是本申请实施例提供的电子设备的方框示意图;FIG. 1 is a schematic block diagram of an electronic device provided by an embodiment of the present application;
图2是本申请实施例提供的文件传输方法的流程示意图之一;FIG. 2 is one of the schematic flowcharts of the file transmission method provided by the embodiment of the present application;
图3是图2中步骤S110包括的子步骤的流程示意图;FIG. 3 is a schematic flowchart of the sub-steps included in step S110 in FIG. 2;
图4是本申请实施例提供的文件传输方法的流程示意图之二;FIG. 4 is a second schematic flowchart of a file transmission method provided by an embodiment of the present application;
图5是本申请实施例提供的文件传输方法的流程示意图之三;FIG. 5 is the third schematic flowchart of a file transmission method provided by an embodiment of the present application;
图6是本申请实施例提供的文件传输装置的方框示意图之一;FIG. 6 is one of the block diagrams of the file transmission device provided by the embodiment of the present application;
图7是本申请实施例提供的文件传输装置的方框示意图之二。FIG. 7 is the second block diagram of the file transmission device provided by the embodiment of the present application.
图标:100-电子设备;110-存储器;120-处理器;130-通信单元;200-文件传输装置;210-第一通信模块;220-第一加密模块;230-第二加密模块;250-广播模块;260-第二通信模块;270-第一解密模块;280-第二解密模块。Icon: 100-electronic equipment; 110-storage; 120-processor; 130-communication unit; 200-file transmission device; 210-first communication module; 220-first encryption module; 230-second encryption module; 250- Broadcast module; 260-second communication module; 270-first decryption module; 280-second decryption module.
下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。The following describes the technical solutions in the embodiments of the present application clearly and completely with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various different configurations.
因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。Therefore, the following detailed description of the embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work shall fall within the protection scope of the present application.
需要说明的是,术语“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that the terms "first" and "second" and other relational terms are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply one of these entities or operations. There is any such actual relationship or order between. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes those that are not explicitly listed Other elements of, or also include elements inherent to this process, method, article or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article, or equipment that includes the element.
请参照图1,图1是本申请实施例提供的电子设备100的方框示意图。所述电子设备100可以是,但不限于,智能手机、个人电脑(personal computer,PC)等。一个电子设备100既可以作为发送设备,也可以作为接收设备。所述电子设备100包括存储器110、处理器120及通信单元130。所述存储器110、处理器120以及通信单元130各元件相互之间直接或间接地电性连接,以实现数据的传输或交互。例如,这些元件相互之间可通过一条或多条通讯总线或信号线实现电性连接。Please refer to FIG. 1, which is a block diagram of an electronic device 100 according to an embodiment of the present application. The electronic device 100 may be, but is not limited to, a smart phone, a personal computer (PC), or the like. An electronic device 100 can be used as both a sending device and a receiving device. The electronic device 100 includes a memory 110, a processor 120 and a communication unit 130. The components of the memory 110, the processor 120, and the communication unit 130 are directly or indirectly electrically connected to each other to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
其中,存储器110用于存储程序或者数据。所述存储器110可以是,但不限于,随机存取存储器(Random Access Memory,RAM),只读存储器(Read Only Memory,ROM),可编程只读存储器(Programmable Read-Only Memory,PROM), 可擦除只读存储器(Erasable Programmable Read-Only Memory,EPROM),电可擦除只读存储器(Electric Erasable Programmable Read-Only Memory,EEPROM)等。Among them, the memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (Random Access Memory, RAM), a read only memory (Read Only Memory, ROM), and a programmable read-only memory (Programmable Read-Only Memory, PROM). Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), etc.
处理器120用于读/写存储器110中存储的数据或程序,并执行相应地功能。比如,存储器110中存储有文件传输装置200,所述文件传输装置200包括至少一个可以软件或固件(firmware)的形式存储于所述存储器110中的软件功能模块。所述处理器120通过运行存储在存储器110内的软件程序以及模块,如本申请实施例中的文件传输装置200,从而执行各种功能应用以及数据处理,即实现本申请实施例中的文件传输方法。The processor 120 is used to read/write data or programs stored in the memory 110 and execute corresponding functions. For example, a file transfer device 200 is stored in the memory 110, and the file transfer device 200 includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes various functional applications and data processing by running software programs and modules stored in the memory 110, such as the file transmission device 200 in the embodiment of the present application, and realizes the file transmission in the embodiment of the present application. method.
通信单元130用于通过网络建立所述电子设备100与其它通信终端之间的通信连接,并用于通过所述网络收发数据。The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network, and is used to send and receive data through the network.
应当理解的是,图1所示的结构仅为电子设备100的结构示意图,所述电子设备100还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。图1中所示的各组件可以采用硬件、软件或其组合实现。It should be understood that the structure shown in FIG. 1 is only a schematic structural diagram of the electronic device 100, and the electronic device 100 may also include more or fewer components than those shown in FIG. Configuration. The components shown in FIG. 1 can be implemented by hardware, software, or a combination thereof.
请参照图2,图2是本申请实施例提供的文件传输方法的流程示意图之一。所述方法应用于电子设备100。下面对文件传输方法的具体流程进行详细阐述。Please refer to FIG. 2. FIG. 2 is one of the flowcharts of the file transmission method provided by the embodiment of the present application. The method is applied to the electronic device 100. The specific process of the file transfer method is described in detail below.
步骤S110,与第一设备建立第一通信连接,并通过所述第一通信连接获取所述第一设备存储的第一密码。Step S110: Establish a first communication connection with a first device, and obtain a first password stored by the first device through the first communication connection.
步骤S120,根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述第一设备,以与所述第一设备建立第二通信连接。Step S120: Encrypt the first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first device through the first communication connection to communicate with the first device. A device establishes a second communication connection.
其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值。Wherein, the first information includes a second password and connection parameters of a second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission speed of the second communication connection is higher than that of the second communication connection. default value.
步骤S130,根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述第一设备,以使所述第一设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。Step S130: Encrypt second information according to the second password to obtain second encrypted information, and send the second encrypted information to the first device through the second communication connection, so that the first A device obtains the target file in the second information after decrypting the second encrypted information according to the second password.
在本实施例中,所述电子设备100在需要向第一设备发送文件时,可先与第一设备建立第一通信连接,然后从第一设备处获得该第一设备存储的第一密码。其中,此时所述电子设备100作为文件发送设备,第一设备作为文件接收设备。接着,所述电子设备100根据该第一密码对第二信息进行加密,得到第二加密信息,并将该第二加密信息通过所述第一通信连接发送给所述第一设备。其中,该第二信息中包括所述电子设备100关于第二通信连接的连接参数,比如,若第二通信连接为WiFi(Wireless Fidelity,无线保真)连接,则该第二信息中可以包括WiFi名称及WiFi密码等。In this embodiment, when the electronic device 100 needs to send a file to the first device, it may first establish a first communication connection with the first device, and then obtain the first password stored by the first device from the first device. Wherein, at this time, the electronic device 100 serves as a file sending device, and the first device serves as a file receiving device. Then, the electronic device 100 encrypts the second information according to the first password to obtain second encrypted information, and sends the second encrypted information to the first device through the first communication connection. The second information includes connection parameters of the electronic device 100 regarding the second communication connection. For example, if the second communication connection is a WiFi (Wireless Fidelity, wireless fidelity) connection, the second information may include WiFi. Name and WiFi password, etc.
其中,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值。所述第一预设值、第二预设值可以是根据实际需求设置。可选地,所述第一通信连接可以是,但不限于,基于具有低功耗、高扫描速度特点的BLE(Bluetooth Low Energy,蓝牙低功耗)、LTE Direct、NFC(Near Field Communication,近距离无线通讯技术)、iBeacon等的通信连接;所述第二通信连接可以是,但不限于,WiFi连接。Wherein, the power consumption of the first communication connection is lower than a first preset value, and the transmission speed of the second communication connection is higher than a second preset value. The first preset value and the second preset value may be set according to actual requirements. Optionally, the first communication connection may be, but not limited to, based on BLE (Bluetooth Low Energy, Bluetooth Low Energy), LTE Direct, NFC (Near Field Communication) with low power consumption and high scanning speed. Distance wireless communication technology), iBeacon, etc.; the second communication connection may be, but not limited to, a WiFi connection.
所述第一设备在通过所述第一通信连接接收到所述第一加密信息后,可根据所述第一密码对所述第一加密信息进行解密,获得包括第二通信连接的连接参数的第一信息。所述第一设备可根据该第二通信连接的连接参数,与所述电子设备100建立第二通信连接。可选地,所述第一设备可根据第二通信连接的连接参数,向所述电子设备100发送建立第二通信连接的连接请求,该连接请求中可以包括WiFi密码;所述电子设备100经过比对,确定该连接请求中的WiFi密码与自身的WiFi密码相同,然后建立与所述第一设备之间的第二通信连接。After receiving the first encrypted information through the first communication connection, the first device may decrypt the first encrypted information according to the first password to obtain a connection parameter that includes the second communication connection First information. The first device may establish a second communication connection with the electronic device 100 according to the connection parameters of the second communication connection. Optionally, the first device may send a connection request for establishing a second communication connection to the electronic device 100 according to the connection parameters of the second communication connection, and the connection request may include a WiFi password; the electronic device 100 passes through By comparison, it is determined that the WiFi password in the connection request is the same as its own WiFi password, and then a second communication connection with the first device is established.
可选地,在本实施例的一种实施方式中,所述第一密码与对第一加密信息进行解密时使用的密码是对称密码。也就是说,所述电子设备100使用第一密码对第一信息进行加密,获得第一加密信息;所述第一设备使用该第一密码对第一加密信息进行解密,获得第一信息。Optionally, in an implementation manner of this embodiment, the first password and the password used when decrypting the first encrypted information are symmetric passwords. That is, the electronic device 100 uses the first password to encrypt the first information to obtain the first encrypted information; the first device uses the first password to decrypt the first encrypted information to obtain the first information.
可选地,在本实施例的另一种实施方式中,所述第一密码为公钥,对第一加密信息进行解密时使用的密码为该公钥对应的私钥。也就是说,所述电子设备100从第一设备处获得该第一设备的公钥,然后利用该公钥对所述第一信息进行加密,并将加密得到的第一加密信息发送给所述第一设备,其中,所述电子设备100未从第一设备处获得与作为公钥的第一密码对应的私钥;所述第一设备则利用与作为公钥的第三密码对应的私钥对该第一加密信息进行解密,从而得到所述第一信息。Optionally, in another implementation manner of this embodiment, the first password is a public key, and the password used when decrypting the first encrypted information is the private key corresponding to the public key. That is, the electronic device 100 obtains the public key of the first device from the first device, then uses the public key to encrypt the first information, and sends the encrypted first encrypted information to the The first device, wherein the electronic device 100 does not obtain the private key corresponding to the first password as the public key from the first device; the first device uses the private key corresponding to the third password as the public key Decrypt the first encrypted information to obtain the first information.
可选地,在接收到所述第一加密信息后,所述第一设备可先显示一提示信息,用于提示用户是否接收文件。若所述第一设备接收到用户确认接收文件的操作,则可根据所述第二通信连接的连接参数与所述电子设备100建立所述第二通信连接。Optionally, after receiving the first encrypted information, the first device may first display a prompt message for prompting the user whether to receive the file. If the first device receives the user's confirmation to receive the file, it can establish the second communication connection with the electronic device 100 according to the connection parameters of the second communication connection.
在本实施例中,所述第一信息中还可以包括第二密码,该第二密码用于对后续传输的文件进行加密。可选地,所述第一信息中还可以包括待传输的目标文件的文件描述信息。所述第一设备在获得所述第一信息后,可显示该文件描述信息,以便用户确定是否接收文件。可选地,该文件描述信息可以包括,但不限于,目标文件的总数量(比如,10个文件)、目标文件的总大小(比如,10M)等。In this embodiment, the first information may also include a second password, and the second password is used to encrypt files to be subsequently transmitted. Optionally, the first information may also include file description information of the target file to be transferred. After obtaining the first information, the first device may display the file description information so that the user can determine whether to receive the file. Optionally, the file description information may include, but is not limited to, the total number of target files (for example, 10 files), the total size of target files (for example, 10M), and so on.
所述电子设备100可根据所述第二密码对第二信息进行加密,得到第二加密信息。其中,所述第二信息可以包括待发送的目标文件、待发送的目标文件的预览数据等。所述电子设备100在确定与所述第一设备建立第二通信连接后,可将所述第二加密信息通过所述第二通信连接发送给所述第一设备。所述第一设备在接收到所述第二加密信息后,根据所述第二密码对所述第二加密信息进行解密,从而得到第二信息。由此,可利用加密方式传输目标文件。The electronic device 100 may encrypt the second information according to the second password to obtain the second encrypted information. Wherein, the second information may include the target file to be sent, preview data of the target file to be sent, and the like. After determining that the electronic device 100 establishes a second communication connection with the first device, the electronic device 100 may send the second encrypted information to the first device through the second communication connection. After receiving the second encrypted information, the first device decrypts the second encrypted information according to the second password to obtain the second information. As a result, the target file can be transferred in an encrypted manner.
可选地,所述第二密码与对第二加密信息进行解密时使用的密码是对称密码。也就是说,所述电子设备100利用所述第二密码对第二信息进行加密,得到第二加密信息;所述第一设备利用所述第二密码对第二加密信息进行解密, 得到所述第二信息。Optionally, the second password and the password used when decrypting the second encrypted information are symmetric passwords. That is, the electronic device 100 uses the second password to encrypt the second information to obtain the second encrypted information; the first device uses the second password to decrypt the second encrypted information to obtain the Second information.
由此,可利用功耗较低的第一通信连接传输各种密码及第二通信连接的连接参数,利用传输速度较快的第二通信连接传输需要传输的文件,从而降低所述第一设备为建立第一通信连接消耗的功耗,并保证文件传输速度。由于对第二通信连接的连接参数及文件均进行了加密,因此,还可降低泄密的可能性。As a result, the first communication connection with lower power consumption can be used to transmit various passwords and connection parameters of the second communication connection, and the second communication connection with faster transmission speed can be used to transmit files that need to be transmitted, thereby reducing the first device. The power consumption to establish the first communication connection and ensure the file transfer speed. Since the connection parameters and files of the second communication connection are encrypted, the possibility of leakage can also be reduced.
在本实施例中,若所述第一通信连接为基于NFC的通信连接,在所述电子设备100与需要接收文件的设备靠近时,即可确定该设备为所述第一设备,并与该第一设备建立第一通信连接。In this embodiment, if the first communication connection is an NFC-based communication connection, when the electronic device 100 is close to a device that needs to receive files, it can be determined that the device is the first device and communicate with the The first device establishes a first communication connection.
在本实施例中,在所述第一通信连接为需要根据广播包建立的连接时,请参照图3,图3是图2中步骤S110包括的子步骤的流程示意图。步骤S110可以包括子步骤S111~子步骤S115。In this embodiment, when the first communication connection is a connection that needs to be established according to a broadcast packet, please refer to FIG. 3. FIG. 3 is a schematic flowchart of the sub-steps included in step S110 in FIG. 2. Step S110 may include sub-step S111 to sub-step S115.
子步骤S111,通过扫描获得至少一个广播包,并获得每个广播包的信号强度。In sub-step S111, at least one broadcast packet is obtained by scanning, and the signal strength of each broadcast packet is obtained.
在本实施例中,所述电子设备100可按照一定频率,进行对支持第一通信连接设备的扫描,从而获得至少一个广播包,并同时获得每个广播包的信号强度。该信号强度可以是RSSI(Received Signal Strength Indication,接收信号强度指示)。其中,所述第一通信连接对应的扫描速度高于第三预设值,第三预设值可根据实际需求设置,比如,第三预设值为所述第二通信连接对应的扫描速度。由此,可利用高扫描速度进行广播包扫描,利用高传输速度传输目标文件。In this embodiment, the electronic device 100 can scan for the device supporting the first communication connection according to a certain frequency, so as to obtain at least one broadcast packet and obtain the signal strength of each broadcast packet at the same time. The signal strength may be RSSI (Received Signal Strength Indication). Wherein, the scanning speed corresponding to the first communication connection is higher than a third preset value, and the third preset value can be set according to actual requirements. For example, the third preset value is the scanning speed corresponding to the second communication connection. As a result, broadcast packets can be scanned at a high scanning speed, and target files can be transferred at a high transmission speed.
支持第一通信连接的设备在开启第一通信连接功能后,会按照一定的频率发送关于第一通信连接的连接参数的广播包。第一通信连接的连接参数由实际的连接方式确定。比如,若所述第一通信连接为蓝牙连接,设备在开启蓝牙功能后,设备会按照一定频率发送BLE广播包,该BLE广播包中可以包括第一通信连接的连接参数,该第一通信连接的连接参数可以包括设备的MAC(Media Access Control,媒体访问控制)地址信息。After the device supporting the first communication connection starts the first communication connection function, it will send a broadcast packet about the connection parameters of the first communication connection at a certain frequency. The connection parameters of the first communication connection are determined by the actual connection mode. For example, if the first communication connection is a Bluetooth connection, after the device turns on the Bluetooth function, the device will send a BLE broadcast packet at a certain frequency. The BLE broadcast packet may include the connection parameters of the first communication connection. The connection parameters of may include MAC (Media Access Control, media access control) address information of the device.
子步骤S112,从所述至少一个广播包中筛选出服务标识为预设服务标识的备选广播包。In sub-step S112, a candidate broadcast package whose service identifier is a preset service identifier is screened out from the at least one broadcast package.
在本实施例中,在通过扫描获得广播包后,可将包括服务标识的每个广播包中的服务标识与所述预设服务标识进行比对,以判断包括服务标识的各广播包中的服务标识与所述预设服务标识是否相同。若相同,则将该广播包作为备选广播包。所述服务标识表示设备支持的某种服务,若服务不同,则服务标识不同。所述电子设备100中也可以包括该预设服务标识。In this embodiment, after the broadcast package is obtained by scanning, the service identifier in each broadcast package including the service identifier can be compared with the preset service identifier to determine whether the broadcast package includes the service identifier. Whether the service identifier is the same as the preset service identifier. If they are the same, use the broadcast packet as a candidate broadcast packet. The service identifier indicates a certain service supported by the device. If the service is different, the service identifier is different. The electronic device 100 may also include the preset service identifier.
其中,所述备选广播包中还可以包括被扫描设备的设备标识、设备名称、第一通信连接的连接参数。所述设备标识表示该电子设备100的唯一标识,可通过GUID(Globally Unique Identifier,全局统一标识符)算法生成;所述设备名称可以是用户设置的名称。Wherein, the candidate broadcast package may also include the device identification, device name, and connection parameters of the first communication connection of the scanned device. The device identifier represents the unique identifier of the electronic device 100, and may be generated by a GUID (Globally Unique Identifier) algorithm; the device name may be a name set by a user.
子步骤S113,按照每个备选广播包的信号强度,对筛选出的备选广播包对应的设备名称进行排序,得到扫描列表。Sub-step S113, according to the signal strength of each candidate broadcast packet, sort the device names corresponding to the selected candidate broadcast packets to obtain a scan list.
子步骤S114,显示所述扫描列表,并将与接收到的选择操作对应的被扫描设备作为所述第一设备。In sub-step S114, the scan list is displayed, and the scanned device corresponding to the received selection operation is taken as the first device.
在确定备选广播包后,按照每个备选广播包对应的信号强度,对经筛选得到的每个备选广播包对应的设备名称进行排序,从而得到扫描列表。其中,若扫描列表中包括相同的设备名称,则该相同的设备名称对应的设备标识不同。接着,对该扫描列表中进行显示,以便用户根据所述扫描列表确定某个被扫描设备作为第一设备。可选地,所述扫描列表中的设备名称可以按照信号强度由大到小的顺序排列,由此,可将用户最有可能确定作为第一设备的被扫描设备的设备名称展示在最优先的位置,从而便于用户快速选出所述第一设备。After the candidate broadcast packages are determined, the device names corresponding to each candidate broadcast package obtained after screening are sorted according to the signal strength corresponding to each candidate broadcast package, thereby obtaining a scan list. Wherein, if the same device name is included in the scan list, the device identifiers corresponding to the same device name are different. Then, the scan list is displayed, so that the user can determine a certain scanned device as the first device according to the scan list. Optionally, the device names in the scan list can be arranged in descending order of signal strength, so that the device name of the scanned device that is most likely to be determined by the user as the first device can be displayed in the highest priority. Location, so that the user can quickly select the first device.
子步骤S115,根据所述第一设备的广播包中的第一通信连接的连接参数,与所述第一设备建立第一通信连接。Sub-step S115, establishing a first communication connection with the first device according to the connection parameters of the first communication connection in the broadcast packet of the first device.
在本实施例中,若在得到扫描列表后,仍在继续扫描,则可根据新得到的广播包判断是否对已得到的扫描列表进行更新。若需要更新,则根据新得到的广播包及对应的信号强度对已得到的扫描列表进行更新。In this embodiment, if the scan continues after the scan list is obtained, it can be determined whether to update the scan list that has been obtained according to the newly obtained broadcast packet. If it needs to be updated, the scan list that has been obtained is updated according to the newly obtained broadcast packet and the corresponding signal strength.
在得到一个新的广播包时,可首先判断该新的广播包中是否包括服务标识以及包括的服务标识是否为所述预设服务标识。若该新的广播包中不包括服务标识,或该新的广播包中的服务标识不是所述预设服务标识,则确定不存在新增的被扫描设备,不需要对已得到的扫描列表进行更新。When a new broadcast package is obtained, it may first be determined whether the new broadcast package includes a service identifier and whether the included service identifier is the preset service identifier. If the new broadcast package does not include the service identifier, or the service identifier in the new broadcast package is not the preset service identifier, it is determined that there is no newly-added scanned device, and there is no need to perform a scan on the obtained scan list. renew.
若该新的广播包中的服务标识是所述预设服务标识,则判断该新的广播包中包括的设备标识是否为已得到的扫描列表中的设备名称对应的设备标识。若是,则确定不存在新增的被扫描设备,不需要对已得到的扫描列表进行更新。If the service identifier in the new broadcast package is the preset service identifier, it is determined whether the device identifier included in the new broadcast package is the device identifier corresponding to the device name in the obtained scan list. If it is, it is determined that there is no newly-added scanned device, and the obtained scan list does not need to be updated.
若不是,则确定存在新增的被扫描设备,可按照该新增的被扫描设备对应的信号强度,将该新增的被扫描设备的设备名称添加至已得到的扫描列表中。比如,已得到的扫描列表中的设备名称按照信号强度由大到小排序,假设已得到的扫描列表包括的内容如下:设备1、设备2、设备3;若新增的被扫描设备4对应的信号强度,在设备1、设备2的信号强度之间,则可将被扫描设备4的设备名称记录在设备1、设备2之间,并不对原有的排序进行修改,从而得到设备名称排序为设备1、设备4、设备2、设备3的扫描列表。If not, it is determined that there is a newly-added scanned device, and the device name of the newly-added scanned device can be added to the obtained scan list according to the signal strength corresponding to the newly-added scanned device. For example, the device names in the obtained scan list are sorted according to the signal strength from largest to smallest. Suppose the obtained scan list includes the following content: device 1, device 2, device 3; if the newly-added scanned device 4 corresponds to The signal strength is between the signal strengths of device 1 and device 2, and the device name of the scanned device 4 can be recorded between device 1 and device 2, without modifying the original order, so that the device name order is Scan list of device 1, device 4, device 2, and device 3.
若所述扫描列表中包括连续预设次数未被扫描到的被扫描设备的设备名称,则将连续预设次数未被扫描到的被扫描设备的设备名称从所述扫描列表中删除。由此,可避免扫描列表中包括无用的设备名称。其中,所述预设次数可以根据实际需求设置,比如,设置为3次。If the scan list includes the device name of the scanned device that has not been scanned for the preset number of consecutive times, the device name of the scanned device that has not been scanned for the preset number of consecutive times is deleted from the scan list. This prevents useless device names from being included in the scan list. Wherein, the preset number of times can be set according to actual needs, for example, set to 3 times.
请参照图4,图4是本申请实施例提供的文件传输方法的流程示意图之二。所述方法还可以包括步骤S150~步骤S190。Please refer to FIG. 4, which is a second schematic flowchart of a file transmission method provided by an embodiment of the present application. The method may further include step S150 to step S190.
步骤S150,发送广播包。In step S150, the broadcast packet is sent.
在本实施例中,在所述电子设备100作为文件接收设备、所述第二设备作为文件发送设备时,所述电子设备100可在开启第一通信连接的功能后,按照一定频率发送广播包。其中,所述广播包中可以包括服务标识、设备标识、第一通信连接的连接参数。该广播包中的服务标识可以为预设服务标识。可选地,所述广播包中还可以包括设备名称。第一通信连接的功耗低于第一预设值,由此,可保证作为文件接收设备的电子设备100发送广播包所使用的功耗低,从而降低所述电子设备100为建立所述第一通信连接所使用的功耗。也就是说, 该方式可降低所述电子设备100为维持被第二设备发现的状态的所使用的功耗。In this embodiment, when the electronic device 100 is used as a file receiving device and the second device is used as a file sending device, the electronic device 100 may send broadcast packets at a certain frequency after enabling the function of the first communication connection . Wherein, the broadcast package may include a service identifier, a device identifier, and connection parameters of the first communication connection. The service identifier in the broadcast package may be a preset service identifier. Optionally, the broadcast package may also include the device name. The power consumption of the first communication connection is lower than the first preset value, thereby ensuring that the electronic device 100 as a file receiving device uses low power consumption for sending broadcast packets, thereby reducing the need for the electronic device 100 to establish the first communication connection. Power consumption used by a communication connection. In other words, this method can reduce the power consumption of the electronic device 100 to maintain the state discovered by the second device.
步骤S160,当接收到第二设备根据所述第一通信连接的连接参数发送的连接请求时,与所述第二设备建立第一通信连接,以使所述第二设备通过所述第一通信连接获取所述电子设备100存储的第三密码。Step S160: When a connection request sent by the second device according to the connection parameters of the first communication connection is received, establish a first communication connection with the second device, so that the second device can pass through the first communication The third password stored in the electronic device 100 is obtained by connecting.
步骤S170,在接收到所述第二设备通过所述第一通信连接发送的根据所述第三密码对所述第三信息加密得到的第三加密信息后,根据所述第三密码对所述第三加密信息进行解密,获得所述第三加密信息中的第三信息,并提示用户是否接收文件。Step S170: After receiving the third encrypted information obtained by encrypting the third information according to the third password and sent by the second device through the first communication connection, perform the The third encrypted information is decrypted, the third information in the third encrypted information is obtained, and the user is prompted whether to receive the file.
可选地,在本实施例的一种实施方式中,所述第三密码与对第三加密信息进行解密时使用的密码是对称密码。在本实施例的另一种实施方式中,所述第三密码为公钥,也就是说,所述第三加密信息由所述第二设备利用作为公钥的所述第三密码对所述第三信息加密得到,此时所述电子设备100可根据与所述第三密码对应的私钥对所述第三加密信息进行解密,从而获得所述第三信息。所述电子设备100中可预先存储采用公开加密技术的数字证书,并将该数字证书的公钥作为所述第三密码。其中,所述第三信息可以包括第四密码、第二通信连接的连接参数。可选地,所述第三信息还可以包括待传输的目标文件的文件描述信息。Optionally, in an implementation manner of this embodiment, the third password and the password used when decrypting the third encrypted information are symmetric passwords. In another implementation manner of this embodiment, the third password is a public key, that is to say, the third encrypted information is used by the second device to pair the third password as the public key. The third information is encrypted and obtained. At this time, the electronic device 100 can decrypt the third encrypted information according to the private key corresponding to the third password, so as to obtain the third information. The electronic device 100 may pre-store a digital certificate using a public encryption technology, and use the public key of the digital certificate as the third password. Wherein, the third information may include a fourth password and connection parameters of the second communication connection. Optionally, the third information may also include file description information of the target file to be transferred.
步骤S180,若接收到用户确认接收文件的操作,则根据所述第二通信连接的连接参数与所述第二设备建立第二通信连接。Step S180: If the user confirms the file reception operation, establish a second communication connection with the second device according to the connection parameters of the second communication connection.
步骤S190,接收所述第二设备通过所述第二通信连接发送的根据所述第四密码对第四信息进行加密得到的第四加密信息,并根据所述第四密码对所述第四加密信息进行解密,以得到所述第四信息中的目标文件。Step S190: Receive fourth encrypted information obtained by encrypting fourth information according to the fourth password sent by the second device through the second communication connection, and encrypt the fourth information according to the fourth password The information is decrypted to obtain the target file in the fourth information.
关于步骤S150~步骤S190的描述,可参照上文对步骤S110~步骤S130的具体描述,在此不再赘述。For the description of step S150 to step S190, please refer to the specific description of step S110 to step S130 above, which will not be repeated here.
请参照图5,图5是本申请实施例提供的文件传输方法的流程示意图之三。所述方法应用于发送设备及接收设备。下面对应用于发送设备及接收设备的文件传输方法的流程进行阐述。Please refer to FIG. 5. FIG. 5 is the third flowchart of the file transmission method provided by the embodiment of the present application. The method is applied to sending equipment and receiving equipment. The following describes the flow of the file transmission method for the sending device and the receiving device.
步骤S210,所述发送设备与所述接收设备建立第一通信连接,并通过所述第一通信连接获取所述接收设备存储的第一密码。Step S210: The sending device establishes a first communication connection with the receiving device, and obtains a first password stored by the receiving device through the first communication connection.
步骤S220,所述发送设备根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述接收设备。Step S220: The sending device encrypts the first information according to the first password to obtain first encrypted information, and sends the first encrypted information to the receiving device through the first communication connection.
其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值。Wherein, the first information includes a second password and connection parameters of a second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission speed of the second communication connection is higher than that of the second communication connection. default value.
步骤S230,所述接收设备根据所述第二通信连接的连接参数与所述发送设备建立第二通信连接。Step S230: The receiving device establishes a second communication connection with the sending device according to the connection parameters of the second communication connection.
步骤S240,所述发送设备根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述接收设备,以使所述接收设备在根据所述第二密码对所述第二加密信息解密后得到所 述第二信息中的目标文件。Step S240: The sending device encrypts the second information according to the second password to obtain second encrypted information, and sends the second encrypted information to the receiving device through the second communication connection, so that The receiving device obtains the target file in the second information after decrypting the second encrypted information according to the second password.
关于应用于发送设备及接收设备的文件传输方法的描述,可参照上文对应用于电子设备100的文件传输方法的具体描述,在此不再赘述。Regarding the description of the file transmission method applied to the sending device and the receiving device, reference may be made to the specific description of the file transmission method corresponding to the electronic device 100 above, which will not be repeated here.
为了执行上述实施例及各个可能的方式中的相应步骤,下面给出一种文件传输装置200的实现方式,可选地,该文件传输装置200可以采用上述图1所示的电子设备100的器件结构。进一步地,请参照图6,图6是本申请实施例提供的文件传输装置200的方框示意之一。所述文件传输装置200应用于所述电子设备100。需要说明的是,本实施例所提供的文件传输装置200,其基本原理及产生的技术效果和上述实施例相同,为简要描述,本实施例部分未提及之处,可参考上述的实施例中相应内容。该文件传输装置200可以包括:第一通信模块210、第一加密模块220、第二加密模块230。In order to perform the corresponding steps in the above-mentioned embodiments and each possible manner, an implementation manner of the file transmission apparatus 200 is given below. Optionally, the file transmission apparatus 200 may use the components of the electronic device 100 shown in FIG. 1 structure. Further, please refer to FIG. 6, which is one of the block diagrams of the file transmission apparatus 200 provided in an embodiment of the present application. The file transmission apparatus 200 is applied to the electronic device 100. It should be noted that the basic principles and technical effects of the file transmission device 200 provided in this embodiment are the same as those of the above-mentioned embodiment. For a brief description, for parts not mentioned in this embodiment, please refer to the above-mentioned embodiment. In the corresponding content. The file transmission device 200 may include: a first communication module 210, a first encryption module 220, and a second encryption module 230.
所述第一通信模块210,用于与第一设备建立第一通信连接,并通过所述第一通信连接获取所述第一设备存储的第一密码。The first communication module 210 is configured to establish a first communication connection with a first device, and obtain a first password stored by the first device through the first communication connection.
所述第一加密模块220,用于根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述第一设备,以与所述第一设备建立第二通信连接。其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值。The first encryption module 220 is configured to encrypt first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first encrypted information through the first communication connection. Device to establish a second communication connection with the first device. Wherein, the first information includes a second password and connection parameters of a second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission speed of the second communication connection is higher than that of the second communication connection. default value.
所述第二加密模块230,用于根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述第一设备,以使所述第一设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。The second encryption module 230 is configured to encrypt second information according to the second password to obtain second encrypted information, and send the second encrypted information to the first through the second communication connection. Device, so that the first device obtains the target file in the second information after decrypting the second encrypted information according to the second password.
请参照图7,图7是本申请实施例提供的文件传输装置200的方框示意图之二。所述文件传输装置200还可以包括:广播模块250、第二通信模块260、第一解密模块270、第二解密模块280。Please refer to FIG. 7. FIG. 7 is the second block diagram of the file transmission apparatus 200 provided by an embodiment of the present application. The file transmission device 200 may further include: a broadcasting module 250, a second communication module 260, a first decryption module 270, and a second decryption module 280.
所述广播模块250,用于发送广播包。其中,所述广播包中包括服务标识、设备标识、第一通信连接的连接参数。The broadcast module 250 is used to send broadcast packets. Wherein, the broadcast package includes a service identifier, a device identifier, and connection parameters of the first communication connection.
所述第二通信模块260,用于当接收到第二设备根据所述第一通信连接的连接参数发送的连接请求时,与所述第二设备建立第一通信连接,以使所述第二设备通过所述第一通信连接获取所述电子设备100存储的第三密码。The second communication module 260 is configured to establish a first communication connection with the second device when receiving a connection request sent by the second device according to the connection parameters of the first communication connection, so that the second device The device obtains the third password stored by the electronic device 100 through the first communication connection.
所述第一解密模块270,用于在接收到所述第二设备通过所述第一通信连接发送的第三加密信息后,根据所述第三密码对所述第三加密信息进行解密,获得所述第三加密信息中的第三信息,并提示用户是否接收文件。其中,所述第三信息包括第四密码及第二通信连接的连接参数。The first decryption module 270 is configured to decrypt the third encrypted information according to the third password after receiving the third encrypted information sent by the second device through the first communication connection to obtain The third information in the third encrypted information, and prompts the user whether to receive the file. Wherein, the third information includes a fourth password and connection parameters of the second communication connection.
所述第二通信模块260,还用于在接收到用户确认接收文件的操作时,根据所述第二通信连接的连接参数与所述第二设备建立第二通信连接。The second communication module 260 is further configured to establish a second communication connection with the second device according to the connection parameters of the second communication connection when receiving the user's confirmation to receive the file.
所述第二解密模块280,用于接收所述第二设备通过所述第二通信连接发送的根据所述第四密码对第四信息进行加密得到的第四加密信息,并根据所述第四密码对所述第四加密信息进行解密,以得到所述第四信息中的目标文件。The second decryption module 280 is configured to receive fourth encrypted information obtained by encrypting fourth information according to the fourth password sent by the second device through the second communication connection, and according to the fourth The password decrypts the fourth encrypted information to obtain the target file in the fourth information.
可选地,上述模块可以软件或固件(Firmware)的形式存储于图1所示的存 储器110中或固化于该电子设备100的操作系统(Operating System,OS)中,并可由图1中的处理器120执行。同时,执行上述模块所需的数据、程序的代码等可以存储在存储器110中。Optionally, the above-mentioned modules can be stored in the memory 110 shown in FIG. 1 in the form of software or firmware (Firmware) or solidified in the operating system (OS) of the electronic device 100, and can be processed by the processing shown in FIG. 1器120 executes. At the same time, data, program codes, etc. required to execute the above-mentioned modules may be stored in the memory 110.
本申请实施例还提供一种可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现项所述的文件传输方法。The embodiment of the present application also provides a readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the file transmission method described in the item is implemented.
综上所述,本申请实施例提供一种文件传输方法、装置、电子设备及可读存储介质。首先与第一设备建立第一通信连接,然后通过该第一通信连接获取第一设备存储的第一密码。接着根据该第一密码对包括第二密码、第二通信连接的连接参数的第一信息进行加密,得到第一加密信息,并将该第一加密信息通过第一通信连接发送给第一设备,以与第一设备建立第二通信连接。其中,第一通信连接的功耗低于第一预设值,第二通信连接的传输速度高于第二预设值。最后根据第二密码对包括目标文件的第二信息进行加密,得到第二加密信息,并将第二加密信息通过第二通信连接发送给第一设备,以使第一设备在根据第二密码对第二加密信息解密后得到目标文件。由此,可通过功耗比较低的第一通信连接传输各种密码及第二通信连接参数,并通过传输速度比较高的第二通信连接传输加密后的目标文件,从而降低信息泄露的可能性,并保证目标文件的传输效率。In summary, the embodiments of the present application provide a file transmission method, device, electronic device, and readable storage medium. First, establish a first communication connection with the first device, and then obtain the first password stored by the first device through the first communication connection. Then encrypt the first information including the second password and the connection parameters of the second communication connection according to the first password to obtain the first encrypted information, and send the first encrypted information to the first device through the first communication connection, To establish a second communication connection with the first device. Wherein, the power consumption of the first communication connection is lower than the first preset value, and the transmission speed of the second communication connection is higher than the second preset value. Finally, the second information including the target file is encrypted according to the second password to obtain the second encrypted information, and the second encrypted information is sent to the first device through the second communication connection, so that the first device can pair according to the second password After the second encrypted information is decrypted, the target file is obtained. As a result, various passwords and second communication connection parameters can be transmitted through the first communication connection with relatively low power consumption, and the encrypted target file can be transmitted through the second communication connection with relatively high transmission speed, thereby reducing the possibility of information leakage , And ensure the transmission efficiency of the target file.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本申请的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the several embodiments provided in this application, it should be understood that the disclosed device and method may also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architectures, functions, and functions of the devices, methods, and computer program products according to multiple embodiments of the present application. operate. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or part of the code, and the module, program segment, or part of the code contains one or more functions for realizing the specified logical function. Executable instructions. It should also be noted that in some alternative implementations, the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two consecutive blocks can actually be executed in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions.
另外,在本申请各个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的 介质。If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of the application, and are not intended to limit the application. For those skilled in the art, the application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection scope of this application.
Claims (20)
- 一种文件传输方法,其特征在于,应用于电子设备,所述方法包括:A file transmission method, characterized in that it is applied to an electronic device, and the method includes:与第一设备建立第一通信连接,并通过所述第一通信连接获取所述第一设备存储的第一密码;Establish a first communication connection with the first device, and obtain the first password stored by the first device through the first communication connection;根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述第一设备,以与所述第一设备建立第二通信连接,其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值;Encrypt the first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first device through the first communication connection to establish a connection with the first device A second communication connection, wherein the first information includes a second password and connection parameters of the second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission of the second communication connection The speed is higher than the second preset value;根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述第一设备,以使所述第一设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。The second information is encrypted according to the second password to obtain second encrypted information, and the second encrypted information is sent to the first device through the second communication connection, so that the first device is After decrypting the second encrypted information according to the second password, the target file in the second information is obtained.
- 根据权利要求1所述的方法,其特征在于,所述与第一设备建立第一通信连接,包括:The method according to claim 1, wherein the establishing a first communication connection with the first device comprises:通过扫描获得至少一个广播包,并获得每个广播包的信号强度,其中,所述第一通信连接对应的扫描速度高于第三预设值;At least one broadcast packet is obtained by scanning, and the signal strength of each broadcast packet is obtained, wherein the scanning speed corresponding to the first communication connection is higher than the third preset value;从所述至少一个广播包中筛选出服务标识为预设服务标识的备选广播包,其中,所述备选广播包中包括被扫描设备的服务标识、设备标识、设备名称、第一通信连接的连接参数;A candidate broadcast package whose service identifier is a preset service identifier is filtered from the at least one broadcast package, where the candidate broadcast package includes the service identifier, device identifier, device name, and first communication connection of the scanned device The connection parameters;按照每个备选广播包的信号强度,对筛选出的备选广播包对应的设备名称进行排序,得到扫描列表;According to the signal strength of each candidate broadcast package, sort the device names corresponding to the selected candidate broadcast packages to obtain a scan list;显示所述扫描列表,并将与接收到的选择操作对应的被扫描设备作为所述第一设备;Display the scan list, and use the scanned device corresponding to the received selection operation as the first device;根据所述第一设备的广播包中的第一通信连接的连接参数,与所述第一设备建立第一通信连接。Establish a first communication connection with the first device according to the connection parameters of the first communication connection in the broadcast packet of the first device.
- 根据权利要求2所述的方法,其特征在于,所述与第一设备建立第一通信连接,还包括:The method according to claim 2, wherein the establishing a first communication connection with the first device further comprises:在继续扫描得到新的广播包时,判断是否存在新增的被扫描设备,并判断所述扫描列表中是否包括连续预设次数未被扫描到的被扫描设备的设备名称,其中,新增的被扫描设备的广播包中包括所述预设服务标识;When continuing to scan for new broadcast packets, determine whether there is a newly-added scanned device, and determine whether the scan list includes the device name of the scanned device that has not been scanned for a preset number of consecutive times. Among them, the newly-added The broadcast packet of the scanned device includes the preset service identifier;若存在新增的被扫描设备,则按照新增的被扫描设备对应的信号强度,将新增的被扫描设备的设备名称添加至所述扫描列表中;If there is a newly-added scanned device, add the device name of the newly-added scanned device to the scan list according to the signal strength corresponding to the newly-added scanned device;若所述扫描列表中包括连续预设次数未被扫描到的被扫描设备的设备名称,则将连续预设次数未被扫描到的被扫描设备的设备名称从所述扫描列表中删除。If the scan list includes the device name of the scanned device that has not been scanned for the preset number of consecutive times, the device name of the scanned device that has not been scanned for the preset number of consecutive times is deleted from the scan list.
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:发送广播包,其中,所述广播包中包括服务标识、设备标识、第一通信连接的连接参数;Sending a broadcast packet, where the broadcast packet includes a service identifier, a device identifier, and connection parameters of the first communication connection;当接收到第二设备根据所述第一通信连接的连接参数发送的连接请求时,与所述第二设备建立第一通信连接,以使所述第二设备通过所述第一通信连接获取所述电子设备存储的第三密码;When a connection request sent by the second device according to the connection parameters of the first communication connection is received, a first communication connection is established with the second device, so that the second device obtains all data through the first communication connection. The third password stored in the electronic device;在接收到所述第二设备通过所述第一通信连接发送的根据所述第三密码对所述第三信息加密得到的第三加密信息后,根据所述第三密码对所述第三加密信息进行解密,获得所述第三加密信息中的第三信息,并提示用户是否接收文件,其中,所述第三信息包括第四密码及第二通信连接的连接参数;After receiving the third encrypted information obtained by encrypting the third information according to the third password from the second device through the first communication connection, encrypt the third information according to the third password Information is decrypted, the third information in the third encrypted information is obtained, and the user is prompted whether to receive the file, where the third information includes the fourth password and the connection parameters of the second communication connection;若接收到用户确认接收文件的操作,则根据所述第二通信连接的连接参数与所述第二设备建立第二通信连接;If the user's confirmation of receiving the file is received, establishing a second communication connection with the second device according to the connection parameters of the second communication connection;接收所述第二设备通过所述第二通信连接发送的根据所述第四密码对第四信息进行加密得到的第四加密信息,并根据所述第四密码对所述第四加密信息进行解密,以得到所述第四信息中的目标文件。Receive fourth encrypted information obtained by encrypting fourth information according to the fourth password sent by the second device through the second communication connection, and decrypt the fourth encrypted information according to the fourth password , To obtain the target file in the fourth information.
- 根据权利要求4所述的方法,其特征在于,所述第三密码为公钥,所述第三加密信息由所述第二设备利用作为公钥的所述第三密码对所述第三信息加密得到,所述根据所述第三密码对所述第三加密信息进行解密,包括:The method according to claim 4, wherein the third password is a public key, and the third encrypted information is compared to the third information by the second device using the third password as the public key. Obtained by encryption, and decrypting the third encrypted information according to the third password includes:根据与所述第三密码对应的私钥对所述第三加密信息进行解密。Decrypt the third encrypted information according to the private key corresponding to the third password.
- 一种文件传输方法,其特征在于,应用于发送设备及接收设备,所述方法包括:A file transmission method, characterized in that it is applied to a sending device and a receiving device, and the method includes:所述发送设备与所述接收设备建立第一通信连接,并通过所述第一通信连接获取所述接收设备存储的第一密码;Establishing a first communication connection between the sending device and the receiving device, and obtaining the first password stored by the receiving device through the first communication connection;所述发送设备根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述接收设备,其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值;The sending device encrypts the first information according to the first password to obtain the first encrypted information, and sends the first encrypted information to the receiving device through the first communication connection, wherein the first One piece of information includes a second password and connection parameters of a second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission speed of the second communication connection is higher than a second preset value;所述接收设备根据所述第二通信连接的连接参数与所述发送设备建立第二通信连接;The receiving device establishes a second communication connection with the sending device according to the connection parameters of the second communication connection;所述发送设备根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述接收设备,以使所述接收设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。The sending device encrypts the second information according to the second password to obtain second encrypted information, and sends the second encrypted information to the receiving device through the second communication connection, so that the receiving device The device obtains the target file in the second information after decrypting the second encrypted information according to the second password.
- 根据权利要求6所述的方法,其特征在于,所述发送设备与所述接收设备建立第一通信连接,包括:The method according to claim 6, wherein the establishing a first communication connection between the sending device and the receiving device comprises:所述发送设备通过扫描获得至少一个广播包,并获得每个广播包的信号强度,其中,所述第一通信连接对应的扫描速度高于第三预设值;The sending device obtains at least one broadcast packet through scanning, and obtains the signal strength of each broadcast packet, wherein the scanning speed corresponding to the first communication connection is higher than a third preset value;所述发送设备从所述至少一个广播包中筛选出服务标识为预设服务标识的备选广播包,其中,所述备选广播包中包括被扫描设备的服务标识、设备标识、设备名称、第一通信连接的连接参数;The sending device filters out candidate broadcast packages whose service identifiers are preset service identifiers from the at least one broadcast package, where the candidate broadcast packages include the service identifier, device identifier, device name, and device name of the scanned device. Connection parameters of the first communication connection;所述发送设备按照每个备选广播包的信号强度,对筛选出的备选广播包对应的设备名称进行排序,得到扫描列表;The sending device sorts the device names corresponding to the selected candidate broadcast packets according to the signal strength of each candidate broadcast packet to obtain a scan list;所述发送设备显示所述扫描列表,并将与接收到的选择操作对应的被扫描 设备作为所述接收设备;The sending device displays the scan list, and uses the scanned device corresponding to the received selection operation as the receiving device;所述发送设备根据所述接收设备的广播包中的第一通信连接的连接参数,与所述接收设备建立第一通信连接。The sending device establishes a first communication connection with the receiving device according to the connection parameters of the first communication connection in the broadcast packet of the receiving device.
- 根据权利要求7所述的方法,其特征在于,所述发送设备与所述接收设备建立第一通信连接,还包括:The method according to claim 7, wherein the establishment of the first communication connection between the sending device and the receiving device further comprises:所述发送设备在继续扫描得到新的广播包时,判断是否存在新增的被扫描设备,并判断所述扫描列表中是否包括连续预设次数未被扫描到的被扫描设备的设备名称,其中,新增的被扫描设备的广播包中包括所述预设服务标识;When the sending device continues to scan for new broadcast packets, it determines whether there is a newly-added scanned device, and determines whether the scan list includes the device name of the scanned device that has not been scanned for a preset number of consecutive times, where , The newly-added broadcast packet of the scanned device includes the preset service identifier;若所述发送设备存在新增的被扫描设备,则按照新增的被扫描设备对应的信号强度,将新增的被扫描设备的设备名称添加至所述扫描列表中;If there is a newly-added scanned device in the sending device, add the device name of the newly-added scanned device to the scan list according to the signal strength corresponding to the newly-added scanned device;若所述扫描列表中包括连续预设次数未被扫描到的被扫描设备的设备名称,则所述发送设备将连续预设次数未被扫描到的被扫描设备的设备名称从所述扫描列表中删除。If the scan list includes the device name of the scanned device that has not been scanned for the preset number of consecutive times, the sending device removes the device name of the scanned device that has not been scanned for the preset number of consecutive times from the scan list delete.
- 一种文件传输装置,其特征在于,应用于电子设备,所述装置包括:A file transmission device, characterized in that it is applied to electronic equipment, and the device includes:第一通信模块,用于与第一设备建立第一通信连接,并通过所述第一通信连接获取所述第一设备存储的第一密码;The first communication module is configured to establish a first communication connection with a first device, and obtain the first password stored by the first device through the first communication connection;第一加密模块,用于根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述第一设备,以与所述第一设备建立第二通信连接,其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值;The first encryption module is configured to encrypt first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first device through the first communication connection to Establish a second communication connection with the first device, wherein the first information includes a second password and connection parameters of the second communication connection, and the power consumption of the first communication connection is lower than a first preset value, so The transmission speed of the second communication connection is higher than the second preset value;第二加密模块,用于根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述第一设备,以使所述第一设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。The second encryption module is configured to encrypt second information according to the second password to obtain second encrypted information, and send the second encrypted information to the first device through the second communication connection to Enabling the first device to obtain the target file in the second information after decrypting the second encrypted information according to the second password.
- 根据权利要求9所述的装置,其特征在于,所述装置还包括:The device according to claim 9, wherein the device further comprises:广播模块,用于发送广播包,其中,所述广播包中包括服务标识、设备标识、第一通信连接的连接参数;The broadcast module is used to send a broadcast packet, where the broadcast packet includes a service identifier, a device identifier, and connection parameters of the first communication connection;第二通信模块,用于当接收到第二设备根据所述第一通信连接的连接参数发送的连接请求时,与所述第二设备建立第一通信连接,以使所述第二设备通过所述第一通信连接获取所述电子设备存储的第三密码;The second communication module is configured to establish a first communication connection with the second device when a connection request sent by the second device according to the connection parameters of the first communication connection is received, so that the second device can pass through all the connections. Acquiring the third password stored by the electronic device through the first communication connection;第一解密模块,用于在接收到所述第二设备通过所述第一通信连接发送的根据所述第三密码对所述第三信息加密得到的第三加密信息后,根据所述第三密码对所述第三加密信息进行解密,获得所述第三加密信息中的第三信息,并提示用户是否接收文件,其中,所述第三信息包括第四密码及第二通信连接的连接参数;The first decryption module is configured to, after receiving the third encrypted information obtained by encrypting the third information according to the third password and sent by the second device through the first communication connection, according to the third The password decrypts the third encrypted information, obtains the third information in the third encrypted information, and prompts the user whether to receive the file, wherein the third information includes the fourth password and the connection parameters of the second communication connection ;所述第二通信模块,还用于在接收到用户确认接收文件的操作时,根据所述第二通信连接的连接参数与所述第二设备建立第二通信连接;The second communication module is further configured to establish a second communication connection with the second device according to the connection parameters of the second communication connection when receiving the user's confirmation to receive the file;第二解密模块,用于接收所述第二设备通过所述第二通信连接发送的根据所述第四密码对第四信息进行加密得到的第四加密信息,并根据所述第四密码 对所述第四加密信息进行解密,以得到所述第四信息中的目标文件。The second decryption module is configured to receive the fourth encrypted information obtained by encrypting the fourth information according to the fourth password sent by the second device through the second communication connection, and verify the information obtained by encrypting the fourth information according to the fourth password. The fourth encrypted information is decrypted to obtain the target file in the fourth information.
- 一种电子设备,其特征在于,包括处理器和存储器,所述存储器存储有能够被所述处理器执行的机器可执行指令,所述处理器可执行所述机器可执行指令以实现文件传输方法,所述方法包括:An electronic device, characterized by comprising a processor and a memory, the memory storing machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement a file transmission method , The method includes:与第一设备建立第一通信连接,并通过所述第一通信连接获取所述第一设备存储的第一密码;Establish a first communication connection with the first device, and obtain the first password stored by the first device through the first communication connection;根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述第一设备,以与所述第一设备建立第二通信连接,其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值;Encrypt the first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first device through the first communication connection to establish a connection with the first device A second communication connection, wherein the first information includes a second password and connection parameters of the second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission of the second communication connection The speed is higher than the second preset value;根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述第一设备,以使所述第一设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。The second information is encrypted according to the second password to obtain second encrypted information, and the second encrypted information is sent to the first device through the second communication connection, so that the first device is After decrypting the second encrypted information according to the second password, the target file in the second information is obtained.
- 根据权利要求11所述的电子设备,其特征在于,所述与第一设备建立第一通信连接,包括:The electronic device according to claim 11, wherein the establishing a first communication connection with the first device comprises:通过扫描获得至少一个广播包,并获得每个广播包的信号强度,其中,所述第一通信连接对应的扫描速度高于第三预设值;At least one broadcast packet is obtained by scanning, and the signal strength of each broadcast packet is obtained, wherein the scanning speed corresponding to the first communication connection is higher than the third preset value;从所述至少一个广播包中筛选出服务标识为预设服务标识的备选广播包,其中,所述备选广播包中包括被扫描设备的服务标识、设备标识、设备名称、第一通信连接的连接参数;A candidate broadcast package whose service identifier is a preset service identifier is filtered from the at least one broadcast package, where the candidate broadcast package includes the service identifier, device identifier, device name, and first communication connection of the scanned device The connection parameters;按照每个备选广播包的信号强度,对筛选出的备选广播包对应的设备名称进行排序,得到扫描列表;According to the signal strength of each candidate broadcast package, sort the device names corresponding to the selected candidate broadcast packages to obtain a scan list;显示所述扫描列表,并将与接收到的选择操作对应的被扫描设备作为所述第一设备;Display the scan list, and use the scanned device corresponding to the received selection operation as the first device;根据所述第一设备的广播包中的第一通信连接的连接参数,与所述第一设备建立第一通信连接。Establish a first communication connection with the first device according to the connection parameters of the first communication connection in the broadcast packet of the first device.
- 根据权利要求12所述的电子设备,其特征在于,所述与第一设备建立第一通信连接,还包括:The electronic device according to claim 12, wherein the establishing a first communication connection with the first device further comprises:在继续扫描得到新的广播包时,判断是否存在新增的被扫描设备,并判断所述扫描列表中是否包括连续预设次数未被扫描到的被扫描设备的设备名称,其中,新增的被扫描设备的广播包中包括所述预设服务标识;When continuing to scan for new broadcast packets, determine whether there is a newly-added scanned device, and determine whether the scan list includes the device name of the scanned device that has not been scanned for a preset number of consecutive times. Among them, the newly-added The broadcast packet of the scanned device includes the preset service identifier;若存在新增的被扫描设备,则按照新增的被扫描设备对应的信号强度,将新增的被扫描设备的设备名称添加至所述扫描列表中;If there is a newly-added scanned device, add the device name of the newly-added scanned device to the scan list according to the signal strength corresponding to the newly-added scanned device;若所述扫描列表中包括连续预设次数未被扫描到的被扫描设备的设备名称,则将连续预设次数未被扫描到的被扫描设备的设备名称从所述扫描列表中删除。If the scan list includes the device name of the scanned device that has not been scanned for the preset number of consecutive times, the device name of the scanned device that has not been scanned for the preset number of consecutive times is deleted from the scan list.
- 根据权利要求11所述的电子设备,其特征在于,所述方法还包括:The electronic device according to claim 11, wherein the method further comprises:发送广播包,其中,所述广播包中包括服务标识、设备标识、第一通信连 接的连接参数;Sending a broadcast packet, where the broadcast packet includes a service identifier, a device identifier, and connection parameters of the first communication connection;当接收到第二设备根据所述第一通信连接的连接参数发送的连接请求时,与所述第二设备建立第一通信连接,以使所述第二设备通过所述第一通信连接获取所述电子设备存储的第三密码;When a connection request sent by the second device according to the connection parameters of the first communication connection is received, a first communication connection is established with the second device, so that the second device obtains all data through the first communication connection. The third password stored in the electronic device;在接收到所述第二设备通过所述第一通信连接发送的根据所述第三密码对所述第三信息加密得到的第三加密信息后,根据所述第三密码对所述第三加密信息进行解密,获得所述第三加密信息中的第三信息,并提示用户是否接收文件,其中,所述第三信息包括第四密码及第二通信连接的连接参数;After receiving the third encrypted information obtained by encrypting the third information according to the third password from the second device through the first communication connection, encrypt the third information according to the third password Information is decrypted, the third information in the third encrypted information is obtained, and the user is prompted whether to receive the file, where the third information includes the fourth password and the connection parameters of the second communication connection;若接收到用户确认接收文件的操作,则根据所述第二通信连接的连接参数与所述第二设备建立第二通信连接;If the user's confirmation of receiving the file is received, establishing a second communication connection with the second device according to the connection parameters of the second communication connection;接收所述第二设备通过所述第二通信连接发送的根据所述第四密码对第四信息进行加密得到的第四加密信息,并根据所述第四密码对所述第四加密信息进行解密,以得到所述第四信息中的目标文件。Receive fourth encrypted information obtained by encrypting fourth information according to the fourth password sent by the second device through the second communication connection, and decrypt the fourth encrypted information according to the fourth password , To obtain the target file in the fourth information.
- 根据权利要求14所述的电子设备,其特征在于,所述第三密码为公钥,所述第三加密信息由所述第二设备利用作为公钥的所述第三密码对所述第三信息加密得到,所述根据所述第三密码对所述第三加密信息进行解密,包括:The electronic device according to claim 14, wherein the third password is a public key, and the third encrypted information is used by the second device to use the third password as a public key to compare to the third The information is encrypted, and the decryption of the third encrypted information according to the third password includes:根据与所述第三密码对应的私钥对所述第三加密信息进行解密。Decrypt the third encrypted information according to the private key corresponding to the third password.
- 一种可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现文件传输方法,所述方法包括:A readable storage medium having a computer program stored thereon, wherein the computer program implements a file transmission method when the computer program is executed by a processor, and the method includes:与第一设备建立第一通信连接,并通过所述第一通信连接获取所述第一设备存储的第一密码;Establish a first communication connection with the first device, and obtain the first password stored by the first device through the first communication connection;根据所述第一密码对第一信息进行加密,得到第一加密信息,并将所述第一加密信息通过所述第一通信连接发送给所述第一设备,以与所述第一设备建立第二通信连接,其中,所述第一信息包括第二密码及第二通信连接的连接参数,所述第一通信连接的功耗低于第一预设值,所述第二通信连接的传输速度高于第二预设值;Encrypt the first information according to the first password to obtain first encrypted information, and send the first encrypted information to the first device through the first communication connection to establish a connection with the first device A second communication connection, wherein the first information includes a second password and connection parameters of the second communication connection, the power consumption of the first communication connection is lower than a first preset value, and the transmission of the second communication connection The speed is higher than the second preset value;根据所述第二密码对第二信息进行加密,得到第二加密信息,并将所述第二加密信息通过所述第二通信连接发送给所述第一设备,以使所述第一设备在根据所述第二密码对所述第二加密信息解密后得到所述第二信息中的目标文件。The second information is encrypted according to the second password to obtain second encrypted information, and the second encrypted information is sent to the first device through the second communication connection, so that the first device is After decrypting the second encrypted information according to the second password, the target file in the second information is obtained.
- 根据权利要求16所述的可读存储介质,其特征在于,所述与第一设备建立第一通信连接,包括:The readable storage medium according to claim 16, wherein the establishing a first communication connection with the first device comprises:通过扫描获得至少一个广播包,并获得每个广播包的信号强度,其中,所述第一通信连接对应的扫描速度高于第三预设值;At least one broadcast packet is obtained by scanning, and the signal strength of each broadcast packet is obtained, wherein the scanning speed corresponding to the first communication connection is higher than the third preset value;从所述至少一个广播包中筛选出服务标识为预设服务标识的备选广播包,其中,所述备选广播包中包括被扫描设备的服务标识、设备标识、设备名称、第一通信连接的连接参数;A candidate broadcast package whose service identifier is a preset service identifier is filtered from the at least one broadcast package, where the candidate broadcast package includes the service identifier, device identifier, device name, and first communication connection of the scanned device The connection parameters;按照每个备选广播包的信号强度,对筛选出的备选广播包对应的设备名称进行排序,得到扫描列表;According to the signal strength of each candidate broadcast package, sort the device names corresponding to the selected candidate broadcast packages to obtain a scan list;显示所述扫描列表,并将与接收到的选择操作对应的被扫描设备作为所述 第一设备;Display the scan list, and use the scanned device corresponding to the received selection operation as the first device;根据所述第一设备的广播包中的第一通信连接的连接参数,与所述第一设备建立第一通信连接。Establish a first communication connection with the first device according to the connection parameters of the first communication connection in the broadcast packet of the first device.
- 根据权利要求17所述的可读存储介质,其特征在于,所述与第一设备建立第一通信连接,还包括:The readable storage medium according to claim 17, wherein the establishing a first communication connection with the first device further comprises:在继续扫描得到新的广播包时,判断是否存在新增的被扫描设备,并判断所述扫描列表中是否包括连续预设次数未被扫描到的被扫描设备的设备名称,其中,新增的被扫描设备的广播包中包括所述预设服务标识;When continuing to scan for new broadcast packets, determine whether there is a newly-added scanned device, and determine whether the scan list includes the device name of the scanned device that has not been scanned for a preset number of consecutive times. Among them, the newly-added The broadcast packet of the scanned device includes the preset service identifier;若存在新增的被扫描设备,则按照新增的被扫描设备对应的信号强度,将新增的被扫描设备的设备名称添加至所述扫描列表中;If there is a newly-added scanned device, add the device name of the newly-added scanned device to the scan list according to the signal strength corresponding to the newly-added scanned device;若所述扫描列表中包括连续预设次数未被扫描到的被扫描设备的设备名称,则将连续预设次数未被扫描到的被扫描设备的设备名称从所述扫描列表中删除。If the scan list includes the device name of the scanned device that has not been scanned for the preset number of consecutive times, the device name of the scanned device that has not been scanned for the preset number of consecutive times is deleted from the scan list.
- 根据权利要求16所述的可读存储介质,其特征在于,所述方法还包括:The readable storage medium according to claim 16, wherein the method further comprises:发送广播包,其中,所述广播包中包括服务标识、设备标识、第一通信连接的连接参数;Sending a broadcast packet, where the broadcast packet includes a service identifier, a device identifier, and connection parameters of the first communication connection;当接收到第二设备根据所述第一通信连接的连接参数发送的连接请求时,与所述第二设备建立第一通信连接,以使所述第二设备通过所述第一通信连接获取电子设备存储的第三密码;When a connection request sent by the second device according to the connection parameters of the first communication connection is received, a first communication connection is established with the second device, so that the second device can obtain electronic information through the first communication connection. The third password stored by the device;在接收到所述第二设备通过所述第一通信连接发送的根据所述第三密码对所述第三信息加密得到的第三加密信息后,根据所述第三密码对所述第三加密信息进行解密,获得所述第三加密信息中的第三信息,并提示用户是否接收文件,其中,所述第三信息包括第四密码及第二通信连接的连接参数;After receiving the third encrypted information obtained by encrypting the third information according to the third password from the second device through the first communication connection, encrypt the third information according to the third password Information is decrypted, the third information in the third encrypted information is obtained, and the user is prompted whether to receive the file, where the third information includes the fourth password and the connection parameters of the second communication connection;若接收到用户确认接收文件的操作,则根据所述第二通信连接的连接参数与所述第二设备建立第二通信连接;If the user's confirmation of receiving the file is received, establishing a second communication connection with the second device according to the connection parameters of the second communication connection;接收所述第二设备通过所述第二通信连接发送的根据所述第四密码对第四信息进行加密得到的第四加密信息,并根据所述第四密码对所述第四加密信息进行解密,以得到所述第四信息中的目标文件。Receive fourth encrypted information obtained by encrypting fourth information according to the fourth password sent by the second device through the second communication connection, and decrypt the fourth encrypted information according to the fourth password , To obtain the target file in the fourth information.
- 根据权利要求19所述的可读存储介质,其特征在于,所述第三密码为公钥,所述第三加密信息由所述第二设备利用作为公钥的所述第三密码对所述第三信息加密得到,所述根据所述第三密码对所述第三加密信息进行解密,包括:The readable storage medium according to claim 19, wherein the third password is a public key, and the third encrypted information is used by the second device to use the third password as the public key to pair the The third information is encrypted and obtained, and the decrypting the third encrypted information according to the third password includes:根据与所述第三密码对应的私钥对所述第三加密信息进行解密。Decrypt the third encrypted information according to the private key corresponding to the third password.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010095209.6A CN113271324A (en) | 2020-02-14 | 2020-02-14 | File transmission method and device, electronic equipment and readable storage medium |
CN202010095209.6 | 2020-02-14 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021160084A1 true WO2021160084A1 (en) | 2021-08-19 |
Family
ID=77227373
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/075987 WO2021160084A1 (en) | 2020-02-14 | 2021-02-08 | File transmission method and apparatus, electronic device, and readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113271324A (en) |
WO (1) | WO2021160084A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105357666A (en) * | 2014-08-20 | 2016-02-24 | 中兴通讯股份有限公司 | WIFI (Wireless Fidelity) password sharing method and terminals |
CN105554062A (en) * | 2015-11-30 | 2016-05-04 | 东莞酷派软件技术有限公司 | Method, associated device and system of file transmission |
CN107148016A (en) * | 2017-04-20 | 2017-09-08 | 宇龙计算机通信科技(深圳)有限公司 | Terminal connection method, device and electronic equipment |
CN109803249A (en) * | 2019-02-25 | 2019-05-24 | 努比亚技术有限公司 | A kind of WIFI network sharing method, terminal and computer readable storage medium |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1333351A1 (en) * | 2002-01-31 | 2003-08-06 | Culture. Com. Technology (Macau) Ltd. | System and method for electronic file transmission |
CN101056171A (en) * | 2006-06-20 | 2007-10-17 | 华为技术有限公司 | An encryption communication method and device |
CN101222521B (en) * | 2008-01-21 | 2011-03-16 | 中兴通讯股份有限公司 | File transfer method based on conversation launching protocol |
CN101631305B (en) * | 2009-07-28 | 2011-12-07 | 交通银行股份有限公司 | Encryption method and system |
CN102412875B (en) * | 2011-12-26 | 2017-05-10 | 中兴通讯股份有限公司 | File sending and receiving method and device as well as file transmission method and system |
CN102682506B (en) * | 2012-05-25 | 2015-07-08 | 北京华大信安科技有限公司 | Intelligent Bluetooth door access control method and device based on symmetric cryptographic technique |
JP5939953B2 (en) * | 2012-10-04 | 2016-06-29 | デジタルア−ツ株式会社 | Electronic file transmission system, program, and electronic file transmission method |
CN105376708B (en) * | 2015-10-09 | 2019-06-07 | Oppo广东移动通信有限公司 | A kind of connection method and system of bluetooth equipment selection target equipment |
CN105472038B (en) * | 2016-01-07 | 2020-06-16 | 腾讯科技(深圳)有限公司 | File transmission control method, device and system |
CN106412028A (en) * | 2016-09-13 | 2017-02-15 | 广州视睿电子科技有限公司 | File transmission method and system |
CN108462953B (en) * | 2018-03-30 | 2021-09-21 | 北京金山安全软件有限公司 | File transmission method and device, electronic equipment and storage medium |
CN109862549A (en) * | 2019-03-28 | 2019-06-07 | 南昌黑鲨科技有限公司 | Bluetooth connection method and device, readable storage medium and mobile device |
CN110278080B (en) * | 2019-07-11 | 2020-10-02 | 珠海格力电器股份有限公司 | Method, system and computer readable storage medium for data transmission |
-
2020
- 2020-02-14 CN CN202010095209.6A patent/CN113271324A/en active Pending
-
2021
- 2021-02-08 WO PCT/CN2021/075987 patent/WO2021160084A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105357666A (en) * | 2014-08-20 | 2016-02-24 | 中兴通讯股份有限公司 | WIFI (Wireless Fidelity) password sharing method and terminals |
CN105554062A (en) * | 2015-11-30 | 2016-05-04 | 东莞酷派软件技术有限公司 | Method, associated device and system of file transmission |
CN107148016A (en) * | 2017-04-20 | 2017-09-08 | 宇龙计算机通信科技(深圳)有限公司 | Terminal connection method, device and electronic equipment |
CN109803249A (en) * | 2019-02-25 | 2019-05-24 | 努比亚技术有限公司 | A kind of WIFI network sharing method, terminal and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113271324A (en) | 2021-08-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106686008B (en) | Information storage means and device | |
US9385996B2 (en) | Method of operating a computing device, computing device and computer program | |
EP2820793B1 (en) | Method of operating a computing device, computing device and computer program | |
US8494164B2 (en) | Method for connecting wireless communications, wireless communications terminal and wireless communications system | |
EP3537652B1 (en) | Method for securely controlling smart home appliance and terminal device | |
US20150264724A1 (en) | Method and system of establishing wireless communication connection | |
EP2820585B1 (en) | Method of operating a computing device, computing device and computer program | |
US20020147819A1 (en) | Method of wireless LAN parameter setting by direct contact or proximity connection between communication devices | |
CN109672523B (en) | Information encryption method, device and equipment based on filter and readable storage medium | |
WO2017185511A1 (en) | Data processing method, device, and terminal | |
KR20160078475A (en) | Key configuration method, system and apparatus | |
CN106385277B (en) | Encryption device, method and system | |
WO2015164999A1 (en) | Virtual card downloading method, terminal and intermediate device | |
CN113301563A (en) | Network configuration method, device, equipment and storage medium | |
WO2016004570A1 (en) | Authorization method and apparatus for management of embedded universal integrated circuit card | |
CN108964886B (en) | Communication method comprising encryption algorithm, communication method comprising decryption algorithm and equipment | |
WO2021160084A1 (en) | File transmission method and apparatus, electronic device, and readable storage medium | |
WO2014079241A1 (en) | Method and system for changing contact information about mobile phone terminals of others by sending messages | |
EP4029215A1 (en) | Ecosystem-based wireless network setup | |
KR101500118B1 (en) | Data sharing method and data sharing system | |
JP2013247533A (en) | Wireless lan communication system, wireless lan master device, wireless lan slave device, communication connection establishment method, and program | |
KR20080112401A (en) | Methods and apparatus for encryption verification | |
CN105792149A (en) | Short message processing system and initialization method thereof, short message storage method and reading method | |
CN111917688A (en) | Method, device and system for transmitting encrypted data through cloud platform | |
JP2006128892A (en) | Information storage system, information storage method, received information providing device, and information storage terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21753604 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 03/01/2023) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21753604 Country of ref document: EP Kind code of ref document: A1 |