CN115987931A - Instant messaging message chaining method and device - Google Patents

Instant messaging message chaining method and device Download PDF

Info

Publication number
CN115987931A
CN115987931A CN202211683847.5A CN202211683847A CN115987931A CN 115987931 A CN115987931 A CN 115987931A CN 202211683847 A CN202211683847 A CN 202211683847A CN 115987931 A CN115987931 A CN 115987931A
Authority
CN
China
Prior art keywords
uplink
target message
server
message
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211683847.5A
Other languages
Chinese (zh)
Inventor
王永南
解丽花
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongqi Lianxin Beijing Technology Co ltd
Original Assignee
Zhongqi Lianxin Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongqi Lianxin Beijing Technology Co ltd filed Critical Zhongqi Lianxin Beijing Technology Co ltd
Priority to CN202211683847.5A priority Critical patent/CN115987931A/en
Publication of CN115987931A publication Critical patent/CN115987931A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides an instant communication message chaining method and a device, wherein the method comprises the following steps: sending the target message to a chat server for instant messaging from local so that the chat server sends the target message to a target node; and based on a symmetric key and a private key which are obtained from the block chain server in advance and are uniquely corresponding to the block chain server, respectively encrypting and signing the target message sent to the target node locally to form a data packet, and sending the data packet to the block chain server for uplink storage. The method and the system can realize the decoupling of the functions of the chat and the block chain, so that the block chain cannot influence the efficiency of the chat of the user, the data of the block chain service cannot be influenced even if the chat server is not trusted, and the security of data transmission can be effectively improved by using a mode of combining symmetric encryption and asymmetric encryption, and the security and the reliability of the block chain of the instant messaging message can be further improved.

Description

