[go: up one dir, main page]

CN105119881A - File sharing method and terminal - Google Patents

File sharing method and terminal Download PDF

Info

Publication number
CN105119881A
CN105119881A CN201510398895.3A CN201510398895A CN105119881A CN 105119881 A CN105119881 A CN 105119881A CN 201510398895 A CN201510398895 A CN 201510398895A CN 105119881 A CN105119881 A CN 105119881A
Authority
CN
China
Prior art keywords
terminal
user
shared
shared password
shaking
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.)
Pending
Application number
CN201510398895.3A
Other languages
Chinese (zh)
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201510398895.3A priority Critical patent/CN105119881A/en
Publication of CN105119881A publication Critical patent/CN105119881A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/067Network architectures or network communication protocols for network security for supporting key management in a packet data network using one-time keys

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a method and a terminal for sharing files, wherein the method comprises the following steps: the method comprises the steps that a first terminal detects parameters of shaking or knocking the first terminal by a user, and a shared password is generated according to the detected parameters and a preset rule; encrypting the shared file by using the sharing password; and sending the encrypted file and the shared password to a second terminal so that the second terminal receives shaking or knocking operation executed by a user according to the preset rule and the shared password and decrypts the shared file. According to the embodiment of the invention, the shared password of the shared file can be generated by detecting the parameter of shaking or knocking the first terminal by the user, so that the convenience and interest of shared password memory are improved, and the usability of the terminal is improved.

Description

一种共享文件的方法及终端A method and terminal for sharing files

技术领域technical field

本发明涉及通信技术领域,具体涉及一种共享文件的方法及终端。The invention relates to the field of communication technology, in particular to a method and terminal for sharing files.

背景技术Background technique

随着电子技术和终端技术的发展,市场上出现了各种各样的终端设备,例如手机、平板电脑、笔记本电脑、智能手环等。利用这些终端设备,用户不仅可以工作、娱乐,还可以和其他用户进行文件传输、语音聊天、视频聊天甚至移动流量共享等各种通信活动。With the development of electronic technology and terminal technology, various terminal devices have appeared on the market, such as mobile phones, tablet computers, notebook computers, smart bracelets and so on. Using these terminal devices, users can not only work and entertain, but also perform various communication activities with other users, such as file transfer, voice chat, video chat, and even mobile traffic sharing.

当终端之间进行文件共享时,为了保护共享文件的安全性,需要对文件进行加密处理,现有技术通常由用户设置或系统随机生成,对于接入方来说,需要记忆自己不熟悉的共享密码,容易出错,用户体验不佳。When sharing files between terminals, in order to protect the security of the shared files, the files need to be encrypted. The existing technology is usually set by the user or randomly generated by the system. For the access party, it is necessary to remember the unfamiliar shared files. Password, error-prone, poor user experience.

发明内容Contents of the invention

本发明实施例提供了一种共享文件的方法及终端,以解决共享密码不易记忆,密码输入时易出错的问题。Embodiments of the present invention provide a method and a terminal for sharing files, so as to solve the problems that shared passwords are difficult to memorize and easy to make mistakes when entering passwords.

本发明实施例第一方面提供了一种共享文件的方法,包括:The first aspect of the embodiment of the present invention provides a method for sharing files, including:

第一终端检测用户摇晃所述第一终端或敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码;The first terminal detects the parameters of the user shaking the first terminal or tapping the first terminal, and generates a shared password according to the detected parameters and preset rules;

使用所述共享密码将共享的文件进行加密;Encrypt the shared file using the shared password;

将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的摇晃或敲击操作,对所述共享的文件解密。Sending the encrypted file and the shared password to the second terminal, so that the second terminal receives a shaking or tapping operation performed by the user according to the preset rule and the shared password, and decrypts the shared file .

其中,所述第一终端检测用户摇晃所述第一终端的参数,根据检测的参数和预设规则生成共享密码,包括:Wherein, the first terminal detects parameters of the user shaking the first terminal, and generates a shared password according to the detected parameters and preset rules, including:

检测用户摇晃所述第一终端的方向和次数;Detecting the direction and number of times the user shakes the first terminal;

将摇晃的方向和次数与字符或数学表达式对应;Correspond the shaking direction and times with characters or mathematical expressions;

当用户停止摇晃所述第一终端达到预设时间后,根据检测到的用户摇晃所述第一终端的方向和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。After the user stops shaking the first terminal for a preset time, according to the detected direction and times of the user shaking the first terminal, a shared password composed of characters or a shared password composed of mathematical expressions is generated.

其中,所述第一终端检测用户敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码,包括:Wherein, the first terminal detects the parameters of the user tapping the first terminal, and generates a shared password according to the detected parameters and preset rules, including:

依次检测用户敲击所述第一终端不同区域的次数;sequentially detecting the number of times the user taps on different areas of the first terminal;

将敲击的区域和次数与字符或数学表达式对应;Correspond the area and times of tapping with characters or mathematical expressions;

当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户敲击所述第一终端的区域和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。When the user stops tapping the first terminal for a preset time, generate a shared password composed of characters or a shared password composed of mathematical expressions according to the detected area and number of times the user tapped the first terminal .

其中,所述第一终端检测用户敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码,包括:Wherein, the first terminal detects the parameters of the user tapping the first terminal, and generates a shared password according to the detected parameters and preset rules, including:

在连续的时间间隔内,依次检测用户在每个时间间隔中敲击所述第一终端的次数;In consecutive time intervals, sequentially detecting the number of times the user taps the first terminal in each time interval;

将敲击的次数与字符对应;Correspond the number of taps to the characters;

当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户在每个时间间隔内敲击所述第一终端的次数,生成由字符组成的共享密码。After the user stops tapping the first terminal for a preset time, a shared password composed of characters is generated according to the detected number of times the user taps the first terminal within each time interval.

其中,所述字符包括字母、符号或数字。Wherein, the characters include letters, symbols or numbers.

相应地,本发明实施例第二方面提供了一种终端,可包括:Correspondingly, the second aspect of the embodiment of the present invention provides a terminal, which may include:

检测生成模块,用于检测用户摇晃所述第一终端或敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码;A detection and generation module, configured to detect parameters of the user shaking the first terminal or knocking on the first terminal, and generate a shared password according to the detected parameters and preset rules;

加密模块,用于使用所述共享密码将共享的文件进行加密;An encryption module, configured to encrypt shared files using the shared password;

发送模块,用于将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的摇晃或敲击操作,对所述共享的文件解密。a sending module, configured to send the encrypted file and the shared password to a second terminal, so that the second terminal receives a shaking or tapping operation performed by the user according to the preset rule and the shared password, and Decrypt the shared files mentioned above.

其中,所述检测生成模块具体用于:Wherein, the detection generation module is specifically used for:

检测用户摇晃所述第一终端的方向和次数;Detecting the direction and number of times the user shakes the first terminal;

将摇晃的方向和次数与字符或数学表达式对应;Correspond the shaking direction and times with characters or mathematical expressions;

当用户停止摇晃所述第一终端达到预设时间后,根据检测到的用户摇晃所述第一终端的方向和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。After the user stops shaking the first terminal for a preset time, according to the detected direction and times of the user shaking the first terminal, a shared password composed of characters or a shared password composed of mathematical expressions is generated.

其中,所述检测生成模块具体用于:Wherein, the detection generation module is specifically used for:

依次检测用户敲击所述第一终端不同区域的次数;sequentially detecting the number of times the user taps on different areas of the first terminal;

将敲击的区域和次数与字符或数学表达式对应;Correspond the area and times of tapping with characters or mathematical expressions;

当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户敲击所述第一终端的区域和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。When the user stops tapping the first terminal for a preset time, generate a shared password composed of characters or a shared password composed of mathematical expressions according to the detected area and number of times the user tapped the first terminal .

其中,所述检测生成模块具体用于:Wherein, the detection generation module is specifically used for:

