Method and apparatus for processing abnormal processes of instant messaging chat data on the blockchain

By judging the abnormality of the blockchain opening interface and information status, closing the blockchain process, and entering the instant messaging chat process, the problem of abnormal data on-chain process affecting chat stability, ensuring the stability of chat and saving server resources.

CN116319637BActive Publication Date: 2025-06-20ZHONGQI LIANXIN (BEIJING) TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310258388.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-16
Publication Date
2025-06-20
Estimated Expiration
2043-03-16

AI Technical Summary

Technical Problem

In real-time communication scenarios, when the data is unblocked, the entire chat process is usually roughly stopped, resulting in poor stability of communication chats and poor linkage and abnormal linkage process is not easily detected, reducing the security of communication data being unblocked.

Method used

By obtaining the blockchain's opening interface status and opening information status, we can determine whether it is abnormal, and obtain specific abnormal data in abnormal situations, initialize the closing of the blockchain process, and enter the instant messaging chat process, so as to ensure the stability of the instant messaging chat when there is an abnormality in the blockchain function.

Benefits of technology

When the blockchain function is abnormal, avoid affecting the stability of instant messaging chats, and close the blockchain process running in the background without the user turning on the blockchain link to save server resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319637B_ABST
    Figure CN116319637B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for processing abnormal processes of instant messaging chat data on the blockchain, including: obtaining the status of the blockchain opening interface during the instant messaging chat of a user, and determining whether the status of the blockchain opening interface is normal; in the case of abnormal interface status, obtaining abnormal interface status data, initializing and closing the blockchain process, and entering the instant messaging chat process; in the case of normal interface status, obtaining the blockchain opening information data of the user, and determining whether the status of the blockchain opening information is normal; in the case of abnormal opening information status, obtaining abnormal opening information status data, initializing and closing the blockchain process, and entering the instant messaging chat process; in the case of normal opening information status, determining whether the blockchain on-chain link is enabled, and in the case of not being enabled, initializing and closing the blockchain process, and entering the instant messaging chat process. This method and device can ensure the stability of instant messaging chat even when the blockchain function is abnormal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of instant messaging, and in particular, to a method and device for processing abnormal processes of instant messaging chat data on the chain. Background Art

[0002] Instant messaging is software that realizes online chatting and communication through technology. Usually, chat messages are stored on the user's terminal device or the server of the service provider, and communication data is stored using a traditional database. Therefore, there is a possibility that the communication data may be tampered with or viewed by the service provider. In addition, there is a risk of loss when the data is stored by a single service provider. Based on the above problems, blockchain technology is used to store instant messaging data, aiming to solve problems such as preventing data tampering, data privacy protection, data security, and increasing data credibility through distributed multi-center storage.

[0003] When existing instant messaging data is on the chain, it is generally implemented according to the following steps: The user creates a blockchain account; the user enters a certain chat room. In this chat room, if any party enables the blockchain on-chain function, it means that all members of this chat room have enabled the blockchain on-chain function; any party among the chat room members acts as the initiator of the blockchain on-chain to enable the on-chain function; the initiator obtains the on-chain key information; the initiator selects the chat messages to be on the chain; uses the key to package and sign the chat messages; uses the packaging result to go on the chain; after the on-chain is successful or failed, informs all members of the chat room of the on-chain result; any member of the chat room uses the key information to view the data that has been on the chain. Currently, based on the above process, although the on-chain operation of communication data can be achieved, in the instant messaging scenario, if an exception occurs in the data on-chain process, generally, the entire chat process is roughly stopped, resulting in poor stability of communication chat; in addition, in addition to the inability to ensure the stability of communication chat when an exception occurs in the data on-chain process, there is also a situation where it is difficult to detect an abnormal on-chain process for existing instant messaging data when it is on the chain, thus reducing the security of the on-chain storage of communication data. Therefore, how to ensure the stability of instant messaging chat when an exception occurs in the blockchain function is a technical problem to be solved urgently. Summary of the Invention

[0004] In view of this, the present invention provides a method and device for processing abnormal processes of instant messaging chat data on the chain to solve one or more problems existing in the prior art.

[0005] According to one aspect of the present invention, the present invention discloses a method for processing abnormal processes of instant messaging chat data on the chain, and the method includes:

[0006] Obtain the status of the blockchain opening interface during the user's instant messaging chat, and determine whether the status of the blockchain opening interface is normal;

