Communication method, computer device, and computer-readable storage medium
By detecting update conditions in the communication device and updating the key information, the data leakage problem caused by theft of the key is solved, and the security of data transmission is improved.
Patent Information
- Application Number
- CN202011588888.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2040-12-28
AI Technical Summary
During data transmission of existing communication devices, data leaked after the key is stolen, resulting in low security.
The communication device detects the update condition before transmitting the data, updates the key information if it is met, and uses the updated key information to encrypt and transmits the data.
Even if the key information is stolen, the updated encrypted data cannot be decrypted, improving the security of data transmission.
Smart Images

Figure CN114697031B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a communication method, a computer device, and a computer-readable storage medium. Background Art
[0002] With the development of communication devices, the data transmission technology between communication devices has become increasingly mature. In the prior art, when a communication device transmits data, it first encrypts the data using a key to obtain encrypted data, and then transmits the encrypted data to a target device. The target device decrypts the encrypted data using the key to obtain the data. However, if a thief obtains the key and the encrypted data, the thief can obtain the data sent by the communication device through the key and the encrypted data, resulting in data leakage. Therefore, the security of data transmission is not high.
[0003] Therefore, the prior art needs to be improved. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a communication method, a computer device, and a computer-readable storage medium to improve the security of data transmission.
[0005] In a first aspect, an embodiment of the present invention provides a communication method, which is applied to a first communication device in a communication system. The communication system includes: the first communication device and a second communication device communicatively connected to the first communication device;
[0006] The communication method includes:
[0007] The first communication device obtains target data and detects whether the first communication device meets a preset update condition;
[0008] When the first communication device meets the preset update condition, the first communication device determines updated key information corresponding to the target data;
[0009] The first communication device determines updated encrypted data corresponding to the target data according to the updated key information and the target data, and sends the updated encrypted data to the second communication device.
[0010] In a second aspect, an embodiment of the present invention provides a communication method, which is applied to a second communication device in a communication system. The communication system includes: a first communication device and the second communication device communicatively connected to the first communication device;
[0011] The communication method includes:
[0012] The second communication device receives the updated encrypted data sent by the first communication device;
[0013] The second communication device determines updated key information;
[0014] The second communication device determines target data corresponding to the updated encrypted data according to the updated key information and the updated encrypted data.
[0015] In a third aspect, an embodiment of the present invention provides a computer device, including a memory and a processor. The memory stores a computer program, which is applied to a first communication device in a communication system. The communication system includes: the first communication device and a second communication device communicatively connected to the first communication device; when the processor executes the computer program, the following steps are implemented:
[0016] The first communication device obtains target data and detects whether the first communication device meets a preset update condition;
[0017] When the first communication device meets the preset update condition, the first communication device determines updated key information corresponding to the target data;
[0018] The first communication device determines updated encrypted data corresponding to the target data according to the updated key information and the target data, and sends the updated encrypted data to the second communication device.
[0019] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which is applied to a first communication device in a communication system. The communication system includes: the first communication device and a second communication device communicatively connected to the first communication device; when the computer program is executed by a processor, the following steps are implemented:
[0020] The first communication device obtains target data and detects whether the first communication device meets a preset update condition;
[0021] When the first communication device meets the preset update condition, the first communication device determines updated key information corresponding to the target data;
[0022] The first communication device determines updated encrypted data corresponding to the target data according to the updated key information and the target data, and sends the updated encrypted data to the second communication device.
[0023] Compared with the prior art, the embodiments of the present invention have the following advantages:
[0024] After the first communication device obtains the target data, it detects whether the first communication device meets the preset update condition; when the first communication device meets the preset update condition, the first communication device determines the updated key information corresponding to the target data; the first communication device determines the updated encrypted data corresponding to the target data according to the updated key information and the target data, and sends the updated encrypted data to the second communication device. Since the key information is updated, even if the key information is stolen, the updated encrypted data cannot be decrypted, so the target data cannot be obtained. Obviously, the present invention improves the security of data transmission by updating the key information. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0026] Figure 1 It is an application environment diagram of the communication method in the embodiment of the present invention;
[0027] Figure 2 It is the first flowchart of the communication method in the embodiment of the present invention;
[0028] Figure 3 It is a timing diagram of the communication method in the embodiment of the present invention;
[0029] Figure 4 It is the second flowchart of the communication method in the embodiment of the present invention;
[0030] Figure 5 It is the internal structure diagram of the computer device in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0031] In order to enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0032] The inventor has found through research that when a communication device transmits data, it first encrypts the data with a key to obtain encrypted data. For example, a Bluetooth device encrypts data with a key and then transmits the encrypted data to the target device. However, if the key of the Bluetooth device is stolen, the data sent by the Bluetooth device can be obtained through the key and the encrypted data, resulting in data leakage. Therefore, the security of data transmission is not high.
[0033] To solve the above problems, as Figure 1 and Figure 2 shown, in an embodiment of the present invention, after the first communication device obtains the target data, it detects whether the first communication device meets a preset update condition; when the first communication device meets the preset update condition, the first communication device determines the updated key information corresponding to the target data; the first communication device determines the updated encrypted data corresponding to the target data according to the updated key information and the target data, and sends the updated encrypted data to the second communication device. Since the key information is updated, even if the key information is stolen, the updated encrypted data cannot be decrypted, and thus the target data cannot be obtained. It can be seen that the present invention improves the security of data transmission through the update of key information.
[0034] For example, mobile phone 10 obtains the target data and detects whether mobile phone 10 meets the preset update condition; when mobile phone 10 meets the preset update condition, mobile phone 10 determines the updated key information corresponding to the target data; mobile phone 10 determines the updated encrypted data corresponding to the target data according to the updated key information and the target data, and sends the updated encrypted data to door lock 30. Specifically, mobile phone 10 can send the updated encrypted data to door lock 30 through server 20.
[0035] It should be noted that the above application scenarios are only shown for the convenience of understanding the present invention, and the embodiments of the present invention are not limited in this regard. On the contrary, the embodiments of the present invention can be applied to any applicable scenario.
[0036] The following will describe various non-limiting embodiments of the present invention in detail with reference to the accompanying drawings.
[0037] As Figure 2As shown in the figure, in an embodiment of the present invention, a communication system is provided. The communication system includes: a first communication device and a second communication device communicatively connected to the first communication device. A communication device refers to a device used for data transmission, and the communication device may specifically be at least one of communication devices such as a mobile phone, a tablet computer, a laptop computer, a personal digital assistant, or a wearable device. If the first communication device and the second communication device are communicatively connected, data can be transmitted between the first communication device and the second communication device. The communication connection includes: a network communication connection and a Bluetooth communication connection. For example, the first communication device and the second communication device can achieve a network communication connection through a local area network, a wide area network, or a metropolitan area network. When using a Bluetooth connection, the first communication device is configured with a Bluetooth device, and the second communication device is also configured with a Bluetooth device. The Bluetooth device of the first communication device and the Bluetooth device of the second communication device are communicatively connected through Bluetooth. As Figure 1 shown, the first communication device is the mobile phone 10, and the second communication device is the door lock 30. As Figure 3 and Figure 4 shown, the Bluetooth device A of the first communication device and the Bluetooth device B of the second communication device are communicatively connected through Bluetooth.
[0038] For example, the first communication device is a mobile phone, and the second communication device is a door lock. The mobile phone connects to a WIFI hotspot, and the door lock also connects to the same WIFI hotspot. That is to say, the mobile phone and the door lock achieve a network communication connection through the WIFI hotspot. Another example is that the first communication device is a mobile phone, and the second communication device is a laptop. The mobile phone and the laptop are connected through Bluetooth devices to achieve a Bluetooth communication connection.
[0039] In an embodiment of the present invention, a first communication device is provided. The first communication device includes: a processor, a non-volatile storage medium, an internal memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the non-volatile storage medium of the first communication device stores an operating system and a communication device, and this communication device is used to implement a communication method. The processor is used to provide computing and control capabilities to support the operation of the entire first communication device. The internal memory in the first communication device provides an environment for the operation of the communication device in the non-volatile storage medium. Computer-readable instructions may be stored in this internal memory. When the computer-readable instructions are executed by the processor, the processor can execute a communication method. The network interface is used for network communication with the server 20, such as receiving updated key information sent by the server 20 and sending a first key update request message to the server 20, etc. The display screen of the first communication device can be a liquid crystal display screen or an electronic ink display screen, etc. The input device can be a touch layer covered on the display screen to form a touch screen, or a button, a trackball or a touchpad provided on the outer shell of the first communication device, or an external keyboard, a touchpad or a mouse, etc. The first communication device may further include a Bluetooth device, and the Bluetooth device of the first communication device can perform Bluetooth communication connection with other communication devices including Bluetooth modules. The first communication device can be a mobile terminal, and the mobile terminal can be a mobile phone, a tablet computer, a personal digital assistant or a wearable device, etc. <> <>
[0040] In an embodiment of the present invention, a second communication device is provided. The second communication device includes a processor, a non-volatile storage medium, an internal memory, a network interface, a display screen, and an input device connected via a system bus. Among them, the non-volatile storage medium of the second communication device stores an operating system and a communication device, and this communication device is used to implement a communication method. The processor is used to provide computing and control capabilities to support the operation of the entire second communication device. The internal memory in the second communication device provides an environment for the operation of the communication device in the non-volatile storage medium. Computer-readable instructions may be stored in this internal memory, and when these computer-readable instructions are executed by the processor, the processor can execute a communication method. The network interface is used for network communication with the server 20, such as receiving updated key information sent by the server 20 and sending second key update request information to the server 20. The display screen of the second communication device can be a liquid crystal display screen or an electronic ink display screen, etc. The input device can be a touch layer covered on the display screen to form a touch screen, or can be a button, a trackball or a touchpad provided on the shell of the second communication device, or can be an external keyboard, a touchpad or a mouse, etc. The second communication device may further include a Bluetooth device, and the Bluetooth device of the second communication device can perform Bluetooth communication connection with other communication devices including Bluetooth modules. For example, the Bluetooth device of the second communication device performs Bluetooth communication connection with the Bluetooth device of the first communication device. The second communication device can be a mobile terminal, and the mobile terminal can be a mobile phone, a tablet computer, a door lock, a personal digital assistant or a wearable device, etc.
[0041] The intelligent door lock system further includes: a server 20 communicatively connected to the first communication device.
[0042] In an embodiment of the present invention, a server 20 is provided. The server 20 includes a processor, a non-volatile storage medium, an internal memory, and a network interface connected via a system bus. Among them, the non-volatile storage medium of the server 20 stores an operating system and a communication device, and this communication device is used to implement a communication method. The processor is used to provide computing and control capabilities to support the operation of the entire server 20. The internal memory of the server 20 provides an environment for the operation of the communication device in the non-volatile storage medium. Computer-readable instructions may be stored in this internal memory, and when these computer-readable instructions are executed by the processor, the processor can execute a communication method. The network interface is used to connect to the network for communication, such as receiving key update request information sent by the first communication device and sending updated key information to the first communication device. The server 20 can be implemented by an independent server or a server cluster composed of multiple servers 20.
[0043] See Figure 2, which shows a communication method in an embodiment of the present invention. In this embodiment, the method is illustrated by taking its application to a first communication device as an example. In this embodiment, the communication method may include the following steps:
[0044] S1. The first communication device acquires target data and detects whether the first communication device meets a preset update condition.
[0045] Specifically, the target data refers to the data transmitted between the first communication device and the second communication device. The target data may specifically be the data sent by the first communication device to the second communication device, or may also be the data sent by the second communication device to the first communication device. In this embodiment, the example of the first communication device sending the target data to the second communication device is used for illustration.
[0046] The preset update condition refers to the condition for pre-setting an update key. Since the target data is encrypted and decrypted with key information when transmitted between the first communication device and the second communication device, once the key information is leaked, the target data is at risk and may be stolen. The present invention updates the original key information. Therefore, it is necessary to detect whether the first communication device meets the preset update condition to determine whether to update the original key information.
[0047] The key information refers to the information used to encrypt and decrypt the target data. The original key information refers to the key information that has not been updated when acquiring the target data. For example, when the first communication device sends the target data to the second communication device, the first communication device first encrypts the target data with the original key information to obtain the original encrypted data and sends the encrypted data to the second communication device. When the second communication device receives the encrypted data, it decrypts the original encrypted data with the original key information to obtain the target data, thereby implementing the transmission of the target data between the first communication device and the second communication device. The original encrypted data refers to the data obtained by encrypting the target data with the original key information.
[0048] The key information is divided into symmetric key information and asymmetric key information. Symmetric key information refers to the same key information used for encrypting and decrypting the target data. That is to say, the same key information is used for encryption and decryption in the encryption process and the decryption process. Asymmetric key information uses different key information for encrypting and decrypting the target data. That is to say, different key information is used for encryption and decryption in the encryption process and the decryption process. Asymmetric encryption is achieved through two keys (public key and private key) to encrypt and decrypt the target data. Both the public key and the private key can be used for encryption or decryption. Therefore, there are two encryption methods. The first encryption method: the public key is used for encryption and the private key is used for decryption. The second encryption method: the private key is used for encryption and the public key is used for decryption.
[0049] In one implementation of the embodiments of the present invention, the first communication device includes: a touch screen, and the preset update condition includes: the first communication device receives a touch instruction, and the touch instruction is an instruction obtained by the touch screen according to a touch operation.
[0050] Specifically, when the touch screen of the first communication device is touched, the first communication device meets the preset update condition. Since when the touch screen of the first communication device is touched, it may be that a thief attempts to touch the touch screen of the first communication device to steal the target data. Therefore, when the touch screen of the first communication device is touched, the first communication device meets the preset update condition and updates the original key information. When the touch screen of the first communication device is touched, it can sense the touch operation and form a touch instruction.
[0051] In one implementation of the embodiments of the present invention, the first communication device and the second communication device are disconnected and then reconnected for communication.
[0052] Specifically, when the first communication device and the second communication device are disconnected and then reconnected for communication, the first communication device meets the preset update condition. Since when the first communication device and the second communication device are disconnected and then reconnected for communication, it may be that a thief attempts to first disconnect the first communication device and the second communication device and then reconnect the first communication device and the second communication device to steal the target data. Therefore, when the first communication device and the second communication device are disconnected and then reconnected for communication, the first communication device meets the preset update condition and updates the original key information.
[0053] In one implementation of the embodiments of the present invention, the communication connection time between the first communication device and the second communication device exceeds a preset time.
[0054] Specifically, when the communication connection time between the first communication device and the second communication device exceeds a preset time, the first communication device meets the preset update condition. Since there may be a risk of theft when the communication connection time between the first communication device and the second communication device is too long, when the communication connection time between the first communication device and the second communication device exceeds the preset time, the first communication device meets the preset update condition, and the original key information is updated. The preset time refers to the time set in advance, and the preset time can be set as needed. For example, the preset time can be set to 10 minutes, 1 minute, or 30 seconds. The preset time can be set according to the target data. For example, if the preset time is less than the transmission time of the target data, the original key information will be updated at least once during the transmission of the target data, which can improve the transmission security of the target data.
[0055] It should be noted that at least one of the above-listed three preset update conditions can be adopted, and of course, multiple preset update conditions can be combined and used. For example, when the communication connection time between the first communication device and the second communication device exceeds the preset time, the original key information will be updated to obtain updated key information, and the updated key information will be used as the original key information. When the first communication device receives a touch instruction, the original key information will be updated again to obtain updated key information. Of course, other update conditions can also be preset. For example, after each transmission of the target data, the original key information can be updated.
[0056] The first communication device first obtains the target data, and then detects whether the first communication device meets the preset update condition. If the first communication device meets the preset update condition, the original key information needs to be updated. If the first communication device does not meet the preset update condition, the original key information does not need to be updated.
[0057] For example, the first communication device is a mobile phone, and the second communication device is a door lock. When the mobile phone and the door lock are in communication connection and the mobile phone sends the target data to the door lock, the mobile phone first obtains the target data and detects whether the mobile phone meets the preset update condition. For example, when the mobile phone and the door lock are disconnected and then reconnected, the mobile phone meets the preset update condition, and the original key information needs to be updated.
[0058] S2. When the first communication device meets the preset update condition, the first communication device determines the updated key information corresponding to the target data.
[0059] Specifically, when the first communication device meets the preset update condition, the first communication device determines the updated key information corresponding to the target data, and the updated key information refers to the key information obtained by updating the original key information. When the first communication device meets the preset update condition, it is necessary to update the original key information to obtain the updated key information.
[0060] For example, the first communication device is a mobile phone, and the second communication device is a door lock. When the mobile phone meets the preset update condition, it is necessary to update the original key information to determine the updated key information, and then the mobile phone can encrypt the target data according to the updated key information.
[0061] Specifically, the communication system further includes: a server communicatively connected to the first communication device; the first communication device determines the updated key information through the server. Step S2, when the first communication device meets the preset update condition, the first communication device determines the updated key information corresponding to the target data, including:
[0062] S21. When the first communication device meets the preset update condition, the first communication device sends the first key update request information corresponding to the target data to the server.
[0063] S22. The first communication device receives the updated key information corresponding to the target data; the updated key information is generated by the server according to the received key update request information.
[0064] Specifically, the first key update request information refers to the information for the first communication device to request key information update. When the first communication device meets the preset update condition, the first communication device sends the first key update request information corresponding to the target data to the server and receives the updated key information fed back by the server based on the first key update request information. The server stores the original key information, and the first communication device obtains the updated key information by updating the original key information through the server.
[0065] Specifically, the first communication device sends the first key update request information to the server. After receiving the first key update request information, the server updates the original key information according to the first key update request information to obtain the updated key information, and then the server sends the updated key information to the first communication device, and the first communication device receives the updated key information.
[0066] For example, Figure 3As shown, the first communication device includes Bluetooth device A, and the server is a trusted security platform. When the first communication device meets the preset update condition, the first communication device sends a first key update request message to the trusted security platform. After receiving the first key update request message, the trusted security platform updates the original key information according to the first key update request message to obtain updated key information, and then the trusted security platform sends the updated key information to the first communication device, and the first communication device receives the updated key information.
[0067] S3. The first communication device determines updated encrypted data corresponding to the target data according to the updated key information and the target data, and sends the updated encrypted data to the second communication device.
[0068] Specifically, after obtaining the updated key information, the first communication device determines the updated encrypted data according to the updated key information and the target data, and sends the updated encrypted data to the second communication device. The updated encrypted data refers to the data obtained by encrypting the target data with the updated key information. Specifically, after obtaining the updated key information, the first communication device encrypts the target data with the updated key information to obtain updated encrypted data, and then sends the updated encrypted data to the second communication device.
[0069] For example, as Figure 3 and Figure 4 shown, the first communication device includes Bluetooth device A, the second communication device includes Bluetooth device B. After obtaining the updated key information, Bluetooth device A encrypts the target data with the updated key information to obtain updated encrypted data, and then sends the updated encrypted data to Bluetooth device B.
[0070] For example, as Figure 1 shown, the first communication device is a mobile phone, the second communication device is a door lock. After the mobile phone obtains the updated key information, it encrypts the target data with the updated key information to obtain updated encrypted data, and then sends the updated encrypted data to the door lock.
[0071] In one implementation of the embodiment of the present invention, after step S2, the communication method further includes the step: S4. The first communication device sends an update instruction corresponding to the target data to the second communication device according to the updated key information, so that the second communication device determines the updated key information according to the update instruction.
[0072] Specifically, when the first communication device meets the preset update condition, the updated key information is obtained. The second communication device also needs to update the original key information to obtain the updated key information in order to decrypt the updated encrypted data to obtain the target data. Therefore, after the first communication device determines the updated key information, the first communication device sends an update instruction corresponding to the target data to the second communication device according to the updated key information, so that the second communication device determines the updated key information according to the update instruction.
[0073] Specifically, after the first communication device determines the updated key information, it sends the update instruction to the second communication device. After receiving the update instruction, the second communication device determines the updated key information according to the update instruction. Specifically, after receiving the update instruction, the second communication device sends second key update request information corresponding to the update instruction to the server. After receiving the second key update request information, the server obtains the updated key information according to the second key update request information and sends the updated key information to the second communication device, and the second communication device receives the updated key information.
[0074] Since the key information is divided into symmetric key information and asymmetric key information, when the key information uses symmetric key information, the updated key information sent by the server to the first communication device and the updated key information sent by the server to the second communication device are the same. When the key information uses asymmetric key information, the updated key information sent by the server to the first communication device and the updated key information sent by the server to the second communication device are different. For example, the updated key information sent by the server to the first communication device is a public key, and the updated key information sent by the server to the second communication device is a private key. Another example is that the updated key information sent by the server to the first communication device is a private key, and the updated key information sent by the server to the second communication device is a public key.
[0075] In an implementation manner of the embodiment of the present invention, after step S1, the communication method further includes the step:
[0076] S5. When the first communication device does not meet the preset update condition, the first communication device obtains the original key information corresponding to the target data.
[0077] S6. The first communication device determines the original encrypted data corresponding to the target data according to the original key information and the target data, and sends the original encrypted data to the second communication device.
[0078] Specifically, when the first communication device does not meet the preset update condition, there is no need to update the original key information. Therefore, the first communication device obtains the original key information corresponding to the target data. Then, the original key information is used to encrypt the target data to obtain the original encrypted data, and the original encrypted data is sent to the second communication device.
[0079] Since the first communication device does not send an update instruction to the second communication device when it does not meet the preset update condition, the second communication device will not update the original key information either. After the second communication device receives the original encrypted data, it can use the original key information to decrypt the original encrypted data to obtain the target data, thereby realizing data transmission between the first communication device and the second communication device.
[0080] A communication method in an embodiment of the present invention is illustrated by taking this method as being applied to a second communication device in this embodiment. In this embodiment, the communication method may include the following steps:
[0081] A1. The second communication device receives the updated encrypted data sent by the first communication device.
[0082] Specifically, after the first communication device sends the updated encrypted data to the second communication device, the second communication device receives the updated encrypted data sent by the first communication device.
[0083] For example, as Figure 1 shown, the first communication device is a mobile phone, and the second communication device is a door lock. After the mobile phone sends the updated encrypted data to the door lock, the door lock receives the updated encrypted data sent by the door lock.
[0084] A2. The second communication device determines the updated key information.
[0085] Specifically, the second communication device determines the updated key information. The first communication device determines the updated key information through the server, and the second communication device can also determine the updated key information through the server.
[0086] In an implementation manner in an embodiment of the present invention, step A2, the second communication device determines the updated key information, includes:
[0087] A21. The second communication device receives the update instruction and sends the second key update request information corresponding to the update instruction to the server according to the update instruction.
[0088] A22. The first communication device receives updated key information, which is generated by the server based on the received second key update request information.
[0089] Specifically, the second key update request information refers to the information for the second communication device to request key information update. When the first communication device meets the preset update condition, the first communication device sends an update instruction to the second communication device according to the updated key information. After receiving the update instruction, the second communication device sends the second key update request information to the server and receives the updated key information fed back by the server based on the second key update request information. The server stores the original key information, and the updated key information is obtained by the server updating the original key information for the second communication device.
[0090] Specifically, the second communication device sends the second key update request information to the server. After receiving the second key update request information, the server updates the original key information according to the second key update request information to obtain the updated key information, and then the server sends the updated key information to the second communication device, and the second communication device receives the updated key information.
[0091] Illustratively, the second communication device is a door lock and the server is a trusted security platform. When the door lock receives the update instruction, the door lock sends the second key update request information to the trusted security platform. After receiving the second key update request information, the trusted security platform updates the original key information according to the second key update request information to obtain the updated key information, and then the trusted security platform sends the updated key information to the door lock, and the door lock receives the updated key information.
[0092] Illustratively, as Figure 3 and Figure 4 shown, the second communication device includes a Bluetooth device B. When the second communication device receives the update instruction, the Bluetooth device B sends the second key update request information to the trusted security platform. After receiving the second key update request information, the trusted security platform updates the original key information according to the second key update request information to obtain the updated key information, and then the trusted security platform sends the updated key information to the second communication device, and the second communication device receives the updated key information.
[0093] A3. The second communication device determines the target data corresponding to the updated encrypted data according to the updated key information and the updated encrypted data.
[0094] Specifically, after obtaining the updated key information, the second communication device determines the target data according to the updated key information and the updated encrypted data. Specifically, after obtaining the updated key information, the second communication device decrypts the updated encrypted data using the updated key information to obtain the target data.
[0095] For example, the second communication device is a door lock. After the door lock obtains the updated key information, it decrypts the updated encrypted data using the updated key information to obtain the target data.
[0096] It should be noted that when the first communication device does not meet the preset update condition, the original key information is used to encrypt the target data to obtain the original encrypted data, and then the second communication device decrypts the original encrypted data using the original key information to obtain the target data.
[0097] In one embodiment, the present invention provides a computer device, which may be a terminal, and its internal structure is as Figure 5 shown. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program, when executed by the processor, implements the communication method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the outer shell of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0098] Those skilled in the art can understand that Figure 5 the block diagram shown only shows the structure of some parts related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer parts than those shown in the figure, or combine some parts, or have different component arrangements.
[0099] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, which is applied to a communication system. The communication system includes: a first communication device and a second communication device communicatively connected to the first communication device; when the processor executes the computer program, the following steps are implemented:
[0100] The first communication device obtains target data and detects whether the first communication device meets a preset update condition;
[0101] When the first communication device meets the preset update condition, the first communication device determines updated key information corresponding to the target data;
[0102] The first communication device determines updated encrypted data corresponding to the target data according to the updated key information and the target data, and sends the updated encrypted data to the second communication device.
[0103] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored and applied to a communication system. The communication system includes: a first communication device and a second communication device communicatively connected to the first communication device; when the computer program is executed by a processor, the following steps are implemented:
[0104] The first communication device obtains target data and detects whether the first communication device meets a preset update condition;
[0105] When the first communication device meets the preset update condition, the first communication device determines updated key information corresponding to the target data;
[0106] The first communication device determines updated encrypted data corresponding to the target data according to the updated key information and the target data, and sends the updated encrypted data to the second communication device.
[0107] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. In the embodiments of the present invention, the program can be stored in the storage medium of the computer system and executed by at least one processor in the computer system to implement the processes of the embodiments including the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0108] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
Claims
1. A communication method, characterized in that: A first communication device applied to a communication system, the communication system comprising: the first communication device and a second communication device communicatively connected to the first communication device; The communication method comprises: The first communication device acquires target data and detects whether the first communication device meets a preset update condition; When the first communication device meets the preset update condition, the first communication device determines updated key information corresponding to the target data; The first communication device determines, based on the updated key information and the target data, updated encrypted data corresponding to the target data, and sends the updated encrypted data to the second communication device; The communication system further includes: a server respectively connected to the first communication device and the second communication device; when the first communication device meets the preset update condition, the first communication device determines the updated key information corresponding to the target data, including: When the first communication device meets the preset update condition, the first communication device sends a first key update request message corresponding to the target data to the server; The first communication device receives updated key information corresponding to the target data; the updated key information is generated by the server according to the received key update request information; When the first communication device meets the preset update condition, after the first communication device determines the updated key information corresponding to the target data, the communication method further includes: The first communication device sends an update instruction corresponding to the target data to the second communication device based on the updated key information, so that after receiving the update instruction, the second communication device sends a second key update request information corresponding to the update instruction to the server and receives the updated key information.
2. The communication method according to claim 1, wherein: The first communication device includes a touch screen, and the preset update condition includes: the first communication device receives a touch instruction, and the touch instruction is an instruction obtained by the touch screen according to a touch operation.
3. The communication method according to claim 1, wherein: The preset update condition includes: the first communication device and the second communication device are disconnected and then reconnected; and / or the time of the communication connection between the first communication device and the second communication device exceeds a preset time.
4. The communication method according to claim 1, wherein: After the first communication device acquires the target data and detects whether the first communication device meets a preset update condition, the communication method further includes: When the first communication device does not meet the preset update condition, the first communication device obtains original key information corresponding to the target data; The first communication device determines the original encrypted data corresponding to the target data according to the original key information and the target data, and sends the original encrypted data to the second communication device.
5. A communication method, characterized in that: A second communication device applied to a communication system, the communication system comprising: a first communication device and the second communication device communicatively connected to the first communication device; The communication method comprises: The second communication device receives the updated encrypted data sent by the first communication device; The second communication device determines updated key information; The second communication device determines, based on the updated key information and the updated encrypted data, target data corresponding to the updated encrypted data; The communication system further includes: a server connected to the first communication device and the second communication device respectively; the second communication device determines that the updated key information includes: The second communication device receives the update instruction and sends a second key update request message corresponding to the update instruction to the server according to the update instruction; the update instruction is an update instruction corresponding to the target data sent to the second communication device by the first communication device after the first communication device determines the updated key information corresponding to the target data when the first communication device meets the preset update condition; The second communication device receives updated key information; the updated key information is generated by the server according to the received second key update request information.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the processor implements the steps of the communication method according to any one of claims 1 to 4, and / or implements the steps of the communication method according to claim 5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the communication method according to any one of claims 1 to 4 and / or the steps of the communication method according to claim 5.
Citation Information
Patent Citations
Data encryption and transmission method and device thereof
CN101572601A
Method for setting and updating dynamic password lock OTC (One Time Code) key
CN106934886A