在连续的时间间隔内,依次检测用户在每个时间间隔中敲击所述第一终端的次数;In consecutive time intervals, sequentially detecting the number of times the user taps the first terminal in each time interval;

将敲击的次数与字符对应;Correspond the number of taps to the characters;

当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户在每个时间间隔内敲击所述第一终端的次数,生成由字符组成的共享密码。After the user stops tapping the first terminal for a preset time, a shared password composed of characters is generated according to the detected number of times the user taps the first terminal within each time interval.

其中,所述字符包括字母、符号或数字。Wherein, the characters include letters, symbols or numbers.

第一终端在建立无线热点后,通过检测用户摇晃或敲击第一终端的参数来生成接入密码,接收第二终端通过摇晃或敲击生成的验证密码,在判断两个密码相同之后,允许第二终端接入无线热点。从而实现第二终端使用第一终端的移动流量上网的目的。由于接入密码通过摇晃或敲击生成,用户无需记忆复杂的密码,利于用户记忆,提高了终端的易用性,提升了密码验证的趣味性和用户体验。After the first terminal establishes a wireless hotspot, it generates an access password by detecting the parameters of the user shaking or tapping the first terminal, receives the verification password generated by the second terminal through shaking or tapping, and after judging that the two passwords are the same, allows The second terminal accesses the wireless hotspot. In this way, the purpose of the second terminal using the mobile traffic of the first terminal to surf the Internet is realized. Since the access password is generated by shaking or tapping, the user does not need to memorize complex passwords, which facilitates user memory, improves the usability of the terminal, and improves the fun and user experience of password verification.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1是本发明实施例提供的一种共享文件的方法的第一实施例流程示意图;FIG. 1 is a schematic flowchart of a first embodiment of a method for sharing files provided by an embodiment of the present invention;

图2是本发明实施例提供的一种共享文件的方法的第二实施例流程示意图;FIG. 2 is a schematic flowchart of a second embodiment of a method for sharing files provided by an embodiment of the present invention;

图3是本发明实施例提供的一种共享文件的方法的第三实施例流程示意图;FIG. 3 is a schematic flowchart of a third embodiment of a method for sharing files provided by an embodiment of the present invention;

图4是本发明实施例提供的一种共享文件的方法的第四实施例流程示意图;FIG. 4 is a schematic flowchart of a fourth embodiment of a method for sharing files provided by an embodiment of the present invention;

图5是本发明实施例提供的一种终端的第一实施例组成示意图;FIG. 5 is a schematic composition diagram of a first embodiment of a terminal provided by an embodiment of the present invention;

图6是本发明实施例提供的一种终端的第二实施例组成示意图。Fig. 6 is a schematic composition diagram of a second embodiment of a terminal provided by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

本发明实施例中的终端可以包括具备拍照功能的智能手机(如Android手机、iOS手机、WindowsPhone手机等)、平板电脑、数码相机、掌上电脑、笔记本电脑、移动互联网设备(MID,MobileInternetDevices)或穿戴式设备等,上述终端仅是举例,而非穷举,包含但不限于上述终端。The terminal in the embodiment of the present invention may include a smart phone (such as an Android phone, an iOS phone, a Windows Phone, etc.), a tablet computer, a digital camera, a handheld computer, a notebook computer, a mobile Internet device (MID, MobileInternetDevices) or a wearable device with a camera function. type equipment, etc., the above-mentioned terminals are only examples, not exhaustive, including but not limited to the above-mentioned terminals.

请参阅图1,为本发明实施例提供的一种共享文件的方法的第一实施例流程示意图。本实施例中所描述的共享文件的方法,包括以下步骤:Please refer to FIG. 1 , which is a schematic flowchart of a first embodiment of a method for sharing files provided by an embodiment of the present invention. The method for sharing files described in this embodiment includes the following steps:

S101、第一终端检测用户摇晃所述第一终端或敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码。S101. The first terminal detects parameters of the user shaking the first terminal or tapping the first terminal, and generates a shared password according to the detected parameters and preset rules.

其中,在检测摇晃或敲击的参数时,可通过终端的三轴加速度传感器、重力传感器、惯性传感器、陀螺仪、距离传感器或位移传感器等进行检测。Wherein, when detecting shaking or knocking parameters, detection may be performed through a three-axis acceleration sensor, a gravity sensor, an inertial sensor, a gyroscope, a distance sensor, or a displacement sensor of the terminal.

可选地,此处的摇晃的参数可以包括但不限于摇晃的方向如上下左右等,摇晃的次数如一次、两次等。Optionally, the shaking parameters here may include but not limited to shaking directions such as up, down, left, right, etc., and shaking times, such as once, twice, and so on.

通过方向和次数的结合可以生成特定的密码,该密码可以是字符,也可以是数学表达式,字符可以是字母、符号或数字,本发明实施例不作任何限定。数学表达式则包含正负号以代表摇晃的方向。A specific password can be generated by combining the direction and the number of times. The password can be a character or a mathematical expression, and the character can be a letter, a symbol or a number, which is not limited in this embodiment of the present invention. Mathematical expressions include plus and minus signs to represent the direction of the shake.

例如,用户朝左摇晃手机1次,再朝右边摇晃手机2次,再朝左摇晃3次,再朝右边摇晃4次,用户朝左摇晃手机5次,再朝右边摇晃手机6次,再朝左摇晃7次,再朝右边摇晃8次,则可以生成纯数字的共享密码为12345678。或者还可以带上正负号如向左为正,向右为负,则共享密码为数学表达式:+1-2+3-4+5-6+7-8。For example, the user shakes the phone 1 time to the left, 2 times to the right, 3 times to the left, 4 times to the right, 5 times to the left, 6 times to the right, 6 times to the right Shake left 7 times, then shake right 8 times, then you can generate a shared password of pure numbers as 12345678. Or you can also bring a positive and negative sign, such as positive to the left and negative to the right, then the shared password is a mathematical expression: +1-2+3-4+5-6+7-8.

或者,还可以将26个英文字母根据方向与次数进行映射,如左晃1-13次分别对应A-N,右晃1-13次分别对应O-Z,则用户朝左摇晃手机1次,再朝右边摇晃手机2次,再朝左摇晃3次,再朝右边摇晃4次,用户朝左摇晃手机5次,再朝右边摇晃手机6次,再朝左摇晃7次,再朝右边摇晃8次,将生成字符形式的共享密码APCRETGV,当然,为了减少摇晃的次数,可以引入更多的方向,例如引入上下左右4个方向,每个方向最大分别配置6到7次的摇晃即可。Alternatively, the 26 English letters can also be mapped according to the direction and frequency. For example, shaking the phone 1-13 times to the left corresponds to A-N, and shaking it to the right 1-13 times corresponds to O-Z respectively. Then the user shakes the phone once to the left and then shakes it to the right Shake the phone 2 times, then 3 times to the left, then 4 times to the right, the user shakes the phone 5 times to the left, then 6 times to the right, then 7 times to the left, then 8 times to the right, will generate For the shared password APCRETGV in the form of characters, of course, in order to reduce the number of shakes, more directions can be introduced, for example, four directions of up, down, left, and right can be introduced, and each direction can be configured with a maximum of 6 to 7 shakes.

或者,还可以数字和字母结合以提高接入密码的安全性,可以在一些方向上摇晃的次数对应数字,而在另一些方向上摇晃的次数对应字母。具体原理与上述字母的映射类似,此处不再赘述。Alternatively, numbers and letters may be combined to improve the security of the access password, and the number of times of shaking in some directions may correspond to numbers, while the number of times of shaking in other directions may correspond to letters. The specific principle is similar to the above letter mapping, and will not be repeated here.

而敲击的参数可以包括但不限于敲击的区域和敲击的次数。The tapped parameters may include but not limited to tapped areas and tapped times.