[0007] When the status of the blockchain startup interface is abnormal, obtain the abnormal interface status data, initialize and close the blockchain process, and enter the instant messaging chat process;

[0008] When the status of the blockchain startup interface is normal, obtain the blockchain startup information data of the user, and determine whether the status of the blockchain startup information is normal;

[0009] When the status of the blockchain startup information is abnormal, obtain the abnormal startup information status data, initialize and close the blockchain process, and enter the instant messaging chat process;

[0010] When the status of the blockchain startup information is normal, determine whether the blockchain uploading link is enabled. If the blockchain uploading link is not enabled, initialize and close the blockchain process, and enter the instant messaging chat process.

[0011] In some embodiments of the present invention, determining whether the status of the blockchain startup interface is normal includes:

[0012] Determine whether the SSL link request verification passes, verify the user's login permission and blockchain permission, and verify the device type used by the user;

[0013] If the SSL link request verification fails, the user's login permission fails, the blockchain permission fails, or the device type fails, then the status of the blockchain startup interface is an abnormal state; and / or

[0014] Determining whether the status of the blockchain startup information is normal includes:

[0015] Determine whether the current user is the blockchain initiator;

[0016] Determine whether the user has only one chat room with blockchain uploading enabled;

[0017] If it is determined that the current user is not the blockchain initiator or at least two chat rooms of the user have blockchain uploading enabled, then it is concluded that the status of the blockchain startup information is an abnormal state.

[0018] In some embodiments of the present invention, initializing and closing the blockchain process includes:

[0019] Determine whether the blockchain process is enabled;

[0020] If the blockchain process is not enabled, determine whether the blockchain initiator repeatedly enables the blockchain uploading link. If the initiator repeatedly enables the blockchain uploading link, close all the enabled blockchain links;

[0021] When the blockchain process has been started, determine whether the blockchain initiator repeats the opening of the blockchain on-chain link. In the case where the initiator repeats the opening of the blockchain on-chain link, close the blockchain link that does not match the started blockchain process. In the case where the initiator does not repeat the opening of the blockchain on-chain link, close the started blockchain process;

[0022] Modify the status of the chat information with the status of "ready for on-chain" or "on-chain" to "on-chain failed".

[0023] In some embodiments of the present invention, the method further includes:

[0024] Determine whether the key information has been cached;

[0025] In the case where the key information has not been cached, generate the key information and cache the key information;

[0026] In the case where the key information has been cached, open the blockchain on-chain link, and determine whether the blockchain on-chain initiator has opened multiple blockchain on-chain links;

[0027] In the case where multiple blockchain on-chain links have been opened, close the other blockchain on-chain links except the current chat room;

[0028] Start the blockchain on-chain process corresponding to the blockchain on-chain link of the current chat room.

[0029] In some embodiments of the present invention, generating the key information includes:

[0030] Verify whether the device type, APP signature, random code, user's login permission, blockchain account information, and SSL link request used by the user pass;

[0031] Generate the key information in the case where all pass.

[0032] In some embodiments of the present invention, the method further includes:

[0033] In the case where the key information has been cached, generate the actual key based on the cached key information;

[0034] In the case where the actual key is successfully generated, pack and sign the on-chain message based on the actual key;

[0035] In the case where the packing and signing are successful, perform on-chain of the to-be-on-chain message.

[0036] In some embodiments of the present invention, in the case where the actual key generation fails, delete the cached key information and close the blockchain on-chain process;

[0037] In the case of failed packaging and signing, delete the cached key information and close the blockchain uploading process.

[0038] In some embodiments of the present invention, the method further includes:

[0039] Decrypt the uploading information based on the actual key;

[0040] In the case of decryption failure, delete the cached key information and close the blockchain uploading process.

[0041] According to another aspect of the present invention, there is also disclosed a system for handling abnormal processes of instant messaging chat data uploading to the blockchain. The system includes a processor and a memory. Computer instructions are stored in the memory, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps of the method described in any one of the above embodiments.

[0042] According to still another aspect of the present invention, there is also disclosed a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, it implements the steps of the method described in any one of the above embodiments.

