Communication method and device based on dynamic encryption, equipment, storage medium and program product
By renewing the dynamic keys of the terminal and gateway by using the real -time network time to update the dynamic key to the low -power wide -area wireless communication network, the problem of low communication security in the existing technology has been solved, and efficient communication security guarantees are achieved.
Patent Information
- Application Number
- CN202411323741.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art, communication security in low-power wide-area wireless communication networks is low, and the existing encryption solutions are simple, making it difficult to effectively ensure communication security.
A dynamic encryption method is proposed to update the dynamic key of the terminal and the gateway through the real -time network time network sent by the gateway to achieve the synchronization and update of the dynamic key.
Improved communication security, and through the update of dynamic keys to prevent the key from being acquired illegally, ensuring the stability and security of communication.
Smart Images

Figure CN119382869A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and in particular, relates to a communication method, a communication device, an electronic device, a computer-readable storage medium, and a computer program product based on dynamic encryption. Background Art
[0002] In low-power wide-area wireless communication networks (LPWAN), the data payload to be sent often needs to be encrypted or scrambled to prevent the information from being obtained during the transmission process. For example, in the LoRaWAN protocol, which is the most widely used protocol in LPWAN, after the terminal node is connected to the service gateway, it will generate secret keys (NwkSKey and AppSKey) for data and signaling transmission and integrity verification, which are used to scramble / encrypt MAC layer data.
[0003] However, current encryption schemes are relatively simple and have low communication security. Summary of the invention
[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a communication method, a communication device, an electronic device, a computer-readable storage medium and a computer program product based on dynamic encryption, which can realize dynamic key update, thereby improving communication security.
[0005] In a first aspect, the present application provides a communication method based on dynamic encryption, including updating a terminal dynamic key based on real-time network time sent by a gateway; sending feedback information indicating that the key has been updated to the gateway, so that the gateway synchronously updates the gateway dynamic key based on the real-time network time; and communicating with the gateway based on the updated terminal dynamic key.
[0006] In a second aspect, the present application provides a communication method based on dynamic encryption, including sending real-time network time to a terminal so that the terminal updates the terminal dynamic key; upon receiving feedback information sent by the terminal indicating that the key has been updated, updating the gateway dynamic key based on the real-time network time; and communicating with the terminal based on the updated gateway dynamic key.
[0007] In a third aspect, the present application provides a communication device, the communication device comprising:
[0008] A first updating module, used for updating the terminal dynamic key based on the real-time network time sent by the gateway;
[0009] A synchronization module, used to send feedback information indicating that the key has been updated to the gateway, so that the gateway synchronously updates the gateway dynamic key based on the real-time network time;
[0010] The first communication module is used to communicate with the gateway based on the updated terminal dynamic key.
[0011] In a fourth aspect, the present application provides a communication device, the communication device comprising:
[0012] A sending module, used for sending the real-time network time to the terminal, so that the terminal updates the terminal dynamic key;
[0013] A second updating module is used to update the gateway dynamic key based on the real-time network time (and feed back the updated information to the terminal) when receiving feedback information sent by the terminal indicating that the key has been updated;
[0014] The second communication module is used to communicate with the terminal based on the updated gateway dynamic key.
[0015] In a fifth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned communication method based on dynamic encryption.
[0016] In a sixth aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned communication method based on dynamic encryption when executing the program.
[0017] In a seventh aspect, the present application provides a computer program product, including a computer program, which implements the above-mentioned communication method based on dynamic encryption when executed by a processor.
[0018] The communication method, communication device, electronic device, computer-readable storage medium and computer program product based on dynamic encryption provided by the embodiments of the present application update the terminal dynamic key through the real-time network time sent by the gateway. Since the real-time network time changes in real time, the dynamic key updated based on the real-time network time also changes dynamically, thereby realizing the generation of dynamic keys.
[0019] The terminal's key needs to be synchronized with the gateway. After the terminal updates the dynamic key, it can send feedback information of the updated dynamic key to the gateway, so that the gateway can synchronize and update the gateway dynamic key based on the real-time network time. When the terminal subsequently sends data based on the updated terminal dynamic key to communicate with the gateway, the gateway can parse the data sent by the terminal according to the synchronized updated gateway dynamic key, thereby realizing communication between the terminal and the gateway based on the dynamic key, which not only ensures the stability of communication, but also has high communication security.
[0020] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0022] Figure 1 This is an application scenario diagram of a communication method based on dynamic encryption provided in an embodiment of the present application;
[0023] Figure 2 It is a flow chart of a communication method based on dynamic encryption applied to a terminal provided in an embodiment of the present application;
[0024] Figure 3 It is a schematic diagram of the principle of a communication method based on dynamic encryption applied to a terminal provided in an embodiment of the present application;
[0025] Figure 4 It is a flow chart of a communication method based on dynamic encryption applied to a gateway provided in an embodiment of the present application;
[0026] Figure 5 is a module schematic diagram of a communication device provided in an embodiment of the present application;
[0027] Figure 6 is a module schematic diagram of a communication device provided in an embodiment of the present application;
[0028] Figure 7 is a module schematic diagram of a communication device provided in an embodiment of the present application;
[0029] Figure 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application; and
[0030] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0032] For ease of understanding, the technical background and application scenarios of this application are first introduced below:
[0033] AES128 encryption is a symmetric encryption scheme. The encryption scheme using AES128 requires the use of the same secret key for encryption and decryption. Therefore, in the LoRaWAN protocol, both ends of the transceiver need to generate and store secret key information. The length of the secret key is 16 bits (Byte) and is generated as follows:
[0034] NwkSKey=aes128_encrypt(appKey,0x01|JoinNonce|NetID|DevNonce|pad16);
[0035] AppSKey=aes128_encrypt(appKey,0x02|JoinNonce|NetID|DevNonce|pad16).
[0036] Among them, NwkSKey is the gateway key, AppSKey is the terminal key, AppKey is the initial secret key with a length of 16 bytes, 0x01 and 0x02 are constants with a length of 1 Byte; JoinNonce is the parameter assigned by the service gateway to the terminal node for calculating the secret key, with a length of 3 Byte; NetID is the network ID of the service gateway, with a length of 4 Byte; DevNonce is the count of the terminal node when it accesses the service gateway, with a length of 2 Byte; pad16 is an all-zero sequence that pads the entire sequence to 16 Bytes. In the method of generating NwkSKey and AppSKey, the length of pad16 is 6 Byte.
[0037] See also Figure 1 , Figure 1 1 is an application scenario diagram of a communication method based on dynamic encryption provided in an embodiment of the present application. The application scenario provided in the present application includes a terminal 101, a gateway 102 and a server 103.
[0038] The terminal 101 may include but is not limited to:
[0039] (1) Internet of Things devices: smart meters, robots, sensor devices (such as temperature sensors, humidity sensors, light sensors, etc.), actuator devices (smart light bulbs, smart sockets, electronic locks, etc.), embedded devices (smart TVs, smart speakers, smart refrigerators, etc.), vehicle-mounted devices (smart vehicles, vehicle-mounted navigation systems, etc.), etc., which are not limited to the embodiments of the present application.
[0040] (2) Other devices: smart phones (such as Android phones, IOS phones, etc.), tablet computers, laptops, desktop computers, smart speakers, smart watches, portable personal computers, mobile Internet devices (Mobile Internet Devices, referred to as MID), intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, wearable devices, etc., which are not limited to the embodiments of the present application.
[0041] A gateway 102 is a network device or software application that acts as a connection point and converter between different networks. The main function of a gateway is to enable different types of networks to communicate with each other. For example, it can connect a local area network (LAN) to the Internet, or connect two networks using different protocols.
[0042] Server 103 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but the embodiments of the present application do not limit this.
[0043] Each terminal 101 communicates with the server 103 or other terminals 101 by accessing the gateway 102 .
[0044] It should be noted that Figure 1 The number of terminals, gateways and servers is only used as an example, and the number of terminals, gateways and servers can also be more or less, which is not limited here. The terminal and the gateway can be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0045] In some embodiments, the electronic device of the present application may be at least one of a terminal and a gateway. In other words, the electronic device may be a terminal, a gateway, or the electronic device may include both a terminal and a gateway. The terminal and the gateway cooperate with each other to implement the communication method based on dynamic encryption of the present application.
[0046] Based on the above technical background and the introduction of its application scenarios, the embodiment of the present application provides a communication method based on dynamic encryption applied to a terminal. The communication method based on dynamic encryption is introduced in detail below:
[0047] See also Figure 2 A communication method based on dynamic encryption provided in an embodiment of the present application is implemented by steps 011 to 013, which are described in detail below.
[0048] Step 011: Update the terminal dynamic key based on the real-time network time sent by the gateway.
[0049] The real-time network time is the time generated by the gateway based on its own network time. For example, the real-time network time can be the time when the gateway data is sent. Since the time delay between the gateway and the terminal is extremely low, the time when the gateway data is sent is generally equivalent to the real-time network time of the gateway.
[0050] Optionally, the gateway may send the real-time network time when the terminal accesses, or send the real-time network time based on the request of the terminal; or send the real-time network time based on a preset policy of the gateway.
[0051] Optionally, the terminal dynamic key and the gateway dynamic key are generated by a preset symmetric key encryption algorithm.
[0052] Optionally, the symmetric key encryption algorithm includes an Advanced Encryption Standard (AES) algorithm, and the key length of the Advanced Encryption Standard algorithm is 128 bits.
[0053] Taking AES algorithm encryption as an example, when generating a key, the AES algorithm can use the real-time network time as one of the influencing factors. When the real-time network time changes, the key generated by the AES algorithm will change.
[0054] Optionally, the gateway dynamic key and the terminal dynamic key may be generated based on the following generation method:
[0055] MsgKey=AES128(InitKey,Msg);
[0056] Msg=Const|JoinID|DevNonce|NetID|NetworkTime|pad16.
[0057] Among them, InitKey corresponds to the initial key at the time of initial access (i.e., the terminal initial key), which is only used for encryption or scrambling operations of related data in access requests and access permissions; Const is a constant. If multiple different keys need to be generated in the system, Const can be configured as different constants (for example, multiple dynamic keys can be generated based on different business needs, so that the corresponding dynamic keys can be used to send corresponding business data); JoinID (i.e., terminal access identification) is the temporary identity information when the terminal node initiates access to the service gateway, which only exists in the access request; DevNonce (i.e., access count) is the count of the terminal node when accessing the service gateway; NetID (i.e., gateway network identification) is the network ID of the service gateway, which exists in the access permission; Network Time is the network time (i.e., real-time network time), which is initially configured in the access permission and subsequently transmitted and updated through specific MAC signaling during data transmission.
[0058] Optionally, the count of the terminal node when accessing the service gateway may include at least one of the number of access failures, the total number of accesses, and the number of access requests sent.
[0059] In this way, both the terminal and the gateway can update the dynamic key based on the real-time network time.
[0060] Step 012: Send feedback information indicating that the key has been updated to the gateway, so that the gateway synchronously updates the gateway dynamic key based on the real-time network time;
[0061] Specifically, after the terminal completes the update of the terminal dynamic key, in order to ensure the key synchronization between the terminal and the gateway, it is necessary to make the gateway synchronously update the dynamic key. The terminal can send feedback information indicating that the key has been updated to the gateway. After the gateway receives the feedback information, it can be determined that the terminal has completed the update of the terminal dynamic key. Therefore, the gateway will synchronously update the gateway dynamic key based on the real-time network time, thereby realizing the synchronization of the dynamic keys of the terminal and the gateway.
[0062] It can be understood that the terminal sends the feedback information after the terminal completes the update of the terminal dynamic key.
[0063] Optionally, after updating the gateway dynamic key, the gateway may also send feedback information indicating that the key has been updated to the terminal, so that the terminal determines that the gateway has completed the update of the dynamic key. When it is determined that the dynamic keys of the terminal and the gateway have been updated, communication based on the updated dynamic key can be avoided to avoid the failure of the gateway dynamic key update, resulting in the failure of communication between the terminal and the gateway.
[0064] Optionally, the feedback information is encrypted or scrambled based on the terminal dynamic key before the update, and the feedback information includes the value of the feedback field in the data header of the terminal's uplink data. When the value of the feedback field is 1, it indicates that the terminal dynamic key has been updated. When the value of the feedback field is 0, it indicates that the terminal dynamic key has not been updated.
[0065] It can be understood that when the terminal sends feedback information, the gateway has not completed the synchronization of the gateway dynamic key. At this time, if the updated terminal dynamic key is used for encryption or scrambling, the gateway may not be able to correctly parse the feedback information. Therefore, the terminal needs to encrypt or scramble the feedback information with the terminal dynamic key that has been synchronized before the update, so as to ensure that the gateway can correctly parse the feedback information based on the gateway dynamic key before the update, thereby completing the synchronization update of the gateway dynamic key.
[0066] The feedback information includes the value of the feedback field in the data header of the terminal's uplink data. When the value of the feedback field is 1, it indicates that the terminal's dynamic key has been updated. When the value of the feedback field is 0, it indicates that the terminal's dynamic key has not been updated.
[0067] For example, taking the transmission of the terminal's uplink data at the physical layer as an example, the MAC header, usually abbreviated as MHDR, is a very important field in the LoRaWAN protocol, which is used to indicate the basic properties of the LoRaWAN frame. In LoRaWAN, the MHDR field is located at the very beginning of the PHY Payload (physical layer payload), which contains several key information bits to identify the type of the frame and other important information.
[0068] The MHDR field includes an ACK information bit (i.e., a feedback field). In the uplink data received by the gateway, if the ACK information bit is detected to be 1, it can be determined that the terminal dynamic key has been updated. If the value of the ACK information bit is 0, it indicates that the terminal dynamic key has not been updated.
[0069] Optionally, when accessing the gateway, an access request is sent based on a terminal initial key (such as the InitKey of the terminal), and the terminal initial key matches the gateway initial key of the gateway.
[0070] When accessing the gateway, the terminal and the gateway only have the pre-set initial key. Therefore, in order to ensure accurate access to the gateway, the access request can be encrypted or scrambled based on the terminal initial key, so that the gateway can accurately parse the access request based on the gateway initial key, ensuring that the terminal can stably access the gateway.
[0071] Step 013: Communicate with the gateway based on the updated terminal dynamic key.
[0072] Specifically, after completing the synchronization of the dynamic keys of the terminal and the gateway, the uplink data sent by the terminal to the gateway can be encrypted or scrambled based on the updated terminal dynamic key, and the gateway can parse the uplink data based on the updated gateway dynamic key, and encrypt or scramble the downlink data sent by the gateway to the terminal based on the gateway dynamic key, thereby realizing secure communication with the gateway based on dynamic keys.
[0073] The communication method based on dynamic encryption provided in the embodiment of the present application updates the terminal dynamic key through the real-time network time sent by the gateway. Since the real-time network time changes in real time, the dynamic key updated based on the real-time network time also changes dynamically, thereby realizing the generation of dynamic keys.
[0074] The terminal's key needs to be synchronized with the gateway. After the terminal updates the dynamic key, it can send feedback information of the updated dynamic key to the gateway, so that the gateway can synchronize and update the gateway dynamic key based on the real-time network time. When the terminal subsequently sends data based on the updated terminal dynamic key to communicate with the gateway, the gateway can parse the data sent by the terminal according to the synchronized updated gateway dynamic key, thereby realizing communication between the terminal and the gateway based on the dynamic key, which not only ensures the stability of communication, but also has high communication security.
[0075] See also Figure 3 In some embodiments, the communication method based on dynamic encryption by the terminal further includes:
[0076] Step 014: When accessing the gateway, receive the access permission sent by the gateway, the access permission includes the real-time network time.
[0077] Specifically, when the terminal accesses the gateway, the dynamic key can be updated. When accessing the gateway, the terminal will receive an access permission sent by the gateway, which may include the real-time network time, so that the terminal updates the terminal dynamic key based on the real-time network time.
[0078] See also Figure 4 In some embodiments, the communication method based on dynamic encryption by the terminal further includes:
[0079] Step 015: When the preset key update conditions are met, a key update request is sent to the gateway to receive the real-time network time sent by the gateway.
[0080] Specifically, the terminal may also actively request a dynamic key update. The terminal may send a key update request to the gateway based on a preset key update condition to receive the real-time network time sent by the gateway, thereby updating the terminal dynamic key based on the real-time network time.
[0081] The key update condition includes at least one of the following:
[0082] (1) The key has been used for a longer time than the preset update time. That is, if the terminal dynamic key has not changed for a long time, the security is low. Therefore, by setting the preset update time, when the terminal dynamic key has been used for a longer time than the preset update time, a key update request is sent to the gateway.
[0083] (2) The current terminal performs a data uplink task. The terminal of this application generally runs at low power consumption and may only send uplink data once a day. Therefore, in order to avoid the extra power consumption caused by sending a key update request, it is also necessary to determine whether the current terminal needs uplink data (i.e., performing a data uplink task). If so, a key update request will be sent to the gateway when uplink data is needed. If not, a key update request will not be sent to the gateway. In addition, the terminal uplink data is non-periodic, which results in the non-periodic update of the dynamic key, thereby further improving the security of the dynamic key.
[0084] (3) Receiving a key update instruction. The operation and maintenance personnel can also actively issue a key update instruction to the terminal based on the needs. The terminal can send a key update request to the gateway based on the received key update instruction.
[0085] It can be understood that the above three key update conditions can be combined arbitrarily to implement a more complex key update strategy. For example, when conditions (1) and (2) are combined, the terminal will only send a key update request to the gateway when the key has been used for a period longer than the preset update period and uplink data is required.
[0086] See also Figure 5 In some embodiments, the present application further provides a communication method based on dynamic encryption applied to a gateway, comprising:
[0087] Step 021: Send the real-time network time to the terminal so that the terminal updates the terminal dynamic key;
[0088] Step 022: upon receiving feedback information sent by the terminal indicating that the key has been updated, updating the gateway dynamic key based on the real-time network time;
[0089] Step 023: Communicate with the terminal based on the updated gateway dynamic key.
[0090] Among them, the specific explanations of steps 021 to 023 can be found in the explanations of the aforementioned steps 011 to 013, which will not be repeated here.
[0091] The following example introduces this solution in detail. The communication between the terminal and the gateway can be divided into three stages:
[0092] (1) Network access phase: The transmission of network access request and network access permission. The initial key InitKey is used to encrypt or scramble the data that needs to be encrypted or scrambled.
[0093] (2) The first data transmission: Before the first data transmission after receiving the network access permission, the terminal node shall use the parameters in the access permission (NetID, Network Time) and the locally recorded access request parameters (JoinID, DevNonce) to update the terminal dynamic key (that is, update InitKey to MsgKey), and use MsgKey for encryption or scrambling of data transmission, and set the ACK information bit in MHDR to 1. The service gateway determines that the terminal node has received and updated MsgKey normally based on the terminal node ID in the MAC frame structure and the ACK information bit in MHDR, and updates the gateway dynamic key (that is, updates InitKey to MsgKey). Subsequent data transmission and parsing are all performed using MsgKey;
[0094] (3) Subsequent data transmission: After the service gateway receives the network clock update request (i.e., key update request) initiated by the terminal node, the service gateway needs to carry data containing the real-time network time in the corresponding downlink return data. The return data still uses the currently effective MsgKey (i.e., the MsgKey before the update) for encryption or scrambling; the terminal node still uses the MsgKey before the update for decryption / descrambling before parsing the valid real-time network time. When the terminal node parses the valid real-time network time, the MsgKey is updated based on the real-time network time to obtain the updated MsgKey. If the terminal dynamic key is updated successfully, the ACK information position of MHDR in the next uplink data is set to 1, that is, feedback information indicating that the dynamic key has been updated is sent, and at this time, the uplink data can still be encrypted or scrambled using the MsgKey before the update, or only the data part is encrypted or scrambled based on the updated MsgKey to ensure that the gateway can parse the ACK information position. If the terminal dynamic key is not updated, the ACK information position of MHDR is set to 0, and the data to be encrypted or scrambled is encrypted or scrambled using the MsgKey before the update. The service gateway determines whether the terminal updates the dynamic key based on whether the real-time network time data is sent and the ACK information bit of the MHDR in the uplink data. If it is determined that the terminal dynamic key update is completed, the gateway dynamic key is updated synchronously based on the sent real-time network time.
[0095] When both the terminal and the gateway update the dynamic key, the subsequent data transmission can be based on the updated dynamic key for communication between the two.
[0096] In particular, if the terminal node fails to successfully update the dynamic key (i.e., the ACK information position of MHDR is 0), the terminal and the gateway still use the MsgKey before the update to communicate and wait for the next network clock update request. If the terminal node successfully updates the network clock, the MsgKey before the update will be invalidated after the MsgKey is updated.
[0097] According to the method described in the above embodiment, the present application embodiment also provides a communication device 300, which is used to execute the steps in the above terminal communication method based on dynamic encryption. Figure 6 , Figure 6 3 is a schematic diagram of the structure of a communication device 300 provided in an embodiment of the present application. The communication device 300 includes:
[0098] The first updating module 301 is used to update the terminal dynamic key based on the real-time network time sent by the gateway;
[0099] The synchronization module 302 is used to send feedback information indicating that the key has been updated to the gateway, so that the gateway can synchronize and update the gateway dynamic key based on the real-time network time;
[0100] The first communication module 303 is configured to communicate with the gateway based on the updated terminal dynamic key.
[0101] According to the method described in the above embodiment, the present application embodiment also provides a communication device 300, which is used to execute the steps in the above gateway communication method based on dynamic encryption. Figure 7 , Figure 7 4 is a schematic diagram of the structure of a communication device 400 provided in an embodiment of the present application. The communication device 400 includes:
[0102] The sending module 401 is used to send the real-time network time to the terminal so that the terminal updates the terminal dynamic key;
[0103] The second updating module 402 is used to update the gateway dynamic key based on the real-time network time when receiving feedback information sent by the terminal indicating that the key has been updated;
[0104] The second communication module 403 is configured to communicate with the terminal based on the updated gateway dynamic key.
[0105] It should be noted that the specific details of each module unit in the above-mentioned communication device have been described in detail in the embodiment of the above-mentioned communication method based on dynamic encryption, and will not be repeated here.
[0106] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0107] In some embodiments, the communication device in the embodiments of the present application can be implemented in hardware, such as an electronic device, or a component in an electronic device, such as an integrated circuit or a chip; the communication device can also be implemented in software, such as as an application installed in an electronic device.
[0108] In some embodiments, see Figure 8 , Figure 8 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 600 includes a processor 601 and a memory 602. The memory 602 stores a computer program 603 that can be run on the processor 601. When the program 603 is executed by the processor 601, each process of the embodiment of the communication method based on dynamic encryption is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0109] See also Fig. 9 , Fig. 9 Schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. The electronic device can be a terminal or a server. Exemplarily, the electronic device 500 includes a central processing unit (CPU) 501, a system memory 504 including a random access memory (RAM) 502 and a read-only memory (ROM) 503, and a system bus 505 connecting the system memory 504 and the central processing unit 501.
[0110] In some embodiments, the electronic device 500 may also include a basic input / output system (Input / Output system) 506 for helping to transmit information between various components within the computer, and a large-capacity storage device 507 for storing an operating system 513, a client 514 and other program modules 515.
[0111] In some embodiments, the basic input / output system 506 includes a display 508 for displaying information and an input device 509 such as a touch panel and other input devices for user input information. The touch panel is also called a touch screen. The touch panel may include two parts: a touch communication device and a touch controller. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0112] The display 508 and the input device 509 are both connected to the central processing unit 501 via an input / output controller 510 connected to the system bus 505. The basic input / output system 506 may also include an input / output controller 510 for receiving and processing inputs from a touch panel, other input devices, etc. Similarly, the input / output system 506 may also include output devices, such as a display screen, a printer, or other types of output devices.
[0113] The mass storage device 507 is connected to the central processing unit 501 through a mass storage controller (not shown) connected to the system bus 505. The mass storage device 507 and its associated computer-readable medium provide non-volatile storage for the electronic device 500. That is, the mass storage device 507 may include a computer-readable medium (not shown) such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.
[0114] Computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid-state memory technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above. The above-mentioned system memory 504 and mass storage device 507 can be collectively referred to as memory.
[0115] According to various embodiments of the present application, the electronic device 500 can also be connected to a remote computer on the network through a network such as the Internet. That is, the electronic device 500 can be connected to the network 517 through the network interface unit 516 connected to the system bus 505, or the network interface unit 516 can also be used to connect to other types of networks or remote computer systems (not shown).
[0116] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the embodiment of the above-mentioned communication method based on dynamic encryption are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0117] The processor may be a processor in the electronic device in the above embodiment. The computer readable storage medium may be a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0118] The embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned communication method based on dynamic encryption when executed by a processor. The processor may be a processor in the electronic device in the above-mentioned embodiment. When the computer program is executed by the processor, each process of the embodiment of the communication method based on dynamic encryption is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0119] It is understandable that in the specific implementation of this application, data related to user identity or characteristics is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0120] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. A communication method based on dynamic encryption, characterized in that: include: Update the terminal dynamic key based on the real-time network time sent by the gateway; Sending feedback information indicating that the key has been updated to the gateway, so that the gateway synchronously updates the gateway dynamic key based on the real-time network time; Communicate with the gateway based on the updated terminal dynamic key.
2. The communication method based on dynamic encryption according to claim 1, characterized in that: The terminal dynamic key and the gateway dynamic key are generated by a preset symmetric key encryption algorithm.
3. The communication method based on dynamic encryption according to claim 2, characterized in that: The symmetric key encryption algorithm includes an Advanced Encryption Standard algorithm, and the key length of the Advanced Encryption Standard algorithm is 128 bits.
4. The communication method based on dynamic encryption according to any one of claims 1 to 3, characterized in that: The updating of the terminal dynamic key based on the real-time network time sent by the gateway includes: Based on the terminal initial key, the real-time network time, the terminal access identifier, the gateway network identifier and the access count, the terminal dynamic key is updated; Among them, the terminal access identifier is a temporary identifier when the current terminal initiates access to the gateway; the gateway network identifier is the network identifier of the accessed gateway, and the access count is the counting information when the current terminal accesses the gateway.
5. The communication method based on dynamic encryption according to claim 4, characterized in that: The counting information includes at least one of the number of access failures, the total number of accesses, and the number of access requests sent.
6. The communication method based on dynamic encryption according to claim 1, characterized in that: Also includes: When accessing the gateway, an access request is sent based on a terminal initial key, and the terminal initial key matches a gateway initial key of the gateway.
7. The communication method based on dynamic encryption according to claim 1 or 6, characterized in that: Also includes: When accessing the gateway, an access permission sent by the gateway is received, wherein the access permission includes the real-time network time.
8. The communication method based on dynamic encryption according to claim 1, characterized in that: Also includes: When the preset key update condition is met, a key update request is sent to the gateway to receive the real-time network time sent by the gateway.
9. The communication method based on dynamic encryption according to claim 1, characterized in that: The key update condition includes at least one of the following: The key has been used for longer than the preset update period; The current terminal performs data uplink tasks; Received a key update instruction.
10. The communication method based on dynamic encryption according to claim 1, characterized in that: The feedback information is encrypted or scrambled based on the terminal dynamic key before updating, and the feedback information includes the value of the feedback field in the data header of the uplink data of the terminal. When the value of the feedback field is 1, it indicates that the terminal dynamic key has been updated; when the value of the feedback field is 0, it indicates that the terminal dynamic key has not been updated.
11. A communication method based on dynamic encryption, characterized in that: include: Sending real-time network time to a terminal so that the terminal updates a terminal dynamic key; When receiving feedback information sent by the terminal indicating that the key has been updated, updating the gateway dynamic key based on the real-time network time; Communicate with the terminal based on the updated gateway dynamic key.
12. The communication method based on dynamic encryption according to claim 11, characterized in that: The real-time network time is sent through an access permission sent by the gateway after the terminal accesses the gateway; or, the real-time network time is sent through downlink data sent after the gateway receives a key update request sent by the terminal.
13. The communication method based on dynamic encryption according to claim 11, characterized in that: Also includes: When receiving an access request from the terminal, the access request is parsed based on a gateway initial key.
14. The communication method based on dynamic encryption according to claim 11, characterized in that: Also includes: When feedback information indicating that the key is not updated is received from the terminal, communication is performed with the terminal based on the gateway dynamic key before the update.
15. A communication device, characterized in that: include: A first updating module, used for updating the terminal dynamic key based on the real-time network time sent by the gateway; A synchronization module, used to send feedback information indicating that the key has been updated to the gateway, so that the gateway synchronously updates the gateway dynamic key based on the real-time network time; The first communication module is used to communicate with the gateway based on the updated terminal dynamic key.
16. A communication device, characterized in that: include: A sending module, used for sending the real-time network time to the terminal, so that the terminal updates the terminal dynamic key; A second updating module is used to update the gateway dynamic key based on the real-time network time when receiving feedback information sent by the terminal indicating that the key has been updated; The second communication module is used to communicate with the terminal based on the updated gateway dynamic key.
17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the communication method based on dynamic encryption as described in any one of claims 1 to 14 is implemented.
18. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the communication method based on dynamic encryption as described in any one of claims 1 to 14 is implemented.
19. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the communication method based on dynamic encryption as described in any one of claims 1 to 14.