例如,敲击终端屏幕的上沿3次,再敲击终端屏幕下沿2次,则可以生成数字密码32,或者也可以将不同区域和不同次数对应不同的字母或数字,具体配置过程与摇晃相似,此处不再赘述。For example, tap the upper edge of the terminal screen 3 times, and then tap the lower edge of the terminal screen 2 times to generate a digital password 32, or you can use different areas and different times to correspond to different letters or numbers. The specific configuration process is similar to shaking similar and will not be repeated here.

或者,还可以仅仅敲击同一区域或设定对任意区域敲击的效果相同,但设置相同的时间间隔例如3秒,在每个时间间隔内进行计数,然后将一连串时间间隔内的敲击数与数字或字母对应,从而得到接入密码。例如,在每个3秒内依次敲击1、2、3、4、5、6、7、8次,且设定次数与数字对应,则将生成12345678的接入密码,若设定次数与字母顺序对应,则将生成ABCDEFGH的接入密码。Or, you can just tap the same area or set the same effect on any area, but set the same time interval, such as 3 seconds, count in each time interval, and then count the number of taps in a series of time intervals Correspond to the numbers or letters, so as to obtain the access password. For example, if you tap 1, 2, 3, 4, 5, 6, 7, and 8 times in sequence within 3 seconds, and the set times correspond to the numbers, an access code of 12345678 will be generated. If the alphabetical order is corresponding, the access password of ABCDEFGH will be generated.

可选地,在每个时间间隔结束时可以发声提示用户,以便用户在进行精准的敲击。Optionally, at the end of each time interval, the user may be sounded to prompt the user to perform precise tapping.

需要说明的是,在共享密码生成之后,可以以文本形式显示给用户查看以便用户确认生成的共享密码是否正确或是否为用户想要的共享密码。It should be noted that after the shared password is generated, it can be displayed to the user in text form so that the user can confirm whether the generated shared password is correct or whether it is the shared password desired by the user.

S102、使用所述共享密码将共享的文件进行加密。S102. Encrypt the shared file by using the shared password.

这样,可以确保共享的文件的安全性。只有了解预设规则和接收到共享密码的用户才能对共享的文件进行解密并查看。In this way, the security of shared files can be ensured. Only users who understand the preset rules and receive the shared password can decrypt and view the shared files.

S103、将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的摇晃或敲击操作,对所述共享的文件解密。S103. Send the encrypted file and the shared password to the second terminal, so that the second terminal receives the shaking or tapping operation performed by the user according to the preset rules and the shared password, and File decryption.

可选地,所述第二终端通过摇晃或敲击生成验证密码的方式与所述第一终端生成共享密码的方式相同。这样,便可以第二终端便可以使用生成的验证密码对共享密码进行验证,验证通过后便可以查看共享的文件。Optionally, the manner in which the second terminal generates the verification password by shaking or tapping is the same as the manner in which the first terminal generates the shared password. In this way, the second terminal can use the generated verification password to verify the shared password, and can view the shared file after passing the verification.

若第二终端摇晃或敲击的操作错误,此时,想查看共享文件的用户可以再次摇晃第二终端或敲击第二终端,尝试进行再次密码验证,而对于连续多次验证密码错误的第二终端,可以在一定时间内锁定、隐藏或删除共享文件。If the operation of shaking or tapping the second terminal is wrong, at this time, the user who wants to view the shared file can shake the second terminal or tap the second terminal again to try to verify the password again. The second terminal can lock, hide or delete shared files within a certain period of time.

第一终端在通过检测用户摇晃或敲击第一终端的参数以及预设规则来生成共享密码,并使用共享密码对共享的文件进行加密,再将加密后的文件以及共享密码发送给第二终端,这样,第二终端便可以根据共享密码和预设规则通过摇晃或敲击操作来对共享的文件进行解密,进而查看共享的文件。由于共享密码通过摇晃或敲击生成,用户无需记忆复杂的密码,利于用户记忆,提高了终端的易用性,提升了密码验证的趣味性和用户体验。The first terminal generates a shared password by detecting the parameters of the user shaking or tapping the first terminal and preset rules, and encrypts the shared file with the shared password, and then sends the encrypted file and the shared password to the second terminal , so that the second terminal can decrypt the shared file by shaking or tapping according to the shared password and preset rules, and then view the shared file. Since the shared password is generated by shaking or tapping, the user does not need to memorize complex passwords, which facilitates user memory, improves the usability of the terminal, and improves the fun and user experience of password verification.

请参阅图2,为本发明实施例提供的一种共享文件的方法的第二实施例流程示意图。本实施例中所描述的共享文件的方法,包括以下步骤:Please refer to FIG. 2 , which is a schematic flowchart of a second embodiment of a method for sharing files provided by an embodiment of the present invention. The method for sharing files described in this embodiment includes the following steps:

S201、检测用户摇晃所述第一终端的方向和次数。S201. Detect the direction and times of shaking the first terminal by the user.

S202、将摇晃的方向和次数与字符或数学表达式对应。S202. Correspond the shaking direction and times with characters or mathematical expressions.

其中,在检测摇晃的方向和次数时,可通过终端的三轴加速度传感器、重力传感器、惯性传感器、陀螺仪、距离传感器或位移传感器等进行检测。Wherein, when detecting the shaking direction and times, it may be detected by a three-axis acceleration sensor, a gravity sensor, an inertial sensor, a gyroscope, a distance sensor or a displacement sensor, etc. of the terminal.

S203、当用户停止摇晃所述第一终端达到预设时间后,根据检测到的用户摇晃所述第一终端的方向和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。S203. After the user stops shaking the first terminal for a preset time, generate a shared password composed of characters or a shared password composed of mathematical expressions according to the detected direction and number of times the user shakes the first terminal .

通过方向和次数的结合可以生成特定的共享密码,该共享密码可以是字符形式如数字、字母或符号,也可以是数学表达式形式,本发明实施例不作任何限定。A specific shared password can be generated by combining the direction and the number of times. The shared password can be in the form of characters such as numbers, letters or symbols, or in the form of mathematical expressions, which is not limited in this embodiment of the present invention.

例如,用户朝左摇晃手机1次,再朝右边摇晃手机2次,再朝左摇晃3次,再朝右边摇晃4次,用户朝左摇晃手机5次,再朝右边摇晃手机6次,再朝左摇晃7次,再朝右边摇晃8次,则可以生成纯数字的共享密码为12345678。或者还可以带上正负号如向左为正,向右为负,则共享密码为数学表达式:+1-2+3-4+5-6+7-8。For example, the user shakes the phone 1 time to the left, 2 times to the right, 3 times to the left, 4 times to the right, 5 times to the left, 6 times to the right, 6 times to the right Shake left 7 times, then shake right 8 times, then you can generate a shared password of pure numbers as 12345678. Or you can also bring a positive and negative sign, such as positive to the left and negative to the right, then the shared password is a mathematical expression: +1-2+3-4+5-6+7-8.

或者,还可以将26个英文字母根据方向与次数进行映射,如左晃1-13次分别对应A-N,右晃1-13次分别对应O-Z,则用户朝左摇晃手机1次,再朝右边摇晃手机2次,再朝左摇晃3次,再朝右边摇晃4次,用户朝左摇晃手机5次,再朝右边摇晃手机6次,再朝左摇晃7次,再朝右边摇晃8次,将生成字符形式的共享密码APCRETGV,当然,为了减少摇晃的次数,可以引入更多的方向,例如引入上下左右4个方向,每个方向最大分别配置6到7次的摇晃即可。Alternatively, the 26 English letters can also be mapped according to the direction and frequency. For example, shaking the phone 1-13 times to the left corresponds to A-N, and shaking it to the right 1-13 times corresponds to O-Z respectively. Then the user shakes the phone once to the left and then shakes it to the right Shake the phone 2 times, then 3 times to the left, then 4 times to the right, the user shakes the phone 5 times to the left, then 6 times to the right, then 7 times to the left, then 8 times to the right, will generate For the shared password APCRETGV in the form of characters, of course, in order to reduce the number of shakes, more directions can be introduced, for example, four directions of up, down, left, and right can be introduced, and each direction can be configured with a maximum of 6 to 7 shakes.