[0043] The method and apparatus for handling abnormal processes of instant messaging chat data uploading to the blockchain disclosed in the embodiments of the present invention first determine whether the status of the blockchain opening interface and the status of the blockchain opening information are abnormal based on the blockchain uploading initialization process. When the status is abnormal, specific abnormal data is obtained, and the blockchain process is initialized and closed, and the instant messaging chat process is entered. It can be seen that this application determines the status of the blockchain opening interface and the blockchain opening information during the initialization process to ensure the stability of instant messaging chat when the blockchain function is abnormal; in addition, when it is detected that the user has not opened the blockchain uploading link, the background-running blockchain process is also closed, thereby saving server resources on the premise of ensuring the stability of instant messaging chat.

[0044] The additional advantages, objects, and features of the present invention will be partially described below and will become partially apparent to those of ordinary skill in the art after studying the following text, or may be learned from the practice of the present invention. The objects and other advantages of the present invention can be realized and obtained by the specific structures pointed out in the written description, its claims, and the drawings.

[0045] Those skilled in the art will understand that the objects and advantages that can be achieved by the present invention are not limited to the above specifically described, and the above and other objects that the present invention can achieve will be more clearly understood according to the following detailed description. Description of the Drawings

[0046] The accompanying drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and do not limit the present invention. The components in the drawings are not drawn to scale, but are only for showing the principles of the present invention. To facilitate showing and describing some parts of the present invention, the corresponding parts in the drawings may be enlarged, that is, may become larger relative to other components in the exemplary device actually manufactured according to the present invention. In the drawings:

[0047] Figure 1 It is a schematic flowchart of a process exception handling method for instant messaging chat data to be uploaded to the blockchain according to an embodiment of the present invention.

[0048] Figure 2 It is a schematic flowchart of a blockchain upload initialization process according to an embodiment of the present invention.

[0049] Figure 3 It is a schematic flowchart of an initialization process for closing a blockchain process according to an embodiment of the present invention.

[0050] Figure 4 It is a schematic flowchart of a process for closing a blockchain link according to an embodiment of the present invention.

[0051] Figure 5 It is a schematic flowchart of a process for a sponsor to start blockchain upload according to an embodiment of the present invention.

[0052] Figure 6 It is a schematic flowchart of a process for chat messages to be uploaded to the blockchain according to an embodiment of the present invention.

[0053] Figure 7 It is a schematic flowchart of a process for decrypting and viewing uploaded data according to an embodiment of the present invention. Detailed implementation manners

[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer and more understandable, the following further describes the embodiments of the present invention in detail with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but do not limit the present invention.

[0055] Here, it should be noted that, in order to avoid obscuring the present invention due to unnecessary details, only the structures and / or processing steps closely related to the solution according to the present invention are shown in the drawings, while other details less related to the present invention are omitted.

[0056] It should be emphasized that the terms "include / comprise / have" when used herein refer to the presence of features, elements, steps, or components, but do not exclude the presence or addition of one or more other features, elements, steps, or components.

[0057] In the following, embodiments of the present invention will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0058] Figure 1 It is a schematic flowchart of a process exception handling method for uploading instant messaging chat data in an embodiment of the present invention. Refer to Figure 1 and the process exception handling method for uploading instant messaging chat data at least includes steps S10 to S50.

[0059] Step S10: Obtain the status of the blockchain opening interface during the user's instant messaging chat process, and determine whether the status of the blockchain opening interface is normal.

[0060] In this step, the user first enters the chat room. Before obtaining that the user has opened the blockchain upload link, first determine whether the status of the blockchain opening interface is normal to complete the initialization of the blockchain upload, so as to prevent abnormal blockchain processes from affecting the user's communication chat process. Among them, the conditions for determining whether the status of the blockchain opening interface is normal include whether the SSL certificate verification passes, whether the user login information is verified, and whether the device type verification passes, etc.; specifically, when verifying the user login information, mainly verify whether the logged-in user is an organizational structure user, whether the user has operated within 30 minutes, whether the user has blockchain permissions, and whether the user logged in this time is the same as the user logged in last time; when verifying the device type, mainly verify whether the logged-in device is a mobile device or a Web terminal.

[0061] Exemplarily, determining whether the status of the blockchain opening interface is normal includes: determining whether the SSL link request verification passes, verifying the user's login permissions and blockchain permissions, and verifying the device type used by the user; if the SSL link request verification fails, the user's login permissions fail, the blockchain permissions fail, or the device type fails, then the status of the blockchain opening interface is an abnormal state.

[0062] Step S20: In the case where the status of the blockchain opening interface is abnormal, obtain the interface status abnormal data, initialize and close the blockchain process, and enter the instant messaging chat process.

