[go: up one dir, main page]

CN115562573B - Method for storing data, communication system, electronic equipment and storage medium - Google Patents

Method for storing data, communication system, electronic equipment and storage medium Download PDF

Info

Publication number
CN115562573B
CN115562573B CN202211049462.3A CN202211049462A CN115562573B CN 115562573 B CN115562573 B CN 115562573B CN 202211049462 A CN202211049462 A CN 202211049462A CN 115562573 B CN115562573 B CN 115562573B
Authority
CN
China
Prior art keywords
target data
key
data
identifier
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211049462.3A
Other languages
Chinese (zh)
Other versions
CN115562573A (en
Inventor
施磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211049462.3A priority Critical patent/CN115562573B/en
Publication of CN115562573A publication Critical patent/CN115562573A/en
Application granted granted Critical
Publication of CN115562573B publication Critical patent/CN115562573B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a method for storing data, a communication system, electronic equipment and a storage medium, relating to the field of data storage, after receiving the first instruction, the first device sends a first request to the second device, and requests the second device to generate a first key, wherein the first key is used for encrypting the target data. The second device receives the first request, generates a first key, and then sends the first key to the first device. After the first device receives the first key from the second device, encrypting the target data by using the first key; the first device then stores the encrypted target data to the third device. The application can realize the user to the transfer of private data in the electronic equipment and the encryption and decryption management, is convenient to operate, ensures the safe storage of user data and realizes the intelligent management of the secret key.

Description

一种存储数据的方法、通信系统、电子设备及存储介质A method for storing data, a communication system, an electronic device and a storage medium

技术领域Technical Field

本申请涉及数据存储领域,特别涉及一种存储数据的方法、通信系统、电子设备及存储介质。The present application relates to the field of data storage, and in particular to a method for storing data, a communication system, an electronic device and a storage medium.

背景技术Background Art

目前,手机、平板电脑等移动终端已经成为人们日常生活中常用的工具,移动终端可以用来拍摄,即时聊天,浏览网站,观看视频,手机支付等等,并可安装各种应用程序以实现不同的功能。因此,移动终端中会存储很多的信息,如联系人信息、通话记录、账号密码、照片、短信、文件等。随着手机、平板电脑等移动终端中存储信息的增加,移动终端的存储空间越来越紧张。At present, mobile terminals such as mobile phones and tablet computers have become common tools in people's daily lives. Mobile terminals can be used to take pictures, chat instantly, browse websites, watch videos, make mobile payments, etc., and various applications can be installed to achieve different functions. Therefore, a lot of information is stored in mobile terminals, such as contact information, call records, account passwords, photos, text messages, files, etc. With the increase of information stored in mobile terminals such as mobile phones and tablet computers, the storage space of mobile terminals is becoming increasingly tight.

发明内容Summary of the invention

本申请提供了一种存储数据的方法、通信系统、电子设备及存储介质,可以缓解移动终端存储空间越来越紧张的问题。所述技术方案如下:The present application provides a method for storing data, a communication system, an electronic device and a storage medium, which can alleviate the problem of increasingly tight storage space in mobile terminals. The technical solution is as follows:

第一方面,本申请实施例提供了一种存储数据的方法,应用于第一设备,该方法包括:In a first aspect, an embodiment of the present application provides a method for storing data, which is applied to a first device, and the method includes:

在接收到第一指令之后,向第二设备发送第一请求,第一指令用于指示对目标数据进行加密存储,第一请求用于请求第二设备生成第一密钥;After receiving the first instruction, sending a first request to the second device, where the first instruction is used to instruct to encrypt and store the target data, and the first request is used to request the second device to generate a first key;

接收来自第二设备的第一密钥,通过第一密钥对目标数据进行加密;receiving a first key from a second device, and encrypting target data using the first key;

将加密后的目标数据存储至第三设备,并删除本地加密后的目标数据。The encrypted target data is stored in the third device, and the locally encrypted target data is deleted.

本申请实施例提供的方法,将加密后的目标数据转存至第三设备中之后,可以将第一设备中的目标数据删除,从而间接扩展第一设备的存储空间,缓解存储空间越来越紧张的问题。第一设备根据第一密钥对目标数据进行加密,保障了目标数据的安全,第一设备只将加密后的目标数据存储至第三设备,没有将第一密钥存储至第三设备,实现了第一密钥与目标数据的分开存储,能够减小第三设备丢失后目标数据被解密的风险,提高数据存储的安全性,且第三设备为用户私有设备,能够避免目标数据在网上泄露的风险。此外,第一密钥是由第二设备生成的,不需要用户自己管理密钥,从而提高用户体验。The method provided in the embodiment of the present application can delete the target data in the first device after transferring the encrypted target data to the third device, thereby indirectly expanding the storage space of the first device and alleviating the problem of increasingly tight storage space. The first device encrypts the target data according to the first key to ensure the security of the target data. The first device only stores the encrypted target data to the third device, and does not store the first key to the third device, thereby realizing the separate storage of the first key and the target data, which can reduce the risk of the target data being decrypted after the third device is lost, improve the security of data storage, and the third device is a user's private device, which can avoid the risk of target data being leaked online. In addition, the first key is generated by the second device, and the user does not need to manage the key himself, thereby improving the user experience.

结合第一方面,在第一方面的某些实现方式中,第一请求包括目标数据的第一标识和目标数据的第二标识。在这一实现方式中,第一标识为目标数据的内容标识,第二标识为目标数据对应的用户的标识,目标数据的内容的不同,每次加密数据生成的第一密钥不相同,解密时需要使用与加密时相同的第一标识和第二标识,其他用户无法对本用户的数据进行解密,从而提高存储数据的安全性。In conjunction with the first aspect, in certain implementations of the first aspect, the first request includes a first identifier of the target data and a second identifier of the target data. In this implementation, the first identifier is a content identifier of the target data, and the second identifier is an identifier of a user corresponding to the target data. The content of the target data is different, and the first key generated each time the data is encrypted is different. When decrypting, the same first identifier and second identifier as used for encryption need to be used, and other users cannot decrypt the data of this user, thereby improving the security of stored data.

结合第一方面,在第一方面的某些实现方式中,将加密后的目标数据存储至第三设备,包括:将加密后的目标数据和目标数据的第一标识存储到第三设备中。In combination with the first aspect, in some implementations of the first aspect, storing the encrypted target data in a third device includes: storing the encrypted target data and a first identifier of the target data in the third device.

在某些实现方式中,第一设备可以将加密后的目标数据和目标数据的第一标识压缩存储到第三设备中,从而节省第三设备的存储空间,并且便于查找目标数据的第一标识,方便对加密后的目标数据进行解密。In some implementations, the first device may compress and store the encrypted target data and the first identifier of the target data in a third device, thereby saving storage space of the third device and facilitating searching for the first identifier of the target data and decrypting the encrypted target data.

结合第一方面,在第一方面的某些实现方式中,上述方法还包括:在接收到第二指令之后,向第二设备发送第二请求,第二指令指示对加密后的目标数据进行解密,第二请求用于请求获取第一密钥;接收来自第二设备的第一密钥;获取第三设备中的加密后的目标数据;通过第一密钥对加密后的目标数据进行解密。In combination with the first aspect, in certain implementations of the first aspect, the above method also includes: after receiving the second instruction, sending a second request to the second device, the second instruction instructing to decrypt the encrypted target data, and the second request is used to request to obtain the first key; receiving the first key from the second device; obtaining the encrypted target data in the third device; and decrypting the encrypted target data using the first key.

结合第一方面,在第一方面的某些实现方式中,第二请求包括目标数据的第一标识和目标数据的第二标识。也就是说,获取第一密钥时需要的信息与生成第一密钥时使用的信息是对应的,从而提高存储数据的安全性。In combination with the first aspect, in some implementations of the first aspect, the second request includes a first identifier of the target data and a second identifier of the target data. That is, the information required when obtaining the first key corresponds to the information used when generating the first key, thereby improving the security of the stored data.

若第一请求中包括目标数据的第一标识,例如目标数据的第一标识为MD5值,第二设备根据MD5值生成第一密钥,对应的,第二请求包括MD5值,云服务器根据MD5值查询第一密钥。If the first request includes the first identifier of the target data, for example, the first identifier of the target data is an MD5 value, the second device generates a first key based on the MD5 value, and correspondingly, the second request includes the MD5 value, and the cloud server queries the first key based on the MD5 value.

若第一请求中包括目标数据的第二标识,第二设备根据目标数据的第二标识生成第一密钥,对应的,第二请求包括目标数据的第二标识,云服务器根据目标数据的第二标识查询第一密钥。If the first request includes the second identifier of the target data, the second device generates the first key according to the second identifier of the target data. Correspondingly, the second request includes the second identifier of the target data, and the cloud server queries the first key according to the second identifier of the target data.

结合第一方面,在第一方面的某些实现方式中,第一指令或第二指令为来自第四设备的指令,目标数据是第四设备发送给第一设备的。In combination with the first aspect, in some implementations of the first aspect, the first instruction or the second instruction is an instruction from a fourth device, and the target data is sent by the fourth device to the first device.

在这一实现方式中,第四设备的存储空间紧张,用户选择将第四设备中存储的部分数据转移到第三设备中进行存储,第四设备将用户选择的部分数据确定为目标数据,将目标数据发送给第一设备。该实现方式中,第四设备通过第一设备实现数据转存,缓解第四设备的存储空间。第一设备属于中转设备,在第四设备转存数据的过程中,还可以有其他的设备通过第一设备将数据转存到第三设备中,可以实现在同一时间段内将多个设备中的数据转存到第三设备,可以提高存储数据的效率。In this implementation, the storage space of the fourth device is tight, and the user chooses to transfer part of the data stored in the fourth device to the third device for storage. The fourth device determines the part of the data selected by the user as the target data and sends the target data to the first device. In this implementation, the fourth device transfers data through the first device to relieve the storage space of the fourth device. The first device is a transfer device. During the process of the fourth device transferring data, other devices can also transfer data to the third device through the first device. It can be realized that data from multiple devices can be transferred to the third device in the same time period, which can improve the efficiency of storing data.

结合第一方面,在第一方面的某些实现方式中,第一指令是第四设备在检测到来自第一界面的第一操作之后发送给第一设备的,第一操作为指示对目标数据进行加密存储的操作,第一界面为用于管理待加密数据的界面。In combination with the first aspect, in certain implementations of the first aspect, the first instruction is sent by the fourth device to the first device after detecting a first operation from the first interface, the first operation is an operation instructing encrypted storage of target data, and the first interface is an interface for managing data to be encrypted.

结合第一方面,在第一方面的某些实现方式中,第二指令是第四设备在检测到来自第二界面的第二操作之后发送给第一设备的,第二操作为指示对加密后的目标数据进行解密的操作,第二界面为用于管理已加密数据的界面。In combination with the first aspect, in certain implementations of the first aspect, the second instruction is sent by the fourth device to the first device after detecting a second operation from the second interface, the second operation is an operation instructing to decrypt the encrypted target data, and the second interface is an interface for managing encrypted data.

在这一实现方式中,第四设备显示第一界面和第二界面,为用户提供通过第一设备管理数据的通道,方便用户操作,从而提高用户体验。In this implementation, the fourth device displays the first interface and the second interface, providing the user with a channel to manage data through the first device, facilitating user operation, thereby improving user experience.

结合第一方面,在第一方面的某些实现方式中,上述方法还包括:向第四设备发送对目标数据进行加密的进度信息,或,向第四设备发送对加密后的目标数据进行解密的进度信息,从而用户能够实时了解当前加密或解密的进度,可以预计完成时间,当时间较久时,用户可以先处理其他事情,从而提高用户体验。In combination with the first aspect, in certain implementations of the first aspect, the above method also includes: sending progress information of encrypting the target data to a fourth device, or sending progress information of decrypting the encrypted target data to the fourth device, so that the user can understand the current progress of encryption or decryption in real time and estimate the completion time. When the time is long, the user can deal with other things first, thereby improving the user experience.

第二方面,本申请实施例提供了一种存储数据的方法,应用于第二设备,该方法包括:In a second aspect, an embodiment of the present application provides a method for storing data, which is applied to a second device, and the method includes:

接收来自第一设备的第一请求,第一请求用于请求第二设备生成第一密钥,第一密钥用于对目标数据进行加密,目标数据为所述第一设备中存储的数据;Receiving a first request from a first device, the first request is used to request a second device to generate a first key, the first key is used to encrypt target data, and the target data is data stored in the first device;

根据第一请求生成第一密钥;generating a first key according to the first request;

向第一设备发送第一密钥。A first key is sent to the first device.

本申请实施例提供的方法,由第二设备生成的第一密钥,能够减少其他设备的计算量,提高存储数据的效率,第二设备可以为多个设备生成密钥,提高本方法的通用性。第二设备生成且存储第一密钥,则解密时从第二设备中获取第一密钥,不需要用户自己管理密钥,能够实现密钥智能化管理,从而提高用户体验。In the method provided by the embodiment of the present application, the first key generated by the second device can reduce the amount of calculation of other devices and improve the efficiency of storing data. The second device can generate keys for multiple devices, thereby improving the versatility of the method. The second device generates and stores the first key, and then obtains the first key from the second device during decryption. The user does not need to manage the key himself, and intelligent key management can be achieved, thereby improving the user experience.

结合第二方面,在第二方面的某些实现方式中,第一请求包括目标数据的第一标识和目标数据的第二标识,生成第一密钥,包括:根据目标数据的第一标识和目标数据的第二标识,生成第一密钥。In combination with the second aspect, in some implementations of the second aspect, the first request includes a first identifier of the target data and a second identifier of the target data, and generating a first key includes: generating the first key according to the first identifier of the target data and the second identifier of the target data.

结合第二方面,在第二方面的某些实现方式中,上述方法还包括:保存第一密钥,以及第一密钥与目标数据的第一标识和目标数据的第二标识的对应关系,从而便于第二设备查找第一密钥,并且在解密时,确定目标数据的第一标识和目标数据的第二标识是否正确,从而提高存储数据的安全性。In combination with the second aspect, in certain implementations of the second aspect, the above method also includes: saving the first key, and the correspondence between the first key and the first identifier of the target data and the second identifier of the target data, so as to facilitate the second device to find the first key, and during decryption, determine whether the first identifier of the target data and the second identifier of the target data are correct, thereby improving the security of the stored data.

结合第二方面,在第二方面的某些实现方式中,上述方法还包括:接收来自第一设备的第二请求,第二请求用于请求获取第一密钥;根据第二请求查询第一密钥;向第一设备发送第一密钥。In combination with the second aspect, in some implementations of the second aspect, the method further includes: receiving a second request from the first device, the second request being used to request obtaining the first key; querying the first key according to the second request; and sending the first key to the first device.

结合第二方面,在第二方面的某些实现方式中,第二请求包括目标数据的第一标识和目标数据的第二标识,查询第一密钥,包括:根据目标数据的第一标识和目标数据的第二标识,查询第一密钥。也就是说,查询第一密钥时需要的信息与生成第一密钥时使用的信息是对应的,从而保证数据的安全。In conjunction with the second aspect, in some implementations of the second aspect, the second request includes a first identifier of the target data and a second identifier of the target data, and querying the first key includes: querying the first key according to the first identifier of the target data and the second identifier of the target data. That is, the information required when querying the first key corresponds to the information used when generating the first key, thereby ensuring data security.

第三方面,本申请实施例提供一种存储数据通信系统,该通信系统包括第一设备、第二设备和第三设备,第一设备与第二设备和第三设备已建立连接。In a third aspect, an embodiment of the present application provides a storage data communication system, which includes a first device, a second device and a third device, and the first device has established connections with the second device and the third device.

当第一设备中存储的一些数据需要转存时,用户可以在第一设备显示的界面上进行第一操作以向第一设备输入第一指令,第一设备在接收到第一指令之后,即响应于第一操作,向第二设备发送第一请求,第一指令用于指示对目标数据进行加密存储,第一请求用于请求第二设备生成第一密钥,第一密钥用于对目标数据进行加密。When some data stored in the first device needs to be transferred, the user can perform a first operation on the interface displayed by the first device to input a first instruction to the first device. After receiving the first instruction, the first device sends a first request to the second device in response to the first operation. The first instruction is used to instruct the encrypted storage of the target data, and the first request is used to request the second device to generate a first key, and the first key is used to encrypt the target data.

第二设备接收来自第一设备的第一请求,响应于该第一请求,第二设备生成第一密钥,然后第二设备向第一设备发送第一密钥。The second device receives the first request from the first device, generates a first key in response to the first request, and then sends the first key to the first device.

第一设备接收到来自第二设备的第一密钥之后,使用第一密钥对目标数据进行加密;然后第一设备将加密后的目标数据存储至第三设备,并删除本地加密后的目标数据。After receiving the first key from the second device, the first device uses the first key to encrypt the target data; then the first device stores the encrypted target data to the third device and deletes the locally encrypted target data.

其中,第一密钥可以存储在第一设备上,也可以存储在第二设备上。若第一密钥存储在第一设备上,当用户需要查看加密后的目标数据时,用户可以在第一设备上进行第二操作以向第一设备输入第二指令,第一设备在接收到第二指令之后,在设备内部查找第一密钥,使用第一密钥对加密后的目标数据进行解密。The first key may be stored on the first device or on the second device. If the first key is stored on the first device, when the user needs to view the encrypted target data, the user may perform a second operation on the first device to input a second instruction to the first device. After receiving the second instruction, the first device searches for the first key inside the device and uses the first key to decrypt the encrypted target data.

若第一密钥存储在第二设备上,第一设备在接收到第二指令之后,向第二设备发送第二请求,第二请求用于请求获取第一密钥。第二设备接收来自第一设备的第二请求,响应于该第二请求,第二设备在设备内部查找第一密钥,然后将第一密钥发送给第一设备。第一设备接收到第一密钥之后,使用第一密钥对加密后的目标数据进行解密。If the first key is stored on the second device, after receiving the second instruction, the first device sends a second request to the second device, and the second request is used to request to obtain the first key. The second device receives the second request from the first device, and in response to the second request, the second device searches for the first key inside the device, and then sends the first key to the first device. After receiving the first key, the first device uses the first key to decrypt the encrypted target data.

本申请实施例中,将加密后的目标数据转存至第三设备中之后,可以将第一设备中的目标数据删除,从而间接扩展第一设备的存储空间,缓解存储空间越来越紧张的问题。In an embodiment of the present application, after the encrypted target data is transferred to the third device, the target data in the first device can be deleted, thereby indirectly expanding the storage space of the first device and alleviating the problem of increasingly tight storage space.

第一设备根据第一密钥对目标数据进行加密,保障了目标数据的安全,第一设备只将加密后的目标数据存储至第三设备,没有将第一密钥存储至第三设备,实现了第一密钥与目标数据的分开存储,能够减小第三设备丢失后目标数据被解密的风险,提高数据存储的安全性,且第三设备为用户私有设备,能够避免目标数据在网上泄露的风险。此外,第一密钥是由第二设备生成的,不需要用户自己管理密钥,从而提高用户体验。The first device encrypts the target data according to the first key, which ensures the security of the target data. The first device only stores the encrypted target data in the third device, and does not store the first key in the third device, which realizes the separate storage of the first key and the target data, and can reduce the risk of the target data being decrypted after the third device is lost, improve the security of data storage, and the third device is a user's private device, which can avoid the risk of target data being leaked online. In addition, the first key is generated by the second device, and the user does not need to manage the key himself, thereby improving the user experience.

在一些实现方式中,第一设备可以为手机或平板电脑等,第二设备可以为云服务器,第三设备可以是移动硬盘。In some implementations, the first device may be a mobile phone or a tablet computer, the second device may be a cloud server, and the third device may be a mobile hard disk.

在一些实现方式中,第一设备可以为手机或平板电脑等,第二设备可以为路由器,第三设备可以为U盘。In some implementations, the first device may be a mobile phone or a tablet computer, the second device may be a router, and the third device may be a USB flash drive.

在一些实现方式中,通信系统包括四个设备:第一设备、第二设备、第三设备和第四设备,示例性地,第一设备为路由器,第二设备为云服务器,第三设备为移动硬盘,第四设备为手机,手机通过Wi-Fi连接路由器,路由器与云服务器通信,移动硬盘通过USB接口连接到路由器上。手机可以控制路由器和移动硬盘,用户在手机上通过手机显示的第一界面选择需要转存的目标数据,如本地照片、视频、文档等,并且确定对目标数据进行加密,响应于用户操作,手机向路由器发送第一指令和目标数据。路由器在接收到目标数据之后,存储目标数据,在接收到第一指令之后,向云服务器发送第一请求。云服务器接收到来自路由器的第一请求后,生成第一密钥,并将第一密钥发送给路由器。路由器根据第一密钥对目标数据进行加密,并将加密后的目标数据存储到移动硬盘。In some implementations, the communication system includes four devices: a first device, a second device, a third device, and a fourth device. For example, the first device is a router, the second device is a cloud server, the third device is a mobile hard disk, and the fourth device is a mobile phone. The mobile phone is connected to the router via Wi-Fi, the router communicates with the cloud server, and the mobile hard disk is connected to the router via a USB interface. The mobile phone can control the router and the mobile hard disk. The user selects the target data to be transferred, such as local photos, videos, documents, etc., through the first interface displayed on the mobile phone, and determines to encrypt the target data. In response to the user operation, the mobile phone sends a first instruction and target data to the router. After receiving the target data, the router stores the target data, and after receiving the first instruction, sends a first request to the cloud server. After receiving the first request from the router, the cloud server generates a first key and sends the first key to the router. The router encrypts the target data according to the first key and stores the encrypted target data in the mobile hard disk.

在将加密后的目标数据存储到移动硬盘之后,路由器可以删除目标数据和第一密钥的相关记录。云服务器生成第一密钥后存储第一密钥,即第一密钥由云服务器存储,从而避免可能存在的手机、路由器出现问题的情况,减小第一密钥丢失的风险。After storing the encrypted target data in the mobile hard disk, the router can delete the target data and the related records of the first key. The cloud server stores the first key after generating it, that is, the first key is stored by the cloud server, thereby avoiding the situation where there may be problems with the mobile phone and the router, and reducing the risk of losing the first key.

在这一实现方式中,第一设备(路由器)属于一种中转设备,在手机转存数据的过程中,还可以有其他的设备通过路由器将数据转存到移动硬盘中,可以实现在同一时间段内将多个设备中的数据转存到第三设备,且,云服务器的计算能力较强,使用云服务器生成第一密钥,可以提高存储数据的效率。In this implementation, the first device (router) is a transfer device. During the process of transferring data from a mobile phone, other devices can also transfer data to a mobile hard disk through the router. This allows data from multiple devices to be transferred to a third device within the same time period. In addition, the cloud server has strong computing power, and using the cloud server to generate the first key can improve the efficiency of storing data.

可以理解,在实际实现时,存储数据的系统还可以包括更多或更少的设备。It can be understood that, in actual implementation, the system for storing data may also include more or fewer devices.

第四方面,本申请提供一种存储数据的装置,该装置包括用于执行上述第一方面或第二方面中的方法的单元。该装置可对应于执行上述第一方面或第二方面中描述的方法,该装置中的单元的相关描述请参照上述第一方面或第二方面的描述,为了简洁,在此不再赘述。In a fourth aspect, the present application provides a device for storing data, the device comprising a unit for executing the method in the first aspect or the second aspect. The device may correspond to executing the method described in the first aspect or the second aspect, and the relevant description of the unit in the device can refer to the description of the first aspect or the second aspect, which will not be repeated here for the sake of brevity.

其中,上述第一方面或第二方面描述的方法可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。例如,处理模块或单元、显示模块或单元,通信模块或单元等。The method described in the first aspect or the second aspect above can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a processing module or unit, a display module or unit, a communication module or unit, etc.

第五方面,本申请实施例提供一种电子设备,包括:一个或多个处理器;一个或多个存储器;存储器存储有一个或多个程序,当一个或者多个程序被处理器执行时,使得电子设备执行上述第一方面及第一方面中任一项可能的方法。In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; one or more memories; the memory stores one or more programs, and when one or more programs are executed by the processor, the electronic device executes the above-mentioned first aspect and any possible method in the first aspect.

第六方面,本申请实施例提供一种电子设备,包括:一个或多个处理器;一个或多个存储器;存储器存储有一个或多个程序,当一个或者多个程序被处理器执行时,使得电子设备执行上述第二方面及第二方面中任一项可能的方法。In the sixth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; one or more memories; the memory stores one or more programs, and when one or more programs are executed by the processor, the electronic device executes the above-mentioned second aspect and any possible method in the second aspect.

第七方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序指令。当计算机程序指令被电子设备执行时,使得电子设备实现如第一方面或第一方面的可能的实现方式中任一项所述的存储数据的方法;或者,当计算机程序指令被电子设备执行时,使得电子设备实现如第二方面或第二方面的可能的实现方式中任一项所述的存储数据的方法。In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by an electronic device, the electronic device implements a method for storing data as described in any one of the first aspect or possible implementations of the first aspect; or, when the computer program instructions are executed by an electronic device, the electronic device implements a method for storing data as described in any one of the second aspect or possible implementations of the second aspect.

第八方面,本申请实施例提供一种装置(例如,该装置可以是芯片系统),该装置包括处理器,用于支持第一设备实现上述第一方面中所涉及的功能;或者,用于支持第二设备实现上述第二方面中所涉及的功能。该装置是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件。可选地,所述芯片系统还包括存储器,存储器与处理器通过电路或电线连接。In an eighth aspect, an embodiment of the present application provides a device (for example, the device may be a chip system), which includes a processor for supporting a first device to implement the functions involved in the first aspect above; or, for supporting a second device to implement the functions involved in the second aspect above. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices. Optionally, the chip system also includes a memory, and the memory is connected to the processor via a circuit or wire.

第九方面,本申请实施例提供一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,使得电子设备实现如第一方面或第一方面的可能的实现方式中任一项所述的存储数据的方法;或者,当所述计算机可读代码在电子设备中运行时,使得电子设备实现如第二方面或第二方面的可能的实现方式中任一项所述的存储数据的方法。In a ninth aspect, an embodiment of the present application provides a computer program product, comprising a computer readable code, which, when the computer readable code is executed in an electronic device, enables the electronic device to implement a method for storing data as described in the first aspect or any possible implementation of the first aspect; or, when the computer readable code is executed in an electronic device, enables the electronic device to implement a method for storing data as described in the second aspect or any possible implementation of the second aspect.

上述第二方面至第九方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。The technical effects obtained in the above-mentioned second to ninth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1示出了本申请实施例提供的一种存储数据的方法所应用的系统示意图;FIG1 is a schematic diagram of a system used in a method for storing data provided in an embodiment of the present application;

图2示出了本申请实施例提供的又一种存储数据的方法所应用的系统示意图;FIG2 shows a schematic diagram of a system used in another method for storing data provided in an embodiment of the present application;

图3示出了本申请实施例提供的第四设备(手机100)的结构示意图;FIG3 shows a schematic structural diagram of a fourth device (mobile phone 100) provided in an embodiment of the present application;

图4示出了本申请实施例提供的第一设备(路由器200)的结构示意图;FIG4 shows a schematic diagram of the structure of a first device (router 200) provided in an embodiment of the present application;

图5示出了本申请实施例提供的第二设备(云服务器300)的结构示意图;FIG5 shows a schematic diagram of the structure of a second device (cloud server 300) provided in an embodiment of the present application;

图6示出了本申请实施例提供的一种存储数据的方法的流程示意图;FIG6 is a schematic diagram showing a flow chart of a method for storing data provided in an embodiment of the present application;

图7示出了本申请实施例提供的一种用于存储数据的界面示意图之一;FIG. 7 shows one of the schematic diagrams of an interface for storing data provided in an embodiment of the present application;

图8示出了本申请实施例提供的一种用于存储数据的界面示意图之二;FIG8 shows a second schematic diagram of an interface for storing data provided in an embodiment of the present application;

图9示出了本申请实施例提供的一种用于存储数据的界面示意图之三;FIG9 shows a third schematic diagram of an interface for storing data provided in an embodiment of the present application;

图10示出了本申请实施例提供的一种存储数据的方法中加密过程的流程示意图;FIG10 is a schematic diagram showing a flow chart of an encryption process in a method for storing data provided in an embodiment of the present application;

图11示出了本申请实施例提供的一种用于存储数据的界面示意图之四;FIG11 shows a fourth schematic diagram of an interface for storing data provided in an embodiment of the present application;

图12示出了本申请实施例提供的一种用于存储数据的界面示意图之五;FIG12 shows a fifth schematic diagram of an interface for storing data provided in an embodiment of the present application;

图13示出了本申请实施例提供的一种存储数据的方法中解密过程的流程示意图;FIG13 is a schematic diagram showing a flow chart of a decryption process in a method for storing data provided in an embodiment of the present application;

图14示出了本申请实施例提供的一种用于存储数据的界面示意图之六;FIG14 shows a sixth schematic diagram of an interface for storing data provided in an embodiment of the present application;

图15示出了本申请实施例提供的一种装置的结构示意图。FIG. 15 shows a schematic diagram of the structure of a device provided in an embodiment of the present application.

图16示出了本申请实施例提供的又一种装置的结构示意图。FIG. 16 shows a schematic structural diagram of another device provided in an embodiment of the present application.

图17示出了本申请实施例提供的电子设备的软件结构示意图。FIG. 17 shows a schematic diagram of the software structure of the electronic device provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。In order to make the purpose, technical scheme and advantages of the present application clearer, the implementation mode of the present application will be further described in detail below with reference to the accompanying drawings. Hereinafter, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present embodiment, unless otherwise specified, the meaning of "multiple" is two or more.

目前,手机、平板电脑等移动终端已经成为人们日常生活中常用的工具,移动终端可以用来拍摄,即时聊天,浏览网站,观看视频,手机支付等等,并可安装各种应用程序以实现不同的功能,因此,移动终端中会存储很多的信息,如联系人信息、通话记录、账号密码、照片、短信、数据等。随着手机、平板电脑等移动终端中存储的信息的增加,移动终端的存储空间越来越紧张。At present, mobile terminals such as mobile phones and tablet computers have become common tools in people's daily lives. Mobile terminals can be used to take pictures, chat instantly, browse websites, watch videos, make mobile payments, etc., and various applications can be installed to achieve different functions. Therefore, a lot of information is stored in mobile terminals, such as contact information, call records, account passwords, photos, text messages, data, etc. With the increase of information stored in mobile terminals such as mobile phones and tablet computers, the storage space of mobile terminals is becoming increasingly tight.

通常情况下,用户可以删除部分数据以释放存储空间,但是对于一些珍贵的照片、视频等数据,用户可能并不想删除,若用户不想删除数据,可以将数据上传到云空间进行存储,但是,云空间中可以免费使用的容量较小,若用户想扩展云空间的容量,需要支付额外的费用,并且云空间容易遭到恶意攻击。或者,用户可以将数据拷贝到移动硬盘中进行存储,但是将数据拷贝到移动硬盘的操作较为繁琐,此外移动硬盘一般是明文存储,若移动硬盘丢失存在数据泄漏风险,安全性得不到保障;为了提高安全性,用户可以自己对存储到移动硬盘的数据进行加密,在此情况下,用户需要记录用于加密的密钥,若忘记密钥或丢失密钥将导致存储到移动硬盘的数据很难被解密。Normally, users can delete some data to free up storage space, but users may not want to delete some precious photos, videos and other data. If users do not want to delete data, they can upload the data to the cloud space for storage. However, the free capacity of the cloud space is small. If users want to expand the capacity of the cloud space, they need to pay extra fees, and the cloud space is vulnerable to malicious attacks. Alternatively, users can copy the data to a mobile hard disk for storage, but the operation of copying data to a mobile hard disk is cumbersome. In addition, mobile hard disks generally store data in plain text. If the mobile hard disk is lost, there is a risk of data leakage and security cannot be guaranteed. In order to improve security, users can encrypt the data stored in the mobile hard disk by themselves. In this case, users need to record the encryption key. If the key is forgotten or lost, the data stored in the mobile hard disk will be difficult to decrypt.

有鉴于此,本申请实施例提供一种存储数据的方法以及存储数据的系统,通过本申请方案,在第一设备或其他设备的存储空间紧张的情况下,用户可以选择将一些数据加密后转存至第三设备,其中,用于加密的密钥是通过第二设备生成的,且将密钥与数据分别存储在不同的设备上,从而缓解移动终端存储空间越来越紧张的问题,实现安全、可靠、长期、易操作的转存数据。In view of this, an embodiment of the present application provides a method for storing data and a system for storing data. Through the scheme of the present application, when the storage space of a first device or other devices is tight, a user can choose to encrypt some data and then transfer it to a third device, wherein the encryption key is generated by a second device, and the key and the data are stored on different devices respectively, thereby alleviating the problem of increasingly tight storage space of mobile terminals and achieving safe, reliable, long-term and easy-to-operate data transfer.

其中,密钥是一种参数,它是在明文转换为密文或者密文转换为明文的过程中必须输入的参数。使用加密算法将明文编码为密文的过程称为加密,相应地,使用解密算法将密文解码为明文的过程称为解密。Among them, the key is a parameter that must be input in the process of converting plaintext to ciphertext or ciphertext to plaintext. The process of encoding plaintext into ciphertext using an encryption algorithm is called encryption, and correspondingly, the process of decoding ciphertext into plaintext using a decryption algorithm is called decryption.

下面依次对本申请实施例提供的系统、设备和方法进行介绍。The following is an introduction to the systems, devices and methods provided in the embodiments of the present application.

图1示出了本申请实施例所涉及的一例存储数据的系统示意图。如图1所示,该存储数据的通信系统可以包括第一设备、第二设备和第三设备。Fig. 1 shows a schematic diagram of a system for storing data according to an embodiment of the present application. As shown in Fig. 1, the communication system for storing data may include a first device, a second device and a third device.

第一设备可以通过无线通信技术与第二设备建立无线连接,无线通信技术包括但不限于:包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code divisionmultiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),第五代移动通信技术(英语:5th generation mobilenetworks或5th generation wireless systems,简称5G)全球导航卫星系统(globalnavigation satellite system,GNSS),无线局域网(wireless local area networks,WLAN),无线保真(wireless fidelity,Wi-Fi)网络,蓝牙(Bluetooth,BT),调频(frequencymodulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenithsatellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。The first device can establish a wireless connection with the second device through wireless communication technology, and the wireless communication technology includes but is not limited to: global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), fifth generation mobile communication technology (English: 5th generation mobile networks or 5th generation wireless systems, referred to as 5G), global navigation satellite system (GNSS), wireless local area networks (WLAN), wireless fidelity (Wi-Fi) network, Bluetooth (BT), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and/or a satellite based augmentation system (SBAS).