或者,还可以数字和字母结合以提高接入密码的安全性,可以在一些方向上摇晃的次数对应数字,而在另一些方向上摇晃的次数对应字母。具体原理与上述字母的映射类似,此处不再赘述。Alternatively, numbers and letters may be combined to improve the security of the access password, and the number of times of shaking in some directions may correspond to numbers, while the number of times of shaking in other directions may correspond to letters. The specific principle is similar to the above letter mapping, and will not be repeated here.

S204、使用所述共享密码将共享的文件进行加密。S204. Encrypt the shared file by using the shared password.

这样,可以确保共享的文件的安全性。只有了解预设规则和接收到共享密码的用户才能对共享的文件进行解密并查看。In this way, the security of shared files can be ensured. Only users who understand the preset rules and receive the shared password can decrypt and view the shared files.

S205、将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的摇晃操作,对所述共享的文件解密。S205. Send the encrypted file and the shared password to the second terminal, so that the second terminal receives a shaking operation performed by the user according to the preset rule and the shared password, and decrypts the shared file.

可选地,所述第二终端通过摇晃生成验证密码的方式与所述第一终端生成共享密码的方式相同。这样,便可以第二终端便可以使用生成的验证密码对共享密码进行验证,验证通过后便可以查看共享的文件。Optionally, the manner in which the second terminal generates the verification password by shaking is the same as the manner in which the first terminal generates the shared password. In this way, the second terminal can use the generated verification password to verify the shared password, and can view the shared file after passing the verification.

若第二终端摇晃的操作错误,此时,想查看共享文件的用户可以再次摇晃第二终端,尝试进行再次密码验证,而对于连续多次验证密码错误的第二终端,可以在一定时间内锁定、隐藏或删除共享文件。If the shaking operation of the second terminal is wrong, at this time, the user who wants to view the shared file can shake the second terminal again to try to verify the password again, and for the second terminal that has repeatedly verified the wrong password, it can be locked within a certain period of time , hide or delete shared files.

通过检测用户摇晃第一终端的方向和次数来生成加密共享文件的共享密码,简单实用,利于用户记忆。The shared password for encrypting the shared file is generated by detecting the direction and the number of times the user shakes the first terminal, which is simple and practical, and is beneficial for the user to remember.

请参阅图3,为本发明实施例提供的一种共享文件的方法的第三实施例流程示意图。本实施例中所描述的共享文件的方法,包括以下步骤:Please refer to FIG. 3 , which is a schematic flowchart of a third embodiment of a method for sharing files provided by an embodiment of the present invention. The method for sharing files described in this embodiment includes the following steps:

S301、依次检测用户敲击所述第一终端不同区域的次数。S301. Sequentially detect the number of times the user taps different areas of the first terminal.

S302、将敲击的区域和次数与字符或数学表达式对应。S302. Corresponding the tapped area and times with characters or mathematical expressions.

其中,在检测敲击的参数时,可通过终端的三轴加速度传感器、重力传感器、惯性传感器、陀螺仪、距离传感器或位移传感器等进行检测。Wherein, when detecting the parameters of tapping, the detection may be performed through a three-axis acceleration sensor, a gravity sensor, an inertial sensor, a gyroscope, a distance sensor or a displacement sensor, etc. of the terminal.

例如,敲击终端屏幕的上沿3次,再敲击终端屏幕下沿2次,则可以生成数字密码32,或者也可以将不同区域和不同次数对应不同的字母或数字,具体配置过程与摇晃相似,此处不再赘述。For example, tap the upper edge of the terminal screen 3 times, and then tap the lower edge of the terminal screen 2 times to generate a digital password 32, or you can use different areas and different times to correspond to different letters or numbers. The specific configuration process is similar to shaking similar and will not be repeated here.

或者也可以将不同区域与不同的算术符合对应,例如区域A对应加号,区域B对应减号,再结合不同的次数,便可以生成对应的共享密码,例如,先敲击区域A达到3次,再敲击区域B达到2次,再敲击区域A达到1次,再敲击区域B达到4次,则可以生成+3-2+1-4的共享密码。当然,还可以设置更多区域对应更多运算符号,例如区域C对应乘号,区域D对应除号等等,此处不再赘述。Alternatively, different areas can be associated with different arithmetic symbols. For example, area A corresponds to a plus sign, and area B corresponds to a minus sign. Combined with different times, the corresponding shared password can be generated. For example, first tap area A to reach 3 times , and then tap area B for 2 times, then tap area A for 1 time, and then tap area B for 4 times, then a shared password of +3-2+1-4 can be generated. Of course, more areas can also be set to correspond to more operation symbols, for example, area C corresponds to the multiplication sign, area D corresponds to the division sign, etc., which will not be repeated here.

S303、当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户敲击所述第一终端的区域和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。S303. After the user stops tapping the first terminal for a preset time, generate a shared password consisting of characters or a mathematical expression according to the detected area and number of times the user taps the first terminal Shared passwords.

需要说明的是,在共享密码生成之后,可以以文本形式显示给用户查看以便用户确认生成的共享密码是否正确或是否为用户想要的共享密码。It should be noted that after the shared password is generated, it can be displayed to the user in text form so that the user can confirm whether the generated shared password is correct or whether it is the shared password desired by the user.

S304、使用所述共享密码将共享的文件进行加密。S304. Encrypt the shared file by using the shared password.

这样,可以确保共享的文件的安全性。只有了解预设规则和接收到共享密码的用户才能对共享的文件进行解密并查看。In this way, the security of shared files can be ensured. Only users who understand the preset rules and receive the shared password can decrypt and view the shared files.

S305、将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的敲击操作,对所述共享的文件解密。S305. Send the encrypted file and the shared password to the second terminal, so that the second terminal receives the tapping operation performed by the user according to the preset rule and the shared password, and decrypts the shared file .

可选地,所述第二终端通过敲击生成验证密码的方式与所述第一终端生成共享密码的方式相同。这样,便可以第二终端便可以使用生成的验证密码对共享密码进行验证,验证通过后便可以查看共享的文件。Optionally, the manner in which the second terminal generates the verification password by tapping is the same as the manner in which the first terminal generates the shared password. In this way, the second terminal can use the generated verification password to verify the shared password, and can view the shared file after passing the verification.

若第二终端敲击的操作错误,此时,想查看共享文件的用户可以再次敲击第二终端,尝试进行再次密码验证,而对于连续多次验证密码错误的第二终端,可以在一定时间内锁定、隐藏或删除共享文件。If the operation of tapping on the second terminal is wrong, at this time, the user who wants to view the shared file can tap on the second terminal again to try to verify the password again. Lock, hide or delete shared files within.

通过检测用户敲击第一终端不同区域的次数来生成共享文件的共享密码,简单实用,利于用户记忆。The shared password of the shared file is generated by detecting the number of times the user taps on different areas of the first terminal, which is simple and practical, and is beneficial to the user's memory.

请参阅图4,为本发明实施例提供的一种共享文件的方法的第四实施例流程示意图。本实施例中所描述的共享文件的方法,包括以下步骤:Please refer to FIG. 4 , which is a schematic flowchart of a fourth embodiment of a method for sharing files provided by an embodiment of the present invention. The method for sharing files described in this embodiment includes the following steps:

S401、在连续的时间间隔内,依次检测用户在每个时间间隔中敲击所述第一终端的次数。S401. In consecutive time intervals, sequentially detect the number of times the user taps the first terminal in each time interval.

可选地,在每个时间间隔结束时可以发声提示用户,以便用户在进行精准的敲击。Optionally, at the end of each time interval, the user may be sounded to prompt the user to perform precise tapping.

需要说明的是,在共享密码生成之后,可以以文本形式显示给用户查看以便用户确认生成的共享密码是否正确或是否为用户想要的共享密码。It should be noted that after the shared password is generated, it can be displayed to the user in text form so that the user can confirm whether the generated shared password is correct or whether it is the shared password desired by the user.