[0063] In this step, when it is determined that the status of the blockchain opening interface is abnormal, further initialize and close the blockchain process running in the background to enter the instant messaging chat process. Based on this step, it can be seen that when the blockchain upload service has an abnormality, it does not simply shut down the instant messaging process roughly, but only shuts down the blockchain process with abnormal phenomena, so that when the blockchain service has an abnormality, it does not affect the instant messaging chat other than the non-blockchain functions.

[0064] Step S30: When the blockchain opening interface is in a normal state, obtain the blockchain opening information data of the user and determine whether the blockchain opening information status is normal.

[0065] In this step, when it is determined that the blockchain opening interface is in a normal state, it is further determined whether the blockchain opening information data is normal. Among them, the conditions for determining whether the blockchain opening data information is normal include whether the random code verification passes, whether the user is the initiator, and whether only one chat room of the initiator has enabled the blockchain on-chain function, etc.

[0066] Exemplarily, determining whether the blockchain opening information status is normal includes: determining whether the current user is the blockchain initiator; determining whether the user has only one chat room enabled for blockchain on-chain; when it is obtained that the current user is not the blockchain initiator or at least two chat rooms of the user have enabled blockchain on-chain, it is concluded that the blockchain opening information status is an abnormal state.

[0067] Step S40: When the blockchain opening information status is abnormal, obtain the abnormal data of the opening information status, initialize and close the blockchain process, and enter the instant messaging chat process.

[0068] In this step, when it is determined that the blockchain opening information status is abnormal, the blockchain process running in the background is further initialized and closed to enter the instant messaging chat process. Based on this step, it can be seen that when the blockchain on-chain service has an abnormal opening information status, the instant messaging process is not brutally shut down, but only the blockchain process with abnormal phenomena is shut down. Thus, when the blockchain service is abnormal, it does not affect the instant messaging chat other than the non-blockchain functions.

[0069] Step S50: When the blockchain opening information status is normal, determine whether the blockchain on-chain link is enabled. If the blockchain on-chain link is not enabled, initialize and close the blockchain process and enter the instant messaging chat process.

[0070] In this step, even when it is obtained that both the blockchain opening interface status and the blockchain opening information status are normal, it is further determined whether the user has enabled the blockchain on-chain link. When it is determined that the blockchain has not enabled the blockchain on-chain link, the blockchain process is initialized and closed at this time. This step is to prevent data security and other problems caused by the accidental opening of the blockchain process due to abnormal blockchain services when the user has not enabled blockchain on-chain.

[0071] Figure 2 It is a schematic flowchart of the blockchain on-chain initialization process according to an embodiment of the present invention. Refer to Figure 2, in this embodiment, first, the user enters the chat page, and further, the foreground calls the "Prepare to Obtain the Blockchain Opening Status" interface to determine whether the blockchain opening interface status is abnormal. Specifically, determining whether the blockchain opening interface status is abnormal includes the background performing a validity check on the user. When it is determined that the user is valid, a random code is generated; the user validity check includes verifying the user login information; and when it is determined that the user is invalid, it can be concluded that the blockchain opening interface status is abnormal. At this time, the already opened blockchain link is further closed, and an "Invalid User" error code is returned; based on the above steps, when it is concluded that the blockchain opening interface status is abnormal, the abnormal status is recorded, and the blockchain on-chain process is initialized and closed, so as to enter the communication chat process and normal chat can be carried out. When it is concluded that the blockchain opening interface status is normal, the foreground further calls the "Obtain Blockchain Opening Information" interface to enter the blockchain opening information status judgment process, that is, to obtain the blockchain opening information; specifically, after the background queries the blockchain opening information, it further determines whether the blockchain initiator has initiated multiple on-chain links; when the initiator has initiated multiple on-chain links, an "Open Repeatedly" error code is returned; based on the above steps, it can be concluded whether the blockchain opening information status is abnormal. When the blockchain opening information status is abnormal, the abnormal status is recorded, and the blockchain on-chain process is initialized and closed, so as to enter the communication chat process and normal chat can be carried out. When the blockchain opening information status is normal, it is further determined whether the user has opened the blockchain on-chain link; when not opened, the blockchain on-chain process is initialized and closed, so as to enter the communication chat process for normal chat; when opened, it is further determined whether the current user is the initiator. When it is the initiator, it is determined that under the condition that the blockchain opening interface status is normal and the blockchain opening information status is normal, the user has initiated the blockchain on-chain link. At this time, the blockchain on-chain process is correspondingly started, and the communication chat process is further entered to ensure the consistency of the blockchain process and the initiation of the blockchain link; on the contrary, if it is concluded that the user has not initiated the blockchain on-chain link, the communication chat process is directly entered at this time.