第一设备可以通过有线的方式与第三设备进行通信连接。例如,第一设备可以通过通用串行总线(Universal Serial Bus,USB)接口连接第三设备。在第三设备与第一设备连接之后,第一设备可以显示第三设备中的数据。The first device can be connected to the third device in a wired manner. For example, the first device can be connected to the third device via a Universal Serial Bus (USB) interface. After the third device is connected to the first device, the first device can display data in the third device.

其中,第一设备可以为移动终端,也可以为非移动终端。示例性的,第一设备可以为手机、可穿戴式设备(如:智能手表、智能手环)、平板电脑、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、路由器等具有处理能力和存储能力的设备。The first device may be a mobile terminal or a non-mobile terminal. For example, the first device may be a mobile phone, a wearable device (such as a smart watch or a smart bracelet), a tablet computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) or virtual reality (VR) device, a router, or other device with processing and storage capabilities.

第二设备可以为路由器、台式计算机、边缘服务器、云服务器等具有处理能力和存储能力的设备。The second device may be a router, a desktop computer, an edge server, a cloud server, or other device with processing and storage capabilities.

第三设备可以为U盘、移动硬盘等存储介质,也可以是其他具有存储能力的设备。The third device may be a storage medium such as a USB flash drive, a mobile hard disk, or other device with storage capabilities.