S402、将敲击的次数与字符对应。S402. Correspond the number of taps to the characters.

其中,在检测摇晃或敲击的参数时,可通过终端的三轴加速度传感器、重力传感器、惯性传感器、陀螺仪、距离传感器或位移传感器等进行检测。Wherein, when detecting shaking or knocking parameters, detection may be performed through a three-axis acceleration sensor, a gravity sensor, an inertial sensor, a gyroscope, a distance sensor, or a displacement sensor of the terminal.

可以设定敲击同一区域或设定对任意区域敲击的效果相同,但设置相同的时间间隔例如3秒,在每个时间间隔内进行计数,然后将一连串时间间隔内的敲击数与数字、符号或字母对应,从而生成共享密码。例如,在每个3秒内依次敲击1、2、3、4、5、6、7、8次,且设定次数与数字对应,则将生成12345678的共享密码,若设定次数与字母顺序对应,则将生成ABCDEFGH的共享入密码。It can be set to tap the same area or to set the effect of tapping on any area to be the same, but set the same time interval, such as 3 seconds, count in each time interval, and then compare the number of taps in a series of time intervals with the number , symbols or letters to generate a shared password. For example, if you tap 1, 2, 3, 4, 5, 6, 7, and 8 times in sequence within 3 seconds, and the set times correspond to the numbers, a shared password of 12345678 will be generated. If the set times correspond to the letters If the order is corresponding, the shared input password of ABCDEFGH will be generated.

S403、当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户在每个时间间隔内敲击所述第一终端的次数,生成由字符组成的共享密码。S403. After the user stops tapping the first terminal for a preset time, generate a shared password consisting of characters according to the detected number of times the user taps the first terminal within each time interval.

可以仅仅敲击同一区域或设定对任意区域敲击的效果相同,但设置相同的时间间隔例如3秒,在每个时间间隔内进行计数,然后将一连串时间间隔内的敲击数与数字或字母对应,从而得到接入密码。例如,在每个3秒内依次敲击1、2、3、4、5、6、7、8次,且设定次数与数字对应,则将生成12345678的接入密码,若设定次数与字母顺序对应,则将生成ABCDEFGH的接入密码。You can just tap the same area or set the effect of tapping on any area to be the same, but set the same time interval, such as 3 seconds, count in each time interval, and then compare the number of taps in a series of time intervals with numbers or Corresponding to the letters, so as to obtain the access password. For example, if you tap 1, 2, 3, 4, 5, 6, 7, and 8 times in sequence within 3 seconds, and the set times correspond to the numbers, an access code of 12345678 will be generated. If the alphabetical order is corresponding, the access password of ABCDEFGH will be generated.

可选地,在每个时间间隔结束时可以发声提示用户,以便用户在进行精准的敲击。Optionally, at the end of each time interval, the user may be sounded to prompt the user to perform precise tapping.

需要说明的是,在接入密码生成之后,可以以文本形式显示给用户查看以便用户确认生成的接入密码是否正确或是否为用户想要的接入密码;或者也可以直接以加密的形式存储在第一终端上,供第一终端与第二终端发送的验证密码进行底层比较即可,本发明不作任何限定。It should be noted that after the access password is generated, it can be displayed to the user in text form so that the user can confirm whether the generated access password is correct or whether it is the access password that the user wants; or it can also be directly stored in an encrypted form On the first terminal, it only needs to perform bottom-level comparison of the verification passwords sent by the first terminal and the second terminal, which is not limited in the present invention.

S404、使用所述共享密码将共享的文件进行加密。S404. Encrypt the shared file by using the shared password.

这样,可以确保共享的文件的安全性。只有了解预设规则和接收到共享密码的用户才能对共享的文件进行解密并查看。In this way, the security of shared files can be ensured. Only users who understand the preset rules and receive the shared password can decrypt and view the shared files.

S405、将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的敲击操作,对所述共享的文件解密。S405. Send the encrypted file and the shared password to the second terminal, so that the second terminal receives the tapping operation performed by the user according to the preset rule and the shared password, and decrypts the shared file .

可选地,所述第二终端通过敲击生成验证密码的方式与所述第一终端生成共享密码的方式相同。这样,便可以第二终端便可以使用生成的验证密码对共享密码进行验证,验证通过后便可以查看共享的文件。Optionally, the manner in which the second terminal generates the verification password by tapping is the same as the manner in which the first terminal generates the shared password. In this way, the second terminal can use the generated verification password to verify the shared password, and can view the shared file after passing the verification.

若第二终端敲击的操作错误,此时,想查看共享文件的用户可以再次敲击第二终端,尝试进行再次密码验证,而对于连续多次验证密码错误的第二终端,可以在一定时间内锁定、隐藏或删除共享文件。If the operation of tapping on the second terminal is wrong, at this time, the user who wants to view the shared file can tap on the second terminal again to try to verify the password again. Lock, hide or delete shared files within.

通过检测用户敲击第一终端的次数来生成共享文件的共享密码,简单实用,利于用户记忆。The shared password of the shared file is generated by detecting the number of times the user taps the first terminal, which is simple and practical, and is beneficial to the user's memory.

请参阅图5,为本发明实施例提供的一种终端的第一实施例结构示意图。本实施例中所描述的终端,包括:检测生成模块100、加密模块200和发送模块300,其中,Please refer to FIG. 5 , which is a schematic structural diagram of a first embodiment of a terminal provided by an embodiment of the present invention. The terminal described in this embodiment includes: a detection generation module 100, an encryption module 200, and a sending module 300, wherein,

检测生成模块100,用于检测用户摇晃所述第一终端或敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码;The detection generation module 100 is used to detect the parameters of the user shaking the first terminal or tapping the first terminal, and generate a shared password according to the detected parameters and preset rules;

其中,在检测摇晃或敲击的参数时,可通过终端的三轴加速度传感器、重力传感器、惯性传感器、陀螺仪、距离传感器或位移传感器等进行检测。Wherein, when detecting shaking or knocking parameters, detection may be performed through a three-axis acceleration sensor, a gravity sensor, an inertial sensor, a gyroscope, a distance sensor, or a displacement sensor of the terminal.

可选地,此处的摇晃的参数可以包括但不限于摇晃的方向如上下左右等,摇晃的次数如一次、两次等。Optionally, the shaking parameters here may include but not limited to shaking directions such as up, down, left, right, etc., and shaking times, such as once, twice, and so on.

通过方向和次数的结合可以生成特定的密码,该密码可以是字符,也可以是数学表达式,字符可以是字母、符号或数字,本发明实施例不作任何限定。数学表达式则包含正负号以代表摇晃的方向。A specific password can be generated by combining the direction and the number of times. The password can be a character or a mathematical expression, and the character can be a letter, a symbol or a number, which is not limited in this embodiment of the present invention. Mathematical expressions include plus and minus signs to represent the direction of the shake.

例如,用户朝左摇晃手机1次,再朝右边摇晃手机2次,再朝左摇晃3次,再朝右边摇晃4次,用户朝左摇晃手机5次,再朝右边摇晃手机6次,再朝左摇晃7次,再朝右边摇晃8次,则可以生成纯数字的共享密码为12345678。或者还可以带上正负号如向左为正,向右为负,则共享密码为数学表达式:+1-2+3-4+5-6+7-8。For example, the user shakes the phone 1 time to the left, 2 times to the right, 3 times to the left, 4 times to the right, 5 times to the left, 6 times to the right, 6 times to the right Shake left 7 times, then shake right 8 times, then you can generate a shared password of pure numbers as 12345678. Or you can also bring a positive and negative sign, such as positive to the left and negative to the right, then the shared password is a mathematical expression: +1-2+3-4+5-6+7-8.