[0072] It can be seen from this specific embodiment that when any one of the blockchain opening interface status and the blockchain opening information status appears abnormal, the blockchain process is initialized and closed, and the ordinary communication chat process is entered; and even when both the blockchain opening interface status and the blockchain opening information status are normal, it is further determined whether the user has opened the blockchain link, and whether the user is the initiator and whether the user has simultaneously initiated the blockchain on-chain link in other chat rooms except the current chat room. Based on the method disclosed in this embodiment, it can be ensured that only one user in the same chat room opens the blockchain on-chain function; and it can be ensured that only one chat room of the initiator opens the blockchain on-chain function, and it can be ensured that when the blockchain function is abnormal, the user can also chat normally.

[0073] In one embodiment, initializing and closing the blockchain process includes: determining whether the blockchain process is enabled; in the case where the blockchain process is not enabled, determining whether the blockchain initiator repeatedly enables the blockchain on-chain link, and in the case where the initiator repeatedly enables the blockchain on-chain link, closing all enabled blockchain links; in the case where the blockchain process is enabled, determining whether the blockchain initiator repeatedly enables the blockchain on-chain link, and in the case where the initiator repeatedly enables the blockchain on-chain link, closing the blockchain links that do not match the enabled blockchain process, and in the case where the initiator does not repeatedly enable the blockchain on-chain link, closing the enabled blockchain process; modifying the status of chat information with the status of being ready for on-chain or in the process of on-chain to on-chain failure.

[0074] In this embodiment, it is further determined whether the blockchain process is enabled in the background. When the blockchain process is not enabled, the blockchain links enabled by the user are directly closed. When the blockchain process is enabled, the blockchain links repeatedly enabled by the user are further closed. Based on this limitation, the number of blockchain processes running in the background matches the number of enabled blockchain links.

[0075] Figure 3 The flowchart of initializing and closing the blockchain process according to an embodiment of the present invention is as follows Figure 3 As shown, in this embodiment, it is first determined whether the on-chain process has been enabled; if the on-chain process has not been enabled, it is further determined whether the initiator repeatedly enables the on-chain link. If it is repeatedly enabled, the background is notified to close all enabled blockchain links. If there is no repeated enabling, the process ends. If the on-chain process has been enabled, it is further determined whether the initiator repeatedly enables the on-chain link. If it is repeatedly enabled, the background is notified to close the other blockchain links except the currently enabled blockchain link, that is, to repair the abnormality of repeated enabling, retain the on-chain function of the current chat room, and the process ends; when the on-chain process has been enabled and the initiator does not repeatedly enable the on-chain link, the on-chain process is closed, and the background is notified to execute the process of "closing the enabled blockchain links". After closing the on-chain process and the on-chain links, the chat messages with the status of being ready for on-chain and in the process of on-chain are further retrieved, and the status of the chat information is changed to on-chain failure to ensure the correct display of abnormal data and that abnormal data will not be automatically on-chain. From the above, it can be seen that in this embodiment, abnormal data is repaired, ensuring the correct display of abnormal data and that abnormal data will not be automatically on-chain.

[0076] In addition, in this embodiment, if the initiator enables multiple blockchain links, the foreground is informed which chat room's on-chain function to retain, ensuring that the initiator has and only has one chat room with the blockchain on-chain function enabled.

[0077] Exemplarily, Figure 4 The flowchart of closing the blockchain link according to an embodiment of the present invention is shown in referenceFigure 4 In the process of closing the opened blockchain link process in the background, the following main processes are included: First, it is judged whether the user is the initiator; if not, the process ends; if the user is the initiator, then the on-chain link of the specified chat room is further closed; after the on-chain link is closed, the abnormal data is further repaired, that is, all chat messages with the status of "on-chain preparation" and "on-chain in progress" are retrieved, and their status is changed to "on-chain failure" to ensure the correctness of the abnormal data and the consistency of the foreground and background data.