本申请实施例对第一设备、第二设备和第三设备的设备类型不予限定。例如,在一些实现方式中,如图1所示,第一设备可以为手机或平板电脑等,第二设备可以为云服务器,第三设备可以是移动硬盘。The embodiment of the present application does not limit the device types of the first device, the second device and the third device. For example, in some implementations, as shown in FIG1 , the first device may be a mobile phone or a tablet computer, the second device may be a cloud server, and the third device may be a mobile hard disk.

当第一设备中存储的一些数据需要转存时,用户可以在第一设备上进行第一操作以向第一设备输入第一指令,第一设备在接收到第一指令之后,即响应于第一操作,向第二设备发送第一请求,第一指令用于指示对目标数据进行加密存储,第一请求用于请求第二设备生成第一密钥,第一密钥用于对目标数据进行加密。When some data stored in the first device needs to be transferred, the user can perform a first operation on the first device to input a first instruction to the first device. After receiving the first instruction, the first device sends a first request to the second device in response to the first operation. The first instruction is used to instruct the target data to be encrypted and stored. The first request is used to request the second device to generate a first key, and the first key is used to encrypt the target data.

第二设备接收来自第一设备的第一请求,响应于该第一请求,第二设备生成第一密钥,然后第二设备向第一设备发送第一密钥。The second device receives the first request from the first device, generates a first key in response to the first request, and then sends the first key to the first device.

第一设备接收到来自第二设备的第一密钥之后,使用第一密钥对目标数据进行加密;然后第一设备将加密后的目标数据存储至第三设备,并删除本地加密后的目标数据。After receiving the first key from the second device, the first device uses the first key to encrypt the target data; then the first device stores the encrypted target data to the third device and deletes the locally encrypted target data.

其中,第一密钥可以存储在第一设备上,也可以存储在第二设备上。若第一密钥存储在第一设备上,当用户需要查看加密后的目标数据时,用户可以在第一设备上进行第二操作以向第一设备输入第二指令,第一设备在接收到第二指令之后,在设备内部查找第一密钥,使用第一密钥对加密后的目标数据进行解密。The first key may be stored on the first device or on the second device. If the first key is stored on the first device, when the user needs to view the encrypted target data, the user may perform a second operation on the first device to input a second instruction to the first device. After receiving the second instruction, the first device searches for the first key inside the device and uses the first key to decrypt the encrypted target data.

若第一密钥存储在第二设备上,第一设备在检测到第二指令之后,向第二设备发送第二请求,第二请求用于请求获取第一密钥。第二设备接收来自第一设备的第二请求,响应于该第二请求,第二设备在设备内部查找第一密钥,然后将第一密钥发送给第一设备。第一设备接收到第一密钥之后,使用第一密钥对加密后的目标数据进行解密。If the first key is stored on the second device, after detecting the second instruction, the first device sends a second request to the second device, and the second request is used to request to obtain the first key. The second device receives the second request from the first device, and in response to the second request, the second device searches for the first key inside the device, and then sends the first key to the first device. After receiving the first key, the first device uses the first key to decrypt the encrypted target data.

在一些实现方式中,第一设备也可以通过无线的方式与第三设备进行连接,第二设备通过有线的方式与第三设备进行通信连接。例如,第一设备可以为手机,第二设备可以为路由器,第三设备可以为U盘,U盘通过USB接口连接到路由器上,在手机使用第一密钥对目标数据进行加密之后,手机将加密后的目标数据发送给路由器,路由器将加密后的目标数据存储到U盘中。In some implementations, the first device may also be connected to the third device wirelessly, and the second device may be connected to the third device in a wired manner. For example, the first device may be a mobile phone, the second device may be a router, and the third device may be a USB flash drive, which is connected to the router via a USB interface. After the mobile phone encrypts the target data using the first key, the mobile phone sends the encrypted target data to the router, and the router stores the encrypted target data in the USB flash drive.

本申请实施例提供的方法,将加密后的目标数据转存至第三设备中之后,可以将第一设备中的目标数据删除,从而间接扩展第一设备的存储空间,缓解存储空间越来越紧张的问题。The method provided in the embodiment of the present application can delete the target data in the first device after transferring the encrypted target data to the third device, thereby indirectly expanding the storage space of the first device and alleviating the problem of increasingly tight storage space.

本申请实施例中,第一设备根据第一密钥对目标数据进行加密,保障了目标数据的安全,第一设备只将加密后的目标数据存储至第三设备,没有将第一密钥存储至第三设备,实现了第一密钥与目标数据的分开存储,能够减小第三设备丢失后目标数据被解密的风险,提高数据存储的安全性,且第三设备为用户私有设备,能够避免目标数据在网上泄露的风险。此外,第一密钥是由第二设备生成的,不需要用户自己管理密钥,从而提高用户体验。In the embodiment of the present application, the first device encrypts the target data according to the first key, thereby ensuring the security of the target data. The first device only stores the encrypted target data in the third device, and does not store the first key in the third device, thereby realizing the separate storage of the first key and the target data, which can reduce the risk of the target data being decrypted after the third device is lost, improve the security of data storage, and the third device is a user's private device, which can avoid the risk of target data being leaked online. In addition, the first key is generated by the second device, and the user does not need to manage the key himself, thereby improving the user experience.

需要说明的是,这里以存储数据的通信系统包括三个设备为例进行示例性说明,其并不对本申请实施例形成限定。可以理解,在实际实现时,存储数据的系统还可以包括更多或更少的设备。例如,在一些实现方式中,存储数据的系统包括两个设备:第一设备、第三设备,第一设备通过有线的方式与第三设备进行连接。例如,第一设备为手机,第三设备为移动硬盘,用户在第一设备上进行第一操作以向第一设备输入第一指令,第一设备在检测到第一指令之后,即响应于第一操作,生成第一密钥,然后使用第一密钥对目标数据进行加密,并将经过第一密钥加密后的目标数据存储至第三设备。It should be noted that the communication system for storing data includes three devices as an example for exemplary description, which does not limit the embodiments of the present application. It can be understood that in actual implementation, the system for storing data may also include more or fewer devices. For example, in some implementations, the system for storing data includes two devices: a first device and a third device, and the first device is connected to the third device by wire. For example, the first device is a mobile phone, and the third device is a mobile hard disk. The user performs a first operation on the first device to input a first instruction to the first device. After detecting the first instruction, the first device generates a first key in response to the first operation, and then uses the first key to encrypt the target data, and stores the target data encrypted by the first key to the third device.

例如,在一些实现方式中,存储数据的通信系统可以包括四个设备:第一设备、第二设备、第三设备和第四设备,其中,第四设备可以为手机、可穿戴式设备(如:智能手表、智能手环)、平板电脑、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobilepersonal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digitalassistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备等。For example, in some implementations, a communication system for storing data may include four devices: a first device, a second device, a third device, and a fourth device, wherein the fourth device may be a mobile phone, a wearable device (such as a smart watch, a smart bracelet), a tablet computer, a handheld computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, etc.