或者,还可以将26个英文字母根据方向与次数进行映射,如左晃1-13次分别对应A-N,右晃1-13次分别对应O-Z,则用户朝左摇晃手机1次,再朝右边摇晃手机2次,再朝左摇晃3次,再朝右边摇晃4次,用户朝左摇晃手机5次,再朝右边摇晃手机6次,再朝左摇晃7次,再朝右边摇晃8次,将生成字符形式的共享密码APCRETGV,当然,为了减少摇晃的次数,可以引入更多的方向,例如引入上下左右4个方向,每个方向最大分别配置6到7次的摇晃即可。Alternatively, the 26 English letters can also be mapped according to the direction and frequency. For example, shaking the phone 1-13 times to the left corresponds to A-N, and shaking it to the right 1-13 times corresponds to O-Z respectively. Then the user shakes the phone once to the left and then shakes it to the right Shake the phone 2 times, then 3 times to the left, then 4 times to the right, the user shakes the phone 5 times to the left, then 6 times to the right, then 7 times to the left, then 8 times to the right, will generate For the shared password APCRETGV in the form of characters, of course, in order to reduce the number of shakes, more directions can be introduced, for example, four directions of up, down, left, and right can be introduced, and each direction can be configured with a maximum of 6 to 7 shakes.

或者,还可以数字和字母结合以提高接入密码的安全性,可以在一些方向上摇晃的次数对应数字,而在另一些方向上摇晃的次数对应字母。具体原理与上述字母的映射类似,此处不再赘述。Alternatively, numbers and letters may be combined to improve the security of the access password, and the number of times of shaking in some directions may correspond to numbers, while the number of times of shaking in other directions may correspond to letters. The specific principle is similar to the above letter mapping, and will not be repeated here.

而敲击的参数可以包括但不限于敲击的区域和敲击的次数。The tapped parameters may include but not limited to tapped areas and tapped times.

例如,敲击终端屏幕的上沿3次,再敲击终端屏幕下沿2次,则可以生成数字密码32,或者也可以将不同区域和不同次数对应不同的字母或数字,具体配置过程与摇晃相似,此处不再赘述。For example, tap the upper edge of the terminal screen 3 times, and then tap the lower edge of the terminal screen 2 times to generate a digital password 32, or you can use different areas and different times to correspond to different letters or numbers. The specific configuration process is similar to shaking similar and will not be repeated here.

或者,还可以仅仅敲击同一区域或设定对任意区域敲击的效果相同,但设置相同的时间间隔例如3秒,在每个时间间隔内进行计数,然后将一连串时间间隔内的敲击数与数字或字母对应,从而得到接入密码。例如,在每个3秒内依次敲击1、2、3、4、5、6、7、8次,且设定次数与数字对应,则将生成12345678的接入密码,若设定次数与字母顺序对应,则将生成ABCDEFGH的接入密码。Or, you can just tap the same area or set the same effect on any area, but set the same time interval, such as 3 seconds, count in each time interval, and then count the number of taps in a series of time intervals Correspond to the numbers or letters, so as to obtain the access password. For example, if you tap 1, 2, 3, 4, 5, 6, 7, and 8 times in sequence within 3 seconds, and the set times correspond to the numbers, an access code of 12345678 will be generated. If the alphabetical order is corresponding, the access password of ABCDEFGH will be generated.

可选地,在每个时间间隔结束时可以发声提示用户,以便用户在进行精准的敲击。Optionally, at the end of each time interval, the user may be sounded to prompt the user to perform precise tapping.

需要说明的是,在共享密码生成之后,可以以文本形式显示给用户查看以便用户确认生成的共享密码是否正确或是否为用户想要的共享密码。It should be noted that after the shared password is generated, it can be displayed to the user in text form so that the user can confirm whether the generated shared password is correct or whether it is the shared password desired by the user.

加密模块200,用于使用所述共享密码将共享的文件进行加密;An encryption module 200, configured to encrypt shared files using the shared password;

这样,可以确保共享的文件的安全性。只有了解预设规则和接收到共享密码的用户才能对共享的文件进行解密并查看。In this way, the security of shared files can be ensured. Only users who understand the preset rules and receive the shared password can decrypt and view the shared files.

发送模块300,用于将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的摇晃或敲击操作,对所述共享的文件解密。The sending module 300 is configured to send the encrypted file and the shared password to the second terminal, so that the second terminal receives the shaking or tapping operation performed by the user according to the preset rules and the shared password, and The shared file is decrypted.

可选地,所述第二终端通过摇晃或敲击生成验证密码的方式与所述第一终端生成共享密码的方式相同。这样,便可以第二终端便可以使用生成的验证密码对共享密码进行验证,验证通过后便可以查看共享的文件。Optionally, the manner in which the second terminal generates the verification password by shaking or tapping is the same as the manner in which the first terminal generates the shared password. In this way, the second terminal can use the generated verification password to verify the shared password, and can view the shared file after passing the verification.

若第二终端摇晃或敲击的操作错误,此时,想查看共享文件的用户可以再次摇晃第二终端或敲击第二终端,尝试进行再次密码验证,而对于连续多次验证密码错误的第二终端,可以在一定时间内锁定、隐藏或删除共享文件。If the operation of shaking or tapping the second terminal is wrong, at this time, the user who wants to view the shared file can shake the second terminal or tap the second terminal again to try to verify the password again. The second terminal can lock, hide or delete shared files within a certain period of time.

第一终端在通过检测用户摇晃或敲击第一终端的参数以及预设规则来生成共享密码,并使用共享密码对共享的文件进行加密,再将加密后的文件以及共享密码发送给第二终端,这样,第二终端便可以根据共享密码和预设规则通过摇晃或敲击操作来对共享的文件进行解密,进而查看共享的文件。由于共享密码通过摇晃或敲击生成,用户无需记忆复杂的密码,利于用户记忆,提高了终端的易用性,提升了密码验证的趣味性和用户体验。The first terminal generates a shared password by detecting the parameters of the user shaking or tapping the first terminal and preset rules, and encrypts the shared file with the shared password, and then sends the encrypted file and the shared password to the second terminal , so that the second terminal can decrypt the shared file by shaking or tapping according to the shared password and preset rules, and then view the shared file. Since the shared password is generated by shaking or tapping, the user does not need to memorize complex passwords, which facilitates user memory, improves the usability of the terminal, and improves the fun and user experience of password verification.

可选的,所述检测生成模块200具体用于:Optionally, the detection generating module 200 is specifically used for:

检测用户摇晃所述第一终端的方向和次数;Detecting the direction and number of times the user shakes the first terminal;

将摇晃的方向和次数与字符或数学表达式对应;Correspond the shaking direction and times with characters or mathematical expressions;

当用户停止摇晃所述第一终端达到预设时间后,根据检测到的用户摇晃所述第一终端的方向和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。After the user stops shaking the first terminal for a preset time, according to the detected direction and times of the user shaking the first terminal, a shared password composed of characters or a shared password composed of mathematical expressions is generated.

可选地,所述检测生成模块200具体用于:Optionally, the detection generation module 200 is specifically configured to:

依次检测用户敲击所述第一终端不同区域的次数;sequentially detecting the number of times the user taps on different areas of the first terminal;

将敲击的区域和次数与字符或数学表达式对应;Correspond the area and times of tapping with characters or mathematical expressions;

当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户敲击所述第一终端的区域和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。When the user stops tapping the first terminal for a preset time, generate a shared password composed of characters or a shared password composed of mathematical expressions according to the detected area and number of times the user tapped the first terminal .

可选地,所述检测生成模块200具体用于:Optionally, the detection generation module 200 is specifically configured to:

在连续的时间间隔内,依次检测用户在每个时间间隔中敲击所述第一终端的次数;In consecutive time intervals, sequentially detecting the number of times the user taps the first terminal in each time interval;

将敲击的次数与字符对应;Correspond the number of taps to the characters;

当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户在每个时间间隔内敲击所述第一终端的次数,生成由字符组成的共享密码。After the user stops tapping the first terminal for a preset time, a shared password composed of characters is generated according to the detected number of times the user taps the first terminal within each time interval.