[0078] In some embodiments of the present invention, the method for processing abnormal processes of instant messaging chat data on-chain further includes the following steps: judging whether the key information has been cached; in the case where the key information has not been cached, generating the key information and caching the key information; in the case where the key information has been cached, opening the blockchain on-chain link, and judging whether the blockchain on-chain initiator has opened multiple blockchain on-chain links; in the case where multiple blockchain on-chain links have been opened, closing the other blockchain on-chain links except the current chat room; opening the blockchain on-chain process corresponding to the blockchain on-chain link of the current chat room.

[0079] As Figure 5 shown, in this embodiment, first, the foreground judges the abnormal state of the chat room. If the chat room is abnormal, the on-chain function cannot be opened, and the process ends at this time. If the chat room is normal, then it is further judged whether the key information has been cached. If not, a random code and key information are obtained from the background. After the background generates the key information, the on-chain key information is returned; after the foreground caches the on-chain key information, a request is further sent to the background to establish a blockchain on-chain link, and the background judges whether the on-chain function has been established; if the background has not established it, a blockchain on-chain link is established; if the background has already established the on-chain link, it is further judged whether the initiator has initiated multiple blockchain on-chain links. If so, the other on-chain links except the current chat room are closed; after the background link is successfully established, the foreground opens the blockchain on-chain process, and the process ends. In this embodiment, specifically, the legality of the foreground device can also be verified, and the on-chain key information is generated under the condition of legality; and during the process of the initiator opening the blockchain on-chain, it is ensured that only one person in the chat room opens the blockchain on-chain function, and it is ensured that only one chat room of the initiator opens the blockchain on-chain function.

[0080] Furthermore, generating the key information specifically includes: verifying whether the device type, APP signature, random code, user's login permission, blockchain account information, and SSL link request used by the user pass; generating the key information in the case where all pass.

[0081] Specifically, the conditions for verifying whether the device type passes, for example, can be to verify whether the device type is a mobile device or a Web terminal; and the conditions for the foreground to verify that the APP signature passes can include: the APP used is an official APP, which can prevent illegal users from decompiling the app code and attacking and stealing the key information for going on-chain; the user's login permission is used to verify the validity of the user. For example, if the user is an organizational structure user and has an operation within 30 minutes, the user has blockchain permission, and the user's login information is not the information of the last login. In addition to verifying the validity of the user, it is also possible to further verify whether the user's enterprise real-name authentication passes; the passing conditions for blockchain account verification, for example, can be whether the account has been created and whether the account status is valid. When generating the key information, in addition to verifying the above conditions, it is also possible to further verify the timeliness of the key information for going on-chain, and the passing conditions can include, for example: the SSL certificate is valid, and the generation time of the random key factor is within the time limit.

[0082] In another embodiment, the method for processing abnormal processes of instant messaging chat data going on-chain further includes the following steps: in the case where the key information has been cached, generating an actual key based on the cached key information; in the case where the actual key is successfully generated, packing and signing the message to be uploaded based on the actual key; in the case where the packing and signing are successful, uploading the message to be uploaded.

[0083] Further, in the case where the actual key generation fails, delete the cached key information and close the blockchain uploading process; in the case where the packing and signing fail, delete the cached key information and close the blockchain uploading process.

[0084] Figure 6 It is a schematic diagram of the process of chat message going on-chain according to an embodiment of the present invention. Refer to Figure 6 , in this embodiment, first, it is judged whether the key information is cached. If not, the processes of "closing the uploading process" and "obtaining the key information for going on-chain" are sequentially executed; when the key information is cached, an actual key is further generated through the key information. If the actual key generation fails, the process of "closing the uploading process" is further executed, and the current uploading process ends; if the actual key is successfully generated, the message is further packed and signed using the actual key; if the signature fails, the cached key information is deleted, and the process of "closing the uploading process" is executed; if the signature is successful, a request for going on-chain is sent to the background. In this embodiment, deleting the key information and closing the uploading process can enable the user to update the key information for going on-chain and prepare for the next uploading.

[0085] Among them, during the process of generating the actual key based on the cached key information, it is further determined whether the actual key is abnormal. For example, it is first determined that the user has logged in; the cached blockchain SSL certificate of the foreground device has been permanently stored and the verification of the blockchain SSL certificate has passed; the aging verification of the generation time of the cached random key factor has passed; the signature verification of the foreground app has passed; the key ciphertext has been successfully generated; and the private key cached is used to decrypt the key ciphertext, and the actual key required for decryption can be successfully obtained. Among them, when verifying whether the key ciphertext has been successfully generated, it can be calculated based on the cached user blockchain number, enterprise blockchain number, random key factor, and data to be uploaded to the blockchain of the current user through a preset algorithm.

