Summary of the invention
It is a general object of the present disclosure to provide a kind of implementation method of instant messaging, terminal device and storage medium, to
Solve the problems, such as that existing instant communication mode is tampered and reveals there are userspersonal information.
To achieve the goals above, according to the first aspect of the embodiments of the present disclosure, a kind of realization side of instant messaging is provided
Method, is applied to terminal device, and the terminal device is the node in block chain network, which comprises
The identity information of target user to be registered is sent to the manager node in the block chain network, the body
Part information carries out legitimate verification to the target user for the manager node and is confirming that the target user is legal
The intelligent contract write-in registration request disposed in backward block chain, the registration request is for triggering the intelligent contract to described
Terminal device send carry registration code be proved to be successful message;
Receive it is described be proved to be successful message after, will the target user personal information encrypt after be distributed to distribution
Memory node is stored, and receives the storage index information that the distributed storage node returns;
It include the registration request of the registration code and the storage index information, the registration to the intelligent contract write-in
Request executes following operation for triggering the intelligent contract:
The target user is verified according to the registration code;
It, will be in the storage index information write-in block chain and to institute after determining the target user by verifying
It states terminal device and returns to the message that succeeds in registration.
Optionally, the registration request further includes the link address information of the terminal device, it is described operation further include by
The link address information of the terminal device is written in the block chain;
The method also includes:
The information acquisition request of the identity information of the target user good friend is carried to the intelligent contract write-in, it is described
Information acquisition request is for triggering described in the intelligent contract reads from the block chain according to the identity information of the good friend
The link address information of good friend;
It is established and is communicated to connect based on DHT agreement or PubSub agreement and good friend's terminal device, the communication connection is used
Instant messaging is carried out in the target user and the good friend.
Optionally, the method also includes:
If there are not sent message and the terminal is set in the historical session message queue that the terminal device is locally stored
It is standby not set up the communication connection between the receiving end of the not sent message, then it is carried to the intelligent contract write-in
State the message upload request of not sent message, the message upload request not sent disappears for triggering the intelligent contract by described
Breath is routed to the historical session message queue of the receiving end.
Optionally, the method also includes:
The offline message acquisition request of the identity information of the target user is carried to the intelligent contract write-in, it is described
Offline message acquisition request executes following operation for triggering the intelligent contract: inquiring the block according to the identity information
Chain obtains target user offline message to be received and the offline message is sent to the terminal device;
The offline message is added to the corresponding historical session message queue of the target user.
Optionally, the method also includes:
It file destination to be uploaded is distributed to the distributed storage node is stored and receives the distribution and deposited
Store up the storage index information for the file destination that node returns;
The storage index letter for carrying the file destination is sent to good friend's terminal device by described communicate to connect
The file message of breath, the file message for good friend's terminal device according to the storage index information of the file destination from
The distributed storage node obtains the file destination.
Optionally, if the target user is the administrator of target group, the method also includes:
The modification of the target group is operated in response to the target user, the modification generated according to the modification operation
Message;
For each group members in the target group, if the terminal device of the group members is with the target user's
Terminal device establishes the communication connection, then the modification message is sent to the terminal of the group members by the communication connection
Equipment;
If the terminal device of the member does not establish the communication connection, Xiang Suoshu with the terminal device of the target user
Intelligent contract write-in carries group's message upload request of the modification message, and group's message upload request is described for triggering
The modification message is routed to the historical session message queue of the member terminal equipment by intelligent contract.
According to the second aspect of an embodiment of the present disclosure, a kind of terminal device is provided, the terminal device is block chain network
In node, the terminal device includes:
First sending module, for the identity information of target user to be registered to be sent in the block chain network
Manager node, the identity information carry out legitimate verification to the target user for the manager node and are confirming
The intelligent contract write-in registration request disposed in the legal backward block chain of target user, the registration request is for triggering institute
State intelligent contract sent to the terminal device carry registration code be proved to be successful message;
Second sending module, for receive it is described be proved to be successful message after, by the personal information of the target user
It is distributed to distributed storage node after encryption to be stored, and receives the storage index letter that the distributed storage node returns
Breath;
First writing module, for including the registration code and the storage index information to the intelligent contract write-in
Registration request, the registration request execute following operation for triggering the intelligent contract:
The target user is verified according to the registration code;
It, will be in the storage index information write-in block chain and to institute after determining the target user by verifying
It states terminal device and returns to the message that succeeds in registration.
Optionally, the registration request further includes the link address information of the terminal device, it is described operation further include by
The link address information of the terminal device is written in the block chain;
The terminal device further include:
Second writing module, for carrying to the intelligent contract write-in identity information of the target user good friend
Information acquisition request, the information acquisition request are used to trigger the intelligent contract according to the identity information of the good friend from described
The link address information of the good friend is read in block chain;
Module is obtained, is retouched for indexing cryptographic Hash according to the storage from the account that the DHT node obtains the good friend
Information is stated, the account description information includes the link address information of the good friend;
Connection establishment module, for establishing communication link based on DHT agreement or PubSub agreement and good friend's terminal device
It connects, the communication connection carries out instant messaging for the target user and the good friend.
Optionally, the terminal device further include:
Third sending module, if there are not sent in the historical session message queue being locally stored for the terminal device
The communication connection is not set up between message and the terminal device and the receiving end of the not sent message, then to the intelligence
The message upload request for carrying the not sent message is written in contract, and the message upload request is closed for triggering the intelligence
The not sent message is about routed to the historical session message queue of the receiving end.
Optionally, the terminal device further include:
4th writing module, for carried to the intelligent contract write-in target user identity information it is offline
Message acquisition request, the offline message acquisition request execute following operation for triggering the intelligent contract: according to the body
Part information inquires the block chain, obtains target user offline message to be received and the offline message is sent to institute
State terminal device;
Adding module, for the offline message to be added to the corresponding historical session message queue of the target user.
Optionally, the terminal device further include:
5th sending module is stored simultaneously for file destination to be uploaded to be distributed to the distributed storage node
Receive the storage index information for the file destination that the distributed storage node returns;
6th sending module, for carrying the target by described communicate to connect to good friend's terminal device transmission
The file message of the storage index information of file, the file message is for good friend's terminal device according to the file destination
Storage index information obtain the file destination from the distributed storage node.
Optionally, if the target user is the administrator of target group, the terminal device further include:
Generation module, for being operated in response to the target user to the modification of the target group, according to the modification
Operate the modification message generated;
7th sending module, for for each group members in the target group, if the terminal device of the group members
The communication connection is established with the terminal device of the target user, then is sent out the modification message by the communication connection
Give the terminal device of the group members, and if the terminal device of the member do not establish institute with the terminal device of the target user
Communication connection is stated, then carries group's message upload request of the modification message, group's message to the intelligent contract write-in
Upload request is used to trigger the historical session message that the modification message is routed to the member terminal equipment by the intelligent contract
Queue.
According to the third aspect that the disclosure is implemented, a kind of terminal device is provided, the terminal device is the area in block chain
Block chain node, the terminal device include:
Memory is stored thereon with computer program;
Processor, for executing the computer program in the memory, to realize the first of the embodiment of the present disclosure
The step of aspect the method.
According to a fourth aspect of embodiments of the present disclosure, a kind of computer readable storage medium is provided, calculating is stored thereon with
Machine program, when which is executed by processor the step of first aspect the method for the realization embodiment of the present disclosure.
The technical scheme provided by this disclosed embodiment can include the following benefits: be based on block chain intelligence contract skill
Art realizes user's registration function, is distributed to distributed storage node after the personal information of user is encrypted and stores, and will
To storage index information write-in block chain in, it makes use of the decentralization of block chain and can not tamper, can to avoid with
The personal information at family is tampered.In addition, the personal information of user is dispersed on each distributed storage node, the transmission of information is straight
It connects and carries out among the nodes, intervened without centralized server, it is ensured that the personal information of user will not be provided by server
Quotient's tracking and leakage, and then ensure that the safety of userspersonal information.
Other feature and advantage of the disclosure will the following detailed description will be given in the detailed implementation section.
Specific embodiment
It is described in detail below in conjunction with specific embodiment of the attached drawing to the disclosure.It should be understood that this place is retouched
The specific embodiment stated is only used for describing and explaining the disclosure, is not limited to the disclosure.
It should be noted that the specification and claims of the disclosure and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being interpreted as specific sequence or precedence.
In order to make those skilled in the art be easier to understand the technical solution of embodiment of the present disclosure offer, first below to this
The communication system that the implementation method of the open instant messaging provided is applicable in is illustrated.As shown in Figure 1, Fig. 1 is shown according to one
Example property implements a kind of communication system schematic diagram of the implementation method suitable for instant messaging exemplified, which includes:
Multiple terminal devices 110 and multiple distributed storage nodes 120.
Wherein, terminal device 110 may is that mobile phone, tablet computer, computer, multimedia play equipment, intelligence are wearable
Equipment etc..It is configured with instant communication client in terminal device 110, instant communication client can be passed through between terminal device 110
Carry out instant messaging, such as transmission file, messaging etc..These terminal devices 110 are the section in block chain network 200
Point, section terminating equipment 110 can also be the manager node in block chain network 200, for its in block chain network 200
His node provides corresponding function, for example, check and verify the user to be registered of other nodes transmission identity it is whether legal.Block
Node in chain network 200 participates in maintenance block chain jointly.Wherein, in order to guarantee the communication security of instant messaging each side, block
Chain can be privately owned chain or alliance's chain, and correspondingly, manager node can also save other non-administrators in block chain network
Point setting corresponding authority, such as read the permission of block chain data, permission of data etc. is written to block chain.
Distributed storage node 120 can be the terminal device with communication and store function, can be used for storing immediately
The social informations such as the userspersonal information of communication parties and file, message.These distributed storage nodes 120 constitute interspace text
Part system (Inter Planetary File System, IPFS) 300.Optionally, distributed storage node 120 can use
The mode of distributed hashtable (Distributed Hash Table, DHT) stores information.
Further, terminal device 120 can establish P2P communication connection with each node in IPFS system 300, by this
P2P communication connection can send information to be stored to the interdependent node in IPFS system 300 and obtain letter from interdependent node
Breath.In addition, distributed storage node 120 is also possible to the node in block chain network 200.
Based on communication system shown in FIG. 1, the embodiment of the present disclosure provides a kind of implementation method of instant messaging.Such as Fig. 2 institute
Show, Fig. 2 is a kind of flow diagram of the implementation method of instant messaging shown according to an exemplary embodiment, this method application
In terminal device, method includes the following steps:
S201, the identity information of target user to be registered is sent to the manager node in block chain network.
Wherein, identity information can be used as the identity of the target user, and illustratively, identity information may include identity card
Number, user name etc..
As shown in figure 3, when registering new user, target user to be registered can be by the Instant Messenger that configures in terminal device
Letter client inputs its identity information, and terminal device is operated in response to the registration of target user, by the identity information of target user
The manager node being sent in block chain network carries out legitimacy to target user according to the identity information by manager node
Verifying.Illustratively, manager node is stored with the identity information of legitimate user, if inquiring the identity information phase with target user
Matched identity information can then determine that the target user is legal;Otherwise, then it is assumed that the target user is illegal.
If it is determined that the target user is illegal, manager node then sends target user's authentication failed message to terminal device;
If it is determined that the target user is legal, registration request, the registration is written in the intelligent contract that manager node is then disposed into block chain
Request generates corresponding registration code and the message that is proved to be successful for carrying the registration code is sent to this for triggering intelligent contract
Terminal device, wherein registration request may include the ostensible identity information such as user name of target user.
In addition, intelligent contract can also be Target Assignment related resource (such as the target user in response to the registration request
Memory space etc. of the relevant information on block chain).
S202, after receiving and being proved to be successful message, be distributed to distribution after the personal information of target user is encrypted and deposit
Storage node is stored.
Wherein, personal information can include but is not limited to: the account name of target user, account password, head portrait, link address
Information, contact method etc..
S203, the storage index information that distributed storage node returns is received.
Wherein, storage index information may include the distributed storage node letter for participating in storing target user's personal information
Breath, download path information etc..
It is worth noting that concrete mode and distribution that terminal device encrypts the personal information of target user
The concrete mode that memory node stores the personal information of target user, belong to well known to a person skilled in the art, this
It is no longer elaborated in open embodiment.
S204, the intelligent contract disposed into block chain write-in include the storage index information and the registration code of target user
Registration request, which executes following operation for triggering intelligent contract: being carried out according to the registration code to target user
Verifying;After determining target user by verifying, it will be set in the storage index information write-in block chain of target user and to terminal
It is standby to return to the message that succeeds in registration.
Further, registration request further includes the link address information of the terminal device of target user.Correspondingly, intelligence is closed
About in response to operation performed by the registration request further include: the link address information is written in block chain, so that block chain
Other nodes in network can get the link address information from block chain, so that other nodes in block chain network
Instant messaging connection can be established according to the terminal device of the link address information and target user.
Further, intelligent contract returns to Account Registration to terminal device and loses when determining that target user is unverified
Lose message.
Using the above method, user's registration function is realized based on block chain intelligence contract technology, by the personal information of user
It is distributed to distributed storage node after encryption to be stored, and obtained storage index information is written in block chain, utilizes
The decentralization of block chain and can not tamper, can be tampered to avoid the personal information of user.In addition, the personal letter of user
Breath is dispersed on each distributed storage node, and the transmission of information directly carries out among the nodes, is situated between without centralized server
Enter, it is ensured that the personal information of user will not be tracked and be revealed by provider server, and then ensure that userspersonal information
Safety.
Further, after target user succeeds in registration, target user can carry out logging in behaviour by instant communication client
Make, the logon operation that terminal device is inputted in response to target user, the write-in of Xiang Zhineng contract carries target user's logon information
The log on request of (such as landing time stamp, user name), the log on request update working as the target user for triggering intelligent contract
Preceding state, for example, being to have logged in by the status indication of the target user.
Further, after target user logs in successfully, good friend's operation can be added.Specifically, target user can be with
The identity information (user name of such as good friend) of good friend to be added is inputted by instant communication client, terminal device is in response to target
The addition good friend of user operates, and sends addition request message to the terminal device of good friend to be added, and receiving good friend's terminal
When the addition success response message that equipment returns, which is added in the buddy list being locally stored.Wherein, add
Adding request message may include the identity information of the identity information (user name of such as target user) of target user, good friend to be added
The session code of (user name of good friend such as to be added), the session code of target user and good friend to be added adds success response
Message may include the identity information (user name of such as target user) of target user, good friend to be added identity information (such as to
Add the user name of good friend), answer code, the session code of target user etc..
Further, target user can also carry out deleting good friend's operation.Specifically, target user can pass through instant messaging
Client inputs the identity information (user name of good friend such as to be deleted) of good friend to be deleted, and terminal device is in response to target user's
Good friend's operation is deleted, deletion request message is sent to the terminal device of good friend to be deleted, to indicate that the terminal of good friend to be deleted is set
It is standby to delete target user from the buddy list of the good friend to be deleted.Wherein, deletion request message may include that target is used
The identity information (user name of such as target user) at family, good friend to be deleted identity information (user name of good friend such as to be deleted),
The session code of target user and the session code of good friend to be added etc..
Further, the terminal device of target user can also be established logical with the terminal device of the good friend in its buddy list
Letter connection.In one possible implementation, as shown in figure 4, carrying is written to intelligent contract in the terminal device of target user
There is the information acquisition request of the identity information of target user good friend, the information acquisition request is for triggering intelligent contract according to the body
Part information reads the link address information of the good friend from block chain;End based on DHT agreement or PubSub agreement and the good friend
End equipment establishes communication connection, which can make target user and good friend carry out instant messaging, such as information receiving and transmitting, text
Part transmission etc..
Communication connection is established between instant communicating pair by DHT agreement or PubSub agreement, instant messaging can be made
Both sides hide the information such as oneself true identity and position, can protect individual subscriber privacy, while will not be taken by third party
Business supplier control, ensures the safety of instant messaging.
Next, being illustrated by different implement scenes to the instant messaging between target user and good friend.
Implement scene one: messaging
In one possible implementation, as shown in figure 5, being set in the terminal device of target user and the terminal of its good friend
After setting up above-mentioned communication connection, the terminal device of target user can be sent out by the communication connection to the terminal device of good friend
Online message is sent, the online message that the terminal device of good friend is sent can also be received by the communication connection.In addition, for each
The terminal device of instant messaging is participated in, which is locally stored the historical session message queue of user, the historical session
Record has the message back between the user and other contact persons to record in message queue, and the terminal device is sending and receiving
The historical session message queue can be updated after message.
Further, if the terminal device of target user and the terminal device of its good friend have not set up above-mentioned communication connection,
The terminal device of target user then carries the message upload request of message to be sent to the write-in of intelligent contract, and message upload is asked
It is real in the historical session message queue for seeking the terminal device for being routed to the good friend for triggering intelligent contract for the message to be sent
The offline transmission of existing message.
Further, as shown in fig. 6, terminal device can load the historical session message queue of target user from local,
And judge wherein to whether there is not sent message, if in the historical session message queue there are not sent message and terminal device
Communication connection is established between the receiving end of the not sent message, then the not sent message is sent to by this by the communication connection
The online transmission of message is realized in receiving end.
Further, if there are not sent message and the terminal device is not sent not with this in the historical session message queue
Communication connection is established between the receiving end of message, terminal device then carries the message of the not sent message to the write-in of intelligent contract
Upload request, the message upload request is for triggering the historical session that the not sent message is routed to the receiving end by intelligent contract
In message queue, the offline transmission of message is realized.
Further, terminal device can also read the offline message of other terminal devices transmission from block chain.Specifically,
The offline message acquisition request for carrying the identity information of target user can be written in terminal device to intelligent contract, this disappears offline
Breath acquisition request executes following operation for triggering intelligent contract: inquiring block chain according to the identity information, obtains target use
Family offline message to be received, and offline message is sent to terminal device.Then, offline message is added to mesh by terminal device
It marks in the corresponding historical session message queue of user.
Implement scene two: file transmission
In one possible implementation, as shown in fig. 7, being set in the terminal device of target user and the terminal of its good friend
After setting up communication connection, the file upload operation that terminal device can be inputted in response to target user, by mesh to be uploaded
Mark file distributing to distributed storage node is stored, and receives depositing for the file destination that these distributed storage nodes return
Store up index information.Then, terminal device carries storage index letter to the transmission of the terminal device of good friend by the communication connection
The file message of breath obtains target text from these distributed storage nodes according to the storage index information by good friend's terminal device
Part.Wherein, the storage index information of file destination may include participate in storage file destination distributed storage nodal information, under
Carry routing information etc..
Further, terminal device can also be in response to the file message that receives, according to the storage rope in file message
Fuse breath obtains corresponding file from relevant distributed storage node.
It is worth noting that terminal device can be by the corresponding DHT interface of IPFS system from relevant distributed storage section
Point obtains corresponding file.Wherein, DHT interface can be for example including the interface Func for obtaining distributed storage node ID
Self () Peer.ID, the interface Func Connect (peer for connecting the distributed storage node to peer node
PeerInfo) error, for obtaining the interface Func GetKey for the value by key index being stored in distributed node
Value (key string) (val [] byte, error) etc..
Further, file message further includes the type of file, and terminal device is after receiving file message, first according to text
Part type determines whether that file opening is downloaded automatically, if file type is multimedia file or picture format file, opens text
Part is downloaded automatically, i.e., obtains this document from corresponding distributed storage node according to the storage index information of this document;If file
Type is the other types file in addition to multimedia file and picture format file, then is not turned on file and downloads automatically, but
Prompting download information is exported first to prompt user, and when receiving the confirmation download instruction of user's input, according to this document
It stores index information and obtains this document from corresponding distributed storage node.
Wherein, the concrete mode and terminal device that distributed storage node stores file destination are deposited from distribution
The concrete mode that node obtains file destination according to storage index information is stored up, belongs to that well known to a person skilled in the art in this public affairs
It opens in embodiment and no longer elaborates.
Implement scene three: management and group
If target user is the administrator of target group, target user can also carry out group by instant communication client
Group modification operation, for example including but be not limited to: increase group members, delete group members, setting group administrator, shielding group members disappear
Breath, removal shielding group members etc..
In one possible implementation, as shown in figure 8, terminal device repairs target group in response to target user
Change operation, corresponding modification message generated according to modification operation information, and will modification message be sent to it is each in target group
Group members.For each group members, communicated to connect if terminal device is established with the terminal device of the group members, terminal device
Modification message is sent to the terminal device of the group members by the communication connection;If terminal device not with the terminal of the group members
Equipment establishes communication connection, and terminal device then carries group's message upload request of modification message, the group to the write-in of intelligent contract
Message upload request disappears the historical session for the terminal device that the modification message is routed to the group members for triggering intelligent contract
Cease queue.Wherein, modification message may include the body of the identity information (user name of such as target user) of target user, group members
Part information (user names of such as group members), the session code of target user and modification operation information.
The embodiment of the present disclosure also provides a kind of terminal device, as shown in figure 9, Fig. 9 is shown according to an exemplary embodiment
A kind of terminal device block diagram, which is the node in block chain network, which includes:
First sending module 901, for the identity information of target user to be registered to be sent to the block chain network
In manager node, the identity information for the manager node to the target user carry out legitimate verification and
Confirm the intelligent contract write-in registration request disposed in the legal backward block chain of the target user, the registration request is for touching
Send out intelligent contract described and sent to the terminal device carry registration code be proved to be successful message;
Second sending module 902, for receive it is described be proved to be successful message after, the individual of the target user is believed
It is distributed to distributed storage node after encryption for information to be stored, and receives the storage index letter that the distributed storage node returns
Breath;
First writing module 903, for including the registration code and storage index letter to the intelligent contract write-in
The registration request of breath, the registration request execute following operation for triggering the intelligent contract:
The target user is verified according to the registration code;
It, will be in the storage index information write-in block chain and to institute after determining the target user by verifying
It states terminal device and returns to the message that succeeds in registration.
Optionally, as shown in Figure 10, the registration request further includes the link address information of the terminal device, the behaviour
Work further includes that the link address information of the terminal device is written in the block chain;
The terminal device 900 further include:
Second writing module 904, for carrying the identity letter of the target user good friend to the intelligent contract write-in
The information acquisition request of breath, the information acquisition request be used to trigger the intelligent contract according to the identity information of the good friend from
The link address information of the good friend is read in the block chain;
Module 905 is obtained, for obtaining the account of the good friend from the DHT node according to the storage index cryptographic Hash
Description information, the account description information include the link address information of the good friend;
Connection establishment module 906, for being communicated based on DHT agreement or PubSub agreement with good friend's terminal device foundation
Connection, the communication connection carry out instant messaging for the target user and the good friend.
Optionally, as shown in Figure 10, the terminal device 900 further include:
Third sending module 907, if existing not in the historical session message queue being locally stored for the terminal device
It sends message and does not set up the communication connection between the terminal device and the receiving end of the not sent message, then Xiang Suoshu
Intelligent contract write-in carries the message upload request of the not sent message, and the message upload request is for triggering the intelligence
The not sent message is routed to the historical session message queue of the receiving end by energy contract.
Optionally, as shown in Figure 10, the terminal device 900 further include:
4th writing module 908, for carrying to the intelligent contract write-in identity information of the target user
Offline message acquisition request, the offline message acquisition request execute following operation for triggering the intelligent contract: according to institute
It states identity information and inquires the block chain, obtain target user offline message to be received and send the offline message
To the terminal device;
Adding module 909, for the offline message to be added to the target user corresponding historical session message team
Column.
Optionally, as shown in Figure 10, the terminal device 900 further include:
5th sending module 910 is deposited for file destination to be uploaded to be distributed to the distributed storage node
Store up and receive the storage index information for the file destination that the distributed storage node returns;
6th sending module 911, for by it is described communicate to connect carried to good friend's terminal device transmission it is described
The file message of the storage index information of file destination, the file message is for good friend's terminal device according to the target
The storage index information of file obtains the file destination from the distributed storage node.
Optionally, as shown in Figure 10, if the target user is the administrator of target group, the terminal device 900
Further include:
Generation module 912 is repaired for operating in response to the target user to the modification of the target group according to described
Change the modification message that operation generates;
7th sending module 913, for for each group members in the target group, if the terminal of the group members is set
It is standby to establish the communication connection with the terminal device of the target user, then it is communicated to connect by described by the modification message
Be sent to the terminal device of the group members, and if the member terminal device not with the terminal device of the target user establish
The communication connection, then carry group's message upload request of the modification message to the intelligent contract write-in, and the group disappears
Breath upload request is used to trigger the intelligent contract and the historical session that the modification message is routed to the member terminal equipment disappears
Cease queue.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each function mould
The division progress of block can according to need and for example, in practical application by above-mentioned function distribution by different functional modules
It completes, i.e., the internal structure of terminal device is divided into different functional modules, it is described above all or part of to complete
Function.The specific work process of foregoing description functional module, can refer to corresponding processes in the foregoing method embodiment, herein not
It repeats again.
Using above-mentioned terminal device, user's registration function is realized based on block chain intelligence contract technology, by the individual of user
Distributed storage node is distributed to after information encryption to be stored, and obtained storage index information is written in block chain,
Be utilized block chain decentralization and can not tamper, can be tampered to avoid the personal information of user.In addition, of user
On each distributed storage node, the transmission of information directly carries out people's information dispersion among the nodes, is not necessarily to centralization service
Device intervention, it is ensured that the personal information of user will not be tracked and be revealed by provider server, and then ensure that individual subscriber
The safety of information.
In addition, establishing communication connection between instant communicating pair by DHT agreement or PubSub agreement, it is based on the communication
Connection carries out instant messaging, and instant messaging both sides can be made to hide the information such as oneself true identity and position, can protect use
Family individual privacy, while will not be controlled by third party's service supplier, ensure the safety of instant messaging.
The embodiment of the present disclosure also provides a kind of computer readable storage medium, is stored thereon with computer program, the program
The step of a kind of implementation method for instant messaging that above method embodiment provides is realized when being executed by processor.
The embodiment of the present disclosure also provides a kind of terminal device, which is the node in block chain network, the terminal
Equipment includes: memory, is stored thereon with computer program;Processor, for executing the computer in the memory
Program, with realize above method embodiment provide a kind of instant messaging implementation method the step of.
Figure 11 is a kind of structural schematic diagram of the terminal device, and the terminal device 1100 as shown in figure 11 may include: place
Manage device 1101, memory 1102.The terminal device 1100 can also include multimedia component 1103, input/output (I/O) interface
One or more of 1104 and communication component 1105.
Wherein, processor 1101 is used to control the integrated operation of the terminal device 1100, to complete above-mentioned instant messaging
Implementation method in all or part of the steps.Memory 1102 is for storing various types of data to support to set in the terminal
Standby 1100 operation, these data for example may include any application program or side for operating on the terminal device 1100
The instruction of method and the relevant data of application program, such as contact data, the message of transmitting-receiving, picture, audio, video etc..
The memory 1102 can realize by any kind of volatibility or non-volatile memory device or their combination, such as quiet
State random access memory (Static Random Access Memory, abbreviation SRAM), the read-only storage of electrically erasable
Device (Electrically Erasable Programmable Read-Only Memory, abbreviation EEPROM), it is erasable to compile
Journey read-only memory (Erasable Programmable Read-Only Memory, abbreviation EPROM), may be programmed read-only storage
Device (Programmable Read-Only Memory, abbreviation PROM), and read-only memory (Read-Only Memory, referred to as
ROM), magnetic memory, flash memory, disk or CD.Multimedia component 1103 may include screen and audio component.Wherein
Screen for example can be touch screen, and audio component is used for output and/or input audio signal.For example, audio component may include
One microphone, microphone is for receiving external audio signal.The received audio signal can be further stored in storage
Device 1102 is sent by communication component 1105.Audio component further includes at least one loudspeaker, is used for output audio signal.I/
O Interface 1104 provides interface between processor 1101 and other interface modules, other above-mentioned interface modules can be keyboard, mouse
Mark, button etc..These buttons can be virtual push button or entity button.Communication component 1105 for the terminal device 1100 with
Wired or wireless communication is carried out between other equipment.Wireless communication, such as Wi-Fi, bluetooth, near-field communication (Near Field
Communication, abbreviation NFC), 2G, 3G or 4G or they one or more of combination, therefore corresponding communication
Component 1105 may include: Wi-Fi module, bluetooth module, NFC module.
In one exemplary embodiment, terminal device 1100 can be by one or more application specific integrated circuit
(Application Specific Integrated Circuit, abbreviation ASIC), digital signal processor (Digital
Signal Processor, abbreviation DSP), digital signal processing appts (Digital Signal Processing Device,
Abbreviation DSPD), programmable logic device (Programmable Logic Device, abbreviation PLD), field programmable gate array
(Field Programmable Gate Array, abbreviation FPGA), controller, microcontroller, microprocessor or other electronics member
Part is realized, for executing the implementation method of above-mentioned instant messaging.
In a further exemplary embodiment, a kind of computer readable storage medium including program instruction is additionally provided, it should
The step of implementation method of above-mentioned instant messaging is realized when program instruction is executed by processor.For example, this computer-readable is deposited
Storage media can be the above-mentioned memory 1102 including program instruction, and above procedure instruction can be by the processor of terminal device 1100
1101 execute to complete the implementation method of above-mentioned instant messaging.
The preferred embodiment of the disclosure is described in detail in conjunction with attached drawing above, still, the disclosure is not limited to above-mentioned reality
The detail in mode is applied, in the range of the technology design of the disclosure, a variety of letters can be carried out to the technical solution of the disclosure
Monotropic type, these simple variants belong to the protection scope of the disclosure.
It is further to note that specific technical features described in the above specific embodiments, in not lance
In the case where shield, it can be combined in any appropriate way.In order to avoid unnecessary repetition, the disclosure to it is various can
No further explanation will be given for the combination of energy.
In addition, any combination can also be carried out between a variety of different embodiments of the disclosure, as long as it is without prejudice to originally
Disclosed thought equally should be considered as disclosure disclosure of that.