可选地,所述字符包括字母、符号或数字。Optionally, the characters include letters, symbols or numbers.

请参阅图5,为本发明实施例提供的一种终端的第二实施例结构示意图。本实施例中所描述的终端,包括:Please refer to FIG. 5 , which is a schematic structural diagram of a second embodiment of a terminal provided by an embodiment of the present invention. The terminal described in this embodiment includes:

至少一个输入设备1000;至少一个输出设备2000;至少一个处理器3000,例如CPU;和存储器4000,上述输入设备1000、输出设备2000、处理器3000和存储器4000通过总线5000连接。At least one input device 1000; at least one output device 2000; at least one processor 3000, such as a CPU;

其中,上述输入设备1000具体可为终端的屏幕或键盘,用于接收用户输入的各种指令。Wherein, the above-mentioned input device 1000 may specifically be a screen or a keyboard of a terminal, and is configured to receive various instructions input by a user.

上述输出设备2000具体可为终端的发送模块,用于将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的摇晃或敲击操作,对所述共享的文件解密。The above-mentioned output device 2000 may specifically be a sending module of a terminal, configured to send the encrypted file and the shared password to the second terminal, so that the second terminal receives the user's execution according to the preset rules and the shared password. Shake or tap operation to decrypt the shared file.

上述存储器4000可以是高速RAM存储器,也可为非不稳定的存储器(non-volatilememory),例如磁盘存储器。上述存储器4000用于存储一组程序代码,上述处理器3000用于调用存储器4000中存储的程序代码,执行如下操作:The above-mentioned memory 4000 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a magnetic disk memory. The memory 4000 is used to store a set of program codes, and the processor 3000 is used to call the program codes stored in the memory 4000 to perform the following operations:

检测用户摇晃所述第一终端或敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码;Detecting parameters of the user shaking the first terminal or tapping the first terminal, and generating a shared password according to the detected parameters and preset rules;

使用所述共享密码将共享的文件进行加密;Encrypt the shared file using the shared password;

指示输出设备2000将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的摇晃或敲击操作,对所述共享的文件解密。instructing the output device 2000 to send the encrypted file and the shared password to the second terminal, so that the second terminal receives a shaking or tapping operation performed by the user according to the preset rule and the shared password, and Shared files are decrypted.

在一些可行的实施方式中,上述处理器3000具体用于:In some feasible implementation manners, the foregoing processor 3000 is specifically configured to:

检测用户摇晃所述第一终端的方向和次数;Detecting the direction and number of times the user shakes the first terminal;

将摇晃的方向和次数与字符或数学表达式对应;Correspond the shaking direction and times with characters or mathematical expressions;

当用户停止摇晃所述第一终端达到预设时间后,根据检测到的用户摇晃所述第一终端的方向和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。After the user stops shaking the first terminal for a preset time, according to the detected direction and times of the user shaking the first terminal, a shared password composed of characters or a shared password composed of mathematical expressions is generated.

在一些可行的实施方式中,上述处理器3000具体用于:In some feasible implementation manners, the foregoing processor 3000 is specifically configured to:

依次检测用户敲击所述第一终端不同区域的次数;sequentially detecting the number of times the user taps on different areas of the first terminal;

将敲击的区域和次数与字符或数学表达式对应;Correspond the area and times of tapping with characters or mathematical expressions;

当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户敲击所述第一终端的区域和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。When the user stops tapping the first terminal for a preset time, generate a shared password composed of characters or a shared password composed of mathematical expressions according to the detected area and number of times the user tapped the first terminal .

在一些可行的实施方式中,上述处理器3000具体用于:In some feasible implementation manners, the foregoing processor 3000 is specifically configured to:

在连续的时间间隔内,依次检测用户在每个时间间隔中敲击所述第一终端的次数;In consecutive time intervals, sequentially detecting the number of times the user taps the first terminal in each time interval;

将敲击的次数与字符对应;Correspond the number of taps to the characters;

当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户在每个时间间隔内敲击所述第一终端的次数,生成由字符组成的共享密码。After the user stops tapping the first terminal for a preset time, a shared password composed of characters is generated according to the detected number of times the user taps the first terminal within each time interval.

在一些可行的实施方式中,所述字符包括字母、符号或数字。In some feasible implementation manners, the characters include letters, symbols or numbers.

具体实现中,本发明实施例中所描述的输入设备1000、输出设备2000和处理器3000可执行本发明实施例提供的一种共享文件的方法的第一实施例、第二实施例、第三实施例和第四实施例中所描述的实现方式,也可执行本发明实施例提供的一种终端的第一实施例中所描述的终端的实现方式,在此不再赘述。In specific implementation, the input device 1000, the output device 2000 and the processor 3000 described in the embodiment of the present invention can execute the first embodiment, the second embodiment, the third embodiment of a method for sharing files provided in the embodiment of the present invention. The implementation manners described in the first embodiment and the fourth embodiment may also implement the implementation manner of the terminal described in the first embodiment of a terminal provided in the embodiment of the present invention, and details are not repeated here.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-OnlyMemory,简称ROM)或随机存取存储器(RandomAccessMemory,简称RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the programs can be stored in a computer-readable storage medium. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM for short), or a random access memory (Random Access Memory, RAM for short).

以上对本发明实施例所提供的一种共享文件的方法及终端进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The method and terminal for sharing files provided by the embodiments of the present invention are described above in detail. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The descriptions of the above embodiments are only used to help understand the present invention. The method of the invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood To limit the present invention.

Claims (10)

