CN108521641A - A method, device and system for generating a key in D2D communication - Google Patents
A method, device and system for generating a key in D2D communication Download PDFInfo
- Publication number
- CN108521641A CN108521641A CN201810272425.6A CN201810272425A CN108521641A CN 108521641 A CN108521641 A CN 108521641A CN 201810272425 A CN201810272425 A CN 201810272425A CN 108521641 A CN108521641 A CN 108521641A
- Authority
- CN
- China
- Prior art keywords
- user equipment
- key
- parameter
- network device
- communication
- 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
Links
- 238000004891 communication Methods 0.000 title claims abstract description 206
- 238000000034 method Methods 0.000 title claims abstract description 137
- 230000005540 biological transmission Effects 0.000 claims abstract description 148
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 85
- 238000004590 computer program Methods 0.000 claims description 17
- 238000005516 engineering process Methods 0.000 abstract description 21
- 230000006870 function Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 8
- 230000010267 cellular communication Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 4
- 238000001514 detection method Methods 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 238000001228 spectrum Methods 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 241000699670 Mus sp. Species 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000005236 sound signal Effects 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/70—Services for machine-to-machine communication [M2M] or machine type communication [MTC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
- H04L9/0863—Generation of secret information including derivation or calculation of cryptographic keys or passwords involving passwords or one-time passwords
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/02—Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
Description
技术领域technical field
本发明实施例涉及通信技术领域,尤其涉及一种D2D通信生成密钥的方法、装置和系统。The embodiments of the present invention relate to the technical field of communication, and in particular to a method, device and system for generating a key for D2D communication.
背景技术Background technique
随着无线通信系统的不断演进,移动通信系统的无线频谱资源已逐渐满足不了无线通信的发展需求。为了提高无线频谱资源的利用率,引入了基于蜂窝网络的设备到设备(Device-to-Device,简称D2D)通信,或称为邻近服务(Proximity Service,简称ProSe),是指用户数据可不经网络设备中转而直接在用户设备(User Equipment,简称UE)之间传输。With the continuous evolution of wireless communication systems, the wireless spectrum resources of mobile communication systems have gradually been unable to meet the development needs of wireless communication. In order to improve the utilization of wireless spectrum resources, the device-to-device (D2D for short) communication based on the cellular network is introduced, or Proximity Service (ProSe for short), which means that user data can The equipment transfers and directly transmits between user equipments (User Equipment, UE for short).
传统的蜂窝通信生成密钥的方法是可进行蜂窝通信的第一用户设备和第二用户设备生成了不同的第一传输密钥和第二传输密钥,网络设备分别采用与第一用户设备生成第一传输密钥相同的参数(包括第一用户设备的初始密钥和随机数等)和算法,生成第一传输密钥,与第二用户设备生成第二传输密钥相同的参数(包括第二用户设备的初始密钥和随机数等)和算法,生成第二传输密钥。从而第一用户设备和第二用户设备的通信数据可以通过网络设备中转而进行安全有效的传输。The traditional method of generating keys for cellular communication is that the first user equipment and the second user equipment capable of cellular communication generate different first transmission keys and second transmission keys, and the network equipment adopts the method generated by the first user equipment respectively. The same parameters (including the initial key and random number, etc.) and algorithm of the first transmission key are used to generate the first transmission key, and the same parameters (including the second transmission key) generated by the second user equipment are used (2) an initial key and a random number of the user equipment, etc.) and an algorithm to generate a second transmission key. Therefore, the communication data between the first user equipment and the second user equipment can be transferred through the network equipment for safe and effective transmission.
然而,传统的蜂窝通信生成的密钥对通信数据加密的方法不适用于D2D通信,因此需要一种安全有效的生成密钥的方法来生成密钥对D2D通信的通信数据进行加解密,以提高D2D通信的通信数据的安全性。However, the method of encrypting communication data with a key generated by traditional cellular communication is not suitable for D2D communication, so a safe and effective method of generating a key is needed to generate a key to encrypt and decrypt communication data in D2D communication, so as to improve Security of communication data for D2D communication.
发明内容Contents of the invention
本发明实施例提供一种D2D通信生成密钥的方法、装置和系统,以解决现有技术提供的生成密钥的方法生成的密钥不适用于D2D通信,从而无法提高D2D通信的通信数据的安全性的问题。Embodiments of the present invention provide a method, device, and system for generating a key for D2D communication, so as to solve the problem that the key generated by the method for generating a key provided by the prior art is not suitable for D2D communication, thereby failing to improve communication data security of D2D communication. security issues.
为了解决上述技术问题,本发明是这样实现的:In order to solve the problems of the technologies described above, the present invention is achieved in that:
第一方面,本发明实施例提供了一种设备到设备D2D通信生成密钥的方法,应用于第一用户设备,方法包括:In a first aspect, an embodiment of the present invention provides a method for generating a key for device-to-device D2D communication, which is applied to a first user equipment, and the method includes:
接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;Receive a first parameter sent by the network device, where the first parameter is used to indicate the initial key of the second user equipment, and the D2D communication condition is satisfied between the second user equipment and the first user equipment;
根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。A first transmission key is generated by using a first algorithm according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment is different from the initial key of the second user equipment.
第二方面,本发明实施例提供了一种设备到设备D2D通信生成密钥的方法,应用于网络设备,方法包括:In the second aspect, an embodiment of the present invention provides a method for generating a key for device-to-device D2D communication, which is applied to a network device, and the method includes:
获取第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;Obtain a first parameter, where the first parameter is used to indicate the initial key of the second user equipment, and the D2D communication condition is satisfied between the second user equipment and the first user equipment;
向第一用户设备发送第一参数,第一参数用于第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。Sending a first parameter to the first user equipment, the first parameter is used by the first user equipment to generate a first transmission key by using a first algorithm according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment The key is different from the initial key of the second user equipment.
第三方面,本发明实施例提供了一种第一用户设备,包括:接收模块和生成模块;In a third aspect, an embodiment of the present invention provides a first user equipment, including: a receiving module and a generating module;
接收模块,用于接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;The receiving module is configured to receive the first parameter sent by the network device, the first parameter is used to indicate the initial key of the second user equipment, and the D2D communication condition is satisfied between the second user equipment and the first user equipment;
生成模块,用于根据第一用户设备的初始密钥和接收模块接收的第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。A generating module, configured to generate a first transmission key by using a first algorithm according to the initial key of the first user equipment and the first parameter received by the receiving module, the initial key of the first user equipment and the initial key of the second user equipment keys are different.
第四方面,本发明实施例提供了一种网络设备,包括:获取模块和发送模块;In a fourth aspect, an embodiment of the present invention provides a network device, including: an acquisition module and a sending module;
获取模块,用于获取第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;An obtaining module, configured to obtain a first parameter, the first parameter is used to indicate the initial key of the second user equipment, and the D2D communication condition is satisfied between the second user equipment and the first user equipment;
发送模块,用于向第一用户设备发送获取模块获取的第一参数,第一参数用于第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。A sending module, configured to send the first parameter acquired by the acquiring module to the first user equipment, where the first parameter is used by the first user equipment to generate a first transmission using a first algorithm according to the initial key and the first parameter of the first user equipment Key, the initial key of the first user equipment is different from the initial key of the second user equipment.
第五方面,本发明实施例提供了一种第一用户设备,包括处理器、存储器及存储在该存储器上并可在该处理器上运行的计算机程序,该计算机程序被该处理器执行时实现如第一方面中的设备到设备D2D通信生成密钥的方法的步骤。In the fifth aspect, the embodiment of the present invention provides a first user equipment, including a processor, a memory, and a computer program stored on the memory and operable on the processor, and the computer program is implemented when executed by the processor. The steps of the method for generating a key for device-to-device D2D communication in the first aspect.
第六方面,本发明实施例提供了一种网络设备,包括处理器、存储器及存储在该存储器上并可在该处理器上运行的计算机程序,该计算机程序被该处理器执行时实现如第二方面中的设备到设备D2D通信生成密钥的方法的步骤。In a sixth aspect, an embodiment of the present invention provides a network device, including a processor, a memory, and a computer program stored in the memory and operable on the processor. When the computer program is executed by the processor, the following Steps in the method for generating a key for device-to-device D2D communication in the second aspect.
第七方面,本发明实施例提供了一种计算机可读存储介质,该计算机可读存储介质上存储计算机程序,该计算机程序被处理器执行时实现如第一方面或第二方面中的设备到设备D2D通信生成密钥的方法的步骤。In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the device-to- Steps of a method for generating a key for device D2D communication.
第八方面,本发明实施例提供了一种无线通信系统,包括:第一用户设备和网络设备;In an eighth aspect, an embodiment of the present invention provides a wireless communication system, including: a first user equipment and a network device;
第一用户设备包括如第三方面的第一用户设备和网络设备包括如第四方面的网络设备;The first user equipment includes the first user equipment according to the third aspect, and the network device includes the network device according to the fourth aspect;
或者,第一用户设备包括如第五方面的第一用户设备和网络设备包括如第六方面的网络设备。Alternatively, the first user equipment includes the first user equipment according to the fifth aspect, and the network device includes the network device according to the sixth aspect.
在本发明实施例中,第一用户设备接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。通过该方案,第一用户设备根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,同理第二用户设备也可以根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,也就是说,可以进行D2D通信的第一用户设备和第二用户设备生成了相同的传输密钥,可以根据该相同的传输密钥进行数据的加密或解密。采用该方案生成密钥的方法生成的密钥对通信数据进行加解密,提高了D2D通信的通信数据的安全性,从而解决了现有技术提供的生成密钥的方法生成的密钥不适用于D2D通信,从而无法提高D2D通信的通信数据的安全性的问题。In this embodiment of the present invention, the first user equipment receives the first parameter sent by the network device, the first parameter is used to indicate the initial key of the second user equipment, and the D2D communication between the second user equipment and the first user equipment satisfies Condition: the first user equipment uses the first algorithm to generate the first transmission key according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment is different from the initial key of the second user equipment. Through this scheme, the first user equipment generates the first transmission key according to the initial key of the first user equipment and the initial key of the second user equipment. key and the initial key of the second user equipment to generate the first transmission key, that is to say, the first user equipment and the second user equipment that can perform D2D communication generate the same transmission key, and the same transmission key can be generated according to the same Encrypt or decrypt data using the transmission key. The key generated by the key generation method of this scheme is used to encrypt and decrypt the communication data, which improves the security of the communication data of D2D communication, thereby solving the problem that the key generated by the method of generating the key provided by the prior art is not suitable for Due to D2D communication, the security of the communication data of D2D communication cannot be improved.
附图说明Description of drawings
图1为本发明实施例提供的D2D通信的网络架构示意图;FIG. 1 is a schematic diagram of a network architecture of D2D communication provided by an embodiment of the present invention;
图2为本发明实施例提供的D2D通信生成密钥的方法的流程图之一;FIG. 2 is one of the flowcharts of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图3(a)为本发明实施例提供的D2D通信生成密钥的方法的流程图之二;Figure 3(a) is the second flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图3(b)为本发明实施例提供的D2D通信生成密钥的方法的流程图之三;FIG. 3(b) is the third flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图4(a)为本发明实施例提供的D2D通信生成密钥的方法的流程图之四;FIG. 4(a) is the fourth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图4(b)为本发明实施例提供的D2D通信生成密钥的方法的流程图之五;FIG. 4(b) is the fifth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图4(c)为本发明实施例提供的D2D通信生成密钥的方法的流程图之六;FIG. 4(c) is the sixth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图5(a)为本发明实施例提供的D2D通信生成密钥的方法的流程图之七;FIG. 5(a) is the seventh flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图5(b)为本发明实施例提供的D2D通信生成密钥的方法的流程图之八;FIG. 5(b) is the eighth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图5(c)为本发明实施例提供的D2D通信生成密钥的方法的流程图之九;FIG. 5(c) is the ninth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图6为本发明实施例提供的D2D通信生成密钥的方法的流程图之十;FIG. 6 is the tenth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图7为本发明实施例提供的D2D通信生成密钥的方法的流程图之十一;FIG. 7 is the eleventh flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图8为本发明实施例提供的D2D通信生成密钥的方法的流程图之十二;FIG. 8 is the twelfth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图9(a)为本发明实施例提供的D2D通信生成密钥的方法的流程图之十三;FIG. 9(a) is the thirteenth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图9(b)为本发明实施例提供的D2D通信生成密钥的方法的流程图之十四;FIG. 9(b) is the fourteenth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图10(a)为本发明实施例提供的D2D通信生成密钥的方法的流程图之十五;FIG. 10(a) is the fifteenth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图10(b)为本发明实施例提供的D2D通信生成密钥的方法的流程图之十六;FIG. 10(b) is the sixteenth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图10(c)为本发明实施例提供的D2D通信生成密钥的方法的流程图之十七;FIG. 10(c) is the seventeenth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图11(a)为本发明实施例提供的D2D通信生成密钥的方法的流程图之十八;Figure 11(a) is the eighteenth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图11(b)为本发明实施例提供的D2D通信生成密钥的方法的流程图之十九;Fig. 11(b) is the nineteenth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图11(c)为本发明实施例提供的D2D通信生成密钥的方法的流程图之二十;FIG. 11(c) is the twentyth flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图12为本发明实施例提供的D2D通信生成密钥的方法的流程图之二十一;FIG. 12 is the twenty-first flowchart of the method for generating a key for D2D communication provided by an embodiment of the present invention;
图13为本发明实施例提供的用户设备的结构示意图之一;FIG. 13 is one of the schematic structural diagrams of user equipment provided by an embodiment of the present invention;
图14为本发明实施例提供的用户设备的结构示意图之二;FIG. 14 is a second structural schematic diagram of user equipment provided by an embodiment of the present invention;
图15为本发明实施例提供的用户设备的结构示意图之三;FIG. 15 is a third structural schematic diagram of user equipment provided by an embodiment of the present invention;
图16为本发明实施例提供的用户设备的硬件示意图;FIG. 16 is a schematic diagram of hardware of a user equipment provided by an embodiment of the present invention;
图17为本发明实施例提供的网络设备的结构示意图;FIG. 17 is a schematic structural diagram of a network device provided by an embodiment of the present invention;
图18为本发明实施例提供的网络设备的硬件示意图。FIG. 18 is a schematic diagram of hardware of a network device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。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 some of the embodiments of the present invention, but 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.
本发明的说明书和权利要求书中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一输入、第二输入、第三输入和第四输入等是用于区别不同的输入,而不是用于描述输入的特定顺序。The terms "first", "second", "third" and "fourth" in the specification and claims of the present invention are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first input, the second input, the third input, and the fourth input are used to distinguish different inputs, rather than describing a specific sequence of inputs.
在本发明实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本发明实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present invention, words such as "exemplary" or "for example" are used as examples, illustrations or illustrations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present invention shall not be construed as being more preferred or more advantageous than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.
在本发明实施例的描述中,除非另有说明,“多个”的含义是指两个或者两个以上,例如,多个处理单元是指两个或者两个以上的处理单元;多个元件是指两个或者两个以上的元件等。In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more, for example, multiple processing units refer to two or more processing units; multiple elements Refers to two or more elements, etc.
本发明实施例提供一种D2D通信生成密钥的方法,第一用户设备接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。通过该方案,第一用户设备根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,同理第二用户设备也可以根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,也就是说,可以进行D2D通信的第一用户设备和第二用户设备生成了相同的传输密钥,可以根据该相同的传输密钥进行数据的加密或解密。采用该方案生成密钥的方法生成的密钥对通信数据进行加解密,提高了D2D通信的通信数据的安全性,从而解决了现有技术提供的生成密钥的方法生成的密钥不适用于D2D通信,从而无法提高D2D通信的通信数据的安全性的问题。An embodiment of the present invention provides a method for generating a key for D2D communication. The first user equipment receives the first parameter sent by the network device. The first parameter is used to indicate the initial key of the second user equipment. The second user equipment and the first The conditions for D2D communication are met between the user equipments; the first user equipment uses the first algorithm to generate the first transmission key according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment and the second The initial keys of the user devices are different. Through this scheme, the first user equipment generates the first transmission key according to the initial key of the first user equipment and the initial key of the second user equipment. key and the initial key of the second user equipment to generate the first transmission key, that is to say, the first user equipment and the second user equipment that can perform D2D communication generate the same transmission key, and the same transmission key can be generated according to the same Encrypt or decrypt data using the transmission key. The key generated by the key generation method of this scheme is used to encrypt and decrypt the communication data, which improves the security of the communication data of D2D communication, thereby solving the problem that the key generated by the method of generating the key provided by the prior art is not suitable for Due to D2D communication, the security of the communication data of D2D communication cannot be improved.
本发明实施例中的用户设备可以为用户设备设备,也可以为非用户设备设备。用户设备设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等;非用户设备设备可以为个人计算机(personalcomputer,PC)、电视机(television,TV)、柜员机或者自助机等;本发明实施例不作具体限定。The user equipment in this embodiment of the present invention may be a user equipment or a non-user equipment. The user equipment may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle terminal, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, or a personal digital assistant (personal digital assistant, PDA), etc. The non-user equipment may be a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc.; the embodiment of the present invention does not specifically limit it.
本发明实施例提供的D2D通信生成密钥的方法的执行主体可以为上述的用户设备,也可以为该用户设备中能够实现该控制方法的功能模块和/或功能实体,具体的可以根据实际使用需求确定,本发明实施例不作限定。下面以用户设备为例,对本发明实施例提供的D2D通信生成密钥的方法进行示例性的说明。The execution subject of the method for D2D communication key generation provided by the embodiment of the present invention may be the above-mentioned user equipment, or may be a functional module and/or a functional entity in the user equipment capable of implementing the control method. Specifically, it may be based on actual use Requirements are determined, and the embodiments of the present invention are not limited. The method for generating a key for D2D communication provided by an embodiment of the present invention is exemplarily described below by taking a user equipment as an example.
D2D通信的网络架构与传统的蜂窝通信的网络架构有显著区别,如图1所示,图中虚线代表了传统的蜂窝通信的网络架构,实线代表了D2D通信网络的架构。在D2D通信模式下,用户数据直接在UE之间传输,避免了蜂窝通信中用户数据经过网络中转传输而产生的链路增益;其次,D2D通信与蜂窝通信的资源可以复用,由此可产生资源复用增益;通过链路增益和资源复用增益则可提高无线频谱资源的利用率,进而提高网络吞吐量。The network architecture of D2D communication is significantly different from the network architecture of traditional cellular communication. As shown in Figure 1, the dotted line in the figure represents the network architecture of traditional cellular communication, and the solid line represents the architecture of D2D communication network. In the D2D communication mode, user data is directly transmitted between UEs, which avoids the link gain caused by the transfer and transmission of user data through the network in cellular communication; secondly, the resources of D2D communication and cellular communication can be reused, which can generate Resource multiplexing gain: Through link gain and resource multiplexing gain, the utilization rate of wireless spectrum resources can be improved, thereby improving network throughput.
实施例一Embodiment one
参考图2所示,本发明实施例提供了一种D2D通信生成密钥的方法,该方法应用于第一用户设备,该方法可以包括下述的步骤201-步骤202。Referring to FIG. 2 , an embodiment of the present invention provides a method for generating a key for D2D communication, the method is applied to a first user equipment, and the method may include the following steps 201 - 202 .
步骤201、接收网络设备发送的第一参数。Step 201. Receive a first parameter sent by a network device.
第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件。The first parameter is used to indicate the initial key of the second user equipment, and the condition of D2D communication is satisfied between the second user equipment and the first user equipment.
第二用户设备和第一用户设备之间满足D2D通信的条件。即第二用户设备和第一用户设备之间可以进行D2D通信。具体的满足D2D通信的条件参考现有相关技术,本发明实施例不作限定。第一用户设备为可以进行D2D通信的两个用户设备中的任意一个,第二用户设备为可以进行D2D通信的两个用户设备中的另一个。网络设备示例性的可以是基站或核心网等中的一个或多个的组合,也可以是其他的,本发明实施例不作限定。A condition for D2D communication is satisfied between the second user equipment and the first user equipment. That is, D2D communication can be performed between the second user equipment and the first user equipment. For specific conditions for satisfying D2D communication, refer to existing related technologies, which are not limited in this embodiment of the present invention. The first user equipment is any one of the two user equipments capable of D2D communication, and the second user equipment is the other of the two user equipments capable of D2D communication. The network device may be, for example, a combination of one or more of base stations, core networks, etc., or other devices, which are not limited in this embodiment of the present invention.
网络设备获取发送给第一用户设备的第一参数。The network device acquires the first parameter sent to the first user equipment.
第一参数用于指示第二用户设备的初始密钥。那么网络设备先要获得第二用户设备的初始密钥,网络设备获得第二用户设备的初始密钥的方法,可以是网络设备从自身的存储模块中获取的,也可以是从第二设备获取的,本发明实施例不作限定。具体可以参考现有相关技术,此处不予赘述。The first parameter is used to indicate the initial key of the second user equipment. Then the network device first needs to obtain the initial key of the second user equipment. The method for the network device to obtain the initial key of the second user equipment can be obtained by the network device from its own storage module or from the second device. Yes, the embodiments of the present invention are not limited. For details, reference may be made to existing related technologies, which will not be repeated here.
示例性的,第一参数包括第二用户设备的初始密钥,即第一参数可以是第二用户设备的初始密钥,第一参数还可以包括除第二用户设备的初始密钥之外其他的,本发明实施例不作限定。Exemplarily, the first parameter includes the initial key of the second user equipment, that is, the first parameter may be the initial key of the second user equipment, and the first parameter may also include other Yes, the embodiments of the present invention are not limited.
示例性的,第一参数包括第二用户设备的初始密钥和网络设备生成的随机数,即第一参数可以是第二用户设备的初始密钥和网络设备生成的随机数,第一参数还可以包括除第二用户设备的初始密钥和网络设备生成的随机数之外其他的,本发明实施例不作限定。网络设备生成的随机数可以参考现有相关技术,此处不予赘述。Exemplarily, the first parameter includes the initial key of the second user equipment and the random number generated by the network device, that is, the first parameter may be the initial key of the second user equipment and the random number generated by the network device, and the first parameter may also be Other than the initial key of the second user equipment and the random number generated by the network device may be included, which is not limited in this embodiment of the present invention. For the random number generated by the network device, reference may be made to existing related technologies, which will not be repeated here.
示例性的,第一参数包括密钥因子,密钥因子是网络设备根据第二用户设备的初始密钥和网络设备生成的随机数获取的,即第一参数可以是密钥因子,第一参数还可以包括除密钥因子之外其他的,本发明实施例不作限定。示例性的,密钥因子是网络设备根据第二用户设备的初始密钥和网络设备生成的随机数,采用A算法生成的。A算法是一种加密算法,具体可以参考现有相关技术,本发明实施例不予赘述。Exemplarily, the first parameter includes a key factor, and the key factor is obtained by the network device according to the initial key of the second user equipment and a random number generated by the network device, that is, the first parameter may be the key factor, and the first parameter Others besides the key factor may also be included, which is not limited in this embodiment of the present invention. Exemplarily, the key factor is generated by the network device using the A algorithm according to the initial key of the second user equipment and a random number generated by the network device. Algorithm A is an encryption algorithm. For details, reference may be made to existing related technologies, and details are not described in this embodiment of the present invention.
示例性的,用户设备的初始密钥在用户设备侧可以存储在用户身份识别卡(Subscriber Identification Module,简称SIM)或全球用户识别卡(UniversalSubscriber Identity Module,简称USIM)或嵌入式用户识别模块(embedded SubscriberIdentity Module,简称ESIM)中。第一用户设备的初始密钥与第二用户设备的初始密钥不同。不同用户设备的初始密钥不同。用户设备的初始密钥在网路设备侧可以存储在网络设备的存储模块中。Exemplarily, the initial key of the user equipment may be stored on the user equipment side in a Subscriber Identification Module (SIM for short) or a Universal Subscriber Identity Module (USIM for short) or an embedded Subscriber Identity Module (embedded SubscriberIdentity Module, referred to as ESIM). The initial key of the first user equipment is different from the initial key of the second user equipment. Different user equipments have different initial keys. The initial key of the user equipment may be stored in a storage module of the network equipment on the network equipment side.
网络设备向第一用户设备发送第一参数。The network device sends the first parameter to the first user equipment.
第一参数用于第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。The first parameter is used by the first user equipment to generate the first transmission key by using the first algorithm according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment and the initial encryption key of the second user equipment keys are different.
第一用户设备接收网络设备发送的第一参数。The first user equipment receives the first parameter sent by the network equipment.
步骤202、根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥。Step 202: According to the initial key of the first user equipment and the first parameter, a first transmission key is generated by using a first algorithm.
第一用户设备的初始密钥与第二用户设备的初始密钥不同。The initial key of the first user equipment is different from the initial key of the second user equipment.
第一算法是一种加密算法,示例性的可以是A8算法,本发明实施例不作限定,具体参考现有相关技术,本发明实施例不予赘述。The first algorithm is an encryption algorithm, for example, the A8 algorithm, which is not limited in the embodiment of the present invention, and is specifically referred to in the existing related technologies, and will not be described in detail in the embodiment of the present invention.
示例性的,以第一参数为密钥因子为例进行说明,第一用户设备根据第一用户设备的初始密钥和密钥因子,采用A8算法生成第一传输密钥。Exemplarily, the first parameter is the key factor as an example for illustration, and the first user equipment generates the first transmission key by using the A8 algorithm according to the initial key and the key factor of the first user equipment.
第一用户设备通过上述步骤201和步骤202的方法生成第一传输密钥,同理第二用户设备也可以根据上述步骤201和步骤202的方法生成第一传输密钥。也就是说,可以进行D2D通信的两个用户设备可以根据相同的参数,采用相同的算法生成相同的传输密钥,然后二者利用相同的传输密钥对通信数据进行加解密,以实现二者之间通信数据的安全有效的传输。The first user equipment generates the first transmission key through the method of step 201 and step 202 above, and the second user equipment can also generate the first transmission key according to the method of step 201 and step 202 above. That is to say, two user equipments capable of D2D communication can use the same algorithm to generate the same transmission key according to the same parameters, and then use the same transmission key to encrypt and decrypt the communication data, so as to realize both Safe and efficient transmission of communication data between them.
示例性的,结合图2,如图3(a)或图3(b)所示,为了提高传输密钥的保密性,在步骤202之后,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤203a或步骤203b-203c。Exemplarily, referring to FIG. 2, as shown in FIG. 3(a) or FIG. 3(b), in order to improve the confidentiality of the transmission key, after step 202, the method for generating a key for D2D communication provided by the embodiment of the present invention The following step 203a or steps 203b-203c may also be included.
步骤203a、根据第一传输密钥,采用第二算法生成第二传输密钥。Step 203a: Generate a second transmission key by using a second algorithm according to the first transmission key.
为了提高传输密钥的保密性,采用第二算法对第一传输密钥在进行一次加密运算。第二算法与第一算法可以相同,也可以不同,本发明实施例不作限定。具体的第二算法可以参考现有相关技术,本发明实施例不作限定。In order to improve the confidentiality of the transmission key, the second algorithm is used to perform an encryption operation on the first transmission key. The second algorithm may be the same as or different from the first algorithm, which is not limited in this embodiment of the present invention. For the specific second algorithm, reference may be made to existing related technologies, which are not limited in this embodiment of the present invention.
步骤203b、获取无线帧号。Step 203b, acquire the wireless frame number.
示例性的,第一用户设备获取无线帧号的方法可以是第一用户设备自身生成无线帧号,也可以是第一用户设备接收第二用户设备发送的无线帧号。需要说明的是:为了保证最终第一用户设备和第二用户设备生成的传输密钥是相同的,二者需要采用的相同的无线帧号。那么第一用户设备和第二用户设备中的一个用户设备采用的是自身生成的无线帧号,另一个采用对方发送的无线帧号。例如,第一用户设备采用自身生成的无线帧号,第二用户设备采用第一用户设备发送的无线帧号;或第一用户设备采用第二用户设备发送的无线帧号,第二用户设备采用自身生成的无线帧号。Exemplarily, the method for the first user equipment to obtain the radio frame number may be that the first user equipment generates the radio frame number itself, or that the first user equipment receives the radio frame number sent by the second user equipment. It should be noted that: in order to ensure that the transmission keys generated by the first user equipment and the second user equipment are the same, they need to use the same radio frame number. Then one of the first user equipment and the second user equipment uses the radio frame number generated by itself, and the other uses the radio frame number sent by the other party. For example, the first user equipment uses the radio frame number generated by itself, and the second user equipment uses the radio frame number sent by the first user equipment; or the first user equipment uses the radio frame number sent by the second user equipment, and the second user equipment uses The wireless frame number generated by itself.
示例性的,无线帧号可以是TDMA帧号,也可以是其他的帧号,本发明实施例不作限定。Exemplarily, the wireless frame number may be a TDMA frame number or other frame numbers, which is not limited in this embodiment of the present invention.
步骤203c、根据第一传输密钥和无线帧号,采用第二算法生成第二传输密钥。Step 203c, according to the first transmission key and the radio frame number, use a second algorithm to generate a second transmission key.
为了提高传输密钥的保密性,采用第二算法对第一传输密钥和无线帧号在进行一次加密运算。第二算法与第一算法可以相同,也可以不同,本发明实施例不作限定。具体的第二算法可以参考现有相关技术,本发明实施例不作限定。In order to improve the confidentiality of the transmission key, an encryption operation is performed on the first transmission key and the wireless frame number by using the second algorithm. The second algorithm may be the same as or different from the first algorithm, which is not limited in this embodiment of the present invention. For the specific second algorithm, reference may be made to existing related technologies, which are not limited in this embodiment of the present invention.
本发明实施例提供的D2D通信生成密钥的方法应用的场景可以是第一用户设备和第二设备需要进行数据通信的情况,即生成密钥之后,要采用密钥对通信数据进行加解密;也可以是第一用户设备和第二设备不需要进行数据通信的情况,即生成密钥之后,可以先不采用密钥对通信数据进行加解密。The application scenario of the method for generating a key for D2D communication provided by the embodiment of the present invention may be a situation where the first user equipment and the second device need to perform data communication, that is, after the key is generated, the communication data must be encrypted and decrypted using the key; It may also be the case that the first user equipment and the second equipment do not need to perform data communication, that is, after the key is generated, the communication data may be encrypted and decrypted without using the key.
示例性的,结合图2,如图4(a)所示,在步骤202之后,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤204a。Exemplarily, referring to FIG. 2, as shown in FIG. 4(a), after step 202, the method for generating a key for D2D communication provided by the embodiment of the present invention may further include the following step 204a.
步骤204a、采用第一传输密钥对待发送的数据进行加密或对接收的数据进行解密。Step 204a, using the first transmission key to encrypt the data to be sent or decrypt the received data.
第一用户设备采用第一传输密钥对待发送的数据进行加密,然后发送给第二用户设备,或者第一用户设备接收第二用户设备发送的数据,然后采用第一传输密钥对该接收的数据进行解密。具体的,加解密过程可以参考现有相关技术,本发明实施例不予赘述。The first user equipment uses the first transmission key to encrypt the data to be sent, and then sends it to the second user equipment, or the first user equipment receives the data sent by the second user equipment, and then uses the first transmission key to encrypt the received data The data is decrypted. Specifically, for the encryption and decryption process, reference may be made to existing related technologies, and details are not described in this embodiment of the present invention.
示例性的,结合图3(a),如图4(b)所示,在步骤203a之后,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤204b;结合图3(b),如图4(c)所示在步骤203c之后,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤204b。Exemplarily, with reference to FIG. 3(a), as shown in FIG. 4(b), after step 203a, the method for generating a key for D2D communication provided by the embodiment of the present invention may further include the following step 204b; with reference to FIG. 3 (b), as shown in FIG. 4(c), after step 203c, the method for generating a key for D2D communication provided by the embodiment of the present invention may further include the following step 204b.
步骤204b、采用第二传输密钥对待发送的数据进行加密或对接收的数据进行解密。Step 204b: Use the second transmission key to encrypt the data to be sent or decrypt the received data.
第一用户设备采用第二传输密钥对待发送的数据进行加密,然后发送给第二用户设备,或者第一用户设备接收第二用户设备发送的数据,然后采用第二传输密钥对该接收的数据进行解密。具体的,加解密过程可以参考现有相关技术,本发明实施例不予赘述。The first user equipment uses the second transmission key to encrypt the data to be sent, and then sends it to the second user equipment, or the first user equipment receives the data sent by the second user equipment, and then uses the second transmission key to encrypt the received data The data is decrypted. Specifically, for the encryption and decryption process, reference may be made to existing related technologies, and details are not described in this embodiment of the present invention.
示例性的,结合图4(a),如图5(a)所示,或结合图4(b),如图5(b)所示,或结合图4(c),如图5(c)所示,在步骤201之前,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤205。Exemplarily, in combination with Figure 4(a), as shown in Figure 5(a), or in combination with Figure 4(b), as shown in Figure 5(b), or in combination with Figure 4(c), as shown in Figure 5(c ), before step 201, the method for generating a key for D2D communication provided by the embodiment of the present invention may further include the following step 205.
步骤205、接收网络设备发送的资源指示信息,资源指示信息用于指示第一无线资源,第一无线资源用于第一用户设备与第二用户设备进行D2D通信。Step 205: Receive resource indication information sent by the network device, where the resource indication information is used to indicate a first radio resource, and the first radio resource is used for D2D communication between the first user equipment and the second user equipment.
网络设备为第一用户设备分配第一无线资源。第一无线资源用于第一用户设备与第二用户设备进行D2D通信。具体的无限资源可以包括通信信道、频率资源、时间资源、码域资源、空间资源和功率资源等,本发明实施例不作限定。The network device allocates the first radio resource for the first user equipment. The first radio resource is used for D2D communication between the first user equipment and the second user equipment. Specific unlimited resources may include communication channels, frequency resources, time resources, code domain resources, space resources, and power resources, etc., which are not limited in this embodiment of the present invention.
网络设备向第一用户设备发送资源指示信息,资源指示信息用于指示第一无线资源。The network device sends resource indication information to the first user equipment, where the resource indication information is used to indicate the first radio resource.
第一用户设备接收网络设备发送的资源指示信息,并使用该资源指示信息指示的第一无线资源,与第二用户设备进行D2D通信。The first user equipment receives the resource indication information sent by the network device, and uses the first radio resource indicated by the resource indication information to perform D2D communication with the second user equipment.
本发明实施例提供了一种D2D通信生成密钥的方法,第一用户设备接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。通过该方案,第一用户设备根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,同理第二用户设备也可以根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,也就是说,可以进行D2D通信的第一用户设备和第二用户设备生成了相同的传输密钥,可以根据该相同的传输密钥进行数据的加密或解密。采用该方案生成密钥的方法生成的密钥对通信数据进行加解密,提高了D2D通信的通信数据的安全性,从而解决了现有技术提供的生成密钥的方法生成的密钥不适用于D2D通信,从而无法提高D2D通信的通信数据的安全性的问题。An embodiment of the present invention provides a method for generating a key for D2D communication. The first user equipment receives the first parameter sent by the network device. The first parameter is used to indicate the initial key of the second user equipment. The second user equipment and the second user equipment A D2D communication condition is satisfied between user equipments; the first user equipment uses a first algorithm to generate a first transmission key according to the initial key and the first parameter of the first user equipment, and the initial key of the first user equipment and the first parameter The initial keys of the two user equipments are different. Through this scheme, the first user equipment generates the first transmission key according to the initial key of the first user equipment and the initial key of the second user equipment. key and the initial key of the second user equipment to generate the first transmission key, that is to say, the first user equipment and the second user equipment that can perform D2D communication generate the same transmission key, and the same transmission key can be generated according to the same Encrypt or decrypt data using the transmission key. The key generated by the key generation method of this scheme is used to encrypt and decrypt the communication data, which improves the security of the communication data of D2D communication, thereby solving the problem that the key generated by the method of generating the key provided by the prior art is not suitable for Due to D2D communication, the security of the communication data of D2D communication cannot be improved.
实施例二Embodiment two
参考图6所示,本发明实施例提供了一种D2D通信生成密钥的方法,应用于网络设备,该方法可以包括下述的步骤301-步骤302。Referring to FIG. 6 , an embodiment of the present invention provides a method for generating a key for D2D communication, which is applied to a network device, and the method may include the following steps 301 - 302 .
步骤301、获取第一参数。Step 301. Acquire a first parameter.
第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件。The first parameter is used to indicate the initial key of the second user equipment, and the condition of D2D communication is satisfied between the second user equipment and the first user equipment.
第一参数包括第二用户设备的初始密钥;或者,第一参数包括第二用户设备的初始密钥和网络设备生成的随机数;或者,第一参数包括密钥因子,密钥因子是网络设备根据第二用户设备的初始密钥和网络设备生成的随机数获取的。The first parameter includes the initial key of the second user equipment; or, the first parameter includes the initial key of the second user equipment and a random number generated by the network device; or, the first parameter includes a key factor, and the key factor is the network The device obtains it according to the initial key of the second user device and the random number generated by the network device.
具体的可以参考实施例一中的步骤201的相关描述,此处不再赘述。For details, reference may be made to the relevant description of step 201 in Embodiment 1, which will not be repeated here.
步骤302、向第一用户设备发送第一参数。Step 302. Send the first parameter to the first user equipment.
第一参数用于第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。The first parameter is used by the first user equipment to generate the first transmission key by using the first algorithm according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment and the initial encryption key of the second user equipment keys are different.
具体的可以参考实施例一中步骤201的相关描述,此处不再赘述。For details, reference may be made to the relevant description of step 201 in Embodiment 1, which will not be repeated here.
示例性的,结合图6,如图7所示,在步骤301之前,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤303-步骤304。Exemplarily, referring to FIG. 6 , as shown in FIG. 7 , before step 301 , the method for generating a key for D2D communication provided by the embodiment of the present invention may further include the following steps 303 - 304 .
步骤303、为第一用户设备分配第一无线资源。Step 303. Allocate a first radio resource for the first user equipment.
第一无线资源用于第一用户设备与第二用户设备进行D2D通信。具体的无限资源可以包括通信信道、频率资源、时间资源、码域资源、空间资源和功率资源等,本发明实施例不作限定。The first radio resource is used for D2D communication between the first user equipment and the second user equipment. Specific unlimited resources may include communication channels, frequency resources, time resources, code domain resources, space resources, and power resources, etc., which are not limited in this embodiment of the present invention.
步骤304、向第一用户设备发送资源指示信息,资源指示信息用于指示第一无线资源,第一无线资源用于第一用户设备与第二用户设备进行D2D通信。Step 304: Send resource indication information to the first user equipment, where the resource indication information is used to indicate a first radio resource, and the first radio resource is used for D2D communication between the first user equipment and the second user equipment.
第一用户设备接收网络设备发送的资源指示信息,并使用该资源指示信息指示的第一无线资源,与第二用户设备进行D2D通信。The first user equipment receives the resource indication information sent by the network device, and uses the first radio resource indicated by the resource indication information to perform D2D communication with the second user equipment.
具体的可以参考实施例一中的相关描述,此处不再赘述。For details, reference may be made to related descriptions in Embodiment 1, and details are not repeated here.
本发明实施例提供了一种D2D通信生成密钥的方法,第一用户设备接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。通过该方案,第一用户设备根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,同理第二用户设备也可以根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,也就是说,可以进行D2D通信的第一用户设备和第二用户设备生成了相同的传输密钥,可以根据该相同的传输密钥进行数据的加密或解密。采用该方案生成密钥的方法生成的密钥对通信数据进行加解密,提高了D2D通信的通信数据的安全性,从而解决了现有技术提供的生成密钥的方法生成的密钥不适用于D2D通信,从而无法提高D2D通信的通信数据的安全性的问题。An embodiment of the present invention provides a method for generating a key for D2D communication. The first user equipment receives the first parameter sent by the network device. The first parameter is used to indicate the initial key of the second user equipment. The second user equipment and the second user equipment A D2D communication condition is satisfied between user equipments; the first user equipment uses a first algorithm to generate a first transmission key according to the initial key and the first parameter of the first user equipment, and the initial key of the first user equipment and the first parameter The initial keys of the two user equipments are different. Through this scheme, the first user equipment generates the first transmission key according to the initial key of the first user equipment and the initial key of the second user equipment. key and the initial key of the second user equipment to generate the first transmission key, that is to say, the first user equipment and the second user equipment that can perform D2D communication generate the same transmission key, and the same transmission key can be generated according to the same Encrypt or decrypt data using the transmission key. The key generated by the key generation method of this scheme is used to encrypt and decrypt the communication data, which improves the security of the communication data of D2D communication, thereby solving the problem that the key generated by the method of generating the key provided by the prior art is not suitable for Due to D2D communication, the security of the communication data of D2D communication cannot be improved.
实施例三Embodiment three
参考图8所示,本发明实施例提供了一种D2D通信生成密钥的方法,该方法可以包括下述的步骤101-步骤103。Referring to FIG. 8 , an embodiment of the present invention provides a method for generating a key for D2D communication, and the method may include the following steps 101 - 103 .
步骤101、网络设备获取发送给第一用户设备的第一参数。Step 101, the network device acquires the first parameter sent to the first user equipment.
第二用户设备和第一用户设备之间满足D2D通信的条件。即第二用户设备和第一用户设备之间可以进行D2D通信。具体的满足D2D通信的条件参考现有相关技术,本发明实施例不做限定。第一用户设备为可以进行D2D通信的两个用户设备中的任意一个,第二用户设备为可以进行D2D通信的两个用户设备中的另一个。网络设备示例性的可以是基站或核心网等中的一个或多个的组合,也可以是其他的,本发明实施例不作限定。A condition for D2D communication is satisfied between the second user equipment and the first user equipment. That is, D2D communication can be performed between the second user equipment and the first user equipment. For specific conditions for satisfying D2D communication, refer to existing related technologies, which are not limited in this embodiment of the present invention. The first user equipment is any one of the two user equipments capable of D2D communication, and the second user equipment is the other of the two user equipments capable of D2D communication. The network device may be, for example, a combination of one or more of base stations, core networks, etc., or other devices, which are not limited in this embodiment of the present invention.
第一参数用于指示第二用户设备的初始密钥。那么网络设备先要获得第二用户设备的初始密钥,网络设备获得第二用户设备的初始密钥的方法,可以是网络设备从自身的存储模块中获取的,也可以是从第二设备获取的,本发明实施例不作限定。具体可以参考现有相关技术,此处不予赘述。The first parameter is used to indicate the initial key of the second user equipment. Then the network device first needs to obtain the initial key of the second user equipment. The method for the network device to obtain the initial key of the second user equipment can be obtained by the network device from its own storage module or from the second device. Yes, the embodiments of the present invention are not limited. For details, reference may be made to existing related technologies, which will not be repeated here.
示例性的,第一参数包括第二用户设备的初始密钥,即第一参数可以是第二用户设备的初始密钥,第一参数还可以包括除第二用户设备的初始密钥之外其他的,本发明实施例不作限定。Exemplarily, the first parameter includes the initial key of the second user equipment, that is, the first parameter may be the initial key of the second user equipment, and the first parameter may also include other Yes, the embodiments of the present invention are not limited.
示例性的,第一参数包括第二用户设备的初始密钥和网络设备生成的随机数,即第一参数可以是第二用户设备的初始密钥和网络设备生成的随机数,第一参数还可以包括除第二用户设备的初始密钥和网络设备生成的随机数之外其他的,本发明实施例不作限定。网络设备生成的随机数可以参考现有相关技术,此处不予赘述。Exemplarily, the first parameter includes the initial key of the second user equipment and the random number generated by the network device, that is, the first parameter may be the initial key of the second user equipment and the random number generated by the network device, and the first parameter may also be Other than the initial key of the second user equipment and the random number generated by the network device may be included, which is not limited in this embodiment of the present invention. For the random number generated by the network device, reference may be made to existing related technologies, which will not be repeated here.
示例性的,第一参数包括密钥因子,密钥因子是网络设备根据第二用户设备的初始密钥和网络设备生成的随机数获取的,即第一参数可以是密钥因子,第一参数还可以包括除密钥因子之外其他的,本发明实施例不作限定。示例性的,密钥因子是网络设备根据第二用户设备的初始密钥和网络设备生成的随机数,采用A算法生成的。A算法是一种加密算法,具体可以参考现有相关技术,本发明实施例不予赘述。Exemplarily, the first parameter includes a key factor, and the key factor is obtained by the network device according to the initial key of the second user equipment and a random number generated by the network device, that is, the first parameter may be the key factor, and the first parameter Others besides the key factor may also be included, which is not limited in this embodiment of the present invention. Exemplarily, the key factor is generated by the network device using the A algorithm according to the initial key of the second user equipment and a random number generated by the network device. Algorithm A is an encryption algorithm. For details, reference may be made to existing related technologies, and details are not described in this embodiment of the present invention.
示例性的,用户设备的初始密钥在用户设备侧可以存储在用户身份识别卡(Subscriber Identification Module,简称SIM)或全球用户识别卡(UniversalSubscriber Identity Module,简称USIM)或嵌入式用户识别模块(embedded SubscriberIdentity Module,简称ESIM)中。第一用户设备的初始密钥与第二用户设备的初始密钥不同。不同用户设备的初始密钥不同。用户设备的初始密钥在网路设备侧可以存储在网络设备的存储模块中。Exemplarily, the initial key of the user equipment may be stored on the user equipment side in a Subscriber Identification Module (SIM for short) or a Universal Subscriber Identity Module (USIM for short) or an embedded Subscriber Identity Module (embedded SubscriberIdentity Module, referred to as ESIM). The initial key of the first user equipment is different from the initial key of the second user equipment. Different user equipments have different initial keys. The initial key of the user equipment may be stored in a storage module of the network equipment on the network equipment side.
步骤102、网络设备向第一用户设备发送第一参数。Step 102, the network device sends the first parameter to the first user equipment.
第一参数用于第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。The first parameter is used by the first user equipment to generate the first transmission key by using the first algorithm according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment and the initial encryption key of the second user equipment keys are different.
第一用户设备接收网络设备发送的第一参数。The first user equipment receives the first parameter sent by the network device.
步骤103、第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥。Step 103, the first user equipment generates a first transmission key by using a first algorithm according to the initial key of the first user equipment and the first parameter.
第一算法是一种加密算法,示例性的可以是A8算法,本发明实施例不作限定,具体参考现有相关技术,本发明实施例不予赘述。The first algorithm is an encryption algorithm, for example, the A8 algorithm, which is not limited in the embodiment of the present invention, and is specifically referred to in the existing related technologies, and will not be described in detail in the embodiment of the present invention.
示例性的,以第一参数为密钥因子为例进行说明,第一用户设备根据第一用户设备的初始密钥和密钥因子,采用A8算法生成第一传输密钥。Exemplarily, the first parameter is the key factor as an example for illustration, and the first user equipment generates the first transmission key by using the A8 algorithm according to the initial key and the key factor of the first user equipment.
第一用户设备通过上述步骤101-步骤103的方法生成第一传输密钥,同理第二用户设备也可以根据上述步骤101-步骤103的方法生成第一传输密钥。也就是说,可以进行D2D通信的两个用户设备可以根据相同的参数,采用相同的算法生成相同的传输密钥,然后二者利用相同的传输密钥对通信数据进行加解密,以实现二者之间通信数据的安全有效的传输。The first user equipment generates the first transmission key through the above method of step 101-step 103, similarly the second user equipment may also generate the first transmission key according to the above method of step 101-step 103. That is to say, two user equipments capable of D2D communication can use the same algorithm to generate the same transmission key according to the same parameters, and then use the same transmission key to encrypt and decrypt the communication data, so as to realize both Safe and efficient transmission of communication data between them.
示例性的,结合图8,如图9(a)或图9(b)所示,为了提高传输密钥的保密性,在步骤103之后,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤104a或步骤104b-104c。Exemplarily, referring to FIG. 8, as shown in FIG. 9(a) or FIG. 9(b), in order to improve the confidentiality of the transmission key, after step 103, the method for generating a key for D2D communication provided by the embodiment of the present invention The following step 104a or steps 104b-104c may also be included.
步骤104a、第一用户设备根据第一传输密钥,采用第二算法生成第二传输密钥。Step 104a, the first user equipment generates a second transmission key by using a second algorithm according to the first transmission key.
为了提高传输密钥的保密性,采用第二算法对第一传输密钥在进行一次加密运算。第二算法与第一算法可以相同,也可以不同,本发明实施例不作限定。具体的第二算法可以参考现有相关技术,本发明实施例不作限定。In order to improve the confidentiality of the transmission key, the second algorithm is used to perform an encryption operation on the first transmission key. The second algorithm may be the same as or different from the first algorithm, which is not limited in this embodiment of the present invention. For the specific second algorithm, reference may be made to existing related technologies, which are not limited in this embodiment of the present invention.
步骤104b、第一用户设备获取无线帧号。Step 104b, the first user equipment obtains the radio frame number.
示例性的,第一用户设备获取无线帧号的方法可以是第一用户设备自身生成无线帧号,也可以是第一用户设备接收第二用户设备发送的无线帧号。需要说明的是:为了保证最终第一用户设备和第二用户设备生成的传输密钥是相同的,二者需要采用的相同的无线帧号。那么第一用户设备和第二用户设备中的一个用户设备采用的是自身生成的无线帧号,另一个采用对方发送的无线帧号。例如,第一用户设备采用自身生成的无线帧号,第二用户设备采用第一用户设备发送的无线帧号;或第一用户设备采用第二用户设备发送的无线帧号,第二用户设备采用自身生成的无线帧号。Exemplarily, the method for the first user equipment to obtain the radio frame number may be that the first user equipment generates the radio frame number itself, or that the first user equipment receives the radio frame number sent by the second user equipment. It should be noted that: in order to ensure that the transmission keys generated by the first user equipment and the second user equipment are the same, they need to use the same radio frame number. Then one of the first user equipment and the second user equipment uses the radio frame number generated by itself, and the other uses the radio frame number sent by the other party. For example, the first user equipment uses the radio frame number generated by itself, and the second user equipment uses the radio frame number sent by the first user equipment; or the first user equipment uses the radio frame number sent by the second user equipment, and the second user equipment uses The wireless frame number generated by itself.
示例性的,无线帧号可以是TDMA帧号,也可以是其他的帧号,本发明实施例不作限定。Exemplarily, the wireless frame number may be a TDMA frame number or other frame numbers, which is not limited in this embodiment of the present invention.
步骤104c、第一用户设备根据第一传输密钥和无线帧号,采用第二算法生成第二传输密钥。Step 104c, the first user equipment generates a second transmission key by using a second algorithm according to the first transmission key and the radio frame number.
为了提高传输密钥的保密性,采用第二算法对第一传输密钥和无线帧号在进行一次加密运算。第二算法与第一算法可以相同,也可以不同,本发明实施例不作限定。具体的第二算法可以参考现有相关技术,本发明实施例不作限定。In order to improve the confidentiality of the transmission key, an encryption operation is performed on the first transmission key and the wireless frame number by using the second algorithm. The second algorithm may be the same as or different from the first algorithm, which is not limited in this embodiment of the present invention. For the specific second algorithm, reference may be made to existing related technologies, which are not limited in this embodiment of the present invention.
本发明实施例提供的D2D通信生成密钥的方法应用的场景可以是第一用户设备和第二设备需要进行数据通信的情况,即生成密钥之后,要采用密钥对通信数据进行加解密;也可以是第一用户设备和第二设备不需要进行数据通信的情况,即生成密钥之后,可以先不采用密钥对通信数据进行加解密。The application scenario of the method for generating a key for D2D communication provided by the embodiment of the present invention may be a situation where the first user equipment and the second device need to perform data communication, that is, after the key is generated, the communication data must be encrypted and decrypted using the key; It may also be the case that the first user equipment and the second equipment do not need to perform data communication, that is, after the key is generated, the communication data may be encrypted and decrypted without using the key.
示例性的,结合图8,如图10(a)所示,在步骤103之后,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤105a。Exemplarily, referring to FIG. 8, as shown in FIG. 10(a), after step 103, the method for generating a key for D2D communication provided by the embodiment of the present invention may further include the following step 105a.
步骤105a、第一用户设备采用第一传输密钥对待发送的数据进行加密或对接收的数据进行解密。Step 105a, the first user equipment encrypts the data to be sent or decrypts the received data by using the first transmission key.
第一用户设备采用第一传输密钥对待发送的数据进行加密,然后发送给第二用户设备,或者第一用户设备接收第二用户设备发送的数据,然后采用第一传输密钥对该接收的数据进行解密。具体的,加解密过程可以参考现有相关技术,本发明实施例不予赘述。The first user equipment uses the first transmission key to encrypt the data to be sent, and then sends it to the second user equipment, or the first user equipment receives the data sent by the second user equipment, and then uses the first transmission key to encrypt the received data The data is decrypted. Specifically, for the encryption and decryption process, reference may be made to existing related technologies, and details are not described in this embodiment of the present invention.
示例性的,结合图9(a),如图10(b)所示,在步骤104a之后,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤105b;结合图9(b),如图10(c)所示在步骤104c之后,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤105b。Exemplarily, referring to FIG. 9(a), as shown in FIG. 10(b), after step 104a, the method for generating a key for D2D communication provided by the embodiment of the present invention may further include the following step 105b; referring to FIG. 9 (b), as shown in FIG. 10(c), after step 104c, the method for generating a key for D2D communication provided by the embodiment of the present invention may further include the following step 105b.
步骤105b、第一用户设备采用第二传输密钥对待发送的数据进行加密或对接收的数据进行解密。Step 105b, the first user equipment encrypts the data to be sent or decrypts the received data by using the second transmission key.
第一用户设备采用第二传输密钥对待发送的数据进行加密,然后发送给第二用户设备,或者第一用户设备接收第二用户设备发送的数据,然后采用第二传输密钥对该接收的数据进行解密。具体的,加解密过程可以参考现有相关技术,本发明实施例不予赘述。The first user equipment uses the second transmission key to encrypt the data to be sent, and then sends it to the second user equipment, or the first user equipment receives the data sent by the second user equipment, and then uses the second transmission key to encrypt the received data The data is decrypted. Specifically, for the encryption and decryption process, reference may be made to existing related technologies, and details are not described in this embodiment of the present invention.
示例性的,结合图10(a),如图11(a)所示,或结合图10(b),如图11(b)所示,或结合图10(c),如图11(c)所示,在步骤101之前,本发明实施例提供的D2D通信生成密钥的方法还可以包括下述的步骤106-步骤107。Exemplarily, in combination with Figure 10(a), as shown in Figure 11(a), or in combination with Figure 10(b), as shown in Figure 11(b), or in combination with Figure 10(c), as shown in Figure 11(c ), before step 101, the method for generating a key for D2D communication provided by the embodiment of the present invention may further include the following steps 106-107.
步骤106、网络设备为第一用户设备分配第一无线资源。Step 106, the network device allocates the first radio resource to the first user equipment.
第一无线资源用于第一用户设备与第二用户设备进行D2D通信。具体的无限资源可以包括通信信道、频率资源、时间资源、码域资源、空间资源和功率资源等,本发明实施例不作限定。The first radio resource is used for D2D communication between the first user equipment and the second user equipment. Specific unlimited resources may include communication channels, frequency resources, time resources, code domain resources, space resources, and power resources, etc., which are not limited in this embodiment of the present invention.
步骤107、网络设备向第一用户设备发送资源指示信息,资源指示信息用于指示第一无线资源,第一无线资源用于第一用户设备与第二用户设备进行D2D通信。Step 107, the network device sends resource indication information to the first user equipment, where the resource indication information is used to indicate a first radio resource, and the first radio resource is used for D2D communication between the first user equipment and the second user equipment.
第一用户设备接收网络设备发送的资源指示信息,并使用该资源指示信息指示的第一无线资源,与第二用户设备进行D2D通信。The first user equipment receives the resource indication information sent by the network device, and uses the first radio resource indicated by the resource indication information to perform D2D communication with the second user equipment.
参考图12所示,以用户设备为UE1和UE2,网络设备为基站为例,提供一个具体的事例来说明本发明实施例提供的D2D通信生成密钥的方法。Referring to FIG. 12 , taking UE1 and UE2 as user equipment and base station as network equipment as an example, a specific example is provided to illustrate the method for generating a key for D2D communication provided by an embodiment of the present invention.
网络设备在确认UE1与UE2可进行D2D通信的情况下,可以利用随机数据产生器产生一组加密用随机数据RAND,这一组的随机数据RAND同时用于UE1与UE2生成密钥的过程。网络设备将随机数据RAND与UE1的初始密钥Ki1,采用A算法生成一组UE2用来生成密钥的参数Ki1&RAND,网络设备将随机数据RAND与UE2的初始密钥Ki2,采用A算法生成一组UE1用来生成密钥的参数Ki2&RAND。备注:Ki1&RAND,Ki2&RAND表示经算法运算后的数据。When the network device confirms that UE1 and UE2 can perform D2D communication, it can use the random data generator to generate a set of random data RAND for encryption, and this set of random data RAND is also used in the process of UE1 and UE2 generating keys. The network device uses the A algorithm to generate a set of parameters Ki1&RAND used by UE2 to generate the key with the random data RAND and the initial key Ki1 of UE1, and the network device uses the A algorithm to generate a set of random data RAND and the initial key Ki2 of UE2 The parameter Ki2&RAND used by UE1 to generate a key. Remarks: Ki1&RAND, Ki2&RAND represent the data after algorithm operation.
网络设备将参数Ki2&RAND发送给终端UE1,将参数Ki1&RAND发送给终端UE2。The network device sends the parameter Ki2&RAND to the terminal UE1, and sends the parameter Ki1&RAND to the terminal UE2.
UE1接收网络设备下发的参数Ki2&RAND,将参数Ki2&RAND与UE1的初始密钥Ki1,采用A8算法生成中间密钥KC1’,KC1’是由UE1的初始密钥和UE2的初始密钥以及随机数RAND经运算生成的。UE1 receives the parameter Ki2&RAND issued by the network device, uses the parameter Ki2&RAND and the initial key Ki1 of UE1, and uses the A8 algorithm to generate an intermediate key KC1', KC1' is composed of the initial key of UE1, the initial key of UE2 and the random number RAND generated by calculation.
UE2接收网络设备下发的参数Ki1&RAND,将参数Ki1&RAND与UE2的初始密钥Ki2采用A8算法生成密钥中间KC2’,KC2’是由UE1的初始密钥和UE2的初始密钥以及随机数RAND经运算生成的。UE2 receives the parameter Ki1&RAND issued by the network device, uses the parameter Ki1&RAND and the initial key Ki2 of UE2 to generate the key intermediate KC2' using the A8 algorithm, and KC2' is composed of the initial key of UE1, the initial key of UE2 and the random number RAND. generated by the operation.
则上面生成的KC1’和KC2’是相同的。Then KC1' and KC2' generated above are the same.
网络设备UE1和UE2分配无线资源,UE1端产生无线帧号TDMA帧号,利用网络设备分配的无线资源将该TDMA帧号发送给UE2,并使UE2与UE1同步。The network equipment UE1 and UE2 allocate wireless resources, UE1 generates a wireless frame number TDMA frame number, uses the wireless resources allocated by the network equipment to send the TDMA frame number to UE2, and makes UE2 synchronize with UE1.
UE1将TDMA帧号与中间密钥KC1’采用A5算法生成密钥KC1,UE2将TDMA帧号与中间密钥KC2’采用A5算法生成密钥KC2。UE1 uses the TDMA frame number and the intermediate key KC1' to generate the key KC1 using the A5 algorithm, and UE2 uses the TDMA frame number and the intermediate key KC2' to generate the key KC2 using the A5 algorithm.
综上,生成密钥KC1与密钥KC2采用了相同的参数(UE1的初始密钥Ki1、UE2的初始密钥Ki2,相同的随机数RAND和相同的TDMA帧号信息),以及相同的算法,因此密钥KC1与密钥KC2相同。可以用于UE1与UE2相互之间的解密与加密。In summary, the key KC1 and the key KC2 are generated using the same parameters (the initial key Ki1 of UE1, the initial key Ki2 of UE2, the same random number RAND and the same TDMA frame number information), and the same algorithm, Key KC1 is therefore identical to key KC2. It can be used for decryption and encryption between UE1 and UE2.
UE1将待发送的数据用密钥KC1加密并发送,UE2将接收到的数据用密钥KC2解密;UE2将待发送的数据用密钥KC2加密并发送,UE1将接收到的数据用密钥KC1解密。UE1 encrypts the data to be sent with the key KC1 and sends it, UE2 decrypts the received data with the key KC2; UE2 encrypts the data to be sent with the key KC2 and sends it, and UE1 uses the key KC1 to receive the data decrypt.
本发明实施例提供了一种D2D通信生成密钥的方法,第一用户设备接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。通过该方案,第一用户设备根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,同理第二用户设备也可以根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,也就是说,可以进行D2D通信的第一用户设备和第二用户设备生成了相同的传输密钥,可以根据该相同的传输密钥进行数据的加密或解密。采用该方案生成密钥的方法生成的密钥对通信数据进行加解密,提高了D2D通信的通信数据的安全性,从而解决了现有技术提供的生成密钥的方法生成的密钥不适用于D2D通信,从而无法提高D2D通信的通信数据的安全性的问题。An embodiment of the present invention provides a method for generating a key for D2D communication. The first user equipment receives the first parameter sent by the network device. The first parameter is used to indicate the initial key of the second user equipment. The second user equipment and the second user equipment A D2D communication condition is satisfied between user equipments; the first user equipment uses a first algorithm to generate a first transmission key according to the initial key and the first parameter of the first user equipment, and the initial key of the first user equipment and the first parameter The initial keys of the two user equipments are different. Through this scheme, the first user equipment generates the first transmission key according to the initial key of the first user equipment and the initial key of the second user equipment. key and the initial key of the second user equipment to generate the first transmission key, that is to say, the first user equipment and the second user equipment that can perform D2D communication generate the same transmission key, and the same transmission key can be generated according to the same Encrypt or decrypt data using the transmission key. The key generated by the key generation method of this scheme is used to encrypt and decrypt the communication data, which improves the security of the communication data of D2D communication, thereby solving the problem that the key generated by the method of generating the key provided by the prior art is not suitable for Due to D2D communication, the security of the communication data of D2D communication cannot be improved.
实施例四Embodiment Four
如图13所示,本发明实施例提供一种第一用户设备120,包括:接收模块121和生成模块122;As shown in FIG. 13 , an embodiment of the present invention provides a first user equipment 120, including: a receiving module 121 and a generating module 122;
接收模块121,用于接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;The receiving module 121 is configured to receive a first parameter sent by the network device, the first parameter is used to indicate the initial key of the second user equipment, and the D2D communication condition is satisfied between the second user equipment and the first user equipment;
生成模块122,用于根据第一用户设备的初始密钥和接收模块121接收的第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。The generating module 122 is configured to generate a first transmission key by using a first algorithm according to the initial key of the first user equipment and the first parameter received by the receiving module 121, and the initial key of the first user equipment is the same as that of the second user equipment. The initial keys are different.
可选的,第一参数包括第二用户设备的初始密钥;或者,第一参数包括第二用户设备的初始密钥和网络设备生成的随机数;或者,第一参数包括密钥因子,密钥因子是网络设备根据第二用户设备的初始密钥和网络设备生成的随机数获取的。Optionally, the first parameter includes the initial key of the second user equipment; or, the first parameter includes the initial key of the second user equipment and a random number generated by the network device; or, the first parameter includes a key factor, and the key The key factor is obtained by the network device according to the initial key of the second user equipment and a random number generated by the network device.
可选的,生成模块122,还用于在根据第一用户设备的初始密钥和接收模块121接收的第一参数,采用第一算法生成第一传输密钥之后,根据第一传输密钥,采用第二算法生成第二传输密钥。Optionally, the generating module 122 is further configured to, after using the first algorithm to generate the first transmission key according to the initial key of the first user equipment and the first parameter received by the receiving module 121, according to the first transmission key, A second transmission key is generated using a second algorithm.
可选的,结合图13,如图14所示,用户设备120还包括:获取模块123;获取模块123,用于在第一用户设备根据第一传输密钥,采用第二算法生成第二传输密钥之前,获取无线帧号;生成模块122,具体用于根据第一传输密钥和获取模块获取的无线帧号,采用第二算法生成第二传输密钥。Optionally, referring to FIG. 13 , as shown in FIG. 14 , the user equipment 120 further includes: an acquisition module 123; the acquisition module 123 is configured to generate a second transmission key using a second algorithm on the first user equipment according to the first transmission key. Before the key, the wireless frame number is obtained; the generating module 122 is specifically configured to generate a second transmission key by using a second algorithm according to the first transmission key and the wireless frame number obtained by the obtaining module.
可选的,结合图14,如图15所示,用户设备120还包括:加解密模块124;加解密模块124,用于在采用第一算法生成第一传输密钥之后,采用生成模块122生成的第一传输密钥对待发送的数据进行加密或对接收的数据进行解密;或者在采用第二算法生成第二传输密钥之后,采用生成模块122生成的第二传输密钥对待发送的数据进行加密或对接收的数据进行解密。Optionally, referring to FIG. 14 , as shown in FIG. 15 , the user equipment 120 further includes: an encryption and decryption module 124; the encryption and decryption module 124 is configured to use the generation module 122 to generate Encrypt the data to be sent or decrypt the received data with the first transmission key; or use the second transmission key generated by the generation module 122 to encrypt the data to be sent Encrypt or decrypt received data.
可选的,接收模块121,还用于在接收网络设备发送的第一参数之前,接收网络设备发送的资源指示信息,资源指示信息用于指示第一无线资源,第一无线资源用于第一用户设备与第二用户设备进行D2D通信。Optionally, the receiving module 121 is also configured to receive resource indication information sent by the network device before receiving the first parameter sent by the network device, the resource indication information is used to indicate the first wireless resource, and the first wireless resource is used for the first The user equipment performs D2D communication with the second user equipment.
本发明实施例提供的用户设备能够实现上述方法实施例中图2至图5任意之一或图8至图12任意之一所示的各个过程,为避免重复,此处不再赘述。The user equipment provided by the embodiments of the present invention can implement the processes shown in any one of FIG. 2 to FIG. 5 or any one of FIG. 8 to FIG. 12 in the above method embodiments. To avoid repetition, details are not repeated here.
本发明实施例提供了一种第一用户设备,第一用户设备接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。通过该方案,第一用户设备根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,同理第二用户设备也可以根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,也就是说,可以进行D2D通信的第一用户设备和第二用户设备生成了相同的传输密钥,可以根据该相同的传输密钥进行数据的加密或解密。采用该方案生成密钥的方法生成的密钥对通信数据进行加解密,提高了D2D通信的通信数据的安全性,从而解决了现有技术提供的生成密钥的方法生成的密钥不适用于D2D通信,从而无法提高D2D通信的通信数据的安全性的问题。An embodiment of the present invention provides a first user equipment. The first user equipment receives a first parameter sent by a network device. The first parameter is used to indicate the initial key of the second user equipment. The second user equipment and the first user equipment meet the conditions of D2D communication; the first user equipment uses the first algorithm to generate the first transmission key according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment and the second user equipment different initial keys. Through this scheme, the first user equipment generates the first transmission key according to the initial key of the first user equipment and the initial key of the second user equipment. key and the initial key of the second user equipment to generate the first transmission key, that is to say, the first user equipment and the second user equipment that can perform D2D communication generate the same transmission key, and the same transmission key can be generated according to the same Encrypt or decrypt data using the transmission key. The key generated by the key generation method of this scheme is used to encrypt and decrypt the communication data, which improves the security of the communication data of D2D communication, thereby solving the problem that the key generated by the method of generating the key provided by the prior art is not suitable for Due to D2D communication, the security of the communication data of D2D communication cannot be improved.
图16为实现本发明各个实施例的一种用户设备的硬件结构示意图。以用户设备为第一用户设备为例进行说明。如图16所示,该用户设备100包括但不限于:射频单元101、网络模块102、音频输出单元103、输入单元104、传感器105、显示单元106、用户输入单元107、接口单元108、存储器109、处理器110、以及电源111等部件。本领域技术人员可以理解,图16中示出的用户设备结构并不构成对用户设备的限定,用户设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本发明实施例中,用户设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载用户设备、可穿戴设备、以及计步器等。Fig. 16 is a schematic diagram of a hardware structure of a user equipment implementing various embodiments of the present invention. The user equipment is taken as the first user equipment as an example for description. As shown in Figure 16, the user equipment 100 includes but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, and a memory 109 , processor 110, and power supply 111 and other components. Those skilled in the art can understand that the structure of the user equipment shown in FIG. 16 does not constitute a limitation on the user equipment, and the user equipment may include more or less components than those shown in the figure, or combine certain components, or different components. layout. In the embodiment of the present invention, the user equipment includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle-mounted user equipment, a wearable device, and a pedometer.
其中,射频单元101,用于接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;Wherein, the radio frequency unit 101 is configured to receive the first parameter sent by the network device, the first parameter is used to indicate the initial key of the second user equipment, and the D2D communication condition is satisfied between the second user equipment and the first user equipment;
处理器110,用于根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。The processor 110 is configured to generate a first transmission key by using a first algorithm according to an initial key of the first user equipment and a first parameter, where the initial key of the first user equipment is different from that of the second user equipment.
本发明实施例提供的用户设备,第一用户设备接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。通过该方案,第一用户设备根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,同理第二用户设备也可以根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,也就是说,可以进行D2D通信的第一用户设备和第二用户设备生成了相同的传输密钥,可以根据该相同的传输密钥进行数据的加密或解密。采用该方案生成密钥的方法生成的密钥对通信数据进行加解密,提高了D2D通信的通信数据的安全性,从而解决了现有技术提供的生成密钥的方法生成的密钥不适用于D2D通信,从而无法提高D2D通信的通信数据的安全性的问题。In the user equipment provided by the embodiment of the present invention, the first user equipment receives the first parameter sent by the network device, the first parameter is used to indicate the initial key of the second user equipment, and the D2D is satisfied between the second user equipment and the first user equipment. Communication conditions: the first user equipment uses the first algorithm to generate the first transmission key according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment and the initial key of the second user equipment different. Through this scheme, the first user equipment generates the first transmission key according to the initial key of the first user equipment and the initial key of the second user equipment. key and the initial key of the second user equipment to generate the first transmission key, that is to say, the first user equipment and the second user equipment that can perform D2D communication generate the same transmission key, and the same transmission key can be generated according to the same Encrypt or decrypt data using the transmission key. The key generated by the key generation method of this scheme is used to encrypt and decrypt the communication data, which improves the security of the communication data of D2D communication, thereby solving the problem that the key generated by the method of generating the key provided by the prior art is not suitable for Due to D2D communication, the security of the communication data of D2D communication cannot be improved.
应理解的是,本发明实施例中,射频单元101可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自基站的下行数据接收后,给处理器110处理;另外,将上行的数据发送给基站。通常,射频单元101包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元101还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in the embodiment of the present invention, the radio frequency unit 101 can be used for receiving and sending signals during sending and receiving information or during a call. Specifically, after receiving the downlink data from the base station, the processor 110 processes it; Uplink data is sent to the base station. Generally, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with the network and other devices through a wireless communication system.
用户设备通过网络模块102为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The user equipment provides users with wireless broadband Internet access through the network module 102, such as helping users send and receive emails, browse web pages, and access streaming media.
音频输出单元103可以将射频单元101或网络模块102接收的或者在存储器109中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元103还可以提供与用户设备100执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元103包括扬声器、蜂鸣器以及受话器等。The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the network module 102 or stored in the memory 109 into an audio signal and output as sound. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the user equipment 100 (eg, call signal reception sound, message reception sound, etc.). The audio output unit 103 includes a speaker, a buzzer, a receiver, and the like.
输入单元104用于接收音频或视频信号。输入单元104可以包括图形处理器(Graphics Processing Unit,GPU)1041和麦克风1042,图形处理器1041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元106上。经图形处理器1041处理后的图像帧可以存储在存储器109(或其它存储介质)中或者经由射频单元101或网络模块102进行发送。麦克风1042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元101发送到移动通信基站的格式输出。The input unit 104 is used to receive audio or video signals. The input unit 104 may include a graphics processing unit (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processing unit 1041 is used for still pictures or video images obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The data is processed. The processed image frames may be displayed on the display unit 106 . The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage media) or sent via the radio frequency unit 101 or the network module 102 . The microphone 1042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format that can be sent to a mobile communication base station via the radio frequency unit 101 for output in the case of a phone call mode.
用户设备100还包括至少一种传感器105,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1061的亮度,接近传感器可在用户设备100移动到耳边时,关闭显示面板1061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别用户设备姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器105还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。The user equipment 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and the / or backlighting. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three axes), and can detect the magnitude and direction of gravity when it is stationary, and can be used to identify the posture of the user device (such as horizontal and vertical screen switching, related games, etc.) , magnetometer posture calibration), vibration recognition-related functions (such as pedometer, knocking), etc.; the sensor 105 can also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, Infrared sensors, etc., will not be repeated here.
显示单元106用于显示由用户输入的信息或提供给用户的信息。显示单元106可包括显示面板1061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1061。The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), or the like.
用户输入单元107可用于接收输入的数字或字符信息,以及产生与用户设备的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元107包括触控面板1071以及其他输入设备1072。触控面板1071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板1071上或在触控面板1071附近的操作)。触控面板1071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器110,接收处理器110发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1071。除了触控面板1071,用户输入单元107还可以包括其他输入设备1072。具体地,其他输入设备1072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 107 can be used to receive input numbers or character information, and generate key signal input related to user settings and function control of the user equipment. Specifically, the user input unit 107 includes a touch panel 1071 and other input devices 1072 . The touch panel 1071, also referred to as a touch screen, can collect touch operations of the user on or near it (for example, the user uses any suitable object or accessory such as a finger or a stylus on the touch panel 1071 or near the touch panel 1071). operate). The touch panel 1071 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the For the processor 110, receive the command sent by the processor 110 and execute it. In addition, the touch panel 1071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071 , the user input unit 107 may also include other input devices 1072 . Specifically, other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.
进一步的,触控面板1071可覆盖在显示面板1061上,当触控面板1071检测到在其上或附近的触摸操作后,传送给处理器110以确定触摸事件的类型,随后处理器110根据触摸事件的类型在显示面板1061上提供相应的视觉输出。虽然在图16中,触控面板1071与显示面板1061是作为两个独立的部件来实现用户设备的输入和输出功能,但是在某些实施例中,可以将触控面板1071与显示面板1061集成而实现用户设备的输入和输出功能,具体此处不做限定。Further, the touch panel 1071 can be covered on the display panel 1061, and when the touch panel 1071 detects a touch operation on or near it, it will be sent to the processor 110 to determine the type of the touch event, and then the processor 110 can The type of event provides a corresponding visual output on the display panel 1061 . Although in FIG. 16 , the touch panel 1071 and the display panel 1061 are used as two independent components to realize the input and output functions of the user equipment, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated. The implementation of the input and output functions of the user equipment is not specifically limited here.
接口单元108为外部装置与用户设备100连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元108可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到用户设备100内的一个或多个元件或者可以用于在用户设备100和外部装置之间传输数据。The interface unit 108 is an interface for connecting an external device to the user equipment 100 . For example, an external device may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The interface unit 108 may be used to receive input from an external device (eg, data information, power, etc.) and transmit the received input to one or more elements within the user device 100 or may be used to interface transfer data between devices.
存储器109可用于存储软件程序以及各种数据。存储器109可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器109可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 109 can be used to store software programs as well as various data. The memory 109 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.) etc.; Data created by the use of mobile phones (such as audio data, phonebook, etc.), etc. In addition, the memory 109 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
处理器110是用户设备的控制中心,利用各种接口和线路连接整个用户设备的各个部分,通过运行或执行存储在存储器109内的软件程序和/或模块,以及调用存储在存储器109内的数据,执行用户设备的各种功能和处理数据,从而对用户设备进行整体监控。处理器110可包括一个或多个处理单元;可选的,处理器110可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器110中。The processor 110 is the control center of the user equipment, and uses various interfaces and lines to connect various parts of the entire user equipment, by running or executing software programs and/or modules stored in the memory 109, and calling data stored in the memory 109 , executing various functions of the user equipment and processing data, so as to monitor the user equipment as a whole. The processor 110 may include one or more processing units; optionally, the processor 110 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem The tuner processor mainly handles wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 110 .
用户设备100还可以包括给各个部件供电的电源111(比如电池),可选的,电源111可以通过电源管理系统与处理器110逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The user equipment 100 may also include a power supply 111 (such as a battery) for supplying power to various components. Optionally, the power supply 111 may be logically connected to the processor 110 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. Management and other functions.
另外,用户设备100包括一些未示出的功能模块,在此不再赘述。In addition, the user equipment 100 includes some unshown functional modules, which will not be repeated here.
实施例五Embodiment five
本发明实施例还提供一种第一用户设备,可以包括上述如图16所示的处理器110,存储器109,以及存储在存储器109上并可在该处理器110上运行的计算机程序,该计算机程序被处理器110执行时实现上述方法实施例中图2至图5任意之一或图8至图12任意之一所示的D2D通信生成密钥的方法的各个过程,且能达到相同的技术效果,为避免重复,此处不再赘述。The embodiment of the present invention also provides a first user equipment, which may include the above-mentioned processor 110 as shown in FIG. When the program is executed by the processor 110, the various processes of the method for generating keys for D2D communication shown in any one of Figures 2 to 5 or any one of Figures 8 to 12 in the above method embodiments are implemented, and the same technology can be achieved Effect, in order to avoid repetition, it is not repeated here.
实施例六Embodiment six
如图17所示,本发明实施例提供一种网络设备130,该网络设备130包括:获取模块131和发送模块132;As shown in FIG. 17 , an embodiment of the present invention provides a network device 130, the network device 130 includes: an acquisition module 131 and a sending module 132;
获取模块131,用于获取第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;The acquiring module 131 is configured to acquire a first parameter, the first parameter is used to indicate the initial key of the second user equipment, and the condition of D2D communication is satisfied between the second user equipment and the first user equipment;
发送模块132,用于向第一用户设备发送获取模块131获取的第一参数,第一参数用于第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。The sending module 132 is configured to send the first parameter acquired by the acquiring module 131 to the first user equipment, and the first parameter is used by the first user equipment to generate the first parameter according to the initial key of the first user equipment and the first parameter using a first algorithm. A transmission key, the initial key of the first user equipment is different from the initial key of the second user equipment.
可选的,第一参数包括第二用户设备的初始密钥;或者,第一参数包括第二用户设备的初始密钥和网络设备生成的随机数;或者,第一参数包括密钥因子,密钥因子是网络设备根据第二用户设备的初始密钥和网络设备生成的随机数获取的。Optionally, the first parameter includes the initial key of the second user equipment; or, the first parameter includes the initial key of the second user equipment and a random number generated by the network device; or, the first parameter includes a key factor, and the key The key factor is obtained by the network device according to the initial key of the second user equipment and a random number generated by the network device.
可选的,发送模块,还用于向第一用户设备发送资源指示信息,资源指示信息用于指示第一无线资源,第一无线资源用于第一用户设备与第二用户设备进行D2D通信。Optionally, the sending module is further configured to send resource indication information to the first user equipment, where the resource indication information is used to indicate a first radio resource, and the first radio resource is used for D2D communication between the first user equipment and the second user equipment.
本发明实施例提供的用户设备能够实现上述方法实施例中图6或图7,或图8至图12任意之一所示的各个过程,为避免重复,此处不再赘述。The user equipment provided by the embodiment of the present invention can implement each process shown in FIG. 6 or FIG. 7, or any one of FIG. 8 to FIG. 12 in the above method embodiment. To avoid repetition, details are not repeated here.
本发明实施例提供了一种网络设备,第一用户设备接收网络设备发送的第一参数,第一参数用于指示第二用户设备的初始密钥,第二用户设备和第一用户设备之间满足D2D通信的条件;第一用户设备根据第一用户设备的初始密钥和第一参数,采用第一算法生成第一传输密钥,第一用户设备的初始密钥与第二用户设备的初始密钥不同。通过该方案,第一用户设备根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,同理第二用户设备也可以根据第一用户设备的初始密钥和第二用户设备的初始密钥,生成了第一传输密钥,也就是说,可以进行D2D通信的第一用户设备和第二用户设备生成了相同的传输密钥,可以根据该相同的传输密钥进行数据的加密或解密。从而采用该生成密钥的方法生成的密钥对通信数据进行加解密,提高了D2D通信的通信数据的安全性。An embodiment of the present invention provides a network device. The first user equipment receives the first parameter sent by the network device. The first parameter is used to indicate the initial key of the second user equipment. Between the second user equipment and the first user equipment Satisfy the conditions of D2D communication; the first user equipment uses the first algorithm to generate the first transmission key according to the initial key of the first user equipment and the first parameter, and the initial key of the first user equipment and the initial key of the second user equipment The keys are different. Through this scheme, the first user equipment generates the first transmission key according to the initial key of the first user equipment and the initial key of the second user equipment. key and the initial key of the second user equipment to generate the first transmission key, that is to say, the first user equipment and the second user equipment that can perform D2D communication generate the same transmission key, and the same transmission key can be generated according to the same Encrypt or decrypt data using the transmission key. Therefore, the communication data is encrypted and decrypted using the key generated by the method for generating the key, which improves the security of the communication data in the D2D communication.
实施例七Embodiment seven
参考图18所示,本发明实施例还提供一种网络设备,包括处理器141,存储器142,以及存储在存储器142上并可在该处理器141上运行的计算机程序,该计算机程序被处理器141执行时实现上述方法实施例中图6或图7,或图8至图12任意之一所示的D2D通信生成密钥的方法的各个过程,且能达到相同的技术效果,为避免重复,此处不再赘述。Referring to FIG. 18, an embodiment of the present invention also provides a network device, including a processor 141, a memory 142, and a computer program stored in the memory 142 and operable on the processor 141. The computer program is executed by the processor. 141 implements each process of the D2D communication key generation method shown in Figure 6 or Figure 7 in the above method embodiment, or any one of Figure 8 to Figure 12 when executed, and can achieve the same technical effect. In order to avoid repetition, I won't repeat them here.
实施例八Embodiment eight
本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述方法实施例中图2至图12任意之一所示的D2D通信生成密钥的方法的各个过程,且能达到相同的技术效果,为避免重复,此处不再赘述。其中,的计算机可读存储介质,如只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。An embodiment of the present invention also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the method shown in any one of Fig. 2 to Fig. 12 in the above method embodiment is implemented. Each process of the method for generating a key for D2D communication can achieve the same technical effect, and will not be repeated here to avoid repetition. Wherein, the computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
实施例九Embodiment nine
本发明实施例还提供一种无线通信系统,包括:第一用户设备和网络设备;An embodiment of the present invention also provides a wireless communication system, including: a first user equipment and a network device;
第一用户设备包括如实施例二所述的第一用户设备和网络设备包括如实施例四所述的网络设备;The first user equipment includes the first user equipment described in Embodiment 2, and the network device includes the network device described in Embodiment 4;
或者,第一用户设备包括如实施例三所述的第一用户设备和网络设备包括如实施例五所述的网络设备。Alternatively, the first user equipment includes the first user equipment described in Embodiment 3, and the network device includes the network device described in Embodiment 5.
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述网页资源获取方法实施例中所述服务器所述实现的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(RandomAccess Memory,简称RAM)、磁碟或者光盘等。The embodiment of the present application also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, each implementation described by the server in the above-mentioned embodiment of the web page resource acquisition method is realized. process, and can achieve the same technical effect, in order to avoid repetition, it will not be repeated here. Wherein, the computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk or an optical disk, and the like.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台用户设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a user equipment (which may be a mobile phone, computer, server, air conditioner, or network equipment, etc.) to execute the methods of various embodiments of the present invention.
上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本发明的保护之内。Embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementations, and the above-mentioned specific implementations are only illustrative, rather than restrictive. Those of ordinary skill in the art will Under the enlightenment of the present invention, many forms can also be made without departing from the gist of the present invention and the protection scope of the claims, all of which belong to the protection of the present invention.
Claims (21)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810272425.6A CN108521641A (en) | 2018-03-29 | 2018-03-29 | A method, device and system for generating a key in D2D communication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810272425.6A CN108521641A (en) | 2018-03-29 | 2018-03-29 | A method, device and system for generating a key in D2D communication |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108521641A true CN108521641A (en) | 2018-09-11 |
Family
ID=63431345
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810272425.6A Pending CN108521641A (en) | 2018-03-29 | 2018-03-29 | A method, device and system for generating a key in D2D communication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108521641A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113452515A (en) * | 2020-03-25 | 2021-09-28 | 阿里巴巴集团控股有限公司 | Communication method, key configuration method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101060404A (en) * | 2006-04-19 | 2007-10-24 | 华为技术有限公司 | A method and system protecting the wireless network against the replay attack |
CN102984699A (en) * | 2012-12-03 | 2013-03-20 | 中国联合网络通信集团有限公司 | D2D (device-to-device) communication data processing method, equipment and system |
CN104737570A (en) * | 2012-10-19 | 2015-06-24 | 诺基亚技术有限公司 | Method and device of generating a key for device-to-device communication between a first user equipment and a second user equipment |
CN106162631A (en) * | 2015-04-14 | 2016-11-23 | 中兴通讯股份有限公司 | A kind of methods, devices and systems of secure communication |
US20170318616A1 (en) * | 2014-10-23 | 2017-11-02 | Zte Corporation | Method for managing device-to-device (d2d) communication group, device, and storage medium |
-
2018
- 2018-03-29 CN CN201810272425.6A patent/CN108521641A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101060404A (en) * | 2006-04-19 | 2007-10-24 | 华为技术有限公司 | A method and system protecting the wireless network against the replay attack |
CN104737570A (en) * | 2012-10-19 | 2015-06-24 | 诺基亚技术有限公司 | Method and device of generating a key for device-to-device communication between a first user equipment and a second user equipment |
CN102984699A (en) * | 2012-12-03 | 2013-03-20 | 中国联合网络通信集团有限公司 | D2D (device-to-device) communication data processing method, equipment and system |
US20170318616A1 (en) * | 2014-10-23 | 2017-11-02 | Zte Corporation | Method for managing device-to-device (d2d) communication group, device, and storage medium |
CN106162631A (en) * | 2015-04-14 | 2016-11-23 | 中兴通讯股份有限公司 | A kind of methods, devices and systems of secure communication |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113452515A (en) * | 2020-03-25 | 2021-09-28 | 阿里巴巴集团控股有限公司 | Communication method, key configuration method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109257740B (en) | Profile downloading method, mobile terminal and readable storage medium | |
EP3605989A1 (en) | Information sending method, information receiving method, apparatus, and system | |
CN108566686B (en) | A method, device and system for establishing a D2D connection | |
CN108449114B (en) | Bluetooth connection method and mobile terminal | |
US12120541B2 (en) | Method for processing communication range information and terminal | |
US10454905B2 (en) | Method and apparatus for encrypting and decrypting picture, and device | |
CN107276991B (en) | Method and device for loading Web page and computer readable storage medium | |
CN107635234B (en) | Wi-Fi control method, mobile terminal and computer-readable storage medium | |
CN108601062B (en) | WiFi connection sharing method, terminal and computer storage medium | |
WO2020228537A1 (en) | Resource determination method, resource indication method, terminal and network side device | |
CN108616878A (en) | A kind of encrypting and decrypting method, equipment and computer storage media | |
CN108012270B (en) | Information processing method, equipment and computer readable storage medium | |
CN107302526B (en) | System interface calling method, device and computer readable storage medium | |
CN111435906A (en) | Reference value determination method and terminal | |
CN114553612B (en) | Data encryption and decryption method and device, storage medium and electronic equipment | |
CN111106909B (en) | Data transmission method, data transmission configuration method, terminal and network side equipment | |
CN109068317A (en) | Communication means, communication processing apparatus and computer readable storage medium | |
CN110808817A (en) | Resource allocation method and device | |
CN113015250B (en) | Uplink resource allocation method and equipment | |
CN115589286B (en) | Data encryption and decryption method and device, electronic equipment and storage medium | |
WO2021018134A1 (en) | Information transmission method and apparatus, and device and medium | |
CN113381966A (en) | Information reporting method, information receiving method, terminal and network side equipment | |
CN108521641A (en) | A method, device and system for generating a key in D2D communication | |
CN108197490B (en) | Method and terminal for preventing malicious acquisition of user authorization information | |
CN115174758B (en) | Picture encryption method and device, electronic equipment and storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180911 |