Instant messaging message chaining method and device
Technical Field
The present application relates to the field of instant messaging technologies, and in particular, to an instant messaging message chaining method and apparatus.
Background
In the conventional IM instant messaging function, chat information is stored on a user terminal device or in a server of a service provider, data is stored by using a conventional database, there is a possibility of tampering and viewing by the service provider, and in addition, there is a risk of loss when the data is stored in a single service provider. In order to prevent the instant messaging message from being tampered, the prior art adopts the block chain technology to store the instant messaging message.
At present, in an existing instant messaging message chaining mode, instant messaging and message chaining between two client nodes are generally realized by using one server, but the mode can affect the transmission efficiency of the instant messaging messages between the client nodes, and further affect the timeliness experience of user communication; meanwhile, the security of the data transmission link of the instant messaging message in the uplink process cannot be ensured.
Disclosure of Invention
Accordingly, embodiments of the present invention provide an instant messaging uplink method and apparatus to obviate or mitigate one or more of the disadvantages of the prior art.
One aspect of the present application provides an instant messaging message uplink method, including:
sending the target message to a chat server for instant messaging from local so that the chat server sends the target message to a target node;
and based on a symmetric key and a private key which are obtained from the block chain server in advance and are only and correspondingly, respectively encrypting and signing the target message sent to the target node locally to form a data packet, and sending the data packet to the block chain server for uplink storage.
In some embodiments of the present application, said sending the target message to the chat server for instant messaging from local, so that the chat server sends the target message to the destination node, includes:
judging whether a symmetric key and a private key which are uniquely corresponding to the chat server are locally stored, if so, sending the target message to the chat server for instant messaging from the local so that the chat server marks the current state of the target message as an uplink preparation state, and sending the target message to a target node so as to display the target message and the state thereof in the target node, wherein the chat server and the block chain server are respectively deployed in a distributed manner.
In some embodiments of the present application, the encrypting and signing, based on a symmetric key and a private key uniquely corresponding to the target message obtained from a blockchain server in advance, a target message sent to the destination node locally to form a data packet, and sending the data packet to the blockchain server for uplink storage includes:
judging whether a target message currently sent to the target node meets preset uplink requirement data, if so, updating the current state of the target message from the uplink preparation state to the uplink state so that the chat server and the target node correspondingly update the current state of the target message;
based on a symmetric key and a private key which are obtained from a block chain server in advance and are only and correspondingly, encrypting and signing each target message which is in the uplink state locally based on the type of the target message, wherein the current state of the target message belongs to the target message, so as to form a corresponding data packet;
and sending the data packets to the blockchain server in batch for uplink storage, and receiving an uplink state notification message for the data packets sent by the blockchain server, so as to locally update the current state of the target message from the current uplink state to an uplink successful state or an uplink failed state based on the uplink state notification message, so that the chat server and the target node correspondingly update the current state of the target message.
In some embodiments of the present application, based on a symmetric key and a private key uniquely corresponding to the target message, which are obtained from a blockchain server in advance, each target message in the uplink-currently state is encrypted and signed locally based on a type to which the target message belongs, so as to form a corresponding data packet, where the method includes:
if the type of the target message is a voice message, a file message or a picture message, generating an MD5 value corresponding to the target message, and encrypting and signing the MD5 value based on a symmetric key and a private key which are obtained from a block chain server in advance and are only corresponding to the MD5 value to form a data packet;
if the type of the target message is a text message, directly encrypting and signing the target message based on a symmetric key and a private key which are obtained from a block chain server in advance and are only corresponding to the target message to form a data packet;
and if the type of the target message is an enterprise reconciliation message, encrypting and signing the reconciliation amount and the subject object identification in the enterprise reconciliation message based on a symmetric key and a private key which are obtained from the block chain server in advance and are only corresponding to the target message to form a data packet.
In some embodiments of the present application, the determining whether a target message currently sent to the destination node satisfies a predetermined uplink request data, and if so, updating a current state of the target message from the uplink ready state to an uplink-in-progress state includes:
judging whether the occupancy rate of a processor of the device where the target message is located is greater than a percentage threshold value, if not, further judging whether the target message currently sent to the target node meets preset first uplink requirement data, if so, updating the current state of the target message from the uplink preparation state to the uplink-in-progress state, wherein the first uplink requirement data comprises: a first quantity threshold and a first latency threshold for target messages to be uplinked.
In some embodiments of the present application, the determining whether the target message currently sent to the destination node satisfies the predetermined uplink requirement data includes:
if the occupancy rate of the processor of the equipment where the occupancy rate of the processor is larger than the percentage threshold value is obtained through judgment, the difference value between the occupancy rate of the processor and the percentage threshold value is obtained;
determining corresponding second uplink requirement data based on the difference, wherein the second uplink requirement data comprises: a second quantity threshold and a second waiting time threshold of the target message to be uplinked; the second quantity threshold is greater than the first quantity threshold, and the second latency threshold is greater than the first latency threshold;
and judging whether a target message currently sent to the destination node meets the second uplink requirement data, if so, updating the current state of the target message from the uplink preparation state to the uplink-in-progress state.
In some embodiments of the present application, further comprising:
if the symmetric key and the private key which are uniquely corresponding to the block chain server are not stored locally through judgment, and the block chain server knows that a block chain account corresponding to the unique user identifier of the block chain server is created currently, a private key query request containing the unique user identifier is sent to the block chain server, so that the block chain server sends the private key which is encrypted by the symmetric key and corresponds to the unique user identifier; receiving the private key encrypted by the symmetric key, acquiring the private key and the symmetric key which are uniquely corresponding to the private key and the symmetric key after decryption, and locally caching the symmetric key and the private key which are uniquely corresponding to the private key and the symmetric key;
if the local stores no symmetric key and private key corresponding to the local user identity, and the blockchain server knows that a blockchain account corresponding to the local user identity is not created currently, the blockchain server sends an account request containing the unique user identity to the blockchain server, so that the blockchain server generates an asymmetric key, a uniquely corresponding public key and a private key corresponding to the unique user identity, creates a blockchain account corresponding to the unique user identity, and sends a private key corresponding to the unique user identity and encrypted by the symmetric key; and receiving the private key encrypted by the symmetric key, acquiring the private key and the symmetric key which are uniquely corresponding to the private key after decryption, and locally caching the symmetric key and the private key which are uniquely corresponding to the private key.
Another aspect of the present application provides an instant messaging message uplink apparatus, including:
the instant communication module is used for locally sending the target message to a chat server for instant communication so that the chat server sends the target message to a target node;
and the encryption uplink module is used for encrypting and signing the target message sent to the target node locally respectively based on a symmetric key and a private key which are obtained from the block chain server in advance and correspond to the block chain server to form a data packet, and sending the data packet to the block chain server for uplink storage.
A third aspect of 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 instant messaging chaining method when executing the computer program.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the instant messaging uplink method.
According to the instant messaging message chaining method, the target message is sent to the chat server for instant messaging from the local, so that the chat server sends the target message to the target node; based on a symmetric key and a private key which are obtained from a block chain server in advance and are only and correspondingly, a target message sent to the target node is encrypted and signed locally to form a data packet, and the data packet is sent to the block chain server for uplink storage; the chat and the block chain functions can be decoupled, the client side directly communicates with the block chain server, and the uplink state of the block chain is notified to the chat server by the client side, so that the uplink of the block chain does not influence the chat efficiency of a user, and the data of the block chain service cannot be influenced if the chat server is not credible. And because of the uncontrollable nature of the data in the user chatting process, whether the data is uplink in the chatting process is controlled by the user; and because the chat server and the blockchain server are decoupled, the two chat servers and the blockchain server can be respectively deployed in a distributed manner. In addition, by using a mode of combining symmetric encryption and asymmetric encryption, the security of data transmission can be effectively improved, and the security and reliability of the uplink of the instant messaging message can be further improved.
Additional advantages, objects, and features of the application will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
It will be appreciated by those skilled in the art that the objects and advantages that can be achieved with the present application are not limited to the specific details set forth above, and that these and other objects that can be achieved with the present application will be more clearly understood from the detailed description that follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, are incorporated in and constitute a part of this application, and are not intended to limit the application. The components in the figures are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the application. For purposes of illustrating and describing certain portions of the present application, the drawings may have been enlarged, i.e., may be larger, relative to other features of the exemplary devices actually made in accordance with the present application. In the drawings:
fig. 1 is a first flowchart illustrating an uplink method for instant messaging messages according to an embodiment of the present application.
Fig. 2 is a second flowchart illustrating an uplink method for instant messaging messages according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of an apparatus for uplink of instant messaging messages in another embodiment of the present application.
Fig. 4 is a schematic diagram illustrating a preparation process of an instant messaging message before uplink in an application example of the present application.
Fig. 5 is a flowchart illustrating an uplink status update process of an instant messaging message according to an exemplary application of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the following embodiments and the accompanying drawings. The exemplary embodiments and descriptions of the present application are provided to explain the present application and not to limit the present application.
Here, it should be further noted that, in order to avoid obscuring the present application with unnecessary details, only the structures and/or processing steps closely related to the scheme according to the present application are shown in the drawings, and other details not so relevant to the present application are omitted.
It should be emphasized that the term "comprises/comprising" when used herein, is taken to specify the presence of stated features, elements, steps or components, but does not preclude the presence or addition of one or more other features, elements, steps or components.
It is also noted herein that the term "coupled," if not specifically stated, may refer herein to not only a direct connection, but also an indirect connection in which an intermediate is present.
Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the drawings, the same reference numerals denote the same or similar parts, or the same or similar steps.
Aiming at the problem that the transmission efficiency of instant messaging messages between client nodes is influenced in the prior art, so that the timeliness experience of user communication is influenced; meanwhile, the security of a data transmission link of the instant messaging message in the uplink process cannot be guaranteed, and the like. And due to the uncontrollable property of the data in the chatting process of the user, whether the data is uplink or not in the chatting process is controlled by the user. The data security is ensured by using a combination of symmetric encryption and asymmetric encryption. The server generates a public key and a symmetric key, and the client stores the private key and the symmetric key. In the transmission project, the private key is encrypted by a symmetric key, the client decrypts the private key and the symmetric key to obtain the private key and the symmetric key, and the client ciphertext stores the private key and the symmetric key. In the process of packaging and chaining the uplink data, the symmetric encryption is carried out on the data by using a symmetric key by using the efficient characteristic of symmetric encryption, and the data is asymmetrically encrypted by using a private key for signature.
The details are explained by the following examples.
An embodiment of the present invention provides an instant messaging message uplink method, referring to fig. 1, the instant messaging message uplink method executed by an instant messaging message uplink device in a client device includes the following steps:
step 100: the target message is sent locally to the chat server for instant messaging so that the chat service 5 sends the target message to the destination node.
It is understood that the destination node may refer to another ue, and in an example, the ue performing the uplink method of the current instant messaging message may be referred to as a ue a, and may specifically be implemented by a user operating an APP in the ue a; the destination node may be a client B, configured to receive, through the chat server, the target message sent by the client a.
In one or more embodiments of the present application, the type of the target message may include a voice message, a file message, a picture message, a text message, an enterprise reconciliation message, and the like, and may be specifically set according to an actual application requirement.
Step 200: and based on a symmetric key and a private key which are obtained from the block chain server in advance and are only and correspondingly, respectively encrypting and signing the target message sent to the target node locally to form a data packet, and sending the data packet to the block chain server for uplink storage.
5, it is understood that the number of the target messages mentioned in step 200 may be one, or may be multiple, and may be specifically set according to factors such as the processor utilization rate of the client a, and the following embodiments will be described in detail.
As can be seen from the above description, the instant messaging message uplink method provided in the embodiments of the present application can decouple chat and blockchain functions, and enable the client to directly communicate with the blockchain server, and the client notifies the uplink state of the blockchain to the chat
And the day server enables the block chain link to not influence the chat efficiency of the user, so that the data of the 0 block chain service cannot be influenced if the chat server is not credible. And because of the uncontrollable nature of the data in the chat process of the user, whether the data is uplink in the chat process is controlled by the user; because the chat server and the block chain server are decoupled, the two chat servers and the block chain server can be respectively deployed in a distributed mode; in addition, by using a mode of combining the symmetric encryption and the asymmetric encryption, the security of data transmission can be effectively improved, and the security and the reliability of the uplink of the instant messaging message can be further improved.
In order to further improve reliability and security of instant messaging message uplink, referring to fig. 2, in an instant messaging message uplink method provided in an embodiment of the present application, step 100 of the instant messaging message uplink method specifically includes the following steps:
step 110: judging whether a symmetric key and a private key which are uniquely corresponding to the local device are stored locally, if so, executing a step 120; if not, step 130 or step 140 in the subsequent embodiments is executed.
0, step 120: the method comprises the steps of sending a target message to a chat server for instant messaging from local so that the chat server marks the current state of the target message as an uplink preparation state, sending the target message to a target node so as to display the target message and the state of the target message in the target node, wherein the chat server and the block chain server are respectively deployed in a distributed mode.
That is, the chat server and the blockchain server are in a many-to-many relationship, because the two services are decoupled, the two services can be respectively deployed in a distributed manner, and uplink of the blockchain does not affect the chat service and the chat server pollutes data on the blockchain.
In order to further solve the problem that the frequent data transmission in the chat process causes excessive stress on the device and the server, in an uplink method of instant messaging messages provided in an embodiment of the present application, referring to fig. 2, a step 200 in the uplink method of instant messaging messages specifically includes the following contents:
step 210: judging whether the target message currently sent to the destination node meets preset uplink requirement data, if yes, executing step 220: if not, continuing to wait.
It can be appreciated that because of the large amount of chat data and the high frequency of message transmissions, data is frequently uploaded if a user uplinks messages for each message transmitted. To reduce the pressure on blockchain services and mobile devices, chat packets are uploaded in a batch uplink manner. Considering different use conditions of the mobile equipment and the fact that the mobile equipment is not used in performance, through a large number of tests, the threshold value of batch uploading is determined according to the CPU occupancy rate of the equipment.
Step 220: updating the current state of the target message from the uplink preparation state to an uplink-in-progress state, so that the chat server and the target node correspondingly update the current state of the target message;
step 230: based on a symmetric key and a private key which are obtained from a block chain server in advance and are only and correspondingly, encrypting and signing each target message which is in the uplink state locally based on the type of the target message, wherein the current state of the target message belongs to the target message, so as to form a corresponding data packet;
step 240: and sending the data packets to the block chain server in batch for uplink storage, and receiving an uplink state notification message for the data packets sent by the block chain server, so as to locally update the current state of the target message from the uplink-currently-transmitting state to an uplink successful state or an uplink failed state based on the uplink state notification message, so that the chat server and the target node correspondingly update the current state of the target message.
In order to further reduce the equipment and server stress, in an instant messaging message uplink method provided in an embodiment of the present application, step 230 in the instant messaging message uplink method specifically includes the following steps:
step 231: if the type of the target message is a voice message, a file message or a picture message, generating an MD5 value corresponding to the target message, and encrypting and signing the MD5 based on a symmetric key and a private key which are uniquely corresponding to the MD and are obtained from a block chain server in advance to form a data packet.
Step 232: and if the type of the target message is a text message, directly encrypting and signing the target message based on a symmetric key and a private key which are obtained from the block chain server in advance and are only and correspondingly obtained to form a data packet.
Step 233: and if the type of the target message is an enterprise reconciliation message, encrypting and signing the reconciliation amount and the subject object identification in the enterprise reconciliation message based on a symmetric key and a private key which are obtained from the block chain server in advance and are only corresponding to the target message to form a data packet.
That is, since the data for chatting are various, there are voice messages, file messages, picture messages, text messages, business reconciliation messages, and the like. Due to the fact that the file data volume is too large, the voice message, the file message and the picture message are chained in the MD5 value of the file, the file can be prevented from being tampered, and encrypted data can be reduced. Enterprise reconciliation message we cryptographically link up the reconciliation amount and the subject object id.
In order to further reduce the equipment and server stress, in an instant messaging message uplink method provided in an embodiment of the present application, steps 210 and 220 in the instant messaging message uplink method specifically include the following:
step 211: judging whether the occupancy rate of the processor of the device is greater than a percentage threshold value, if not, executing a step 212; if yes, go to step 214;
step 212: judging whether the target message currently sent to the destination node meets preset first uplink requirement data, if yes, executing step 213; if not, continuing to wait
Step 213: updating the current state of the target message from the uplink ready state to an uplink-in-progress state, so that the chat server and the destination node also correspondingly update the current state of the target message, wherein the first uplink request data includes: a first quantity threshold and a first waiting time threshold of the target messages to be uplinked;
step 214: obtaining a difference between the processor occupancy and the percentage threshold;
step 215: determining a corresponding second uplink requirement data based on the difference value, wherein the second uplink requirement data comprises: a second quantity threshold and a second waiting time threshold of the target message to be uplinked; the second quantity threshold is greater than the first quantity threshold, and the second latency threshold is greater than the first latency threshold;
step 216: determining whether a target message currently sent to the destination node satisfies the second uplink request data, if yes, performing step 213; if not, continuing to wait.
It will be appreciated that the percentage threshold may be set between 30% and 70%, preferably 50%; the first number threshold may be set between 1 and 100, preferably 10; the first latency threshold may be set between 1 and 60s, preferably 8s. The second quantity threshold = a first uplink quantity threshold + w × n, where n is a multiple between the difference and 10; w is between 1 and 50, preferably w =4; the second waiting time threshold = the first waiting time threshold + t × n, t is between 1 and 30s, and preferably t =3.
Specifically, because the sending number and the sending frequency of the users are different in the chat process, for example, some users do not send a message after sending two pieces of data or send a message after a long time interval, some users send dozens of messages every second, and the application adopts two latitudes of time and number to upload the number according to different situations.
And if the occupancy rate of the CPU of the current equipment is below 50%, the time is more than or equal to 8 seconds and the number of the uploaded data is more than or equal to 10. If the occupancy rate of the CPU of the current device is above 50%, the time latitude is increased by 3 seconds every time the occupancy rate of the CPU is increased by 10%, the number of the latitudes is increased by 4 pieces, for example, if the occupancy rate of the CPU of the current device is below 50%, the time is greater than or equal to 11 seconds, and the number is greater than or equal to 14 pieces of uploading data, so that the interaction frequency is reduced to achieve the purpose of less stress of the device.
In order to further improve the reliability of the instant messaging uplink, in an embodiment of the present invention, the step 100 of the instant messaging uplink method further includes the following steps:
if the step 110 determines that the symmetric key and the private key which are uniquely corresponding to the local device are not stored, the step 130 or the step 140 is executed;
step 130: if the blockchain server knows that a blockchain account corresponding to the unique user identifier of the blockchain server is created currently, sending a private key query request containing the unique user identifier to the blockchain server so that the blockchain server sends a private key which corresponds to the unique user identifier and is encrypted by a symmetric key; receiving the private key encrypted by the symmetric key, acquiring the private key and the symmetric key which are uniquely corresponding to the private key and the symmetric key after decryption, and locally caching the symmetric key and the private key which are uniquely corresponding to the private key and the symmetric key; then step 120 is performed.
Step 140: if the blockchain server knows that a blockchain account corresponding to the unique user identifier of the blockchain server is not created currently, sending an account request containing the unique user identifier to the blockchain server so that the blockchain server generates an asymmetric key, a uniquely corresponding public key and a private key corresponding to the unique user identifier, creates a blockchain account corresponding to the unique user identifier, and sends the private key which is encrypted by the symmetric key and corresponds to the unique user identifier; receiving the private key encrypted by the symmetric key, acquiring the private key and the symmetric key which are uniquely corresponding to the private key and the symmetric key after decryption, and locally caching the symmetric key and the private key which are uniquely corresponding to the private key and the symmetric key; step 120 is then performed.
In terms of software, based on the foregoing embodiment of the instant messaging uplink method, the present application further provides an embodiment of an instant messaging uplink apparatus for implementing the instant messaging uplink method, and referring to fig. 3, the instant messaging uplink apparatus includes the following contents:
the instant messaging module 10 is used for sending the target message to the chat server for instant messaging from local so that the chat server sends the target message to the destination node.
And the encrypted uplink module 20 is configured to encrypt and sign the target message sent to the destination node locally based on a symmetric key and a private key uniquely corresponding to the target message, which are obtained from the blockchain server in advance, to form a data packet, and send the data packet to the blockchain server for uplink storage.
The instant messaging message uplink apparatus provided in the present application may be specifically configured to execute the processing procedure of the embodiment of the instant messaging message uplink method in the above embodiment, and its functions are not described herein again, and refer to the detailed description of the embodiment of the instant messaging message uplink method.
The part of the instant messaging message uplink device for performing the instant messaging message uplink can be executed in the client device, and can be specifically selected according to the processing capability of the client device, the limitation of the user use scenario and the like. This is not a limitation of the present application. If all operations are performed in the ue, the ue may further include a processor configured to perform uplink processing for the instant messaging message.
The client device may have a communication module (i.e., a communication unit), and may be in communication connection with a remote chat server and a blockchain server, so as to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
The server and the client device may communicate using any suitable network protocol, including a network protocol that has not been developed at the filing date of the present application. The network protocol may include, for example, a TCP/IP protocol, a UDP/IP protocol, an HTTP protocol, an HTTPS protocol, or the like. Of course, the network Protocol may also include, for example, an RPC Protocol (Remote Procedure Call Protocol), a REST Protocol (Representational State Transfer Protocol), and the like used above the above Protocol.
As can be seen from the above description, the instant messaging message uplink apparatus provided in the embodiment of the present application can decouple the chat and the blockchain functions, and the client directly communicates with the blockchain server, and the uplink state of the blockchain is notified to the chat server by the client, so that the uplink of the blockchain does not affect the efficiency of the user chat, and thus, if the chat server is not trusted, the data of the blockchain service is not affected. And because of the uncontrollable nature of the data in the user chatting process, whether the data is uplink in the chatting process is controlled by the user; because the chat server and the block chain server are decoupled, the two chat servers and the block chain server can be respectively deployed in a distributed manner; in addition, by using a mode of combining symmetric encryption and asymmetric encryption, the security of data transmission can be effectively improved, and the security and reliability of the uplink of the instant messaging message can be further improved.
In order to further explain the scheme, the application also provides a specific application example of the instant messaging message uplink method, which can prevent data from being tampered, improve the security of the data and increase the credibility of the data; the uplink of the block chain can not influence the chat service and the chat server pollutes the data on the block chain; the data security in the uplink process can be improved; the problem of excessive pressure on equipment and a server caused by frequent data transmission in the chatting process can be solved.
The method for uplink of instant messaging messages provided by the application example of the application example specifically comprises the following contents:
(1) Due to the characteristics of the block chain, the uplink of the user chatting data can prevent the data from being tampered, the safety of the data is improved, and the reliability of the data is improved.
(2) The method and the system decouple the functions of the chat and the block chain, the client directly communicates with the block chain server, and the uplink state of the block chain is notified to the chat server by the client, so that the uplink of the block chain does not influence the chat efficiency of a user, and thus, if the chat server is not credible, the data of the block chain service is not influenced. And due to the uncontrollable property of the data in the chatting process of the user, whether the data is uplink or not in the chatting process is controlled by the user.
The chat server and the blockchain server are in a many-to-many relationship, and because the two services are decoupled, the two services can be respectively deployed in a distributed manner.
(3) The method and the device use a combination mode of symmetric encryption and asymmetric encryption to ensure the data security. The server generates a public key and a symmetric key, and the client stores the private key and the symmetric key. In the transmission project, the private key is encrypted by a symmetric key, the client decrypts the private key and the symmetric key to obtain the private key and the symmetric key, and the client ciphertext stores the private key and the symmetric key. In the process of packaging and chaining the uplink data, the symmetric encryption is carried out on the data by using a symmetric key by using the efficient characteristic of symmetric encryption, and the data is asymmetrically encrypted by using a private key for signature.
Due to the wide variety of data in chatting, there are voice messages, file messages, picture messages, text messages, enterprise account checking messages, and the like. Due to the fact that the file data volume is too large, the voice message, the file message and the picture message are chained in the MD5 value of the file, the file can be prevented from being tampered, and encrypted data can be reduced. And in the enterprise account checking message, the account checking amount and the subject object id are encrypted and linked up.
(4) Because of the large amount of chat data and the high frequency of message transmission, if a user uplinks a message every time the user transmits a message, data is frequently uploaded. To reduce the pressure on blockchain services and mobile devices, chat data packets are uploaded in a batch uplink manner. Considering that the use conditions of the mobile devices are different and the performances of the mobile devices are not used, through a large number of tests, the threshold value of batch uploading is determined according to the CPU occupancy rate of the devices.
Because the sending number and the sending frequency of the users are different in the chat process, for example, some users do not send a message after sending two pieces of data or send a message after a long time interval, some users send dozens of messages every second, and the application adopts two latitudes of time and number to upload the number aiming at different situations.
And if the occupancy rate of the CPU of the current equipment is below 50%, the time is more than or equal to 8 seconds and the number of the uploaded data is more than or equal to 10. If the occupancy rate of the CPU of the current device is above 50%, the time latitude is increased by 3 seconds every time the occupancy rate of the CPU is increased by 10%, the number of the latitudes is increased by 4 pieces, for example, if the occupancy rate of the CPU of the current device is below 50%, the time is greater than or equal to 11 seconds, and the number is greater than or equal to 14 pieces of uploading data, so that the interaction frequency is reduced to achieve the purpose of less stress of the device.
Based on the above, the application example of the present application provides a pre-uplink preparation process of an instant messaging message, referring to fig. 4, the pre-uplink preparation process of a block chain specifically includes the following contents:
1. after the uplink is started, the client requests a symmetric key and a private key of a user from the server for carrying out encryption processing on data in the uplink process, and the uplink starting process comprises the following steps:
1.1 after a user initiates a blockchain chat, whether the private key of the client is stored at the client is judged firstly (the private key is prevented from being lost after the user changes a mobile phone or unloads software).
1.2 else perform 1.4.
If 1.3 is true, then 1.14 is performed.
1.4 request background to inquire the current user's blockchain account creation status and return the result.
And 1.5, after receiving the return result, the client judges whether a block chain account exists or not.
1.6 otherwise, 1.11 is performed.
A 1.7 yes then a 1.8 is performed.
1.8 prompt the user whether to update the private key to the mobile phone.
1.9 if the user chooses to update the private key, the user inquires the private key to the background, caches the private key and the symmetric key returned by the background to the mobile phone, and simultaneously prompts the user to recover successfully and end the process.
1.10 the user does not update the private key and the process ends.
1.11 prompt the user whether to create a blockchain user, if not, end the flow, if so, execute 1.12.
1.12 calling an interface to create a blockchain account, generating a public private key and storing the public private key in a background, and then creating the account and returning the private key to the client.
1.13 client saves private key.
1.14 checks if the client has cached the symmetric key.
1.15 if there is a symmetric key, ending the process, otherwise, requesting query to the background, the background encrypting the queried symmetric key with a private key and returning to the client, and the client ends the process after storing.
In addition, the application example of the present application further provides an uplink state updating process of an instant messaging message, referring to fig. 5, the uplink state updating process of the block chain is as follows:
2.1 the client A starts the block chain chat and sends the message, the client packages the message data, and the chat server forwards the message to the user B after receiving the message.
2.2 after the message is successfully forwarded by the chat server, returning a message receipt to the client a, after the message is successfully sent, judging whether the uplink standard is reached by the client a, and whether the number of uplink is greater than or equal to 10 or whether the current time and the earliest data of non-uplink are greater than or equal to 8 seconds.
2.3 if the uplink is not reached, continue to execute 2.1
2.4 after reaching the uplink standard, the client a updates the uplink data state to be uplink and sends the message state to the chat server, and the chat server forwards the state to the client B. And meanwhile, the client A packs the uplink data and uploads the data to the block chain server.
2.5 the blockchain server returns the result of the uplink to the client A, the client A updates the blockchain state of the message and sends the state to the chat server, and the chat server forwards the state to the client B.
To sum up, the application example of the application can decouple the chat and the function of the block chain, the client communicates with the block chain server directly, and the uplink state of the block chain is notified to the chat server by the client, so that the uplink of the block chain does not affect the chat efficiency of the user, and the data of the block chain service cannot be affected if the chat server is not trusted. And because of the uncontrollable nature of the data in the user chatting process, whether the data is uplink in the chatting process is controlled by the user; because the chat server and the block chain server are decoupled, the two chat servers and the block chain server can be respectively deployed in a distributed mode; in addition, by using a mode of combining symmetric encryption and asymmetric encryption, the security of data transmission can be effectively improved, and the security and reliability of the uplink of the instant messaging message can be further improved.
Embodiments of the present application further provide an electronic device (i.e., a computer device), where the electronic device may include a processor, a memory, a receiver, and a transmitter, where the processor is configured to execute the instant messaging uplink method mentioned in the foregoing embodiments, and the processor and the memory may be connected by a bus or other means, for example, connected by a bus. The receiver can be connected with the processor and the memory in a wired or wireless mode.
The processor may be a Central Processing Unit (CPU). The Processor may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or a combination thereof.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the instant messaging chaining method in embodiments of the present application. The processor executes the non-transitory software programs, instructions, and modules stored in the memory to execute various functional applications and data processing of the processor, so as to implement the instant messaging uplink method in the above method embodiments.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor, and the like. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and such remote memory may be coupled to the processor via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory and, when executed by the processor, perform an instant messaging uplink method of an embodiment.
In some embodiments of the present application, the user equipment may include a processor, a memory, and a transceiving unit, the transceiving unit may include a receiver and a transmitter, the processor, the memory, the receiver, and the transmitter may be connected through a bus system, the memory to store computer instructions, the processor to execute the computer instructions stored in the memory to control the transceiving unit to transceive signals.
As an implementation manner, the functions of the receiver and the transmitter in the present application may be implemented by a transceiver circuit or a dedicated chip for transceiving, and the processor may be implemented by a dedicated processing chip, a processing circuit or a general-purpose chip.
As another implementation manner, a server provided in the embodiment of the present application may be implemented by using a general-purpose computer. That is, program code that implements the functions of the processor, receiver, and transmitter is stored in the memory, and a general-purpose processor implements the functions of the processor, receiver, and transmitter by executing the code in the memory.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the above-mentioned instant messaging uplink method. The computer readable storage medium may be a tangible storage medium such as Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.
Those of ordinary skill in the art will appreciate that the various illustrative components, systems, and methods described in connection with the embodiments disclosed herein may be implemented as hardware, software, or combinations of both. Whether this is done in hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link.
It is to be understood that the present application is not limited to the particular arrangements and instrumentality described above and shown in the attached drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions or change the order between the steps after comprehending the spirit of the present application.
Features that are described and/or illustrated with respect to one embodiment may be used in the same way or in a similar way in one or more other embodiments and/or in combination with or instead of the features of the other embodiments.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made to the embodiment of the present application by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. An instant messaging message uplink method, comprising:
sending the target message to a chat server for instant messaging from local so that the chat server sends the target message to a target node;
and based on a symmetric key and a private key which are obtained from the block chain server in advance and are only and correspondingly, respectively encrypting and signing the target message sent to the target node locally to form a data packet, and sending the data packet to the block chain server for uplink storage.
2. The method of claim 1, wherein the sending the target message from local to a chat server for instant messaging to cause the chat server to send the target message to a destination node, comprises:
judging whether a symmetric key and a private key which are uniquely corresponding to the chat server are locally stored, if so, sending the target message to the chat server for instant messaging from the local so that the chat server marks the current state of the target message as an uplink preparation state, and sending the target message to a target node so as to display the target message and the state thereof in the target node, wherein the chat server and the block chain server are respectively deployed in a distributed manner.
3. The method of claim 2, wherein the encrypting and signing the target message sent to the destination node locally based on the symmetric key and private key uniquely corresponding to the target message obtained from the blockchain server in advance to form a data packet, and sending the data packet to the blockchain server for uplink storage comprises:
judging whether a target message currently sent to the target node meets preset uplink requirement data, if so, updating the current state of the target message from the uplink preparation state to the uplink state so that the chat server and the target node correspondingly update the current state of the target message;
based on a symmetric key and a private key which are obtained from a block chain server in advance and are only and correspondingly, encrypting and signing each target message which is in the uplink state locally based on the type of the target message which is in the current state and belongs to the target message to form a corresponding data packet;
and sending the data packets to the blockchain server in batch for uplink storage, and receiving an uplink state notification message for the data packets sent by the blockchain server, so as to locally update the current state of the target message from the current uplink state to an uplink successful state or an uplink failed state based on the uplink state notification message, so that the chat server and the target node correspondingly update the current state of the target message.
4. The method of claim 3, wherein encrypting and signing each target message in the uplink state locally based on a type to which the target message in the current state belongs to form a corresponding data packet based on a symmetric key and a private key uniquely corresponding to the target message obtained from a blockchain server in advance comprises:
if the type of the target message is a voice message, a file message or a picture message, generating an MD5 value corresponding to the target message, and encrypting and signing the MD5 value based on a symmetric key and a private key which are obtained from a block chain server in advance and are only corresponding to the MD5 value to form a data packet;
if the type of the target message is a text message, directly encrypting and signing the target message based on a symmetric key and a private key which are obtained from a block chain server in advance and are only corresponding to the target message to form a data packet;
and if the type of the target message is an enterprise reconciliation message, encrypting and signing the reconciliation amount and the subject object identifier in the enterprise reconciliation message based on a symmetric key and a private key which are obtained from a block chain server in advance and are only corresponding to the target message to form a data packet.
5. The method of claim 3, wherein the determining whether a target message currently sent to the destination node satisfies a predetermined uplink request data, and if so, updating the current status of the target message from the uplink ready status to an uplink on status comprises:
judging whether the occupancy rate of a processor of the device where the target message is located is greater than a percentage threshold value, if not, further judging whether the target message currently sent to the target node meets preset first uplink requirement data, if so, updating the current state of the target message from the uplink preparation state to the uplink-in-progress state, wherein the first uplink requirement data comprises: a first quantity threshold and a first latency threshold for target messages to be uplinked.
6. The method of claim 5, wherein the determining whether the target message currently sent to the destination node satisfies predetermined uplink request data comprises:
if the occupancy rate of the processor of the equipment where the occupancy rate of the processor is larger than the percentage threshold value is obtained through judgment, the difference value between the occupancy rate of the processor and the percentage threshold value is obtained;
determining corresponding second uplink requirement data based on the difference, wherein the second uplink requirement data comprises: a second quantity threshold and a second waiting time threshold of the target message to be uplinked; the second quantity threshold is greater than the first quantity threshold, and the second latency threshold is greater than the first latency threshold;
and judging whether a target message currently sent to the destination node meets the second uplink requirement data, if so, updating the current state of the target message from the uplink preparation state to the uplink-in-progress state.
7. The method of claim 2 further comprising:
if the symmetric key and the private key which are uniquely corresponding to the block chain server are not stored locally through judgment, and the block chain server knows that a block chain account corresponding to the unique user identifier of the block chain server is created currently, a private key query request containing the unique user identifier is sent to the block chain server, so that the block chain server sends the private key which is encrypted by the symmetric key and corresponds to the unique user identifier; receiving the private key encrypted by the symmetric key, acquiring the private key and the symmetric key which are uniquely corresponding to the private key and the symmetric key after decryption, and locally caching the symmetric key and the private key which are uniquely corresponding to the private key and the symmetric key;
if the symmetric key and the private key which are uniquely corresponding to the block chain server are judged not to be stored locally, and the block chain server is informed that the block chain account corresponding to the unique user identifier of the block chain server is not created currently, an account request containing the unique user identifier is sent to the block chain server, so that the block chain server generates an asymmetric key, a uniquely corresponding public key and a private key which are corresponding to the unique user identifier, creates a block chain account corresponding to the unique user identifier, and sends the private key which is corresponding to the unique user identifier and is encrypted by the symmetric key; and receiving the private key encrypted by the symmetric key, acquiring the private key and the symmetric key which are uniquely corresponding to the private key after decryption, and locally caching the symmetric key and the private key which are uniquely corresponding to the private key.
8. An instant messaging message chaining apparatus, comprising:
the instant communication module is used for sending the target message to a chat server for instant communication from local so as to enable the chat server to send the target message to a target node;
and the encrypted uplink module is used for encrypting and signing the target message sent to the destination node locally respectively based on a symmetric key and a private key which are obtained from the block chain server in advance and uniquely correspond to the block chain server to form a data packet, and sending the data packet to the block chain server for uplink storage.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for uplink of instant messaging messages according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the instant messaging uplink method according to any of claims 1 to 7.
CN202211683847.5A 2022-12-27 2022-12-27 Instant messaging message chaining method and device Pending CN115987931A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211683847.5A CN115987931A (en) 2022-12-27 2022-12-27 Instant messaging message chaining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211683847.5A CN115987931A (en) 2022-12-27 2022-12-27 Instant messaging message chaining method and device