1.一种共享文件的方法,其特征在于,包括:1. A method for sharing files, comprising: 第一终端检测用户摇晃所述第一终端或敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码;The first terminal detects the parameters of the user shaking the first terminal or tapping the first terminal, and generates a shared password according to the detected parameters and preset rules; 使用所述共享密码将共享的文件进行加密;Encrypt the shared file using the shared password; 将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的摇晃或敲击操作,对所述共享的文件解密。Sending the encrypted file and the shared password to the second terminal, so that the second terminal receives a shaking or tapping operation performed by the user according to the preset rule and the shared password, and decrypts the shared file . 2.根据权利要求1所述的方法,其特征在于,所述第一终端检测用户摇晃所述第一终端的参数,根据检测的参数和预设规则生成共享密码,包括:2. The method according to claim 1, wherein the first terminal detects parameters of the user shaking the first terminal, and generates a shared password according to the detected parameters and preset rules, including: 检测用户摇晃所述第一终端的方向和次数;Detecting the direction and number of times the user shakes the first terminal; 将摇晃的方向和次数与字符或数学表达式对应;Correspond the shaking direction and times with characters or mathematical expressions; 当用户停止摇晃所述第一终端达到预设时间后,根据检测到的用户摇晃所述第一终端的方向和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。After the user stops shaking the first terminal for a preset time, according to the detected direction and times of the user shaking the first terminal, a shared password composed of characters or a shared password composed of mathematical expressions is generated. 3.根据权利要求1所述的方法,其特征在于,所述第一终端检测用户敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码,包括:3. The method according to claim 1, wherein the first terminal detects the parameters of the user tapping the first terminal, and generates a shared password according to the detected parameters and preset rules, including: 依次检测用户敲击所述第一终端不同区域的次数;sequentially detecting the number of times the user taps on different areas of the first terminal; 将敲击的区域和次数与字符或数学表达式对应;Correspond the area and times of tapping with characters or mathematical expressions; 当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户敲击所述第一终端的区域和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。When the user stops tapping the first terminal for a preset time, generate a shared password composed of characters or a shared password composed of mathematical expressions according to the detected area and number of times the user tapped the first terminal . 4.根据权利要求1所述的方法,其特征在于,所述第一终端检测用户敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码,包括:4. The method according to claim 1, wherein the first terminal detects the parameters of the user tapping the first terminal, and generates a shared password according to the detected parameters and preset rules, comprising: 在连续的时间间隔内,依次检测用户在每个时间间隔中敲击所述第一终端的次数;In consecutive time intervals, sequentially detecting the number of times the user taps the first terminal in each time interval; 将敲击的次数与字符对应;Correspond the number of taps to the characters; 当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户在每个时间间隔内敲击所述第一终端的次数,生成由字符组成的共享密码。After the user stops tapping the first terminal for a preset time, a shared password composed of characters is generated according to the detected number of times the user taps the first terminal within each time interval. 5.根据权利要求2-4任一项所述的方法,其特征在于,所述字符包括字母、符号或数字。5. The method according to any one of claims 2-4, wherein the characters comprise letters, symbols or numbers. 6.一种终端,其特征在于,包括:6. A terminal, characterized in that, comprising: 检测生成模块,用于检测用户摇晃所述第一终端或敲击所述第一终端的参数,根据检测的参数和预设规则生成共享密码;A detection and generation module, configured to detect parameters of the user shaking the first terminal or knocking on the first terminal, and generate a shared password according to the detected parameters and preset rules; 加密模块,用于使用所述共享密码将共享的文件进行加密;An encryption module, configured to encrypt shared files using the shared password; 发送模块,用于将加密后的文件以及所述共享密码发送给第二终端,以便所述第二终端接收用户根据所述预设规则和所述共享密码执行的摇晃或敲击操作,对所述共享的文件解密。a sending module, configured to send the encrypted file and the shared password to a second terminal, so that the second terminal receives a shaking or tapping operation performed by the user according to the preset rule and the shared password, and Decrypt the shared files mentioned above. 7.根据权利要求6所述的终端,其特征在于,所述检测生成模块具体用于:7. The terminal according to claim 6, wherein the detection generation module is specifically used for: 检测用户摇晃所述第一终端的方向和次数;Detecting the direction and number of times the user shakes the first terminal; 将摇晃的方向和次数与字符或数学表达式对应;Correspond the shaking direction and times with characters or mathematical expressions; 当用户停止摇晃所述第一终端达到预设时间后,根据检测到的用户摇晃所述第一终端的方向和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。After the user stops shaking the first terminal for a preset time, according to the detected direction and times of the user shaking the first terminal, a shared password composed of characters or a shared password composed of mathematical expressions is generated. 8.根据权利要求6所述的终端,其特征在于,所述检测生成模块具体用于:8. The terminal according to claim 6, wherein the detection generation module is specifically used for: 依次检测用户敲击所述第一终端不同区域的次数;sequentially detecting the number of times the user taps on different areas of the first terminal; 将敲击的区域和次数与字符或数学表达式对应;Correspond the area and times of tapping with characters or mathematical expressions; 当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户敲击所述第一终端的区域和次数,生成由字符组成的共享密码或生成由数学表达式组成的共享密码。When the user stops tapping the first terminal for a preset time, generate a shared password composed of characters or a shared password composed of mathematical expressions according to the detected area and number of times the user tapped the first terminal . 9.根据权利要求6所述的终端,其特征在于,所述检测生成模块具体用于:9. The terminal according to claim 6, wherein the detection generation module is specifically used for: 在连续的时间间隔内,依次检测用户在每个时间间隔中敲击所述第一终端的次数;In consecutive time intervals, sequentially detecting the number of times the user taps the first terminal in each time interval; 将敲击的次数与字符对应;Correspond the number of taps to the characters; 当用户停止敲击所述第一终端达到预设时间后,根据检测到的用户在每个时间间隔内敲击所述第一终端的次数,生成由字符组成的共享密码。After the user stops tapping the first terminal for a preset time, a shared password composed of characters is generated according to the detected number of times the user taps the first terminal within each time interval. 10.根据权利要求7-9任一项所述的终端,其特征在于,所述字符包括字母、符号或数字。10. The terminal according to any one of claims 7-9, wherein the characters include letters, symbols or numbers.
CN201510398895.3A 2015-07-08 2015-07-08 File sharing method and terminal Pending CN105119881A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510398895.3A CN105119881A (en) 2015-07-08 2015-07-08 File sharing method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510398895.3A CN105119881A (en) 2015-07-08 2015-07-08 File sharing method and terminal

Publications (1)

Publication Number Publication Date
CN105119881A true CN105119881A (en) 2015-12-02

Family

ID=54667774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510398895.3A Pending CN105119881A (en) 2015-07-08 2015-07-08 File sharing method and terminal

Country Status (1)

Country Link
CN (1) CN105119881A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108781473A (en) * 2016-12-12 2018-11-09 华为技术有限公司 A kind of method and apparatus of the shared file between different terminals

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100097320A1 (en) * 2008-10-22 2010-04-22 Hong Fu Jin Precision Industry (Shenzhen) Co., Ltd. Electronic device for entering password
CN101789862A (en) * 2010-01-25 2010-07-28 中兴通讯股份有限公司 Encryption and decryption device and method based on gravity acceleration
CN102455842A (en) * 2010-10-21 2012-05-16 北京创新方舟科技有限公司 Method and equipment for unlocking screen according to knocking operation of user
CN102981737A (en) * 2012-10-30 2013-03-20 北京小米科技有限责任公司 File operation method and device
CN103079000A (en) * 2012-12-27 2013-05-01 深圳市金立通信设备有限公司 Method and device for terminal unlocking

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100097320A1 (en) * 2008-10-22 2010-04-22 Hong Fu Jin Precision Industry (Shenzhen) Co., Ltd. Electronic device for entering password
CN101789862A (en) * 2010-01-25 2010-07-28 中兴通讯股份有限公司 Encryption and decryption device and method based on gravity acceleration
CN102455842A (en) * 2010-10-21 2012-05-16 北京创新方舟科技有限公司 Method and equipment for unlocking screen according to knocking operation of user
CN102981737A (en) * 2012-10-30 2013-03-20 北京小米科技有限责任公司 File operation method and device
CN103079000A (en) * 2012-12-27 2013-05-01 深圳市金立通信设备有限公司 Method and device for terminal unlocking

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108781473A (en) * 2016-12-12 2018-11-09 华为技术有限公司 A kind of method and apparatus of the shared file between different terminals
US10887745B2 (en) 2016-12-12 2021-01-05 Huawei Technologies Co., Ltd. Method and device for sharing file between different terminals

Similar Documents

Publication Publication Date Title
CN105072611A (en) A verification method and terminal
CN108769027B (en) Secure communication method, device, mobile terminal and storage medium
CN105262756B (en) The encryption and decryption approaches and encryption and decryption devices of data
CN104125055B (en) Encryption and decryption method and electronic equipment
CN108964903B (en) Password storage method and device
US8868927B1 (en) Method and apparatus for secure data input and output
EP3220573B1 (en) Method and system for controlling encryption of information and analyzing information as well as terminal
WO2016045469A1 (en) Information encryption method and mobile terminal
CN104994098B (en) Document transmission method and relevant apparatus and Transmission system
US9659189B2 (en) Systems and methods of safeguarding user information while interacting with online service providers
CN105117632B (en) The method and terminal of a kind of terminal unlocking
US20170374044A1 (en) Messenger application systems and methods
US10263785B1 (en) Cryptography method and system for securing data via electronic transmission
CN105243331A (en) Encryption device and encryption method, and decryption device and decryption method
CN106295379A (en) Encrypt input method and device, deciphering input method and device and relevant device
CN114629649B (en) Data processing method and device based on cloud computing and storage medium
CN114338156A (en) Data processing method, device and storage medium
CN105119881A (en) File sharing method and terminal
CN110262868B (en) Notification message display method and related equipment
CN103441854A (en) Link protection method and system
WO2017000343A1 (en) Fingerprint unlocking method and terminal
CN106650416A (en) Password setting and decrypting methods and terminal
CN103297240B (en) Towards secure password input system and the implementation method of intelligent terminal
Latvala et al. " Speak, Friend, and Enter"-Secure, Spoken One-Time Password Authentication
WO2017215436A1 (en) Information encryption and decryption method, device and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20151202