[0086] In another embodiment, the process exception handling method for instant messaging chat data uploading to the chain further includes the following steps: decrypting the data uploaded to the chain based on the actual key; in the case of decryption failure, deleting the cached key information and closing the blockchain uploading process. This embodiment realizes the process of decrypting and viewing the data uploaded to the chain.

[0087] Figure 7 This is a schematic diagram of the process for decrypting and viewing the data uploaded to the chain in an embodiment of the present invention. Refer to Figure 7 , in the process of decrypting and viewing the data uploaded to the chain, first execute the "generate actual key" process, and then decrypt the data uploaded to the chain; if the decryption is successful, display the decryption result, and if the decryption fails, delete the cached key information and execute the "close the uploading process to the chain" process. In this embodiment, the purpose of deleting the key information and closing the uploading process to the chain is as follows: a) For legitimate users: it can update the key information uploaded to the chain to repair the problem of inability to view. b) For illegal users: it can prevent the data on the chain from being viewed by illegal users and protect the privacy and security of user data.

[0088] In other embodiments, when the following abnormal situations occur, the background can also automatically close the opened blockchain link. For example, when the foreground does not initiate an uploading request to the chain for 30 consecutive minutes, when the user exits or switches devices, and when the balance of the current user account is insufficient or the account is disabled. The background automatically closes the opened blockchain link to automatically recycle the link resources when the user has not used the uploading function to the chain for a long time; and for the uploading message whose uploading time exceeds 30 minutes and the uploading status is in the process of uploading to the chain, its status can be further changed to "uploading failed". This setting can repair abnormal data and ensure the correct display of abnormal data.

[0089] As can be seen from the above embodiments, the method for processing abnormal processes of instant messaging chat data on the blockchain in the present invention can ensure that only one person in the chat room enables the blockchain on-chain function, and can ensure the normal operation of the blockchain on-chain function of the initiator and that only one chat room enables the blockchain on-chain function. In addition, when the blockchain function is abnormal, users can still conduct normal communication and chat; and when the blockchain on-chain function of the user is normal, blockchain services are provided. In addition to the above, the method for processing abnormal processes of instant messaging chat data on the blockchain in the present application can also repair abnormal data, ensure the correct display of abnormal data, and ensure that abnormal data is not automatically uploaded to the blockchain; in addition, by verifying the legality of the foreground device, the foreground on-chain key information is generated and given only when it is legal, ensuring the security of the data; and when the user has not used the on-chain function for a long time, the link resources are automatically recycled, improving the server performance; and the abnormal data is repaired to ensure the correct display of the abnormal data.

[0090] Correspondingly, the present invention also discloses a system for processing abnormal processes of instant messaging chat data on the blockchain. The system includes a processor and a memory. Computer instructions are stored in the memory, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps of the method described in any of the above embodiments.

[0091] The method and device for processing abnormal processes of instant messaging chat data on the blockchain disclosed in the embodiments of the present invention first determine whether the blockchain opening interface status and the blockchain opening information status are abnormal based on the blockchain on-chain initialization process. When the status is abnormal, specific abnormal data is obtained, and the blockchain process is initialized and closed, and the instant messaging chat process is entered. It can be seen from this that the present application determines the status of the blockchain opening interface and the blockchain opening information during the initialization process to ensure the stability of instant messaging chat when the blockchain function is abnormal; in addition, when it is detected that the user has not enabled the blockchain on-chain link, the background-running blockchain process is also closed, thereby saving server resources on the premise of ensuring the stability of instant messaging chat.

[0092] In addition, the invention also discloses a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the steps of the method described in any of the above embodiments.

[0093] Those of ordinary skill in the art should understand that the various exemplary components, systems, and methods described in connection with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Specifically, whether to implement in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, and so on. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted via a data signal carried in a carrier wave over a transmission medium or a communication link. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical discs, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.

[0094] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, can be different from the order in the embodiments, or several steps can be executed simultaneously.

[0095] In the present invention, the features described and / or illustrated for one embodiment can be used in the same or a similar manner in one or more other embodiments, and / or combined with the features of other embodiments or replace the features of other embodiments.