Publications (1)

Publication Number Publication Date
CN115987931A true CN115987931A (en) 2023-04-18

Family

ID=85967636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211683847.5A Pending CN115987931A (en) 2022-12-27 2022-12-27 Instant messaging message chaining method and device

Country Status (1)

Country Link
CN (1) CN115987931A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117221007A (en) * 2023-11-03 2023-12-12 南通极粟设计服务有限公司 Remote workgroup chat communication method and system based on digital multimedia

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117221007A (en) * 2023-11-03 2023-12-12 南通极粟设计服务有限公司 Remote workgroup chat communication method and system based on digital multimedia
CN117221007B (en) * 2023-11-03 2024-02-02 南通极粟设计服务有限公司 Remote workgroup chat communication method and system based on digital multimedia

Similar Documents

Publication Publication Date Title
TWI489893B (en) Apparatus and method to efficiently send device trigger messages
US8626142B2 (en) System and method for performing a light weight, wireless activation of a mobile communication device
CN112449315B (en) Network slice management method and related device
WO2018214865A1 (en) Processing method for message acknowledgement, related apparatus, storage medium and processor
US11102017B2 (en) Robust event handling in an electronic subscriber identity module (eSIM) notification service
WO2022032865A1 (en) Traffic descriptor transmission method and related device
US11895083B2 (en) Address obtaining method and an address obtaining apparatus
KR102382894B1 (en) Apparatus and method for managing events in communication system
CN111447678B (en) Communication method and communication device
CN110784434B (en) Communication method and device
US20210184852A1 (en) System and method for securely transmitting non-pki encrypted messages
CN113938880B (en) Application verification method and device
CN115987931A (en) Instant messaging message chaining method and device
WO2022134089A1 (en) Method and apparatus for generating security context, and computer-readable storage medium
WO2013189398A2 (en) Application data push method, device, and system
US20070230702A1 (en) Method, system and apparatus for updating encryption keys on a mobile communication device
US10348518B2 (en) Method, apparatus, system and media for transmitting messages between networked devices in data communication with a local network access point
Jacobsen et al. A Low-Cost Vehicle Tracking Platform Using Secure SMS
US9998919B1 (en) SMS spoofing protection
US9451430B2 (en) Delivery of messages in mobile communication network
KR20200044592A (en) Multi-path transmission system and method
KR101523253B1 (en) Method and device for monitoring and blocking packet
US20220224521A1 (en) Managing a secure element
WO2022165787A1 (en) Parameter configuration method and apparatus, device, and storage medium
WO2022082447A1 (en) Method and apparatus for task management in next generation networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination