A doctor-patient platform instant communication method and system
By employing authentication, data encryption, and adaptive transmission delay adjustment for both the MQTT client and server, the security and privacy issues of traditional instant messaging solutions in the medical field are resolved, enabling secure and reliable transmission of information between doctors and patients.
Patent Information
- Application Number
- CN202411880018.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2044-12-19
AI Technical Summary
Traditional instant messaging solutions in the medical field suffer from insufficient security, poor privacy, high risks of data sharing, and limited and costly communication methods, failing to meet the information exchange needs between doctors and patients.
An authentication mechanism based on MQTT client and server is adopted to ensure the authenticity of identity through multiple verifications. Identifier and message content fields are defined, data is encrypted and a signature packet is generated, and transmission delay is calculated and adaptively adjusted to ensure the security and privacy of data transmission.
It improves the security and privacy of doctor-patient communication, reduces the risk of data leakage, enhances the reliability and efficiency of communication, and ensures the integrity and accuracy of information.
Smart Images

Figure CN119675969B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of instant messaging technology, and in particular to an instant messaging method and system for a doctor-patient platform. Background Technology
[0002] With the rapid development of the Internet, instant messaging has become an indispensable part of people's daily life and work. Instant messaging systems based on the lightweight protocol MQTT are widely used in fields such as medical care, industry, and smart homes. In the medical field, doctor-patient instant messaging systems can significantly improve the efficiency of real-time information transmission and provide patients with timely medical service support.
[0003] Traditional instant messaging solutions rely on third-party platforms, incurring substantial annual service fees based on traffic growth. Data is shared with other platforms, compromising the security and privacy of patient treatment data. Limited chat scenarios fail to meet the needs of doctor-patient communication regarding reports, prescriptions, and other information exchange. Furthermore, traditional instant messaging solutions typically depend on simple authentication and data transmission mechanisms, which are prone to authentication failures, data delays, and inadequate security in dynamic network environments or large-scale data interactions. Therefore, improving the security and privacy of doctor-patient communication is a pressing issue that needs to be addressed. Summary of the Invention
[0004] This invention provides a method and system for real-time communication between doctors and patients, the main purpose of which is to improve the security and privacy of doctor-patient communication.
[0005] To achieve the above objectives, the present invention provides a real-time communication method for a doctor-patient platform, comprising:
[0006] Launch the doctor-patient instant messaging application and perform authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application to obtain authentication parameters;
[0007] Determine whether authentication was successful based on the verification parameters;
[0008] If authentication fails, return to the steps described above for authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application;
[0009] If authentication is successful, define the identifier content field and the message content field;
[0010] Retrieve historical data, construct a display format set based on the identified content field, and update the data based on the display format set and the message content field to obtain the updated data;
[0011] Based on the updated data, real-time data is sent, and the real-time data is encrypted and a signature is generated to obtain encrypted data and a verification signature package.
[0012] Data is sent based on the encrypted data and the verification signature packet, and the transmission delay is calculated;
[0013] Determine whether the transmission delay is within the preset delay range;
[0014] If the transmission delay is outside the delay range, adaptive adjustment is performed and verification is carried out according to the verification signature packet to obtain verification data;
[0015] If the transmission delay is within the delay range, the verification is performed according to the verification signature packet to obtain verification data and complete the communication.
[0016] Optionally, the definition of the identifier content field and the message content field includes:
[0017] Set the identifier field id and the identifier field type. The identifier field id is msgType, and the identifier field type includes: type 1, type 2, type 3, type 4 and type 5.
[0018] Message types are defined based on types 1, 2, 3, 4 and 5, where message types include: text messages, voice messages, image messages, treatment suggestions and treatment reports, and type 1 corresponds to text messages, type 2 corresponds to voice messages, type 3 corresponds to image messages, type 4 corresponds to treatment suggestions and type 5 corresponds to treatment reports.
[0019] The identifier content field is defined based on the identifier field id, msgType, identifier field type (type 1, type 2, type 3, type 4, type 5), message type (text message, voice message, image message), treatment suggestion, and treatment report.
[0020] Set the message field ID and message field type ID. The message field ID is msgContent, and the message field type ID includes: text, audioFile, imgFile, suggest, and reportData.
[0021] The message content field is defined based on the message field id, msgContent, message field type id, text, audioFile, imgFile, suggest, and reportData.
[0022] Optionally, constructing the display format set based on the identifier content field includes:
[0023] Set text limits and construct a text representation format based on the identified content field and the text limits. The text representation format is a text box that supports inputting multiple lines of text. When the input text in a single line exceeds the text limit, it will automatically wrap to the next line.
[0024] Set an audio length limit. Construct an audio representation format based on the identifier content field and the audio length limit. The audio representation format is a horizontal bar in blue color. The duration of the audio is displayed on the bar and cannot exceed the audio length limit.
[0025] An image representation format is constructed based on the identifier content field, and the doctor's name and avatar are set. The suggestion representation format is constructed using the doctor's name and avatar. The suggestion representation format is a long bar module containing the doctor's name, avatar, and treatment suggestions.
[0026] Obtain the average usage duration, treatment report date, average assessment index, and average treatment index, and construct a report representation format based on the average usage duration, treatment report date, average assessment index, and average treatment index;
[0027] A set of display formats is constructed based on the aforementioned text representation format, audio representation format, image representation format, suggestion representation format, and report representation format.
[0028] Optionally, the step of encrypting and signing real-time data to obtain encrypted data and a verification signature packet includes:
[0029] Based on the real-time data, the message type is determined to obtain the real-time data type.
[0030] When the real-time data type is an image message, the real-time data is encrypted to obtain encrypted image data, and the encrypted image data is converted into encrypted data using a preset data conversion method;
[0031] When the real-time data type is text message, voice message, treatment suggestion and treatment report, the data conversion method described above is used to convert the real-time data into encrypted data;
[0032] A signature is generated based on the encrypted data to obtain a verification signature packet.
[0033] Optionally, the step of encrypting real-time data to obtain encrypted image data includes:
[0034] Based on the real-time data, a real-time image is obtained, and the image size of the real-time image is acquired, wherein the image size includes: image height and image width;
[0035] Based on the real-time image and its size, determine whether the real-time image is square;
[0036] If the real-time image is not square, then the edges are adjusted based on the image height and image width to obtain an adjusted image. The adjusted size of the adjusted image is obtained, the real-time image is updated using the adjusted image, the image size is updated using the adjusted size, and the steps of determining whether the real-time image is square based on the real-time image and image size are returned.
[0037] If the real-time image is a square, then perform equalization on the real-time image to obtain an enhanced image;
[0038] A coordinate system is established, an initial segmentation size is set, and the enhanced image is divided based on the initial segmentation size to obtain a tile set, wherein the tile set consists of non-overlapping rectangular tiles;
[0039] Based on the tile set, a disordered tile set is obtained. A horizontal and vertical tile index are set. The horizontal and vertical coordinates of pixels are extracted based on a coordinate system. Texture complexity is calculated based on the disordered tile set and rectangular tiles. A logarithmic distribution is calculated based on the tile horizontal and vertical indices, pixel horizontal and vertical coordinates, and texture complexity.
[0040]
[0041] in, The x-coordinate of the pixel is The pixel ordinate is The logarithmic distribution, Points to the floor symbol. The horizontal index of the map block is The vertical index of the map is Texture complexity;
[0042] Calculate the minimum segment size based on the logarithmic distribution, and set the segmentation texture threshold;
[0043] Determine if the texture complexity is greater than the texture segmentation threshold;
[0044] If the texture complexity is greater than the texture segmentation threshold, then segmentation is performed based on the minimum segmentation size to obtain segmented patches. The segmentation complexity is calculated based on the segmented patches, the texture complexity is updated using the segmentation complexity, and the above steps of determining whether the texture complexity is greater than the texture segmentation threshold are returned.
[0045] If the texture complexity is not greater than the segmentation texture threshold, the segmented tiles are encrypted to obtain encrypted image data.
[0046] Optionally, calculating the minimum segment size based on the logarithmic distribution includes:
[0047] Calculate the minimum segment size based on the initial segment size and the logarithmic distribution:
[0048]
[0049] in, The x-coordinate of the pixel is The pixel ordinate is The minimum partition size, This refers to the initial segment size.
[0050] Optionally, encrypting the segmented image tiles to obtain encrypted image data includes:
[0051] Obtain the dynamic key, tile identifier, original pixel horizontal index, and original pixel vertical index. Generate encrypted random numbers based on the dynamic key, tile identifier, original pixel horizontal index, original pixel vertical index, preset pseudo-random algorithm, and random function:
[0052]
[0053] in, The original pixel horizontal index is The original pixel vertical index is Encrypted random numbers, Refers to pseudo-random algorithms. Refers to dynamic key. The XOR operation. Refers to a random function. Refers to the block identifier;
[0054] Obtain the original pixel value, and construct an encryption function based on the encrypted random number and the original pixel value:
[0055]
[0056] in, The original pixel horizontal index is The original pixel vertical index is encryption function, The original pixel horizontal index is The original pixel vertical index is The original pixel values, Modulo operation;
[0057] The segmented image tiles are encrypted using the encryption function to obtain encrypted image data.
[0058] Optionally, the step of generating a signature based on the encrypted data to obtain a verification signature packet includes:
[0059] Set an encryption prefix, and calculate a data digest based on the encryption prefix, a random function, and the encrypted data:
[0060]
[0061] in, Refers to data summary, Refers to the encryption prefix. Refers to encrypted data;
[0062] Set a salt value length threshold, and dynamically generate random salt values based on a preset random number generator and the salt value length threshold;
[0063] Obtain the encryption function and encryption private key, and generate a verification signature based on the random salt value, data digest, encryption function, and encryption private key:
[0064]
[0065] in, Refers to verifying the signature. Refers to encryption functions. Refers to the encrypted private key. Refers to random salt value;
[0066] Construct a verification signature package based on the random salt value and the verification signature:
[0067]
[0068] in, Refers to verifying the signature package.
[0069] Optionally, the calculation of transmission delay includes:
[0070] Obtain the processing time and confirmation time, and calculate the protocol delay based on the processing time and confirmation time:
[0071]
[0072] in, This refers to a delay in the agreement. This refers to processing time. Refers to the confirmation time;
[0073] Obtain network latency, data size, and decryption rate; calculate transmission latency based on the protocol latency, network latency, data size, and decryption rate.
[0074]
[0075] in, Refers to transmission delay. Network latency, Refers to data size. This refers to the decryption rate. Refers to the transmission delay. This refers to reception delay.
[0076] To achieve the above objectives, the present invention also provides a doctor-patient platform instant messaging system, comprising:
[0077] An authentication module is used to receive torque adjustment commands and activate a pre-built system adjustment unit based on the torque adjustment commands. The system adjustment unit includes a data acquisition unit, a data transmission unit, an interference estimation unit, and a data analysis unit. The data acquisition unit is used to acquire the lateral sway angle and lateral angular velocity of the electric-assisted bicycle to obtain a transmission data set.
[0078] The data update module is used to determine whether the transmission delay is within a preset delay range; if the transmission delay is not within the delay range, a data packet size threshold is set, and the transmission data packet set is filtered based on the data packet size threshold to obtain a standard data packet set and an over-limit data packet set. The over-limit data packets in the over-limit data packet set are split to obtain an adjusted data packet set. The standard data packet set and the adjusted data packet set are integrated to obtain an integrated data packet set. The transmission data packet set is updated using the integrated data packet set, and the steps described above for calculating the transmission delay of the data transmission unit using the transmission data packet set are returned.
[0079] The delay calculation module is used to transmit the lateral swing angle and lateral swing angular velocity to the interference estimation unit and calculate the external interference estimate if the transmission delay is within the delay range.
[0080] The signature verification module is used to transmit the estimated value of external interference to the data analysis unit using the data transmission unit and to calculate the lateral sway angle acceleration using the estimated value of external interference; calculate the lateral sway torque based on the lateral sway angle acceleration, calculate the yaw torque, and adjust the torque according to the lateral sway torque and yaw torque in real time communication, and complete the torque adaptive adjustment according to the adjusted torque.
[0081] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:
[0082] Memory, storing at least one instruction;
[0083] The processor executes the instructions stored in the memory to implement the real-time communication method for the doctor-patient platform described above.
[0084] To address the aforementioned issues, the present invention also provides a computer-readable storage medium storing at least one instruction, which is executed by a processor in an electronic device to implement the aforementioned real-time communication method for a doctor-patient platform.
[0085] To address the problems described in the background section, this invention first performs authentication based on the MQTT client and server. Verification parameters ensure the user's identity is authentic and reliable, preventing unauthorized users from entering the system, effectively blocking malicious attackers from gaining communication privileges, and improving security during the initial connection phase. This provides a fundamental guarantee for subsequent data encryption and transmission. Second, it determines whether authentication was successful. If authentication fails, the authentication process is re-executed. This multi-verification mechanism reduces the probability of authentication failure due to network fluctuations or incorrect input, ensuring that the system only allows authenticated users to perform subsequent operations, fundamentally guaranteeing user identity security. Next, it defines an identifier content field and a message content field to improve the accuracy of message classification management and system scalability, facilitating rapid identification and processing of different message types and reducing processing delays. Finally, it retrieves historical data and constructs a system based on the identifier content field. This invention displays a set of formats and combines them with message content fields to update data, providing a unified and clear data display format, thus improving the user experience. Loading historical data allows doctors and patients to refer to past communication records, improving the continuity and accuracy of communication. Then, before sending real-time data, it encrypts the data and generates a verification signature packet. Data encryption ensures the confidentiality of the transmitted content, preventing data theft over the network, while the verification signature packet ensures data integrity and immutability, preventing man-in-the-middle attacks. Furthermore, it calculates the transmission delay and determines whether it falls within the delay range. If it falls outside the range, it adaptively adjusts, improving the data transmission rate. Finally, it verifies the data based on the verification signature packet to obtain verified data, completing the communication. Verification using the verification signature packet further guarantees the security, accuracy, and privacy of the communication data, preventing malicious tampering. Therefore, this invention can improve the security and privacy of doctor-patient communication. Attached Figure Description
[0086] Figure 1 This is a flowchart illustrating a real-time communication method for a doctor-patient platform provided in an embodiment of the present invention.
[0087] Figure 2 This is a functional block diagram of a doctor-patient platform instant messaging system provided in an embodiment of the present invention;
[0088] Figure 3 This is a schematic diagram of the structure of an electronic device that implements the real-time communication method of the doctor-patient platform according to an embodiment of the present invention;
[0089] Figure 4 This is a schematic diagram illustrating the message types for implementing the real-time communication method of the doctor-patient platform according to an embodiment of the present invention;
[0090] Figure 5 This is a schematic diagram of the message content field for implementing the real-time communication method of the doctor-patient platform according to an embodiment of the present invention;
[0091] Figure 6 This is a schematic diagram of the interface of a doctor-patient real-time communication application that implements the doctor-patient platform real-time communication method according to an embodiment of the present invention.
[0092] Explanation of reference numerals in the attached figures:
[0093] 10. Electronic device; 11. Processor; 12. Memory; 13. Bus.
[0094] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0095] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0096] This application provides a method for real-time communication on a doctor-patient platform. The executing entity of this method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster.
[0097] Reference Figure 1 The diagram shown is a flowchart illustrating a real-time communication method for a doctor-patient platform according to an embodiment of the present invention. In this embodiment, the real-time communication method for a doctor-patient platform includes:
[0098] S1. Start the doctor-patient instant messaging application and perform authentication based on the pre-built MQTT client, MQTT server and doctor-patient instant messaging application to obtain authentication parameters.
[0099] Explainable, a doctor-patient instant messaging application refers to an instant messaging application used by doctors and patients to enable one-to-many communication, aiming to improve instant communication services between doctors and patients. A doctor-patient instant messaging application includes a doctor's end and a patient's end. The doctor's end refers to the port used by the doctor, and the patient's end refers to the port used by the patient. The MQTT client is the protocol component used in the doctor-patient instant messaging application, responsible for connecting to the MQTT server and exchanging information. In a doctor-patient instant messaging application, both the patient's and doctor's ends need to initialize and configure the MQTT client when the application starts. A connection is established with the MQTT server using `mqtt.connect`, and authentication is performed by the MQTT server using the username and password provided by the MQTT client. The username and password are the information set by the user when registering an account in the doctor-patient instant messaging application. Authentication parameters... This refers to the parameter generated by the MQTT server after verifying the username and password. This parameter has four representations: "Incorrect username," "Incorrect password," "Incorrect username and password," and "Login successful." "Incorrect username" means the username entered to log in to the doctor-patient instant messaging application is different from the username recorded on the MQTT server. "Incorrect password" means the login password entered to log in to the doctor-patient instant messaging application is different from the login password recorded on the MQTT server. "Incorrect username and password" means both the username and password entered to log in to the doctor-patient instant messaging application are different from the username and password recorded on the MQTT server. "Login successful" means the username and password entered to log in to the doctor-patient instant messaging application are the same as the username and password recorded on the MQTT server, and the user successfully logged in to the doctor-patient instant messaging application.
[0100] S2. Determine whether the authentication was successful based on the verification parameters.
[0101] Understandably, authentication is considered successful when the verification parameter is "Login successful", and unsuccessful when the verification parameters are "Incorrect username", "Incorrect login password" or "Both username and login password are incorrect".
[0102] If authentication fails, return to the steps described above for authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application.
[0103] If authentication is successful, execute S3 to define the identifier content field and message content field.
[0104] Explainable: the identifier content field refers to the field that defines the message type, and the message content field refers to the field that defines the message content;
[0105] Specifically, the defined identifier content field and message content field include:
[0106] Set the identifier field id and the identifier field type. The identifier field id is msgType, and the identifier field type includes: type 1, type 2, type 3, type 4 and type 5.
[0107] Message types are defined based on types 1, 2, 3, 4 and 5, where message types include: text messages, voice messages, image messages, treatment suggestions and treatment reports, and type 1 corresponds to text messages, type 2 corresponds to voice messages, type 3 corresponds to image messages, type 4 corresponds to treatment suggestions and type 5 corresponds to treatment reports.
[0108] The identifier content field is defined based on the identifier field id, msgType, identifier field type (type 1, type 2, type 3, type 4, type 5), message type (text message, voice message, image message), treatment suggestion, and treatment report.
[0109] Set the message field ID and message field type ID. The message field ID is msgContent, and the message field type ID includes: text, audioFile, imgFile, suggest, and reportData.
[0110] The message content field is defined based on the message field id, msgContent, message field type id, text, audioFile, imgFile, suggest, and reportData.
[0111] The identifier field `id` refers to the name of the identifier content field, and the identifier field `type` refers to the field representing the message type, including type 1, type 2, type 3, type 4, and type 5. Type 1 represents text messages, where the message type is a parameter describing the form of the message, such as text message, voice message, etc. Text messages refer to ordinary text messages with content represented by pure text. Type 2 represents voice messages, which refer to information containing audio content, where the audio content is speech. Type 3 represents image messages, which refer to information containing images. Type 4 represents treatment suggestions, which refer to treatment plans given by doctors after diagnosing patients. Type 5 represents treatment reports, which refer to relevant treatment information for patients. Figure 4 ,and Figure 4 The numbers 1, 2, 3, 4, and 5 in the table correspond to type 1, type 2, type 3, type 4, and type 5, respectively.
[0112] Understandably, the message field `id` refers to the name of the message content field, and the message field type `id` refers to the field representing the specific content of the message. Message field type `id` includes: `text`, `audioFile`, `imgFile`, `suggest`, and `reportData`. `text` indicates that when the identifier field type is type 1, the `text` field in the message content field contains plain text content, which is the text message sent by the user. `audioFile` indicates that when the identifier field type is type 2, the `audioFile` field in the message content field contains a link to an audio file. `imgFile` indicates that when the identifier field type is type 3, the `imgFile` field in the message content field contains the file path of an image, which is displayed on the front end. `suggest` indicates that when the identifier field type is type 4, the `suggest` field in the message content field contains the doctor's treatment plan and suggestions. `reportData` indicates that when the identifier field type is type 5, the `reportData` field in the message content field contains the patient's treatment data. The identifier field defines the type of message and determines the message format. The message content field specifically defines the content of the type defined by the identifier field, providing specific formats and information. (See reference...) Figure 5 .
[0113] S4. Retrieve historical data, construct a display format set based on the identified content field, update the data based on the display format set and the message content field, and obtain updated data.
[0114] Explainable historical data refers to the data of past exchanges between doctors and patients in a doctor-patient instant messaging application. For example, if the current date is October 20, 2024, and patient Xiao Zhang communicated with a doctor in the doctor-patient instant messaging application on October 18, 2024, then the information from October 18, 2024, is historical data. Display format set refers to the set of display methods, which refers to the way information is displayed. Updated data refers to unread information sent by doctors or patients. For example, when a doctor sends a message to a patient, the message is unread. When the patient launches the doctor-patient instant messaging application, the application updates the data to obtain updated data.
[0115] Specifically, the construction of the display format set based on the identifier content field includes:
[0116] Set text limits and construct a text representation format based on the identified content field and the text limits. The text representation format is a text box that supports inputting multiple lines of text. When the input text in a single line exceeds the text limit, it will automatically wrap to the next line.
[0117] Set an audio length limit. Construct an audio representation format based on the identifier content field and the audio length limit. The audio representation format is a horizontal bar in blue color. The duration of the audio is displayed on the bar and cannot exceed the audio length limit.
[0118] An image representation format is constructed based on the identifier content field, and the doctor's name and avatar are set. The suggestion representation format is constructed using the doctor's name and avatar. The suggestion representation format is a long bar module containing the doctor's name, avatar, and treatment suggestions.
[0119] Obtain the average usage duration, treatment report date, average assessment index, and average treatment index, and construct a report representation format based on the average usage duration, treatment report date, average assessment index, and average treatment index;
[0120] A set of display formats is constructed based on the aforementioned text representation format, audio representation format, image representation format, suggestion representation format, and report representation format.
[0121] Explainable: Text limit refers to the limit on the number of characters; when the number in a line exceeds the text limit, it will automatically wrap to the next line. Text representation format refers to the format used to represent messages of type text. Audio length limit refers to the limit on the duration of audio information, which is 60 seconds. For example, an audio message is 59 seconds long. Audio representation format refers to the format used to represent messages of type voice. Image representation format refers to the format used to represent messages of type image. Doctor's name refers to the doctor's name. Doctor's avatar refers to the doctor's avatar in the doctor-patient instant messaging application. Suggestion representation... The format refers to the format used to represent messages of treatment recommendation type. Average usage duration refers to the average daily treatment duration within the treatment report date range. The treatment report date refers to the treatment period, such as October 21, 2018 to October 27, 2018. Average assessment index refers to the index used to assess the disease; for example, if the disease is sleep apnea-hypopnea syndrome, the average assessment index is AHI. Average treatment index refers to the index used to assess treatment effectiveness; for example, the average treatment index is average air leakage. The report representation format refers to the format used to represent messages of treatment report type. See the attached document for details. Figure 6 .
[0122] S5. Based on the updated data, send real-time data, encrypt and generate a signature on the real-time data to obtain encrypted data and a verification signature package.
[0123] Explainable terms: Real-time data refers to the information currently sent by the doctor or patient; data format refers to the format of the real-time data; format judgment of real-time data refers to determining the format of the real-time data, which is the message type, including: text messages, voice messages, image messages, treatment suggestions, and treatment reports; data encryption and signature generation based on data format refers to encrypting the real-time data according to the data format obtained after format judgment; signature generation refers to generating a signature used to verify the integrity and authenticity of the real-time data; encrypted data refers to the data obtained after format conversion of the real-time data, and the converted format is Base64 encoded; the verification signature package refers to the set formed by the verification signature and the random salt value; the verification signature refers to the signature used to verify the integrity and authenticity of the real-time data; the random salt value refers to the random value generated according to the salt value length threshold and the random number generator; the salt value length threshold refers to the value that limits the length of the generated random salt value, and the salt value length threshold is 16 bytes; the random number generator refers to SecureRandom.
[0124] In detail, the process of encrypting and signing real-time data to obtain encrypted data and a verification signature packet includes:
[0125] Based on the real-time data, the message type is determined to obtain the real-time data type.
[0126] When the real-time data type is an image message, the real-time data is encrypted to obtain encrypted image data, and the encrypted image data is converted into encrypted data using a preset data conversion method;
[0127] When the real-time data type is text message, voice message, treatment suggestion and treatment report, the data conversion method described above is used to convert the real-time data into encrypted data;
[0128] A signature is generated based on the encrypted data to obtain a verification signature packet.
[0129] Explainable, real-time data type refers to the message type of real-time data, encrypted image data refers to the data obtained after encrypting the real-time data type when the real-time data type is an image message, and the data conversion method refers to the btoa (Binary to ASCII) method.
[0130] In detail, the process of encrypting real-time data to obtain encrypted image data includes:
[0131] Based on the real-time data, a real-time image is obtained, and the image size of the real-time image is acquired, wherein the image size includes: image height and image width;
[0132] Based on the real-time image and its size, determine whether the real-time image is square;
[0133] If the real-time image is not square, then the edges are adjusted based on the image height and image width to obtain an adjusted image. The adjusted size of the adjusted image is obtained, the real-time image is updated using the adjusted image, the image size is updated using the adjusted size, and the steps of determining whether the real-time image is square based on the real-time image and image size are returned.
[0134] If the real-time image is a square, then perform equalization on the real-time image to obtain an enhanced image;
[0135] A coordinate system is established, an initial segmentation size is set, and the enhanced image is divided based on the initial segmentation size to obtain a tile set, wherein the tile set consists of non-overlapping rectangular tiles;
[0136] Based on the tile set, a disordered tile set is obtained. A horizontal and vertical tile index are set. The horizontal and vertical coordinates of pixels are extracted based on a coordinate system. Texture complexity is calculated based on the disordered tile set and rectangular tiles. A logarithmic distribution is calculated based on the tile horizontal and vertical indices, pixel horizontal and vertical coordinates, and texture complexity.
[0137]
[0138] in, The x-coordinate of the pixel is The pixel ordinate is The logarithmic distribution, Points to the floor symbol. The horizontal index of the map block is The vertical index of the map is Texture complexity;
[0139] Calculate the minimum segment size based on the logarithmic distribution, and set the segmentation texture threshold;
[0140] Determine if the texture complexity is greater than the texture segmentation threshold;
[0141] If the texture complexity is greater than the texture segmentation threshold, then segmentation is performed based on the minimum segmentation size to obtain segmented patches. The segmentation complexity is calculated based on the segmented patches, the texture complexity is updated using the segmentation complexity, and the above steps of determining whether the texture complexity is greater than the texture segmentation threshold are returned.
[0142] If the texture complexity is not greater than the segmentation texture threshold, the segmented tiles are encrypted to obtain encrypted image data.
[0143] Explainable terms: Real-time image refers to an image when the real-time data type is an image message; image size refers to the dimensions of the real-time image, including its height and width; adjusted image refers to the image obtained after edge adjustment of a non-square real-time image; edge adjustment of a non-square real-time image involves filling the non-square real-time image to make it a square; enhanced image refers to the image obtained after histogram equalization of a real-time image; coordinate system refers to the planar coordinate system established based on the enhanced image, with the top-left vertex of the enhanced image as the origin; initial segmentation size refers to the pre-set size of the enhanced image's divisions, which is a fixed value; tile set refers to the collection formed by rectangular tiles; rectangular tiles refer to the tiles obtained after dividing the enhanced image; disordered tile set refers to the set of tiles obtained after disordering the tile set. Set, randomized processing refers to randomly shuffling the rectangular tiles in the tile set. The tile horizontal index and tile vertical index are parameters used to traverse the rectangular tiles. The pixel horizontal coordinate refers to the horizontal coordinate in the coordinate system, and the pixel vertical coordinate refers to the vertical coordinate in the coordinate system. Texture complexity refers to the complexity of the pixel distribution in the rectangular tile. Logarithmic distribution refers to a value calculated from texture complexity, which is an integer rounded up, used to represent the complexity of the pixels. Minimum segmentation size refers to the minimum size required to capture the pixel distribution of the rectangular tile. Segmentation texture threshold refers to the pre-set texture complexity used to segment the rectangular tile. If the texture complexity of the rectangular tile is greater than the segmentation texture threshold, it means that the pixel distribution complexity in the rectangular tile is too complex and can still be segmented. Segmented tile refers to the tile obtained after segmenting the rectangular tile whose texture complexity is greater than the segmentation texture threshold. Segmentation complexity refers to the texture complexity of the segmented tile.
[0144] In detail, the calculation of the minimum segment size based on the logarithmic distribution includes:
[0145] Calculate the minimum segment size based on the initial segment size and the logarithmic distribution:
[0146]
[0147] in, The x-coordinate of the pixel is The pixel ordinate is The minimum partition size, This refers to the initial segment size.
[0148] Specifically, the encryption of the segmented image tiles to obtain encrypted image data includes:
[0149] Obtain the dynamic key, tile identifier, original pixel horizontal index, and original pixel vertical index. Generate encrypted random numbers based on the dynamic key, tile identifier, original pixel horizontal index, original pixel vertical index, preset pseudo-random algorithm, and random function:
[0150]
[0151] in, The original pixel horizontal index is The original pixel vertical index is Encrypted random numbers, Refers to pseudo-random algorithms. Refers to dynamic key. The XOR operation. Refers to a random function. Refers to the block identifier;
[0152] Obtain the original pixel value, and construct an encryption function based on the encrypted random number and the original pixel value:
[0153]
[0154] in, The original pixel horizontal index is The original pixel vertical index is encryption function, The original pixel horizontal index is The original pixel vertical index is The original pixel values, Modulo operation;
[0155] The segmented image tiles are encrypted using the encryption function to obtain encrypted image data.
[0156] Interpretable, dynamic key refers to the key calculated through texture complexity, tile identifier refers to the symbol used to identify the segmented tile, generated by UUID, original pixel horizontal index refers to the horizontal coordinate of the pixels of the segmented tile, original pixel vertical index refers to the vertical coordinate of the pixels of the segmented tile, pseudo-random algorithm refers to PRNG, random function refers to the Hash function SHA-256, encrypted random number refers to a pseudo-random number generated by the pseudo-random algorithm PRNG and used to encrypt the segmented tile, original pixel value refers to the original pixel value of the segmented tile, and encryption function refers to the function used to encrypt the segmented tile.
[0157] Specifically, the step of generating a signature based on the encrypted data to obtain a verification signature packet includes:
[0158] Set an encryption prefix, and calculate a data digest based on the encryption prefix, a random function, and the encrypted data:
[0159]
[0160] in, Refers to data summary, Refers to the encryption prefix. Refers to encrypted data;
[0161] Set a salt value length threshold, and dynamically generate random salt values based on a preset random number generator and the salt value length threshold;
[0162] Obtain the encryption function and encryption private key, and generate a verification signature based on the random salt value, data digest, encryption function, and encryption private key:
[0163]
[0164] in, Refers to verifying the signature. Refers to encryption functions. Refers to the encrypted private key. Refers to random salt value;
[0165] Construct a verification signature package based on the random salt value and the verification signature:
[0166]
[0167] in, Refers to verifying the signature package.
[0168] Explainable terms include: encryption prefix (which indicates the data type), data digest (which is a fixed-length, unique identifier generated by a digest function to identify encrypted data), encryption function (RSA), and encryption private key (which is a private key for asymmetric encryption used to encrypt data digests and generate verification signatures).
[0169] S6. Based on the encrypted data and the verification signature packet, send the data and calculate the transmission delay.
[0170] Explainable transmission delay refers to the delay in sending data.
[0171] Specifically, the calculation of transmission delay includes:
[0172] Obtain the processing time and confirmation time, and calculate the protocol delay based on the processing time and confirmation time:
[0173]
[0174] in, This refers to a delay in the agreement. This refers to processing time. Refers to the confirmation time;
[0175] Obtain network latency, data size, and decryption rate; calculate transmission latency based on the protocol latency, network latency, data size, and decryption rate.
[0176]
[0177] in, Refers to transmission delay. Network latency, Refers to data size. This refers to the decryption rate. Refers to the transmission delay. This refers to reception delay.
[0178] Explainable terms include: processing time (the time it takes for the MQTT client to send encrypted data to the MQTT server), acknowledgment time (the time it takes for the MQTT server to process the encrypted data after receiving it), network latency (the time it takes for the encrypted data to travel from the sender to the receiver), sender (the port that sends the data), receiver (the port that receives the data), data size (the size of the encrypted data), and decryption rate (the rate at which the encrypted data is decrypted).
[0179] S7. Determine whether the transmission delay is within the preset delay range.
[0180] Explainable, the delay range refers to a pre-defined range of transmission delays.
[0181] If the transmission delay is not within the delay range, then execute S8, perform adaptive adjustment, and verify according to the verification signature packet to obtain verification data.
[0182] Explainable, adaptive adjustment refers to dynamically selecting the network path for transmitting data, selecting the network path according to network conditions. The network path refers to a series of network nodes and links in the network from the sending end to the receiving end. Network conditions refer to the latency, bandwidth and packet loss rate of the network path. Verification data refers to the data obtained after verification based on the verification signature packet.
[0183] If the transmission delay is within the delay range, then execute S9 to verify according to the verification signature packet, obtain verification data, and complete the communication.
[0184] To address the problems described in the background section, this invention first performs authentication based on the MQTT client and server. Verification parameters ensure the user's identity is authentic and reliable, preventing unauthorized users from entering the system, effectively blocking malicious attackers from gaining communication privileges, and improving security during the initial connection phase. This provides a fundamental guarantee for subsequent data encryption and transmission. Second, it determines whether authentication was successful. If authentication fails, the authentication process is re-executed. This multi-verification mechanism reduces the probability of authentication failure due to network fluctuations or incorrect input, ensuring that the system only allows authenticated users to perform subsequent operations, fundamentally guaranteeing user identity security. Next, it defines an identifier content field and a message content field to improve the accuracy of message classification management and system scalability, facilitating rapid identification and processing of different message types and reducing processing delays. Finally, it retrieves historical data and constructs a system based on the identifier content field. This invention displays a set of formats and combines them with message content fields to update data, providing a unified and clear data display format, thus improving the user experience. Loading historical data allows doctors and patients to refer to past communication records, improving the continuity and accuracy of communication. Then, before sending real-time data, it encrypts the data and generates a verification signature packet. Data encryption ensures the confidentiality of the transmitted content, preventing data theft over the network, while the verification signature packet ensures data integrity and immutability, preventing man-in-the-middle attacks. Furthermore, it calculates the transmission delay and determines whether it falls within the delay range. If it falls outside the range, it adaptively adjusts, improving the data transmission rate. Finally, it verifies the data based on the verification signature packet to obtain verified data, completing the communication. Verification using the verification signature packet further guarantees the security, accuracy, and privacy of the communication data, preventing malicious tampering. Therefore, this invention can improve the security and privacy of doctor-patient communication.
[0185] like Figure 2 The diagram shown is a functional block diagram of a doctor-patient platform instant messaging system provided in an embodiment of the present invention.
[0186] The instant messaging system 100 for doctor-patient platforms described in this invention can be installed in an electronic device. Depending on the functions implemented, the instant messaging system 100 may include an authentication module 101, a data update module 102, a delay calculation module 103, and a signature verification module 104. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.
[0187] The authentication module 101 is used to start the doctor-patient instant messaging application and perform authentication based on the pre-built MQTT client, MQTT server and doctor-patient instant messaging application to obtain authentication parameters; determine whether the authentication is successful based on the authentication parameters; if the authentication fails, return to the above steps of authenticating based on the pre-built MQTT client, MQTT server and doctor-patient instant messaging application; if the authentication is successful, define the identifier content field and the message content field.
[0188] The data update module 102 is used to pull historical data, construct a display format set based on the identifier content field, and update the data based on the display format set and the message content field to obtain updated data.
[0189] The delay calculation module 103 is used to send real-time data based on the updated data, encrypt and generate a signature on the real-time data to obtain encrypted data and a verification signature packet; send data based on the encrypted data and the verification signature packet, and calculate the transmission delay.
[0190] The signature verification module 104 is used to determine whether the transmission delay is within a preset delay range; if the transmission delay is not within the delay range, adaptive adjustment is performed and verification is performed according to the verification signature packet to obtain verification data; if the transmission delay is within the delay range, verification is performed according to the verification signature packet to obtain verification data and complete the communication.
[0191] In detail, the modules in the instant messaging system 100 of the doctor-patient platform described in this embodiment of the invention employ the same methods as described above. Figure 1 The method used is the same as the real-time communication method for doctor-patient platforms described above, and it can produce the same technical effects, so it will not be elaborated here.
[0192] like Figure 3 The diagram shown is a structural schematic of an electronic device for implementing a real-time communication method for a doctor-patient platform according to an embodiment of the present invention.
[0193] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and capable of running on the processor 10, such as a doctor-patient platform instant communication method program.
[0194] The memory 11 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as the portable hard drive of the electronic device 1. In other embodiments, the memory 11 can be an external storage device of the electronic device 1, such as a plug-in portable hard drive, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device 1. Furthermore, the memory 11 includes both internal storage units and external storage devices of the electronic device 1. The memory 11 can be used not only to store application software and various types of data installed on the electronic device 1, such as the code of a real-time communication method program for a doctor-patient platform, but also to temporarily store data that has been output or will be output.
[0195] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (such as instant messaging methods for doctor-patient platforms) and calls data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
[0196] The bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 can be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize the connection and communication between the memory 11 and at least one processor 10, etc.
[0197] Figure 3 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 3The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0198] For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0199] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is typically used to establish communication connections between the electronic device 1 and other electronic devices.
[0200] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device 1 and to display a visual user interface.
[0201] The instant messaging method program for the doctor-patient platform stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When run in the processor 10, it can achieve the following:
[0202] Launch the doctor-patient instant messaging application and perform authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application to obtain authentication parameters;
[0203] Determine whether authentication was successful based on the verification parameters;
[0204] If authentication fails, return to the steps described above for authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application;
[0205] If authentication is successful, define the identifier content field and the message content field;
[0206] Retrieve historical data, construct a display format set based on the identified content field, and update the data based on the display format set and the message content field to obtain the updated data;
[0207] Based on the updated data, real-time data is sent, and the real-time data is encrypted and a signature is generated to obtain encrypted data and a verification signature package.
[0208] Data is sent based on the encrypted data and the verification signature packet, and the transmission delay is calculated;
[0209] Determine whether the transmission delay is within the preset delay range;
[0210] If the transmission delay is outside the delay range, adaptive adjustment is performed and verification is carried out according to the verification signature packet to obtain verification data;
[0211] If the transmission delay is within the delay range, the verification is performed according to the verification signature packet to obtain verification data and complete the communication.
[0212] Specifically, the processor 10's implementation method for the above instructions can be found in [reference needed]. Figures 1 to 3 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.
[0213] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0214] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following:
[0215] Launch the doctor-patient instant messaging application and perform authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application to obtain authentication parameters;
[0216] Determine whether authentication was successful based on the verification parameters;
[0217] If authentication fails, return to the steps described above for authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application;
[0218] If authentication is successful, define the identifier content field and the message content field;
[0219] Retrieve historical data, construct a display format set based on the identified content field, and update the data based on the display format set and the message content field to obtain the updated data;
[0220] Based on the updated data, real-time data is sent, and the real-time data is encrypted and a signature is generated to obtain encrypted data and a verification signature package.
[0221] Data is sent based on the encrypted data and the verification signature packet, and the transmission delay is calculated;
[0222] Determine whether the transmission delay is within the preset delay range;
[0223] If the transmission delay is outside the delay range, adaptive adjustment is performed and verification is carried out according to the verification signature packet to obtain verification data;
[0224] If the transmission delay is within the delay range, the verification is performed according to the verification signature packet to obtain verification data and complete the communication.
[0225] In the embodiments provided by this invention, it should be understood that the disclosed devices, systems, and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and actual implementations may have other classification methods.
[0226] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0227] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0228] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0229] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for real-time communication on a doctor-patient platform, characterized in that, The method includes: Launch the doctor-patient instant messaging application and perform authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application to obtain authentication parameters; Determine whether authentication was successful based on the verification parameters; If authentication fails, return to the steps described above for authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application; If authentication is successful, define the identifier content field and the message content field; Retrieve historical data, construct a display format set based on the identified content field, and update the data based on the display format set and the message content field to obtain the updated data; Based on the updated data, real-time data is sent, and the real-time data is encrypted and a signature is generated to obtain encrypted data and a verification signature package. Data is sent based on the encrypted data and the verification signature packet, and the transmission delay is calculated; Determine whether the transmission delay is within the preset delay range; If the transmission delay is outside the delay range, adaptive adjustment is performed and verification is carried out according to the verification signature packet to obtain verification data; If the transmission delay is within the delay range, the verification is performed according to the verification signature packet to obtain verification data and complete the communication.
2. The real-time communication method for doctor-patient platforms as described in claim 1, characterized in that, The defined identifier content field and message content field include: Set the identifier field id and the identifier field type. The identifier field id is msgType, and the identifier field type includes: type 1, type 2, type 3, type 4 and type 5. Message types are defined based on types 1, 2, 3, 4 and 5, where message types include: text messages, voice messages, image messages, treatment suggestions and treatment reports, and type 1 corresponds to text messages, type 2 corresponds to voice messages, type 3 corresponds to image messages, type 4 corresponds to treatment suggestions and type 5 corresponds to treatment reports. The identifier content field is defined based on the identifier field id, msgType, identifier field type (type 1, type 2, type 3, type 4, type 5), message type (text message, voice message, image message), treatment suggestion, and treatment report. Set the message field ID and message field type ID. The message field ID is msgContent, and the message field type ID includes: text, audioFile, imgFile, suggest, and reportData. The message content field is defined based on the message field id, msgContent, message field type id, text, audioFile, imgFile, suggest, and reportData.
3. The real-time communication method for doctor-patient platforms as described in claim 2, characterized in that, The construction of the display format set based on the identified content field includes: Set text limits and construct a text representation format based on the identified content field and the text limits. The text representation format is a text box that supports inputting multiple lines of text. When the input text in a single line exceeds the text limit, it will automatically wrap to the next line. Set an audio length limit. Construct an audio representation format based on the identifier content field and the audio length limit. The audio representation format is a horizontal bar in blue color. The duration of the audio is displayed on the bar and cannot exceed the audio length limit. An image representation format is constructed based on the identifier content field, and the doctor's name and avatar are set. The suggestion representation format is constructed using the doctor's name and avatar. The suggestion representation format is a long bar module containing the doctor's name, avatar, and treatment suggestions. Obtain the average usage duration, treatment report date, average assessment index, and average treatment index, and construct a report representation format based on the average usage duration, treatment report date, average assessment index, and average treatment index; A set of display formats is constructed based on the aforementioned text representation format, audio representation format, image representation format, suggestion representation format, and report representation format.
4. The real-time communication method for doctor-patient platforms as described in claim 3, characterized in that, The process of encrypting and signing real-time data to obtain encrypted data and a verification signature packet includes: Based on the real-time data, the message type is determined to obtain the real-time data type. When the real-time data type is an image message, the real-time data is encrypted to obtain encrypted image data, and the encrypted image data is converted into encrypted data using a preset data conversion method; When the real-time data type is text message, voice message, treatment suggestion and treatment report, the data conversion method described above is used to convert the real-time data into encrypted data; A signature is generated based on the encrypted data to obtain a verification signature packet.
5. The real-time communication method for doctor-patient platforms as described in claim 4, characterized in that, The process of encrypting real-time data to obtain encrypted image data includes: Based on the real-time data, a real-time image is obtained, and the image size of the real-time image is acquired, wherein the image size includes: image height and image width; Based on the real-time image and its size, determine whether the real-time image is square; If the real-time image is not square, then the edges are adjusted based on the image height and image width to obtain an adjusted image. The adjusted size of the adjusted image is obtained, the real-time image is updated using the adjusted image, the image size is updated using the adjusted size, and the steps of determining whether the real-time image is square based on the real-time image and image size are returned. If the real-time image is a square, then perform equalization on the real-time image to obtain an enhanced image; A coordinate system is established, an initial segmentation size is set, and the enhanced image is divided based on the initial segmentation size to obtain a tile set, wherein the tile set consists of non-overlapping rectangular tiles; Based on the tile set, a disordered tile set is obtained. A horizontal and vertical tile index are set. The horizontal and vertical coordinates of pixels are extracted based on a coordinate system. Texture complexity is calculated based on the disordered tile set and rectangular tiles. A logarithmic distribution is calculated based on the tile horizontal and vertical indices, pixel horizontal and vertical coordinates, and texture complexity. in, The x-coordinate of the pixel is The pixel ordinate is The logarithmic distribution, Points to the floor symbol. The horizontal index of the map block is The vertical index of the map is Texture complexity; Calculate the minimum segment size based on the logarithmic distribution, and set the segmentation texture threshold; Determine if the texture complexity is greater than the texture segmentation threshold; If the texture complexity is greater than the texture segmentation threshold, then segmentation is performed based on the minimum segmentation size to obtain segmented patches. The segmentation complexity is calculated based on the segmented patches, the texture complexity is updated using the segmentation complexity, and the process returns to the steps described above for determining whether the texture complexity is greater than the texture segmentation threshold. If the texture complexity is not greater than the segmentation texture threshold, the segmented tiles are encrypted to obtain encrypted image data.
6. The real-time communication method for doctor-patient platforms as described in claim 5, characterized in that, The calculation of the minimum segment size based on the logarithmic distribution includes: Calculate the minimum segment size based on the initial segment size and the logarithmic distribution: in, The x-coordinate of the pixel is The pixel ordinate is The minimum partition size, This refers to the initial segment size.
7. The real-time communication method for doctor-patient platforms as described in claim 6, characterized in that, The process of encrypting the segmented image blocks to obtain encrypted image data includes: Obtain the dynamic key, tile identifier, original pixel horizontal index, and original pixel vertical index. Generate encrypted random numbers based on the dynamic key, tile identifier, original pixel horizontal index, original pixel vertical index, preset pseudo-random algorithm, and random function: in, The original pixel horizontal index is The original pixel vertical index is Encrypted random numbers, Refers to pseudo-random algorithms. Refers to dynamic key. The XOR operation. Refers to a random function. Refers to the block identifier; Obtain the original pixel value, and construct an encryption function based on the encrypted random number and the original pixel value: in, The original pixel horizontal index is The original pixel vertical index is encryption function, The original pixel horizontal index is The original pixel vertical index is The original pixel values, Modulo operation; The segmented image tiles are encrypted using the encryption function to obtain encrypted image data.
8. The real-time communication method for doctor-patient platforms as described in claim 7, characterized in that, The step of generating a signature based on the encrypted data to obtain a verification signature packet includes: Set an encryption prefix, and calculate a data digest based on the encryption prefix, a random function, and the encrypted data: in, Refers to data summary, Refers to the encryption prefix. Refers to encrypted data; Set a salt value length threshold, and dynamically generate random salt values based on a preset random number generator and the salt value length threshold; Obtain the encryption function and encryption private key, and generate a verification signature based on the random salt value, data digest, encryption function, and encryption private key: in, Refers to verifying the signature. Refers to encryption functions. Refers to the encrypted private key. Refers to random salt value; Construct a verification signature package based on the random salt value and the verification signature: in, Refers to verifying the signature package.
9. The real-time communication method for doctor-patient platforms as described in claim 8, characterized in that, The calculation of transmission delay includes: Obtain the processing time and confirmation time, and calculate the protocol delay based on the processing time and confirmation time: in, This refers to a delay in the agreement. This refers to processing time. Refers to the confirmation time; Obtain network latency, data size, and decryption rate; calculate transmission latency based on the protocol latency, network latency, data size, and decryption rate. in, Refers to transmission delay. Network latency Refers to data size. This refers to the decryption rate. Refers to the transmission delay. This refers to reception delay.
10. A real-time communication system for doctor-patient platforms, characterized in that, The system includes: The authentication module is used to launch the doctor-patient instant messaging application and perform authentication based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application to obtain authentication parameters; determine whether the authentication is successful based on the authentication parameters; if the authentication fails, return to the above steps of authenticating based on the pre-built MQTT client, MQTT server, and doctor-patient instant messaging application; if the authentication is successful, define the identifier content field and the message content field. The data update module is used to retrieve historical data, construct a display format set based on the identifier content field, and update the data based on the display format set and the message content field to obtain updated data. The delay calculation module is used to send real-time data based on the updated data, encrypt and generate a signature for the real-time data to obtain encrypted data and a verification signature packet; send data based on the encrypted data and the verification signature packet, and calculate the transmission delay. The signature verification module is used to determine whether the transmission delay is within a preset delay range. If the transmission delay is not within the delay range, adaptive adjustment is performed and verification is performed according to the verification signature packet to obtain verification data. If the transmission delay is within the delay range, verification is performed according to the verification signature packet to obtain verification data and complete the communication.
Citation Information
Patent Citations
Instant message encryption system based on commercial cryptographic algorithm in medical field
CN115001713A
Medical data management method based on Internet of Things
CN116825259A