例如,图2示出了一种用户(第四设备)与第一设备处于近距离场景下的示意图,第一设备可以与第二设备、第四设备建立无线连接,第一设备可以通过有线的方式与第三设备进行通信连接。For example, Figure 2 shows a schematic diagram of a user (fourth device) and a first device in a close proximity scenario. The first device can establish a wireless connection with the second device and the fourth device, and the first device can communicate with the third device via a wired connection.

如图2所示,第一设备为路由器,第二设备为云服务器,第三设备为移动硬盘,第四设备为手机,手机通过Wi-Fi连接路由器,路由器与云服务器通信,移动硬盘通过USB接口连接到路由器上。用户使用手机控制路由器,在手机上选择需要转存的目标数据,如本地照片、视频、文档等,并且确定对目标数据进行加密,响应于用户操作,手机向路由器发送第一指令和目标数据。As shown in Figure 2, the first device is a router, the second device is a cloud server, the third device is a mobile hard disk, and the fourth device is a mobile phone. The mobile phone is connected to the router via Wi-Fi, the router communicates with the cloud server, and the mobile hard disk is connected to the router via a USB interface. The user uses the mobile phone to control the router, selects the target data to be transferred on the mobile phone, such as local photos, videos, documents, etc., and determines to encrypt the target data. In response to the user operation, the mobile phone sends the first instruction and the target data to the router.

路由器在接收到目标数据之后,存储目标数据,并且在接收到第一指令之后,向云服务器发送第一请求。云服务器接收到来自路由器的第一请求后,生成第一密钥,并将第一密钥发送给路由器。路由器根据第一密钥对目标数据进行加密,并将加密后的目标数据存储到移动硬盘。After receiving the target data, the router stores the target data, and after receiving the first instruction, sends a first request to the cloud server. After receiving the first request from the router, the cloud server generates a first key and sends the first key to the router. The router encrypts the target data according to the first key and stores the encrypted target data in the mobile hard disk.

在将加密后的目标数据存储到移动硬盘之后,路由器可以删除目标数据和第一密钥的相关记录,云服务器生成第一密钥后存储第一密钥,即第一密钥由云服务器存储,从而避免可能存在的手机、路由器出现问题的情况,减小第一密钥丢失的风险。After storing the encrypted target data in the mobile hard disk, the router can delete the relevant records of the target data and the first key. The cloud server stores the first key after generating the first key, that is, the first key is stored by the cloud server, thereby avoiding possible problems with the mobile phone and the router and reducing the risk of losing the first key.

在图2所示实现方式中,第四设备通过第一设备实现数据转存,缓解第四设备的存储空间。第一设备(路由器)属于一种中转设备,在手机转存数据的过程中,还可以有其他的设备通过路由器将数据转存到移动硬盘中,可以实现在同一时间段内将多个设备中的数据转存到第三设备,且云服务器的计算能力较强,使用云服务器生成第一密钥,可以提高存储数据的效率。In the implementation shown in FIG2 , the fourth device transfers data through the first device, thereby alleviating the storage space of the fourth device. The first device (router) is a transfer device. During the process of transferring data by the mobile phone, other devices can transfer data to the mobile hard disk through the router, so that data in multiple devices can be transferred to the third device in the same time period. The cloud server has strong computing power, and using the cloud server to generate the first key can improve the efficiency of storing data.

接下来结合附图介绍第一设备、第二设备和第四设备的硬件结构示意图。Next, the hardware structure diagrams of the first device, the second device and the fourth device are introduced in conjunction with the accompanying drawings.

以第四设备为手机为例,图3示出了本申请实施例提供的手机100的结构示意图。Taking the fourth device as a mobile phone as an example, FIG3 shows a schematic structural diagram of the mobile phone 100 provided in an embodiment of the present application.