[0096] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, various changes and modifications can be made to the embodiments of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for processing abnormal processes of instant messaging chat data on the chain, characterized in that, The method includes: Obtain the status of the blockchain enabling interface during the instant messaging chat of the user, and determine whether the status of the blockchain enabling interface is normal; In the case where the status of the blockchain enabling interface is abnormal, obtain the abnormal data of the interface status, initialize and close the blockchain process, and enter the instant messaging chat process; In the case where the status of the blockchain enabling interface is normal, obtain the blockchain enabling information data of the user, and determine whether the status of the blockchain enabling information is normal; In the case where the status of the blockchain enabling information is abnormal, obtain the abnormal data of the enabling information status, initialize and close the blockchain process, and enter the instant messaging chat process; In the case where the status of the blockchain enabling information is normal, determine whether the blockchain uploading link is enabled. In the case where the blockchain uploading link is not enabled, initialize and close the blockchain process, and enter the instant messaging chat process; Determining whether the status of the blockchain enabling information is normal includes: Determine whether the current user is the initiator of the blockchain; Determine whether only one chat room of the user has enabled blockchain uploading; In the case where it is determined that the current user is not the initiator of the blockchain or at least two chat rooms of the user have enabled blockchain uploading, it is concluded that the status of the blockchain enabling information is an abnormal state; Among them, during the process of the initiator enabling blockchain uploading, only one person in the chat room enables the blockchain uploading function.

2. The method for processing abnormal processes of instant messaging chat data on the chain according to claim 1, characterized in that, Determining whether the status of the blockchain enabling interface is normal includes: Determine whether the SSL link request verification passes, verify the login permission and blockchain permission of the user, and verify the device type used by the user; In the case where the SSL link request verification fails, the user's login permission fails, the blockchain permission fails, or the device type fails, the status of the blockchain enabling interface is an abnormal state.

3. The method for processing abnormal processes of instant messaging chat data on the chain according to claim 1, characterized in that, Initializing and closing the blockchain process includes: Determine whether the blockchain process is enabled; In the case where the blockchain process is not enabled, determine whether the blockchain initiator repeatedly enables the blockchain uploading link. In the case where the initiator repeatedly enables the blockchain uploading link, close all the enabled blockchain links; In the case where the blockchain process is enabled, determine whether the blockchain initiator repeatedly enables the blockchain uploading link. In the case where the initiator repeatedly enables the blockchain uploading link, close the blockchain links that do not match the enabled blockchain process. In the case where the initiator does not repeatedly enable the blockchain uploading link, close the enabled blockchain process; Modify the status of the chat information with the status of being ready for uploading or in the process of uploading to the status of uploading failure.

4. The method for processing abnormal processes of instant messaging chat data on the chain according to claim 1, characterized in that, The method further includes: Determine whether the key information has been cached; In the case where the key information has not been cached, generate the key information and cache the key information; In the case where the key information has been cached, enable the blockchain uploading link, and determine whether the blockchain uploading initiator has enabled multiple blockchain uploading links; In the case where multiple blockchain uploading links are enabled, close the other blockchain uploading links except the current chat room; Enable the blockchain uploading process corresponding to the blockchain uploading link of the current chat room.

5. The method for processing abnormal processes of instant messaging chat data on the chain according to claim 4, characterized in that, Generating the key information includes: Verify whether the device type, APP signature, random code, user's login permission, blockchain account information, and SSL link request used by the user pass; Generate key information when all pass.

6. The method for processing abnormal processes of instant messaging chat data on the chain according to claim 4, characterized in that, The method further includes: When key information has been cached, generate an actual key based on the cached key information; When the actual key is successfully generated, pack and sign the message to be uploaded to the chain based on the actual key; When the packing and signing are successful, upload the message to be uploaded to the chain.

7. The method for processing abnormal processes of instant messaging chat data being chained according to claim 6, wherein, When the generation of the actual key fails, delete the cached key information and close the blockchain uploading process; When the packing and signing fail, delete the cached key information and close the blockchain uploading process.

8. The method for processing abnormal processes of instant messaging chat data being chained according to claim 6, wherein, The method further includes: Decrypt the information uploaded to the chain based on the actual key; When the decryption fails, delete the cached key information and close the blockchain uploading process.

9. A system for processing abnormal processes of instant messaging chat data being chained, the system comprising a processor and a memory, wherein, The memory stores computer instructions, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps of the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Evidence obtaining method and device based on block chain, computer equipment and storage medium

    CN114491660A