手机100可以包括处理器110,外部存储器接口120,内部存储器121,USB接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及第二标识模块(subscriberidentification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a second identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,第二标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a second identification module (Subscriber Identity Module, SIM) interface, and/or a universal serial bus (USB) interface, etc.

I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.

USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为手机100充电,也可以用于手机100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transfer data between the mobile phone 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

手机100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。The wireless communication function of the mobile phone 100 can be realized by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.

移动通信模块150可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(lownoise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to the mobile phone 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

无线通信模块160可以提供应用在手机100上的包括无线局域网(wireless localarea networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequencymodulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile phone 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

在一些实施例中,手机100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得手机100可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.

手机100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。显示屏194用于显示图像,视频等。The mobile phone 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information. The display screen 194 is used to display images, videos, etc.

外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行手机100的各种功能应用以及数据处理。The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.

压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。手机100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,手机100根据压力传感器180A检测所述触摸操作强度。手机100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The mobile phone 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the mobile phone 100 detects the touch operation intensity according to the pressure sensor 180A. The mobile phone 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于手机100的表面,与显示屏194所处的位置不同。The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the mobile phone 100, which is different from the position of the display screen 194.

以第一设备为路由器为例,图4示出了本申请实施例提供的路由器200的结构示意图。Taking the first device as a router as an example, FIG4 shows a schematic structural diagram of a router 200 provided in an embodiment of the present application.

如图4所示,路由器200可以包括:处理器210,无线通信模块220,存储器230,电源模块240,通信接口250,开关260,以及天线。As shown in FIG. 4 , the router 200 may include: a processor 210 , a wireless communication module 220 , a memory 230 , a power module 240 , a communication interface 250 , a switch 260 , and an antenna.

处理器210可以包括一个或多个处理单元,例如:处理器210可以包括CPU,GPU,DSP,ISP,AP,NPU,调制解调处理器,控制器,视频编解码器,基带处理器等。在一些实施例中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,CPU是信息处理、程序运行的最终执行单元,其主要工作包括处理指令、执行操作、控制时间和处理数据等。CPU可以包括控制器、运算器、高速缓冲存储器,以及用于连接这些部件的总线。The processor 210 may include one or more processing units, for example, the processor 210 may include a CPU, a GPU, a DSP, an ISP, an AP, an NPU, a modem processor, a controller, a video codec, a baseband processor, etc. In some embodiments, different processing units may be independent devices or integrated into one or more processors. Among them, the CPU is the final execution unit for information processing and program running, and its main tasks include processing instructions, executing operations, controlling time, and processing data. The CPU may include a controller, an arithmetic unit, a cache memory, and a bus for connecting these components.

无线通信模块220可以提供Wi-Fi、调频(frequency modulation,FM)、蓝牙或NFC等无线通信。无线通信模块220可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块220经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块220还可以从处理器210接收待发送的信号,对其进行调频、放大,经天线转为电磁波辐射出去。The wireless communication module 220 can provide wireless communication such as Wi-Fi, frequency modulation (FM), Bluetooth or NFC. The wireless communication module 220 can be one or more devices integrating at least one communication processing module. The wireless communication module 220 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 220 can also receive the signal to be sent from the processor 210, modulate and amplify it, and convert it into electromagnetic waves for radiation through the antenna.

存储器230,可以用于存储计算机可执行程序代码,可执行程序代码包括计算机指令。处理器210通过运行存储在存储器230的指令,从而执行各种功能以及数据处理。存储器230可以包括存储程序区和存储数据区。其中,存储程序区可存储至少一个功能(比如生成密钥,发送请求等)所需的应用程序。存储数据区可存储接收的来自其他设备的目标数据、密钥等。此外,存储器230可以包括高速随机存取存储器,还可以包括非易失性存储器等。The memory 230 can be used to store computer executable program codes, and the executable program codes include computer instructions. The processor 210 executes various functions and data processing by running the instructions stored in the memory 230. The memory 230 may include a program storage area and a data storage area. Among them, the program storage area may store at least one application required for a function (such as generating a key, sending a request, etc.). The data storage area may store target data, keys, etc. received from other devices. In addition, the memory 230 may include a high-speed random access memory, and may also include a non-volatile memory, etc.

电源模块240,可以用于接收电源输入,储蓄电能,以及为处理器210、无线通信模块220、存储器230等供电。The power module 240 can be used to receive power input, store electrical energy, and provide power to the processor 210, the wireless communication module 220, the memory 230, etc.

通信接口250,可以用于与电子设备、移动硬盘和U盘等外部设备通讯。通信接口250可以为网口或通用串行总线(universal serial bus,USB)接口等任意可能的接口。The communication interface 250 can be used to communicate with external devices such as electronic devices, mobile hard disks, and USB flash drives. The communication interface 250 can be any possible interface such as a network port or a universal serial bus (USB) interface.

开关260用于触发路由器的开启或者关闭。The switch 260 is used to trigger the router to be turned on or off.

以第二设备为云服务器为例,图5示出了本申请实施例提供的云服务器300的结构示意图。Taking the second device as a cloud server as an example, FIG5 shows a schematic diagram of the structure of the cloud server 300 provided in an embodiment of the present application.

如图5所示,云服务器300可以包括处理器310、存储器320及通信模块330。As shown in FIG. 5 , the cloud server 300 may include a processor 310 , a memory 320 , and a communication module 330 .

处理器310可用于读取和执行计算机可读指令。具体地,处理器310可以包括控制器、运算器和寄存器。其中,控制器主要负责指令译码,并为指令对应的操作发出控制信号。运算器主要负责保存指令执行过程中临时存放的寄存器操作数和中间操作结果等。具体实现中,处理器310的硬件架构可以是专用集成电路(application specificintegratedcircuit,ASIC)架构、MIPS(microprocessor without interlocked pipedstages)架构、ARM(advanced risc machines)架构或者网络处理器(net processor,NP)架构等等。The processor 310 can be used to read and execute computer-readable instructions. Specifically, the processor 310 may include a controller, an arithmetic unit, and a register. Among them, the controller is mainly responsible for decoding instructions and issuing control signals for operations corresponding to the instructions. The arithmetic unit is mainly responsible for saving register operands and intermediate operation results temporarily stored during the execution of instructions. In a specific implementation, the hardware architecture of the processor 310 may be an application specific integrated circuit (ASIC) architecture, a MIPS (microprocessor without interlocked piped stages) architecture, an ARM (advanced RISC machines) architecture, or a network processor (NP) architecture, etc.

存储器320与处理器310耦合,用于存储各种软件程序和/或多组指令。具体实现中,存储器320可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。存储器320可以存储操作系统,例如uCOS,VxWorks、RTLinux等嵌入式操作系统。The memory 320 is coupled to the processor 310 and is used to store various software programs and/or multiple sets of instructions. In a specific implementation, the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices. The memory 320 may store an operating system, such as an embedded operating system such as uCOS, VxWorks, RTLinux, etc.

通信模块330可用于通过网络建立云服务器300与其它通信终端之间的通信连接,并用于通过网络收发数据。The communication module 330 may be used to establish a communication connection between the cloud server 300 and other communication terminals through a network, and to send and receive data through a network.

可以理解的是,本实施例示意的结构并不构成对手机100、路由器200、云服务器300的具体限定。在另一些实施例中,手机100、路由器200、云服务器300可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is understood that the structure shown in this embodiment does not constitute a specific limitation on the mobile phone 100, the router 200, and the cloud server 300. In other embodiments, the mobile phone 100, the router 200, and the cloud server 300 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

下面对本申请实施例提供的存储数据的方法进行描述。The following describes a method for storing data provided in an embodiment of the present application.

图6为本申请实施例提供的存储数据的方法的流程示意图。继续以第一设备为路由器,第二设备为云服务器,第三设备为移动硬盘,第四设备为手机为例进行示意性说明,如图6所示,用户可以先将目标数据转存到移动硬盘,该方法包括下述S601-S606。Figure 6 is a flow chart of a method for storing data provided by an embodiment of the present application. Continuing to take the first device as a router, the second device as a cloud server, the third device as a mobile hard disk, and the fourth device as a mobile phone as an example for schematic description, as shown in Figure 6, the user can first transfer the target data to the mobile hard disk, and the method includes the following S601-S606.

S601,手机与路由器建立连接。S601, the mobile phone establishes a connection with the router.

本申请实施例不限定第一设备与第四设备的连接方式。手机与路由器之间可以建立有线连接,如可以通过USB方式建立连接,手机与路由器之间可以进行USB通信。手机与路由之间也可以建立无线连接,其中,无线连接可以是通过蓝牙协议建立的连接,也可以是通过Wi Fi协议建立的连接。The embodiment of the present application does not limit the connection method between the first device and the fourth device. A wired connection can be established between the mobile phone and the router, such as a connection can be established through USB, and USB communication can be performed between the mobile phone and the router. A wireless connection can also be established between the mobile phone and the router, wherein the wireless connection can be a connection established through the Bluetooth protocol or a connection established through the Wi Fi protocol.

其中,当手机与路由器建立无线连接,路由器通过端口,如80http web端口,监听来自手机的信息。Among them, when the mobile phone establishes a wireless connection with the router, the router monitors the information from the mobile phone through a port, such as the 80http web port.

S602,移动硬盘与路由器建立连接。S602, the mobile hard disk establishes a connection with the router.

路由器上配置有USB接口,移动硬盘可以通过USB接口插入到路由器上,从而建立连接。The router is equipped with a USB interface, and the mobile hard drive can be inserted into the router through the USB interface to establish a connection.

S603,手机检测到来自用户的转存操作。S603, the mobile phone detects a transfer operation from the user.

本申请实施例中,手机可以显示多个用于管理数据的预设界面,用户可以通过预设界面选择转存数据、加密数据以及解密数据,通过预设界面选择转存的数据时,手机可以向路由器批量发送不同类型的数据。In an embodiment of the present application, the mobile phone can display multiple preset interfaces for managing data. The user can choose to transfer data, encrypt data, and decrypt data through the preset interface. When selecting data to transfer through the preset interface, the mobile phone can send different types of data to the router in batches.

示例性地,图7示出了本申请实施例提供的一种管理数据的界面示意图。本申请实施例中,开发者可以预先创建一个公众号,该公众号可以实现很多功能,如图7中的(a)所示,用户进入该公众号之后,手机显示公众号主界面,公众号主界面中包括该公众号发布过的文章,以及一些用于用户交互的控件,如设备管理控件71。如图7中的(b)所示,用户点击设备管理控件71之后,进入设备管理界面,手机显示当前已经与手机建立连接的设备,例如,已连接设备包括路由器72、电脑73、手表74、U盘75等,手机显示已连接设备的图标,用户还可以通过查找控件76查找其他可连接设备。Exemplarily, FIG7 shows a schematic diagram of an interface for managing data provided in an embodiment of the present application. In an embodiment of the present application, a developer can pre-create a public account, which can implement many functions. As shown in (a) in FIG7 , after the user enters the public account, the mobile phone displays the main interface of the public account, which includes articles published by the public account, and some controls for user interaction, such as the device management control 71. As shown in (b) in FIG7 , after the user clicks the device management control 71, the device management interface is entered, and the mobile phone displays the devices that are currently connected to the mobile phone. For example, the connected devices include a router 72, a computer 73, a watch 74, a USB flash drive 75, etc. The mobile phone displays the icons of the connected devices, and the user can also search for other connectable devices through the search control 76.

用户可以选择已连接设备中的一个设备用于存储数据。例如,如图7中的(c)所示,用户点击路由器72的图标之后,手机进入路由器登录界面,路由器登录界面包括路由器图标、用于输入账号和密码的输入框、用于触发登录的控件。用户在输入框中输入路由器的登录账号和密码之后,点击“登录”,通过验证后,手机显示路由器管理界面。如图7中的(d)所示,用户可以设置路由器的密码、上网设置、WIFI设置等,用户可以在路由器管理界面中点击控件77进入路由器的转存功能,然后手机显示如图8中的(a)所示的界面。The user can select one of the connected devices to store data. For example, as shown in (c) of FIG. 7 , after the user clicks the icon of the router 72, the mobile phone enters the router login interface, which includes a router icon, an input box for entering an account and password, and a control for triggering login. After the user enters the login account and password of the router in the input box, clicks "Login", and after verification, the mobile phone displays the router management interface. As shown in (d) of FIG. 7 , the user can set the router's password, Internet settings, WIFI settings, etc. The user can click control 77 in the router management interface to enter the router's transfer function, and then the mobile phone displays the interface shown in (a) of FIG. 8 .

如图8中的(a)所示,路由器的转存功能可以包括两部分:转入硬盘和查看硬盘,转入硬盘指的是将手机中存储的数据通过路由器转移到移动硬盘中进行存储,查看硬盘指的是通过路由器获取移动硬盘中已存储的数据,查看移动硬盘中的数据,对移动硬盘中的数据进行修改等。As shown in (a) of FIG8 , the transfer function of the router may include two parts: transferring to the hard disk and viewing the hard disk. Transferring to the hard disk refers to transferring the data stored in the mobile phone to the mobile hard disk for storage through the router, and viewing the hard disk refers to obtaining the data stored in the mobile hard disk through the router, viewing the data in the mobile hard disk, modifying the data in the mobile hard disk, etc.

用户点击“转入硬盘”,并授权手机读取本地数据之后,如图8中的(b)所示,手机显示本地存储的照片、视频、文档等数据,用户可以选择其中的一个或同时选择多个文件,在选中需要转移到移动硬盘中进行存储的数据之后,用户可以点击“存储”,手机将用户选中的数据确定为目标数据,然后开始传输数据。After the user clicks "Transfer to Hard Drive" and authorizes the mobile phone to read local data, as shown in (b) of Figure 8, the mobile phone displays locally stored photos, videos, documents and other data. The user can select one or multiple files at the same time. After selecting the data to be transferred to the mobile hard drive for storage, the user can click "Save". The mobile phone determines the data selected by the user as the target data and then starts transferring the data.

S604,响应于用户的转存操作,手机向路由器发送目标数据。S604, in response to the user's transfer operation, the mobile phone sends the target data to the router.

其中,手机可以使用超文本传输协议(Hyper Text Transfer Protocol,HTTP)将目标数据发送给路由器。Among them, the mobile phone can use Hyper Text Transfer Protocol (HTTP) to send target data to the router.

S605,路由器通过端口,如80http web端口,接收到目标数据。S605, the router receives the target data through a port, such as 80http web port.

S606,路由器将目标数据存储到移动硬盘中。S606, the router stores the target data in the mobile hard disk.

路由器接收到目标数据之后,可以将目标数据直接存储到移动硬盘中,在将目标数据存储到移动硬盘中时,路由器可以根据日期在移动硬盘中创建新的文件夹1,将本次接收的目标数据存储至新的文件夹1中。After the router receives the target data, it can store the target data directly in the mobile hard disk. When storing the target data in the mobile hard disk, the router can create a new folder 1 in the mobile hard disk according to the date, and store the target data received this time in the new folder 1.

在S606之后,路由器可以向手机发送数据传输完成的通知,在确认路由器接收到目标数据之后,手机可以将目标数据从手机的存储空间中删除。After S606, the router may send a notification of data transmission completion to the mobile phone. After confirming that the router has received the target data, the mobile phone may delete the target data from the storage space of the mobile phone.

路由器将目标数据存储到移动硬盘中之后,用户可以选择对移动硬盘中的目标数据进行加密。例如,手机显示如图9中的(a)所示的界面,用户点击“查看硬盘”之后,手机可以获取移动硬盘中已存储的数据,并按照名称、日期、类型等格式排列数据,显示给用户,如图9中的(b)所示,手机显示了文件1、文档1、文档2、压缩包2022-22-23等数据,用户找到存储目标数据的文件夹1,点击“加密”按钮以请求对文件夹1中的目标数据进行加密。可以理解的是,图9中的(b)所示的显示方式只是一种示例,不同的设备可以适应性的显示不同的格式。After the router stores the target data in the mobile hard disk, the user can choose to encrypt the target data in the mobile hard disk. For example, the mobile phone displays the interface shown in (a) of Figure 9. After the user clicks "View Hard Disk", the mobile phone can obtain the data stored in the mobile hard disk and arrange the data in the format of name, date, type, etc., and display it to the user. As shown in (b) of Figure 9, the mobile phone displays data such as file 1, document 1, document 2, compressed package 2022-22-23, etc. The user finds folder 1 storing the target data and clicks the "Encrypt" button to request encryption of the target data in folder 1. It can be understood that the display method shown in (b) of Figure 9 is only an example, and different devices can adaptively display different formats.

图10示出了本申请实施例提供的存储数据的方法的流程示意图。如图10所示,该加密的过程包括下述S1001-S1007。Fig. 10 shows a schematic flow chart of a method for storing data provided in an embodiment of the present application. As shown in Fig. 10, the encryption process includes the following S1001-S1007.

S1001,手机检测到来自用户的加密操作,向路由器发送第一指令,第一指令指示对目标数据进行加密。S1001, the mobile phone detects an encryption operation from the user and sends a first instruction to the router, where the first instruction instructs to encrypt the target data.

例如,加密操作(第一操作)可以是点击“加密”按钮的操作,也可以是点击“加密存储”按钮的操作。For example, the encryption operation (first operation) may be an operation of clicking an “encryption” button or an operation of clicking an “encrypted storage” button.

S1002,路由器接收到第一指令,获取用于加密的信息。S1002: The router receives the first instruction and obtains information for encryption.

路由器接收到第一指令之后,对第一指令进行解析,得到需要对目标数据进行加密的指示,获取用于加密的信息,然后向云服务器发送第一请求,第一请求用于请求云服务器生成第一密钥。After receiving the first instruction, the router parses the first instruction, obtains an indication that the target data needs to be encrypted, obtains information used for encryption, and then sends a first request to the cloud server, where the first request is used to request the cloud server to generate a first key.

S1003,路由器向云服务器发送第一请求。S1003, the router sends a first request to the cloud server.

在一些实现方式中,第一请求可以包括目标数据的第一标识,目标数据的第一标识唯一对应待加密的数据。第一标识为目标数据的内容标识,例如,目标数据的第一标识可以是信息摘要MD5值(Message Digest Algorithm MD5),路由器接收到第一指令之后,读取文件夹1中目标数据的内容,并根据所有数据的内容计算出MD5值。In some implementations, the first request may include a first identifier of the target data, and the first identifier of the target data uniquely corresponds to the data to be encrypted. The first identifier is a content identifier of the target data, for example, the first identifier of the target data may be a message digest MD5 value (Message Digest Algorithm MD5). After receiving the first instruction, the router reads the content of the target data in folder 1 and calculates the MD5 value based on the content of all the data.

在另一些实现方式中,第一请求可以包括目标数据的第二标识,第二标识为目标数据对应的用户的标识,例如,公众号为微信公众号,第二标识可以是微信标识,手机检测到加密操作之后,获取微信标识appid,一个appid唯一对应一个微信账号,手机在向路由器发送第一指令时,可以将微信标识appid携带在第一指令中,从而路由器对第一指令进行解析之后可以获取到微信标识appid。例如,第二标识也可以是移动设备识别码(MobileEquipment Identifier,MEID),MEID为手机的唯一标识。In other implementations, the first request may include a second identifier of the target data, and the second identifier is an identifier of the user corresponding to the target data. For example, if the public account is a WeChat public account, the second identifier may be a WeChat identifier. After the mobile phone detects the encryption operation, it obtains the WeChat identifier appid. An appid uniquely corresponds to a WeChat account. When the mobile phone sends the first instruction to the router, the WeChat identifier appid may be carried in the first instruction, so that the router may obtain the WeChat identifier appid after parsing the first instruction. For example, the second identifier may also be a mobile equipment identifier (MEID), which is a unique identifier of the mobile phone.

在另一些实现方式中,第一请求可以包括目标数据的第一标识和目标数据的第二标识。In some other implementations, the first request may include a first identifier of the target data and a second identifier of the target data.

S1004,云服务器接收到第一请求,生成第一密钥。S1004: The cloud server receives the first request and generates a first key.

云服务器根据第一请求中携带的信息生成第一密钥,例如,云服务器根据微信标识appid和MD5值生成目标数据对应的唯一的高级加密标准(Advanced EncryptionStandard,AES)的对称加密密钥,在这一实现方式中,目标数据的内容的不同,每次加密数据生成的第一密钥均不相同,解密时需要使用与加密时使用的第二标识相同的设备或微信,其他用户无法对本用户的数据进行解密,从而提高存储数据的安全性。The cloud server generates a first key based on the information carried in the first request. For example, the cloud server generates a unique Advanced Encryption Standard (AES) symmetric encryption key corresponding to the target data based on the WeChat identifier appid and the MD5 value. In this implementation, the first key generated each time the data is encrypted is different depending on the content of the target data. Decryption requires the use of a device or WeChat with the same second identifier as used for encryption. Other users cannot decrypt the user's data, thereby improving the security of stored data.

云服务器生成第一密钥后,存储第一密钥,以及生成第一密钥时使用的目标数据的第一标识,或,第二标识,或,目标数据的第一标识和第二标识。After generating the first key, the cloud server stores the first key and the first identifier of the target data used when generating the first key, or the second identifier, or the first identifier and the second identifier of the target data.

S1005,云服务器将第一密钥发送给路由器。S1005, the cloud server sends the first key to the router.

S1006,路由器接收来自云服务器的第一密钥,并根据第一密钥对目标数据进行加密。S1006, the router receives the first key from the cloud server and encrypts the target data according to the first key.

S1007,路由器向手机发送包含加密进度的信息。S1007, the router sends information including encryption progress to the mobile phone.

在加密的过程中,路由器可以将包含加密进度的信息发送给手机,手机向用户显示当前加密进度,如图11中的(a)所示,当路由器的加密进度为80%时,手机可以显示加密进度为80%。如图11中的(b)所示,加密完成后,手机向用户显示加密已完成。During the encryption process, the router can send information containing the encryption progress to the mobile phone, and the mobile phone displays the current encryption progress to the user. As shown in (a) of FIG11 , when the encryption progress of the router is 80%, the mobile phone can display the encryption progress as 80%. As shown in (b) of FIG11 , after the encryption is completed, the mobile phone displays to the user that the encryption is completed.

在一些实现方式中,路由器在加密完成后,可以直接将加密后的目标数据压缩存储,以节省存储空间。例如,加密完成后的界面如图12中的(a)所示,路由器将加密后的目标数据压缩为压缩包2,压缩包2可以为zip格式,压缩包2可以根据当前日期命名为2022-08-26。In some implementations, after the encryption is completed, the router can directly compress and store the encrypted target data to save storage space. For example, the interface after the encryption is completed is shown in (a) of FIG. 12 , and the router compresses the encrypted target data into a compressed package 2, which can be in a zip format and can be named 2022-08-26 according to the current date.

在一些实现方式中,路由器将加密后的文件夹1和目标数据的第一标识同时压缩到压缩包2中,如图12中的(b)所示,从而在解密数据时可以从压缩包中获取目标数据的第一标识,便于查找目标数据的第一标识。In some implementations, the router compresses the encrypted folder 1 and the first identifier of the target data into the compressed package 2 at the same time, as shown in (b) in Figure 12, so that the first identifier of the target data can be obtained from the compressed package when decrypting the data, which facilitates the search for the first identifier of the target data.

在另一些实现方式中,路由器还可以将第二标识也存储到压缩包中。这样,当用户查看移动硬盘中的内容时,路由器向用户显示压缩包来自于哪一用户,从而方便用户查找加密后的目标数据。解密时,路由器可以根据本次获取的用户的标识,与压缩包中的第二标识进行对比,当二者不匹配时,将不能对加密后的数据进行操作。In other implementations, the router can also store the second identifier in the compressed package. In this way, when the user views the content in the mobile hard disk, the router shows the user which user the compressed package comes from, so that the user can find the encrypted target data easily. When decrypting, the router can compare the user identifier obtained this time with the second identifier in the compressed package. When the two do not match, the encrypted data cannot be operated.

在一些实现方式中,第一密钥也可以由路由器存储,或者路由器将第一密钥发送给手机,由手机存储第一密钥。In some implementations, the first key may also be stored by the router, or the router sends the first key to the mobile phone, and the mobile phone stores the first key.

上述实施例中,手机将一些被用户的选择文件确定为目标数据,先将目标数据发送至路由器,由路由器存储到移动硬盘中,再根据用户指示向路由器发送第一指令。也就是说,在移动硬盘中已经存储有未加密的数据的情况下,用户可以查看移动硬盘中的数据,手机也可以根据用户选择确定移动硬盘中未加密的数据为目标数据,向路由器发送第一指令。然后路由器确定需要加密的目标数据之后,向云服务器发送第一请求。In the above embodiment, the mobile phone determines some files selected by the user as target data, first sends the target data to the router, and the router stores it in the mobile hard disk, and then sends the first instruction to the router according to the user's instructions. In other words, if unencrypted data is already stored in the mobile hard disk, the user can view the data in the mobile hard disk, and the mobile phone can also determine the unencrypted data in the mobile hard disk as target data according to the user's selection, and send the first instruction to the router. Then, after the router determines the target data that needs to be encrypted, it sends the first request to the cloud server.

在一些实现方式中,在图8中的(b)所示的界面中,用户选中目标数据之后,可以点击“加密存储”,在步骤S603所述的检测到来自用户的转存操作之后,手机响应于用户的转存操作,向路由器发送第一指令和目标数据,其中,目标数据可以携带在第一指令中,路由器接收到第一指令后,执行步骤S1002及之后的步骤。其中,手机也可以先向路由器发送目标数据后发送第一指令,或者,手机也可以先向路由器发送第一指令后发送目标数据。路由器接收到目标数据之后,可以先将目标数据暂时存储在路由器的存储器中,在对目标数据进行加密之后将加密后的目标数据存储到移动硬盘中。将加密的目标数据存储至移动硬盘之后,路由器删除本地的目标数据。In some implementations, in the interface shown in (b) of FIG. 8 , after the user selects the target data, he can click “encrypted storage”. After the transfer operation from the user is detected in step S603, the mobile phone responds to the user's transfer operation and sends a first instruction and target data to the router, wherein the target data can be carried in the first instruction. After the router receives the first instruction, it executes step S1002 and subsequent steps. Among them, the mobile phone can also send the target data to the router first and then send the first instruction, or the mobile phone can also send the target data to the router first and then send the first instruction. After the router receives the target data, it can temporarily store the target data in the router's memory, and after encrypting the target data, store the encrypted target data in the mobile hard disk. After storing the encrypted target data in the mobile hard disk, the router deletes the local target data.

本申请实施例提供的方法,将加密后的目标数据转存至移动硬盘中之后,可以将手机中的目标数据删除,从而间接扩展手机的存储空间,缓解手机的存储空间越来越紧张的问题。The method provided in the embodiment of the present application can delete the target data in the mobile phone after transferring the encrypted target data to the mobile hard disk, thereby indirectly expanding the storage space of the mobile phone and alleviating the problem of increasingly tight storage space of the mobile phone.

本申请实施例中,路由器根据第一密钥对目标数据进行加密,保障了目标数据的安全,路由器只将经过第一密钥加密后的目标数据存储至移动硬盘,没有将第一密钥也存储至移动硬盘,实现了第一密钥与目标数据的分开存储,能够减小移动硬盘丢失后目标数据被解密的风险,且移动硬盘为用户私有设备,能够避免目标数据在网上泄露的风险,从而提高数据存储的安全性。In the embodiment of the present application, the router encrypts the target data according to the first key, thereby ensuring the security of the target data. The router only stores the target data encrypted by the first key to the mobile hard disk, and does not store the first key to the mobile hard disk, thereby realizing the separate storage of the first key and the target data, which can reduce the risk of the target data being decrypted after the mobile hard disk is lost. The mobile hard disk is a private device of the user, which can avoid the risk of the target data being leaked on the Internet, thereby improving the security of data storage.

此外,在手机转存数据的过程中,还可以有其他的设备,例如平板电脑,通过路由器将数据转存到移动硬盘中,可以实现在同一时间段内将多个设备中的数据转存到第三设备。并且,本申请实施例提供的方法使用云服务器生成第一密钥,可以提高存储数据的效率。第一密钥是由云服务器生成的,不需要用户自己管理密钥,从而提高用户体验。In addition, in the process of transferring data from a mobile phone, other devices, such as a tablet computer, can also be used to transfer data to a mobile hard disk through a router, so that data from multiple devices can be transferred to a third device within the same time period. In addition, the method provided in the embodiment of the present application uses a cloud server to generate a first key, which can improve the efficiency of storing data. The first key is generated by the cloud server, and the user does not need to manage the key himself, thereby improving the user experience.

本申请提供的方法还可以对加密后的目标数据进行解密。图13示出了本申请实施例提供的存储数据的方法的流程示意图。如图13所示,该加密的过程包括下述S1301-S1307。The method provided by the present application can also decrypt the encrypted target data. Figure 13 shows a schematic flow chart of the method for storing data provided by an embodiment of the present application. As shown in Figure 13, the encryption process includes the following S1301-S1307.

S1301,手机检测到来自用户的解密操作(第二操作),向路由器发送第二指令,第二指令指示对加密后的目标数据进行解密。S1301, the mobile phone detects a decryption operation (second operation) from the user, and sends a second instruction to the router, where the second instruction instructs to decrypt the encrypted target data.

例如,手机显示如图12中的(a)所示的界面时,用户可以选中压缩包2,点击“解密”按钮以请求对压缩包2中的数据进行解密。For example, when the mobile phone displays the interface shown in (a) of FIG. 12 , the user can select compressed package 2 and click the “decrypt” button to request decryption of the data in compressed package 2 .

S1302,路由器接收到第二指令之后,获取用于解密的信息。S1302: After receiving the second instruction, the router obtains information for decryption.

其中,用于解密的信息与用于加密的信息是对应的。The information used for decryption corresponds to the information used for encryption.

例如,以第一密钥由第二标识和MD5值生成为例,路由器接收到第二指令之后,解压压缩包2,提取压缩包2中的MD5值,并获取第二标识。第二标识可以携带在第二指令中发送给路由器,路由器解析第二指令获取第二标识。或者,路由器可以在接收到第二指令之后,向手机发送获取第二标识的请求,手机再将第二标识发送给路由器。For example, taking the example of the first key being generated by the second identifier and the MD5 value, after receiving the second instruction, the router decompresses the compressed package 2, extracts the MD5 value in the compressed package 2, and obtains the second identifier. The second identifier can be carried in the second instruction and sent to the router, and the router parses the second instruction to obtain the second identifier. Alternatively, after receiving the second instruction, the router can send a request to obtain the second identifier to the mobile phone, and the mobile phone then sends the second identifier to the router.

S1303,路由器向云服务器发送第二请求,第二请求用于请求获取第一密钥。S1303, the router sends a second request to the cloud server, where the second request is used to request to obtain the first key.

第二请求包括MD5值和第二标识,即获取第一密钥时需要的信息与生成第一密钥时使用的信息是对应的。The second request includes an MD5 value and a second identifier, that is, the information required to obtain the first key corresponds to the information used to generate the first key.

S1304,云服务器接收到第二请求之后,从云服务器中查询第一密钥。S1304: After receiving the second request, the cloud server queries the first key from the cloud server.

云服务器根据第二请求中的信息,即,根据MD5值和第二标识,查询第一密钥。The cloud server queries the first key according to the information in the second request, that is, according to the MD5 value and the second identifier.

可以理解,在第一密钥由MD5值生成的情况下,第二请求包括MD5值,对应的,云服务器根据MD5值查询第一密钥。在第一密钥由第二标识生成的情况下,第二请求包括第二标识,对应的,云服务器根据第二标识查询第一密钥。It can be understood that when the first key is generated by an MD5 value, the second request includes the MD5 value, and the cloud server queries the first key according to the MD5 value. When the first key is generated by a second identifier, the second request includes the second identifier, and the cloud server queries the first key according to the second identifier.

S1305,云服务器将第一密钥发送给路由器。S1305, the cloud server sends the first key to the router.

S1306,路由器根据第一密钥,对经过第一密钥加密的目标数据进行解密。S1306: The router decrypts the target data encrypted by the first key according to the first key.

即路由器解压压缩包2后,还得到加密的文件夹1。在获取第一密钥后,路由器根据第一密钥,对文件夹1进行解密。解密完成后,路由器可以删除压缩包2。That is, after the router decompresses the compressed package 2, it also obtains the encrypted folder 1. After obtaining the first key, the router decrypts the folder 1 according to the first key. After the decryption is completed, the router can delete the compressed package 2.

S1307,路由器向手机发送包含解密进度的信息。S1307, the router sends information including decryption progress to the mobile phone.

在解密的过程中,路由器可以将包含解密进度的信息发送给手机,手机收到进度信息后,向用户显示当前解密进度,如图14中的(a)所示,当路由器的解密进度为50%时,手机可以显示解密进度为50%。如图14中的(b)所示,解密完成后,手机向用户显示解密已完成的信息,然后显示如图9中(b)所示的界面。During the decryption process, the router can send information containing the decryption progress to the mobile phone. After receiving the progress information, the mobile phone displays the current decryption progress to the user. As shown in (a) of FIG14, when the decryption progress of the router is 50%, the mobile phone can display the decryption progress as 50%. As shown in (b) of FIG14, after the decryption is completed, the mobile phone displays the information that the decryption is completed to the user, and then displays the interface shown in (b) of FIG9.

在其他一些实现方式中,手机(第四设备)与路由器(第一设备)处于远距离场景,手机与路由器之间的距离超过了路由器的覆盖范围,路由器与移动硬盘(第三设备)连接。In some other implementations, the mobile phone (the fourth device) and the router (the first device) are in a long-distance scenario, the distance between the mobile phone and the router exceeds the coverage range of the router, and the router is connected to the mobile hard disk (the third device).

在该场景下,手机进入如图7中的(b)所示的界面时,还可以显示已绑定的路由器,其中,已绑定的路由器为使用本手机登录过的路由器,用户点击已绑定的路由器的图标,登录已绑定的路由器,手机可以通过已绑定的路由器实现数据的远程管理。In this scenario, when the mobile phone enters the interface shown in (b) in Figure 7, the bound router can also be displayed, where the bound router is a router that has been logged in using this mobile phone. The user clicks the icon of the bound router to log in to the bound router. The mobile phone can remotely manage data through the bound router.

例如,当用户选择对已经存储在移动硬盘中的未加密数据进行加密时,手机响应于用户的加密操作,向云服务器发送第一指令、第二标识以及已绑定的路由器的标识,其中,已绑定的路由器的标识唯一对应已绑定的路由器,用于云服务器确定已绑定的路由器,与已绑定的路由器建立通信。For example, when a user chooses to encrypt unencrypted data stored in a mobile hard disk, the mobile phone responds to the user's encryption operation and sends a first instruction, a second identifier, and an identifier of a bound router to the cloud server, wherein the identifier of the bound router uniquely corresponds to the bound router, and is used by the cloud server to determine the bound router and establish communication with the bound router.

云服务器接收到第一指令之后,将第一指令下发给已绑定的路由器。已绑定的路由器接收到第一指令之后,生成目标数据对应的MD5值,然后将MD5值发送给云服务器。云服务器接收到MD5值之后,根据MD5值和第二标识生成第一密钥,然后将第一密钥发送给已绑定的路由器。已绑定的路由器接收到第一密钥之后,使用第一密钥对目标数据进行加密。根据第一密钥生成时使用的信息的不同,在一些实现方式中,云服务器接收到第一指令之后,生成第一密钥,将第一密钥和第一指令下发给已绑定的路由器。已绑定的路由器接收到第一指令之后,使用第一密钥对目标数据进行加密。After receiving the first instruction, the cloud server sends the first instruction to the bound router. After receiving the first instruction, the bound router generates an MD5 value corresponding to the target data, and then sends the MD5 value to the cloud server. After receiving the MD5 value, the cloud server generates a first key based on the MD5 value and the second identifier, and then sends the first key to the bound router. After receiving the first key, the bound router uses the first key to encrypt the target data. Depending on the information used when generating the first key, in some implementations, after receiving the first instruction, the cloud server generates a first key and sends the first key and the first instruction to the bound router. After receiving the first instruction, the bound router uses the first key to encrypt the target data.

对于手机中的一些保密性要求较低的数据以及数据大小较小的数据,也可以通过已绑定的路由器实现数据的远程转存。For some data in the mobile phone with low confidentiality requirements and small data size, remote data transfer can also be achieved through the bound router.

例如,手机向云服务器发送第一指令,第一指令中包括目标数据、第二标识以及已绑定的路由器的标识。云服务器接收到第一指令之后,根据目标数据的内容生成目标数据对应的MD5值,根据MD5值和第二标识生成第一密钥,使用第一密钥对目标数据进行加密。云服务器将加密后的目标数据和MD5值发送给已绑定的路由器,并删除云服务器上的目标数据。已绑定的路由器接收到加密后的目标数据和MD5值之后,将加密后的目标数据和MD5值压缩后存储到移动硬盘中。For example, a mobile phone sends a first instruction to a cloud server, and the first instruction includes target data, a second identifier, and an identifier of a bound router. After receiving the first instruction, the cloud server generates an MD5 value corresponding to the target data according to the content of the target data, generates a first key according to the MD5 value and the second identifier, and uses the first key to encrypt the target data. The cloud server sends the encrypted target data and MD5 value to the bound router, and deletes the target data on the cloud server. After receiving the encrypted target data and MD5 value, the bound router compresses the encrypted target data and MD5 value and stores them in a mobile hard disk.

解密时,手机向云服务器发送第二指令、第二标识以及已绑定的路由器的标识,云服务器接收到第二指令之后,将第二指令下发给已绑定的路由器。已绑定的路由器接收到第二指令之后,获取目标数据对应的MD5值,然后将MD5值发送给云服务器。云服务器接收到MD5值之后,根据MD5值和第二标识查询第一密钥,然后将查询到的第一密钥发送给已绑定的路由器。已绑定的路由器接收到第一密钥之后,使用第一密钥对加密后的目标数据进行解密。During decryption, the mobile phone sends the second instruction, the second identifier, and the identifier of the bound router to the cloud server. After receiving the second instruction, the cloud server sends the second instruction to the bound router. After receiving the second instruction, the bound router obtains the MD5 value corresponding to the target data, and then sends the MD5 value to the cloud server. After receiving the MD5 value, the cloud server queries the first key based on the MD5 value and the second identifier, and then sends the queried first key to the bound router. After receiving the first key, the bound router uses the first key to decrypt the encrypted target data.

本申请实施例提供存储数据的方法,路由器的USB接口插入U盘、移动硬盘等外部存储介质,通过手机、路由器和云服务器之间的交互,实现了用户对手机中私有数据的转存和加密解密管理,操作便捷,既保障了用户数据的安全存储,又实现了密钥智能化管理。The embodiment of the present application provides a method for storing data. The USB interface of the router is inserted into an external storage medium such as a USB flash drive or a mobile hard disk. Through the interaction between the mobile phone, the router and the cloud server, the user can transfer and encrypt and decrypt private data in the mobile phone. The operation is convenient, which not only ensures the secure storage of user data, but also realizes the intelligent management of keys.

除了上述方法之外,在其他一些实现方式中,密钥可以是手机本地生成的,也可以是路由器生成的,例如,在如图7中的(b)所示的界面中,用户可以点击任意一个已连接设备的图标,如点击U盘75的图标,然后手机显示类似如图7中的(d)所示的界面以管理U盘75的数据,当用户选择将手机中的数据转移到U盘75中时,手机响应于用户操作,生成目标数据的MD5值,并根据目标数据的MD5值,生成第一密钥,手机使用第一密钥对目标数据进行加密,将加密后的目标数据存储到U盘75中,将第一密钥存储在手机中。In addition to the above method, in some other implementations, the key can be generated locally on the mobile phone or by a router. For example, in the interface shown in (b) of Figure 7, the user can click on the icon of any connected device, such as clicking on the icon of the USB flash drive 75, and then the mobile phone displays an interface similar to that shown in (d) of Figure 7 to manage the data in the USB flash drive 75. When the user chooses to transfer the data in the mobile phone to the USB flash drive 75, the mobile phone generates an MD5 value of the target data in response to the user operation, and generates a first key based on the MD5 value of the target data. The mobile phone uses the first key to encrypt the target data, stores the encrypted target data in the USB flash drive 75, and stores the first key in the mobile phone.

本申请实施例提供的方法,将加密后的目标数据转存至第三设备中之后,可以将第一设备中的目标数据删除,从而间接扩展第一设备的存储空间,缓解存储空间越来越紧张的问题。The method provided in the embodiment of the present application can delete the target data in the first device after transferring the encrypted target data to the third device, thereby indirectly expanding the storage space of the first device and alleviating the problem of increasingly tight storage space.

第一设备根据第一密钥对目标数据进行加密,保障了目标数据的安全,第一设备只将经过第一密钥加密后的目标数据存储至第三设备,没有将第一密钥存储至第三设备,实现了第一密钥与目标数据的分开存储,能够减小第三设备丢失后目标数据被解密的风险,提高数据存储的安全性,且第三设备为用户私有设备,能够避免目标数据在网上泄露的风险。此外,第一密钥是由第二设备生成的,不需要用户自己管理密钥,从而提高用户体验。The first device encrypts the target data according to the first key, which ensures the security of the target data. The first device only stores the target data encrypted by the first key to the third device, and does not store the first key to the third device, which realizes the separate storage of the first key and the target data, and can reduce the risk of the target data being decrypted after the third device is lost, improve the security of data storage, and the third device is a user's private device, which can avoid the risk of target data being leaked online. In addition, the first key is generated by the second device, and the user does not need to manage the key himself, thereby improving the user experience.

当第一设备属于中转设备时,可以实现在同一时间段内将多个设备中的数据转存到第三设备。本申请实施例还提供了方便用户操作的公众号,方便用户管理数据,操作便捷且具体通用性。总之,本申请实施例提供的方法,在电子设备的存储空间不足的情况下,能够安全、可靠、长期、易操作的管理电子设备中的数据。When the first device is a transfer device, it is possible to transfer data from multiple devices to a third device within the same time period. The embodiment of the present application also provides a public account that is convenient for users to operate, which is convenient for users to manage data, and has convenient operation and specific versatility. In short, the method provided by the embodiment of the present application can manage data in electronic devices safely, reliably, long-term, and easily in the case of insufficient storage space in electronic devices.

本文中描述的各个实现方式可以为独立的方案,也可以根据内在逻辑进行组合,这些方案都落入本申请的保护范围中。The various implementations described in this document may be independent solutions or may be combined according to internal logic, and all of these solutions fall within the protection scope of this application.

可以理解的是,上述各个方法实施例中由电子设备实现的方法和操作,也可以由可用于电子设备的部件(例如芯片或者电路)实现。It can be understood that the methods and operations implemented by electronic devices in the above-mentioned various method embodiments can also be implemented by components (such as chips or circuits) that can be used in electronic devices.

本申请实施例可以根据上述方法示例,对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有其它可行的划分方式。下面以采用对应各个功能划分各个功能模块为例进行说明。The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other feasible division methods in actual implementation. The following is an example of dividing each functional module corresponding to each function.

图15为本申请实施例提供的装置1500的示意性框图。该装置1500可以用于执行上文方法实施例中第一设备所执行的动作。该装置1500包括接收单元1510、发送单元1520和处理单元1530。FIG15 is a schematic block diagram of an apparatus 1500 provided in an embodiment of the present application. The apparatus 1500 can be used to execute the action executed by the first device in the above method embodiment. The apparatus 1500 includes a receiving unit 1510, a sending unit 1520 and a processing unit 1530.

其中,接收单元1510,用于接收来自第四设备的第一指令,第一指令指示对目标数据进行加密存储。The receiving unit 1510 is used to receive a first instruction from a fourth device, where the first instruction instructs to encrypt and store the target data.

发送单元1520,用于向第二设备发送第一请求,第一请求用于请求第二设备生成第一密钥,第一密钥用于对目标数据进行加密。在某些实现方式中,第一请求包括目标数据的标识和目标数据对应的第二标识。The sending unit 1520 is configured to send a first request to the second device, wherein the first request is used to request the second device to generate a first key, and the first key is used to encrypt the target data. In some implementations, the first request includes an identifier of the target data and a second identifier corresponding to the target data.

接收单元1510,还用于接收来自第二设备的第一密钥。The receiving unit 1510 is further configured to receive a first key from a second device.

处理单元1530,用于根据来自第二设备的第一密钥,对目标数据进行加密。The processing unit 1530 is configured to encrypt the target data according to the first key from the second device.

处理单元1530,还用于将加密后的目标数据存储至第三设备。The processing unit 1530 is further configured to store the encrypted target data in a third device.

在某些实现方式中,处理单元1530将加密后的目标数据和目标数据的第一标识压缩后,存储到第三设备中。In some implementations, the processing unit 1530 compresses the encrypted target data and the first identifier of the target data and stores them in a third device.

接收单元1510,还用于接收来自第四设备的第二指令,第二指令指示对经过第一密钥加密后的目标数据进行解密。The receiving unit 1510 is further configured to receive a second instruction from a fourth device, where the second instruction instructs decrypting the target data encrypted by the first key.

处理单元1520,还用于获取第三设备中的加密后的目标数据。The processing unit 1520 is further configured to obtain the encrypted target data in the third device.

发送单元1520,还用于向第二设备发送第二请求,第二请求用于请求获取第一密钥。在某些实现方式中,第二请求包括目标数据的第一标识和目标数据的第二标识。The sending unit 1520 is further configured to send a second request to the second device, where the second request is used to request to obtain the first key. In some implementations, the second request includes the first identifier of the target data and the second identifier of the target data.

处理单元1520,还用于对经过第一密钥加密的目标数据进行解密。The processing unit 1520 is further configured to decrypt the target data encrypted by the first key.

发送单元1520,还用于向第四设备发送对目标数据进行加密的进度信息,或,向第四设备发送对经过第一密钥加密后的目标数据进行解密的进度信息。The sending unit 1520 is further configured to send progress information of encrypting the target data to the fourth device, or send progress information of decrypting the target data encrypted by the first key to the fourth device.

装置1500还包括通信单元,通信单元用于使装置1500与第二设备、第三设备、第四设备建立连接。The apparatus 1500 further includes a communication unit, and the communication unit is used to establish a connection between the apparatus 1500 and the second device, the third device, and the fourth device.

在其他可能的实现方式中,接收单元1510,用于接收用户的第一操作,第一操作用于指示对目标数据进行加密存储。In other possible implementations, the receiving unit 1510 is used to receive a first operation from a user, where the first operation is used to instruct to encrypt and store target data.

接收单元1510,还用于接收用户的第二操作,第二操作用于指示对加密后的目标数据进行解密的操作。The receiving unit 1510 is further used to receive a second operation from the user, where the second operation is used to instruct an operation of decrypting the encrypted target data.

装置1500还包括显示单元,显示单元用于显示第一界面,以接收用户的第一操作。显示单元还用于显示第二界面,以接收用户的第二操作。The device 1500 further includes a display unit, which is used to display a first interface to receive a first operation from a user and a second interface to receive a second operation from a user.

显示单元还用于显示对目标数据进行加密的进度。显示单元还用于显示对经过第一密钥加密后的目标数据进行解密的进度。The display unit is also used to display the progress of encrypting the target data. The display unit is also used to display the progress of decrypting the target data encrypted by the first key.

本申请的方案,将加密后的目标数据转存至第三设备中之后,可以将第一设备中的目标数据删除,从而间接扩展第一设备的存储空间,缓解存储空间越来越紧张的问题。According to the solution of the present application, after the encrypted target data is transferred to the third device, the target data in the first device can be deleted, thereby indirectly expanding the storage space of the first device and alleviating the problem of increasingly tight storage space.

第一设备根据第一密钥对目标数据进行加密,保障了目标数据的安全,第一设备只将经过第一密钥加密后的目标数据存储至第三设备,没有将第一密钥存储至第三设备,实现了第一密钥与目标数据的分开存储,能够减小第三设备丢失后目标数据被解密的风险,提高数据存储的安全性,且第三设备为用户私有设备,能够避免目标数据在网上泄露的风险。此外,第一密钥是由第二设备生成的,不需要用户自己管理密钥,从而提高用户体验。The first device encrypts the target data according to the first key, which ensures the security of the target data. The first device only stores the target data encrypted by the first key to the third device, and does not store the first key to the third device, which realizes the separate storage of the first key and the target data, and can reduce the risk of the target data being decrypted after the third device is lost, improve the security of data storage, and the third device is a user's private device, which can avoid the risk of target data being leaked online. In addition, the first key is generated by the second device, and the user does not need to manage the key himself, thereby improving the user experience.

根据本申请实施例的装置1500可对应于执行本申请实施例中描述的方法,并且装置1500中的单元的上述和其它操作和/或功能分别为了实现方法的相应流程,为了简洁,在此不再赘述。According to the embodiment of the present application, the device 1500 may correspond to executing the method described in the embodiment of the present application, and the above and other operations and/or functions of the units in the device 1500 are respectively for implementing the corresponding processes of the method, which will not be repeated here for the sake of brevity.

本申请实施例还提供一种装置1600,该装置1500可以用于执行上文方法实施例中第二设备所执行的动作。图16为本申请实施例提供的装置1600的示意性框图。该装置1600包括接收单元1610、发送单元1620和处理单元1630。The embodiment of the present application also provides an apparatus 1600, which can be used to perform the action performed by the second device in the above method embodiment. Figure 16 is a schematic block diagram of the apparatus 1600 provided in the embodiment of the present application. The apparatus 1600 includes a receiving unit 1610, a sending unit 1620 and a processing unit 1630.

其中,接收单元1610,用于接收来自第一设备的第一请求。在某些实现方式中,第一请求包括目标数据的第一标识和目标数据的第二标识。The receiving unit 1610 is configured to receive a first request from a first device. In some implementations, the first request includes a first identifier of the target data and a second identifier of the target data.

处理单元1630,用于根据第一请求生成第一密钥。The processing unit 1630 is configured to generate a first key according to the first request.

发送单元1620,用于向第一设备发送第一密钥。The sending unit 1620 is configured to send the first key to the first device.

接收单元1610,还用于接收来自第一设备的第二请求。在某些实现方式中,第二请求包括目标数据的第一标识和目标数据的第二标识。The receiving unit 1610 is further configured to receive a second request from the first device. In some implementations, the second request includes a first identifier of the target data and a second identifier of the target data.

处理单元1630,还用于根据第二请求查询第一密钥。The processing unit 1630 is further configured to query the first key according to the second request.

此外,装置1600还包括存储单元,用于存储第一密钥。In addition, the apparatus 1600 further includes a storage unit for storing the first key.

装置1600还包括通信单元,用于与第一设备建立连接。The apparatus 1600 further includes a communication unit, configured to establish a connection with the first device.

本申请的方案,由第二设备生成的第一密钥,能够减少其他设备的计算量,提高存储数据的效率,第二设备可以为多个设备生成密钥,提高本方案的通用性。第二设备生成且存储第一密钥,则解密时从第二设备中获取第一密钥,不需要用户自己管理密钥,实现密钥智能化管理,从而提高用户体验。In the solution of the present application, the first key generated by the second device can reduce the amount of calculation of other devices and improve the efficiency of storing data. The second device can generate keys for multiple devices, which improves the versatility of the solution. The second device generates and stores the first key, and then obtains the first key from the second device during decryption. The user does not need to manage the key himself, and intelligent key management is realized, thereby improving the user experience.

另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的方法。In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.

需要说明的是,该芯片可以使用下述电路或者器件来实现:一个或多个现场可编程门阵列(field programmable gate array,FPGA)、可编程逻辑器件(programmablelogicdevice,PLD)、控制器、状态机、门逻辑、分立硬件部件、任何其他适合的电路、或者能够执行本申请通篇所描述的各种功能的电路的任意组合。It should be noted that the chip can be implemented using the following circuits or devices: one or more field programmable gate arrays (FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits that can perform the various functions described throughout this application.

可选地,在一些实施例中,本申请提供一种电子设备,该电子设备包括芯片,该芯片用于读取并执行存储器存储的计算机程序或指令,使得各实施例中的方法被执行。Optionally, in some embodiments, the present application provides an electronic device, which includes a chip, and the chip is used to read and execute a computer program or instruction stored in a memory, so that the method in each embodiment is executed.

可选地,在一些实施例中,本申请提供一种电子设备,该电子设备包括芯片,该芯片用于读取并执行存储器存储的计算机程序或指令,使得各实施例中的方法被执行。Optionally, in some embodiments, the present application provides an electronic device, which includes a chip, and the chip is used to read and execute a computer program or instruction stored in a memory, so that the method in each embodiment is executed.

本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得电子设备执行时实现可实现上述各个方法实施例中的步骤。An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

在本申请实施例中,电子设备包括硬件层、运行在硬件层之上的操作系统层,以及运行在操作系统层上的应用层。其中,硬件层可以包括中央处理器(centralprocessingunit,CPU)、内存管理单元(memory management unit,MMU)和内存(也称为主存)等硬件。操作系统层的操作系统可以是任意一种或多种通过进程(process)实现业务处理的计算机操作系统,例如,Linux操作系统、Unix操作系统、Android操作系统、iOS操作系统或windows操作系统等。当操作系统为Android操作系统时,电子设备的可以具有如图17所示软件结构。In an embodiment of the present application, the electronic device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. Among them, the hardware layer may include hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system of the operating system layer can be any one or more computer operating systems that implement business processing through processes, such as Linux operating systems, Unix operating systems, Android operating systems, iOS operating systems, or Windows operating systems. When the operating system is an Android operating system, the electronic device can have a software structure as shown in Figure 17.

分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.

如图17所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in FIG. 17 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

如图17所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in FIG. 17 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

电话管理器用于提供电子设备的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).

资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

2D图形引擎是2D绘图的绘图引擎。A 2D graphics engine is a drawing engine for 2D drawings.

内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

上述本申请实施例提供的电子设备、计算机可读存储介质、计算机程序产品以及芯片均用于执行上文所提供的方法,因此,其所能达到的有益效果可参考上文所提供的方法对应的有益效果,在此不再赘述。The electronic device, computer-readable storage medium, computer program product and chip provided in the above-mentioned embodiments of the present application are all used to execute the methods provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding beneficial effects of the methods provided above, and will not be repeated here.

在本申请所提供的实施例中,应该理解到,所揭露的装置/电子设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/电子设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in the present application, it should be understood that the disclosed devices/electronic devices and methods can be implemented in other ways. For example, the device/electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

以上描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the above description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and/or combinations thereof.

还应当理解,本申请说明书和所附权利要求书中提及的“多个”是指两个或两个以上。在本申请的描述中,除非另有说明,“/”表示或的意思,比如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合,比如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。It should also be understood that the "multiple" mentioned in the specification and the appended claims of this application refers to two or more. In the description of this application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this article is only a description of the association relationship of associated objects, which means any combination of one or more of the items listed in the association and all possible combinations, and includes these combinations, for example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

另外,为了便于清楚描述本申请的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,不能理解为指示或暗示相对重要性,并且“第一”、“第二”等字样也并不限定一定不同。In addition, in order to clearly describe the technical solution of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and cannot be understood as indicating or implying relative importance, and words such as "first" and "second" do not necessarily limit differences.

在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims (6)

1.一种存储数据的方法,其特征在于,所述方法应用于通信系统,所述通信系统包括第一设备、第二设备、第三设备和第四设备,所述第三设备为移动硬盘,所述方法包括:1. A method for storing data, characterized in that the method is applied to a communication system, the communication system comprises a first device, a second device, a third device and a fourth device, the third device is a mobile hard disk, and the method comprises: 所述第四设备显示管理所述第一设备的界面,所述管理所述第一设备的界面包括转存功能控件;The fourth device displays an interface for managing the first device, wherein the interface for managing the first device includes a transfer function control; 响应于用户对所述转存功能控件的点击操作,所述第四设备显示管理数据界面,所述管理数据界面包括转入硬盘控件和查看硬盘控件;In response to a user clicking operation on the transfer function control, the fourth device displays a data management interface, wherein the data management interface includes a transfer to hard disk control and a view hard disk control; 响应于所述用户对转入硬盘控件的点击操作,所述第四设备显示本地存储界面,所述本地存储界面包括待选择的至少一个第一文件图标,还包括加密存储控件和存储控件,所述至少一个第一文件图标分别表示所述第四设备存储的至少一个第一文件;In response to the user clicking the transfer to hard disk control, the fourth device displays a local storage interface, the local storage interface including at least one first file icon to be selected, and also including an encrypted storage control and a storage control, the at least one first file icon respectively representing at least one first file stored in the fourth device; 在所述用户在所述至少一个第一文件中选择存储文件后,响应于所述用户对所述存储控件的点击操作,所述第四设备向所述第一设备发送所述存储文件,所述第一设备将所述存储文件存储至所述第三设备;After the user selects a storage file in the at least one first file, in response to a click operation of the user on the storage control, the fourth device sends the storage file to the first device, and the first device stores the storage file in the third device; 在所述用户在所述至少一个第一文件中选择目标文件后,响应于所述用户对所述加密存储控件的点击操作,所述第四设备向所述第一设备发送第一指令;After the user selects a target file from the at least one first file, in response to a click operation of the user on the encrypted storage control, the fourth device sends a first instruction to the first device; 所述第一设备在接收到所述第一指令之后,向所述第二设备发送第一请求,所述第一指令用于指示对所述第一设备存储的目标数据进行加密存储,所述第一请求包括所述目标数据的第二标识,所述第二标识用于标识所述目标数据对应的用户,所述第一请求用于请求所述第二设备生成第一密钥,所述第一指令是来自所述第四设备的指令,所述目标数据是所述第四设备发送给所述第一设备的,所述目标数据为所述目标文件中的数据;After receiving the first instruction, the first device sends a first request to the second device, the first instruction is used to instruct to encrypt and store the target data stored in the first device, the first request includes a second identifier of the target data, the second identifier is used to identify a user corresponding to the target data, the first request is used to request the second device to generate a first key, the first instruction is an instruction from the fourth device, the target data is sent by the fourth device to the first device, and the target data is data in the target file; 所述第一设备接收来自所述第二设备的所述第一密钥,通过所述第一密钥对所述目标数据进行加密;The first device receives the first key from the second device, and encrypts the target data using the first key; 所述第一设备将加密后的所述目标数据和所述目标数据的第二标识进行压缩以得到目标压缩包,将所述目标压缩包存储至第三设备,并删除本地所述加密后的所述目标数据;The first device compresses the encrypted target data and the second identifier of the target data to obtain a target compressed package, stores the target compressed package in a third device, and deletes the encrypted target data locally; 在所述第一设备将所述加密后的所述目标数据和所述目标数据的第二标识压缩存储至第三设备后,在所述第四设备显示所述管理数据界面的情况下,响应于所述用户对所述查看硬盘控件的点击操作,显示第一硬盘存储界面,所述第一硬盘存储界面包括多个第二文件图标,所述多个第二文件图标分别表示所述第三设备存储的多个第二文件,所述多个第二文件包括所述目标压缩包,所述第一硬盘存储界面还包括所述目标压缩包对应的用户,所述多个第二文件还包括至少一个未加密的文件,所述第一硬盘存储界面还包括加密控件和解密控件;After the first device compresses and stores the encrypted target data and the second identifier of the target data to the third device, when the fourth device displays the management data interface, in response to the user's click operation on the view hard disk control, a first hard disk storage interface is displayed, the first hard disk storage interface includes a plurality of second file icons, the plurality of second file icons respectively represent a plurality of second files stored by the third device, the plurality of second files include the target compressed package, the first hard disk storage interface also includes a user corresponding to the target compressed package, the plurality of second files also include at least one unencrypted file, and the first hard disk storage interface also includes an encryption control and a decryption control; 在所述用户在所述多个第二文件中选择目标压缩包后,响应于所述用户在所述加密控件和所述解密控件中对所述解密控件的点击操作,所述第四设备向所述第一设备发送第二指令;After the user selects a target compressed package from the plurality of second files, in response to the user clicking the decryption control among the encryption control and the decryption control, the fourth device sends a second instruction to the first device; 在接收到所述第二指令之后,所述第一设备获取所述第三设备中的所述加密后的所述目标数据和所述目标数据的第二标识,所述第二指令用于指示对所述加密后的所述目标数据进行解密,所述第二指令包括用户标识;After receiving the second instruction, the first device obtains the encrypted target data and the second identifier of the target data in the third device, wherein the second instruction is used to instruct to decrypt the encrypted target data, and the second instruction includes a user identifier; 在所述用户标识与从所述第三设备获取的所述第二标识匹配的情况下,所述第一设备向所述第二设备发送第二请求,所述第二请求用于请求获取所述第一密钥;When the user identifier matches the second identifier obtained from the third device, the first device sends a second request to the second device, where the second request is used to request to obtain the first key; 所述第一设备接收来自所述第二设备的所述第一密钥;The first device receives the first key from the second device; 所述第一设备通过所述第一密钥对所述加密后的所述目标数据进行解密;The first device decrypts the encrypted target data using the first key; 在所述第一设备解密后,所述第四设备显示第二硬盘存储界面,所述第二硬盘存储界面包括多个第三文件图标,所述多个第三文件图标分别表示所述第三设备存储的多个第三文件,所述多个第三文件包括目标解密文件,所述目标解密文件包括对所述加密后的所述目标数据解密后得到的数据。After decryption by the first device, the fourth device displays a second hard disk storage interface, wherein the second hard disk storage interface includes multiple third file icons, wherein the multiple third file icons respectively represent multiple third files stored in the third device, and the multiple third files include a target decrypted file, wherein the target decrypted file includes data obtained by decrypting the encrypted target data. 2.根据权利要求1所述的方法,其特征在于,所述第一请求包括所述目标数据的第一标识,所述第一标识用于标识所述目标数据的内容。2 . The method according to claim 1 , wherein the first request comprises a first identifier of the target data, and the first identifier is used to identify the content of the target data. 3.根据权利要求2所述的方法,其特征在于,所述第一设备将加密后的所述目标数据和所述目标数据的第二标识进行压缩以得到目标压缩包,包括:3. The method according to claim 2, wherein the first device compresses the encrypted target data and the second identifier of the target data to obtain a target compressed package, comprising: 所述第一设备将所述加密后的所述目标数据以及所述第一请求中的所述目标数据的第一标识、所述目标数据的第二标识进行压缩以得到所述目标压缩包。The first device compresses the encrypted target data and the first identifier of the target data and the second identifier of the target data in the first request to obtain the target compressed package. 4.根据权利要求2或3所述的方法,其特征在于,所述第二请求包括所述目标数据的第一标识。4. The method according to claim 2 or 3, characterized in that the second request includes a first identifier of the target data. 5.根据权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:5. The method according to any one of claims 1 to 3, characterized in that the method further comprises: 所述第一设备向所述第四设备发送对所述目标数据进行加密的进度信息,或,向所述第四设备发送对加密后的所述目标数据进行解密的进度信息。The first device sends progress information of encrypting the target data to the fourth device, or sends progress information of decrypting the encrypted target data to the fourth device. 6.一种存储数据的通信系统,其特征在于,所述通信系统包括:如权利要求1-5中任一项所述的第一设备、第二设备、第三设备和第四设备。6. A communication system for storing data, characterized in that the communication system comprises: a first device, a second device, a third device and a fourth device according to any one of claims 1 to 5.
CN202211049462.3A 2022-08-30 2022-08-30 Method for storing data, communication system, electronic equipment and storage medium Active CN115562573B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211049462.3A CN115562573B (en) 2022-08-30 2022-08-30 Method for storing data, communication system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211049462.3A CN115562573B (en) 2022-08-30 2022-08-30 Method for storing data, communication system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115562573A CN115562573A (en) 2023-01-03
CN115562573B true CN115562573B (en) 2024-10-29

Family

ID=84739186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211049462.3A Active CN115562573B (en) 2022-08-30 2022-08-30 Method for storing data, communication system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115562573B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107295069A (en) * 2017-05-27 2017-10-24 广东欧珀移动通信有限公司 Data back up method, device, storage medium and server
CN114117461A (en) * 2020-09-01 2022-03-01 华为技术有限公司 Data protection method, electronic equipment and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200125218A1 (en) * 2012-05-25 2020-04-23 T. Gregory Bender Method of reporting a live incident in real time
US9639705B1 (en) * 2015-06-17 2017-05-02 Amazon Technologies, Inc. Encryption management for data storage
US10289861B2 (en) * 2016-07-01 2019-05-14 Intel Corporation Permission-based secure media content sharing
CN109413191A (en) * 2018-11-07 2019-03-01 深圳市网心科技有限公司 Data transmission method, electronic equipment and storage medium
CN109862119A (en) * 2019-03-15 2019-06-07 深圳市网心科技有限公司 Storage capacity sharing method, device, service server, user terminal and system
CN111723383B (en) * 2019-03-22 2024-03-19 阿里巴巴集团控股有限公司 Data storage and verification method and device
CN112654989B (en) * 2020-03-18 2022-01-28 华为技术有限公司 Data storage method, data access method, and related devices and equipment
CN115391849A (en) * 2021-05-24 2022-11-25 荣耀终端有限公司 Method and device for storing ciphertext

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107295069A (en) * 2017-05-27 2017-10-24 广东欧珀移动通信有限公司 Data back up method, device, storage medium and server
CN114117461A (en) * 2020-09-01 2022-03-01 华为技术有限公司 Data protection method, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115562573A (en) 2023-01-03

Similar Documents

Publication Publication Date Title
CN113259301B (en) Account data sharing method and electronic device
CN112291764B (en) Content connection system
CN111466099B (en) Login method, token sending method, device and storage medium
US10275581B2 (en) Method and apparatus for sharing content between electronic devices
CN113609498B (en) Data protection method and electronic equipment
EP4152198B1 (en) Method and apparatus for storing ciphertext
CN114531676B (en) Key processing method and device and terminal equipment
CN117131481A (en) User login method and electronic equipment
CN117592021A (en) Account login methods and electronic devices
CN116484431B (en) Data protection method, electronic device and storage medium
WO2022179443A1 (en) Nfc method and system, and electronic device
US20250141884A1 (en) Communication method, communication system, and electronic device
EP4266202A1 (en) Data protection method and system, and medium and electronic device
CN113781686B (en) Verification method, generation method and device for temporary password of intelligent door lock
CN115562573B (en) Method for storing data, communication system, electronic equipment and storage medium
CN115550919A (en) Equipment pairing authentication method and device, sender equipment and receiver equipment
CN115146293A (en) A file encryption and decryption method, device and medium
CN113891310B (en) Cooperative communication method, user equipment and system
CN116414575A (en) A privacy protection method and electronic equipment for clipboard data
CN116055032A (en) Key generation method and electronic equipment
CN114637627A (en) Method and system for data recovery
CN106453335A (en) Data transmission method and device
CN117131519B (en) Information protection method and device
RU2809740C2 (en) Method for processing file stored in external memory
EP4465667A1 (en) Offline device control method and related apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China