WO2023178973A1 - Online consulting instant messaging system and message processing method - Google Patents

Online consulting instant messaging system and message processing method Download PDF

Info

Publication number
WO2023178973A1
WO2023178973A1 PCT/CN2022/121760 CN2022121760W WO2023178973A1 WO 2023178973 A1 WO2023178973 A1 WO 2023178973A1 CN 2022121760 W CN2022121760 W CN 2022121760W WO 2023178973 A1 WO2023178973 A1 WO 2023178973A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
consultation
identity
data
component
Prior art date
Application number
PCT/CN2022/121760
Other languages
French (fr)
Chinese (zh)
Inventor
彭宜堃
Original Assignee
康键信息技术(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 康键信息技术(深圳)有限公司 filed Critical 康键信息技术(深圳)有限公司
Publication of WO2023178973A1 publication Critical patent/WO2023178973A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H80/00ICT specially adapted for facilitating communication between medical practitioners or patients, e.g. for collaborative diagnosis, therapy or health monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/043Real-time or near real-time messaging, e.g. instant messaging [IM] using or handling presence information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Definitions

  • This application relates to the fields of instant messaging, artificial intelligence and digital medical technology, and in particular to an online consultation instant messaging system and a message processing method for an online consultation instant messaging system.
  • IM Instant Messaging, instant messaging
  • a network instant messaging system consists of an instant messaging server, a service management system (SMS, Service Management System) connected to the IM server, and multiple IM clients connected to the IM server at the same time.
  • SMS Service Management System
  • Most IM service frameworks are presented as IM service monomer frameworks.
  • the traditional IM service unit cannot support high-concurrency messaging.
  • the traditional IM service unit cannot support personalized queries, such as querying all messages sent by a specific doctor. , messages received by a specific patient from a specific doctor, or all messages during a specific consultation process, if encountering high-concurrency online consultations, the traditional IM service unit will be overloaded and unable to Ensure the stable operation of the system.
  • this application provides an online consultation instant messaging system.
  • the system includes: a communication component, a message processing component and a data storage component.
  • the communication component and the data storage component are respectively connected to the message processing component;
  • the communication component is used to receive IM consultation dialogue messages and send IM consultation dialogue messages to the message processing component and data storage component;
  • the data storage component is used to extract the patient identity and doctor's identity in the IM consultation conversation message, and splice the patient's identity and doctor's identity into a session identity. Based on the session identity, the IM is stored in the form of data fragmentation and data routing.
  • the consultation conversation messages are stored in the default IM database;
  • the message processing component is used to receive a data query request carrying a doctor's identity or patient's identity, query the preset IM database based on the doctor's identity or patient's identity, obtain the query results, and push the query results through the communication component.
  • the above-mentioned online consultation instant messaging system divides the traditional IM service monolithic architecture into independent component modules, so that the online consultation instant messaging system has the functions of communication, message processing and storage at the same time, and the consistency of messages between each component can be maintained and supports high-concurrency data query.
  • IM consultation conversation messages are stored in the form of data sharding and data routing, which can greatly disperse the reading and writing pressure, so that when receiving the message carrying the doctor's identity or the patient's identity
  • the query is performed in the preset IM database based on the doctor's identity or patient's identity, and the corresponding query results are obtained, thereby realizing personalized query of the consultation dialogue messages between a specific doctor and a specific patient.
  • this application also provides a message processing method for an online consultation instant messaging system.
  • the online consultation instant messaging system includes a communication component, a message processing component and a data storage component.
  • the communication component and the data storage component are respectively related to the message processing component.
  • Component connection methods include:
  • the communication component receives the IM consultation dialogue message and sends the IM consultation dialogue message to the message processing component and the data storage component;
  • the data storage component extracts the patient identity and doctor's identity in the IM consultation conversation message, splices the patient's identity and doctor's identity into a session identity, and based on the session identity, the IM consultation is stored in the form of data sharding and data routing. Conversation messages are stored in the default IM database;
  • the message processing component When the message processing component receives a data query request carrying a doctor's identity or patient's identity, it queries the preset IM database based on the doctor's identity or patient's identity, obtains the query results, and pushes the query results through the communication component.
  • this application also provides a computer-readable storage medium.
  • the computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by the processor, the following steps are implemented:
  • the communication component receives the IM consultation dialogue message and sends the IM consultation dialogue message to the message processing component and the data storage component;
  • the data storage component extracts the patient identity and the doctor's identity in the IM consultation conversation message, splices the patient's identity and the doctor's identity into a session identity, and segments the data based on the session identity. and data routing, storing the IM consultation conversation message in a preset IM database;
  • the message processing component When the message processing component receives a data query request carrying a doctor's identity or a patient's identity, it performs a query in the preset IM database based on the doctor's identity or the patient's identity, obtains the query results, and passes the required The communication component pushes the query results.
  • the online consultation instant messaging system includes independent components and has the functions of communication, message processing and storage at the same time.
  • the components can maintain message consistency and support high concurrency.
  • the data storage component stores IM consultation conversation messages based on patient identity and doctor identity in the form of data sharding and data routing, which not only greatly disperses the reading and writing pressure, but also enables the message processing component to receive the doctor's identity when it receives the message.
  • the query is performed in the preset IM database based on the doctor's identity or the patient's identity, and the corresponding query results are obtained, thereby realizing personalized query of the consultation dialogue messages between a specific doctor and a specific patient.
  • using the above method can support high-concurrency and efficient queries.
  • Figure 1 is a structural block diagram of an online consultation instant messaging system in one embodiment
  • Figure 2 is a schematic diagram of an online consultation scenario in one embodiment
  • Figure 3 is a schematic flowchart of a message processing method of the online consultation instant messaging system in one embodiment.
  • an online consultation instant messaging system including the system including: a communication component 200, a message processing component 202 and a data storage component 204.
  • the communication component 200 and the data storage Component 204 is connected to message processing component 202 respectively;
  • the communication component is used to receive IM consultation dialogue messages and send IM consultation dialogue messages to the message processing component and data storage component;
  • the data storage component is used to extract the patient identity and doctor's identity in the IM consultation conversation message, and splice the patient's identity and doctor's identity into a session identity. Based on the session identity, the IM is stored in the form of data fragmentation and data routing.
  • the consultation conversation messages are stored in the default IM database;
  • the message processing component is used to receive a data query request carrying a doctor's identity or patient's identity, query the preset IM database based on the doctor's identity or patient's identity, obtain the query results, and push the query results through the communication component.
  • the instant messaging system is a cross-platform (Linux Server, Windows Server), customizable P2P instant messaging system (integrated multi-person video conferencing function), providing "one-stop" customized solutions for various industry portals and enterprises and institutions , to create a stable, safe, efficient and scalable instant messaging system that is close to or compatible with instant messaging products such as MSN, TM, Tradelink and Taobao Want Want in terms of user habits.
  • traditional IM service frameworks are generally service monolithic frameworks.
  • the communication component is responsible for the push and arrival of messages, which is a centralized service. All types of user messages will be transferred and delivered through this centralized communication component, but the processing of each message is handed over to the data storage component and message processing component.
  • IM services never provide API (Application Programming Interface, Application Programming Interface) to the outside world, and only provide basic long link communication functions.
  • the IM service In order to meet the delivery of template messages, the IM service must expose an independent server interface. This interface provides the function of sending template messages for other related business applications. Therefore, in this embodiment, after the communication component is added with an independent server API interface, the interface is exposed to each service background and used to send robot messages (template messages) and card messages, etc.
  • This interface can meet the needs of the interface caller. It has fault tolerance and load balancing and supports horizontal expansion of the API layer. In addition, in order to prevent information bombing, the interface can also support security, flow control, desensitization and other functions.
  • the message processing component also known as the computing component, provides query services related to IM consultation dialogue messages and is responsible for data desensitization of query results. In terms of deployment, capacity is estimated individually and server resources are planned based on the respective service loads. Since IM consultation conversation messages are stored based on patient identification and doctor identification, when the user wants to query messages sent by a specific doctor and patient, he or she can send a data query request carrying the doctor's identification or patient's identification. To the message processing component, the message processing component can query the preset IM database according to the doctor identity or patient identity in the data query request, obtain the corresponding query results, and then send the query results to the client through the communication component. To meet the user's query needs.
  • the data storage component After receiving the IM consultation dialogue message, the data storage component extracts the patient identity identifier patientId and doctor identity identifier patientId in the IM consultation dialogue message entity, and splices the patient identity identifier patientId and doctor identity identifier patientId into The session identifier is used as the KEY for data fragmentation and data routing, and the IM consultation dialogue message is stored in the preset IM database in the form of data fragmentation and data routing. In this way, it not only greatly disperses the pressure of data reading and writing, but also associates conversational messages with doctors and patients.
  • the above-mentioned online consultation instant messaging system divides the traditional IM service monolithic architecture into independent component modules, so that the online consultation instant messaging system has the functions of communication, message processing and storage, and can achieve message consistency between components. , supports high-concurrency data query.
  • IM consultation conversation messages are stored in the form of data sharding and data routing, which can greatly disperse the reading and writing pressure, so that when receiving the message carrying the doctor's identity or the patient's identity
  • the query is performed in the preset IM database based on the doctor's identity or patient's identity, and the corresponding query results are obtained, thereby realizing personalized query of the consultation dialogue messages between a specific doctor and a specific patient.
  • the message processing component is also used to perform data desensitization processing on the query results before pushing the query results through the communication component, and the communication component is also used to push the query results after data desensitization.
  • Data desensitization refers to the deformation of certain sensitive information through desensitization rules to achieve reliable protection of sensitive private data.
  • customer security data or some commercially sensitive data real data must be transformed and used for testing without violating system rules, such as ID number, mobile phone number, card number, customer number and other personal information.
  • system rules such as ID number, mobile phone number, card number, customer number and other personal information.
  • Sensitive information depends on the actual business scenario and security dimensions.
  • the sensitive fields of individual users include: name, ID number, mobile phone number, email address, etc.; in the banking system, as a customer, it may also involve bank card number, Expiration time, payment password, etc.; in the company system, as an employee, it may also involve salary, educational background, etc.; in the medical system, as a patient, it may also involve medical treatment information, etc.
  • data desensitization is divided into static data desensitization and dynamic data desensitization. Static data desensitization is the "movement and simulation replacement" of data. After the data is extracted and desensitized, it is sent to downstream links for free access, reading and writing.
  • Dynamic data desensitization After desensitization, the data is isolated from the production environment, which satisfies meet business needs while ensuring the security of the production database. Dynamic data desensitization performs desensitization processing in real time while accessing sensitive data. It can implement different desensitization schemes for different roles, different permissions, and different data types, thereby ensuring that the returned data is available and safe.
  • the dynamic data desensitization method may be used.
  • real-time desensitization processing can be implemented based on determining whether the preset validity conditions are met. Validation conditions are usually based on the judgment of the current user role.
  • the visible range of sensitive data is preset for different users. The system administrator has the highest authority and can see any field in any table at any time.
  • the query results are desensitized in real time according to the desensitization rules to achieve reliable protection of the data.
  • the message processing component may also desensitize the IM consultation dialogue message before storing it, and send the desensitized IM consultation message to the data storage component, so that The data storage component stores the desensitized IM consultation conversation messages into the preset IM database.
  • desensitization rules include replacement, rearrangement, encryption, truncation, and masking. In this embodiment, it can be Desensitize doctor identification and patient identification by means of rearrangement, encryption or masking.
  • the data storage component is also used to extract a preset number of characters in the session identification, determine the preset number of characters as the primary key of data fragmentation and data routing, and use the data fragmentation and data routing according to the primary key.
  • the IM consultation conversation message is stored in the corresponding default IM database.
  • the last 4 bits of the session identifier can be extracted and used as the primary key for data fragmentation and data routing. Then, the IM consultation dialogue message is divided, and the IM consultation message is divided into data fragmentation and data routing methods.
  • the medical consultation dialogue messages are stored in the IM database. In this embodiment, the last 4 digits of the session identifier are used as the unique identifier. Storing the IM data can ensure the orderly storage of the IM medical consultation dialogue messages, and at the same time, the IM medical consultation dialogue can be stored in an orderly manner. Messages are associated with the doctor and patient who initiated the session to facilitate subsequent data queries.
  • the data storage component is also used to further include an IM consultation dialogue message storage model.
  • the IM consultation dialogue message storage model is used to store the IM consultation dialogue message according to the consultation session identification field, the patient identity identification field, The formats of the doctor identity field, terminal identification field and message service type field are stored in the default IM database.
  • IM consultation dialogue message storage model in non-medical scenarios is: MessageId (message ID), From (sender), To (receiver), Message (message content), Time (sending time) and Status (message state).
  • MessageId messages ID
  • From sender
  • To sender
  • Message messages content
  • Time sending time
  • Status messages state
  • the above IM consultation dialogue message storage model cannot clarify the identity of the message sender and receiver. If the user wants to query all messages sent by a specific doctor, messages from a specific doctor received by a specific patient, or all messages during a specific consultation process, It cannot meet the user's query needs. Therefore, in this embodiment, the IM consultation dialogue message storage model is expanded.
  • the IM consultation dialogue message storage model in this embodiment includes fields: MessageId (message ID), ConsultId (consultation ID), appId ( Terminal type), bizType (message service type), doctorId (doctor ID), patientId (patient ID), From (sender), To (receiver), Message (message content), Time (sending time), Status (message state).
  • the doctorId and patientId will be used as keys for data routing shards in storage.
  • the AppId will be used in later pushes to indicate the device terminal type being pushed.
  • BizType and consultID will be used in risk control and AI (Artificial Intelligence, artificial intelligence) scenarios to refine the business affiliation and business type of the message.
  • artificial intelligence scenarios can include conducting intelligent consultation sessions and sending robot template messages. Richer medical data can be expanded through the newly introduced five fields: ConsultId (consultation ID), appId (terminal type), bizType (message service type), doctorId (doctor ID), and patientId (patient ID). dimensions to better meet specific medical-related scenarios.
  • the communication component is also used to obtain a message template when a template message generation event is triggered, generate a corresponding template message according to the message template, and push the template message.
  • the sender of the IM consultation dialogue message is sometimes not a human sender, but a template message triggered by the communication component under specific rules and generated and sent according to specific template rules, that is, the AI robot template message
  • a greeting message sending event can be triggered, and a greeting message is generated according to the greeting message template, such as "Hello, how can I help you?"
  • sending the template message It can improve communication efficiency and save communication time.
  • the communication component is also used to extract the message service type and consultation identifier in the IM consultation dialogue message body of the session when the session ends and reaches the preset duration, and search based on the message service type and consultation identifier. Go to the corresponding target message template, generate a template message based on the target message template, and push the template message.
  • the triggering rules at this time are applied and triggered by the communication component.
  • the consultation ends the timer starts, and when 20 minutes have passed after the consultation,
  • the message template for the corresponding business will be immediately queried based on the biztype and consultid fields in the IM consultation conversation message body.
  • This template is provided in the form of placeholder replacement. For example: Hello, $User, your consultation $ConsultID has ended. What is your evaluation of this service? Then, when the template is queried, the placeholders in the template are replaced with variable information such as consultid to generate the final template message.
  • the template message may be sent 10 minutes or 5 minutes after the consultation is completed.
  • the specific setting can be set according to the actual situation, and is not limited here.
  • the IM database includes multiple sub-databases and sub-data tables, and the data storage component is also used to store the IM consultation conversation messages into the preset IM database in a sub-database and sub-table manner.
  • the storage of IM consultation conversation messages is crucial.
  • the storage must meet the characteristics of scalable storage space, low read and write timeliness, and historical data archiving. This solution is based on these three characteristics.
  • the underlying database is split into several sub-databases and sub-tables, and at the application level, the data writing scheme of sub-databases and sub-tables is used. Specifically, you can split the IM database into 10 databases and 10 tables, and add a separate table name to each table, for example: msg_1010, msg_0103, msg_0204.
  • the first two digits of the number represent the serial number of the sub-database, and the last two The bit represents the number of the sub-table. Then, the two user IDs doctorId and patientId in the IM consultation conversation message are extracted and spliced into a session ID, and then the data is written and read based on the last 4 bits of the session ID.
  • the IM database can also be split into more sub-databases and sub-tables. In this embodiment, by splitting the IM database into multiple sub-databases and sub-tables, data reading and writing pressure can be further dispersed.
  • the communication component is also used to monitor the connection status of the client. When it is detected that the client is offline, it sends a user logout event message to the client and updates the connection status to the offline status.
  • IM's communication component will monitor the connection status of all user terminals in real time. Once it is found that the user terminal has been disconnected for a period of time, it will send a user logout event message to the user terminal and update the user status to offline. In this embodiment, the communication component monitors the connection status of the user terminal and can update the status of the user terminal in time to facilitate the push of offline messages.
  • the communication component is also used to obtain the current IM text message content and the preset offline message push field when it is detected that the client is offline, and push the current IM text message content and the preset offline message push field according to the current IM text message content and the preset offline message push field. Fields synthesize offline messages and push offline messages to the client.
  • each message will determine the online status of the current user during the processing of the data stream.
  • the current IM text message and the preset offline message push fields (such as appId, device number, device number, etc.) will be obtained. type, pushed title, etc.), and based on the current IM text message content, and supplementing the appId, device number, device type, pushed title, etc., after synthesizing the complete offline message, the interface of the push platform is called to complete the offline message push . In this way, even if the user terminal is offline, the push and storage of messages can be completed.
  • the communication component and the data storage component communicate with the message processing component through RPC or message queue.
  • RPC Remote Procedure Call, remote process call
  • message queue etc. maintain communication.
  • RPC provides an inter-process communication mechanism.
  • a program can use this protocol to request services from a program on another computer in the network. Through this mechanism, a program running on one computer can smoothly execute a remote code on the system.
  • a "message queue” is a container that saves messages during their transmission. Messages are sent to the queue, and the message queue manager acts as an intermediary in relaying the message from its source to its destination.
  • the main purpose of a queue is to provide routing and ensure the delivery of messages; if a message is sent and the recipient is unable to receive it, the message queue retains the message until it can be successfully delivered.
  • the successful delivery of the IM consultation dialogue message can be ensured through RPC or message queue.
  • this application also provides a message processing method for an online consultation instant messaging system.
  • the online consultation instant messaging system includes a communication component, a message processing component and a data storage component.
  • the communication component The data storage component and the data storage component are respectively connected to the message processing component. This method is explained using the online instant messaging system shown in Figure 1 as an example, including the following steps:
  • Step 302 The communication component receives the IM consultation dialogue message and sends the IM consultation dialogue message to the message processing component and the data storage component;
  • Step 304 The data storage component extracts the patient identity and the doctor's identity in the IM consultation conversation message, splices the patient's identity and the doctor's identity into a session identity, and based on the session identity, uses data fragmentation and data routing.
  • IM consultation conversation messages are stored in the default IM database;
  • Step 306 When the message processing component receives a data query request carrying a doctor's identity or a patient's identity, it queries the preset IM database based on the doctor's identity or patient's identity, obtains the query results, and pushes the query through the communication component. result.
  • the communication component, data storage component and message processing component maintain communication with each other through RPC, message queue and other methods.
  • the data storage component extracts the patient identity identifier patientId and doctor identity identifier doctorId in the IM consultation dialogue message entity, splices the patient identity identifier patientId and doctor identity identifier patientId into a session identifier, and uses the session identifier as
  • the KEY of data fragmentation and data routing stores IM consultation conversation messages in the default IM database in the form of data fragmentation and data routing.
  • the message processing component can query the message based on the doctor's identity or patient's identity in the request.
  • the logo is queried in the preset IM database to obtain the corresponding query results, and then the query results are sent to the client through the communication component to meet the user's query needs.
  • the message processing component before pushing the query results, the message processing component also performs data desensitization processing on the query results, and pushes the query results after the data desensitization processing through the communication component.
  • the online consultation instant messaging system includes independent components and has the functions of communication, message processing and storage at the same time.
  • the components can maintain message consistency and support high concurrency.
  • the data storage component stores IM consultation conversation messages based on patient identity and doctor identity in the form of data sharding and data routing, which not only greatly disperses the reading and writing pressure, but also enables the message processing component to receive the doctor's identity when it receives the message.
  • the query is performed in the preset IM database based on the doctor's identity or the patient's identity, and the corresponding query results are obtained, thereby realizing personalized query of the consultation dialogue messages between a specific doctor and a specific patient.
  • using the above method can support high-concurrency and efficient queries.
  • the component module includes communication component, data storage component and message processing component. Communication component, data storage component and message processing component maintain communication with each other through RPC, message queue and other methods. Moreover, conventional IM services never provide external APIs.
  • the communication component is added with an independent server-side API interface. This interface is exposed to various service backgrounds and is used to send robot messages (template messages) and Card messages, etc., this interface can meet the fault tolerance and load balancing of the interface caller and support horizontal expansion of the API layer. In addition, in order to prevent information bombing, this interface can also meet security, flow control, desensitization and other functional support.
  • the user terminal establishes a connection with the communication component.
  • the communication component can trigger a greeting message sending event and generate a greeting message according to the greeting message template, such as "Hello, how can I help you?" to start an online consultation session.
  • the IM consultation conversation messages in the session are sent to the computing component and the data storage component in real time.
  • the communication component monitors the connection status of all user terminals in real time.
  • the user terminal Once it is found that the user terminal has been disconnected for a period of time, it will send a user logout event to the user terminal, update the user status to offline, and obtain the current IM text messages and preset offline message push fields (such as appId, device number, device type, pushed title, etc.) are based on the current IM text message content and supplemented with appId, device number, device type, pushed title, etc. Content, after synthesizing the complete offline message, call the interface of the push platform to complete the offline message push. When the consultation ends, the timer starts. When 20 minutes have elapsed after the consultation, the message template for the corresponding business will be queried immediately based on the biztype and consultid fields in the IM consultation dialogue message body.
  • the current IM text messages and preset offline message push fields such as appId, device number, device type, pushed title, etc.
  • This template is replaced by placeholders. to provide. For example: Hello, $User, your consultation $ConsultID has ended. What is your evaluation of this service? Then, when the template is queried, the placeholders in the template are replaced with variable information such as consultid to generate the final template message.
  • the data storage component After receiving the IM consultation dialogue message, the data storage component extracts the patient identity identifier patientId and doctor identity identifier doctorId in the message entity of the IM consultation dialogue message, splices the patient identity identifier patientId and doctor identity identifier patientId into a session identifier, and The last 4 digits of the session identifier are used as the KEY for data fragmentation and data routing.
  • the IM consultation conversation message is stored in the default IM database in the form of data fragmentation and data routing.
  • the IM consultation dialogue messages are stored in the form of separate databases and tables based on the built IM consultation dialogue message storage model.
  • the fields included in the IM consultation dialogue message storage model are: MessageId (message ID), ConsultId (consultation ID), appId (terminal type), bizType (message business type), doctorId (doctor ID), patientId (patient ID), From (sender), To (receiver), Message (message content), Time (sending time), Status (message status).
  • the doctorId and patientId will be used as keys for data routing shards in storage.
  • the AppId will be used in later pushes to indicate the device terminal type being pushed.
  • BizType and consultID will be used in risk control and AI scenarios to refine the business affiliation and business type of the message.
  • the message processing component When the message processing component receives the data query request carrying the doctor's identity or the patient's identity sent by the client, it queries the preset IM database based on the doctor's identity or the patient's identity, obtains the query results, and communicates the query results The component is sent to the client to satisfy the user's query needs.
  • a computer-readable storage medium is provided.
  • the computer-readable storage medium may be non-volatile or volatile.
  • a computer program is stored thereon and the computer program is executed by a processor.

Abstract

The present application relates to the fields of artificial intelligence and digital medical healthcare. Provided are an online consulting instant messaging system and a message processing method. The system comprises a communication module, a message processing module and a data storage module. The communication module receives an IM consulting session message, and sends the IM consulting session message to the message processing module and the data storage module; the data storage module extracts a patient identification and a doctor identification from the IM consulting session message, splices the patient identification and the doctor identification to form a session identifier, and, on the basis of the session identifier, stores the IM consulting session message into a preset IM database by means of a data partitioning mode and a data routing mode; and, the message processing module receives a data query request carrying a doctor identification or a patient identification, queries in the preset IM database according to the doctor identification or the patient identification to obtain a query result, and pushes the query result by means of the communication module. By using the solution, efficient high-concurrency query can be supported.

Description

在线问诊即时通讯系统和消息处理方法Online consultation instant messaging system and message processing method
本申请要求于2022年03月22日提交中国专利局、申请号为202210283140.9,发明名称为“在线问诊即时通讯系统和消息处理方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application submitted to the China Patent Office on March 22, 2022, with the application number 202210283140.9, and the invention name is "Online Consultation Instant Messaging System and Message Processing Method", the entire content of which is incorporated by reference in in this application.
技术领域Technical field
本申请涉及即时通讯、人工智能及数字医疗技术领域,特别是涉及一种在线问诊即时通讯系统和在线问诊即时通讯系统的消息处理方法。This application relates to the fields of instant messaging, artificial intelligence and digital medical technology, and in particular to an online consultation instant messaging system and a message processing method for an online consultation instant messaging system.
背景技术Background technique
在当今高度信息化的移动互联网时代,生活中IM(Instant Messaging,即时通讯)类产品已经成为必备品,像‘微信’、‘钉钉’等以IM核心的社交产品备受大家的青睐。一个网络即时通讯系统由一个即时消息服务器、连接到IM服务器的一个业务管理系统(SMS,Service Management System)以及同时连接到IM服务器的多个IM客户端组成。而IM服务框架大多是以IM服务单体框架呈现。In today's highly information-based mobile Internet era, IM (Instant Messaging, instant messaging) products have become a must-have in life. Social products with IM core such as "WeChat" and "DingTalk" are highly favored by everyone. A network instant messaging system consists of an instant messaging server, a service management system (SMS, Service Management System) connected to the IM server, and multiple IM clients connected to the IM server at the same time. Most IM service frameworks are presented as IM service monomer frameworks.
伴随着互联网医疗行业的蓬勃发展,在线问诊场景成为嫁接医生和患者之间,提供医疗服务的重要核心功能。发明人发现,传统的IM服务单体无法支持高并发的消息传递,在医疗领域中的在线问诊场景下,传统的IM服务单体无法支持个性化的查询,如查询特定医生发送的所有消息、特定患者收到的特定医生的消息、或特定某次问诊过程中所有的消息,若遇到高并发的在线问诊时,传统的IM服务单体将会出现负载过大的情况,无法保证系统的稳定运行。With the vigorous development of the Internet medical industry, online consultation scenarios have become an important core function that bridges the gap between doctors and patients and provides medical services. The inventor found that the traditional IM service unit cannot support high-concurrency messaging. In the online consultation scenario in the medical field, the traditional IM service unit cannot support personalized queries, such as querying all messages sent by a specific doctor. , messages received by a specific patient from a specific doctor, or all messages during a specific consultation process, if encountering high-concurrency online consultations, the traditional IM service unit will be overloaded and unable to Ensure the stable operation of the system.
因此,目前医疗行业普遍亟需一个能够支持高效查询的即时通讯方案。Therefore, the current medical industry is generally in urgent need of an instant messaging solution that can support efficient queries.
发明内容Contents of the invention
基于此,有必要针对上述技术问题,提供一种能够支持高并发在线问诊的在线问诊即时通讯系统和在线问诊即时通讯系统的消息处理方法。Based on this, it is necessary to address the above technical problems and provide an online consultation instant messaging system and a message processing method for the online consultation instant messaging system that can support high-concurrency online consultations.
第一方面,本申请提供了一种在线问诊即时通讯系统,系统包括:通信组件、消息处理组件和数据存储组件,通信组件和数据存储组件分别与消息处理组件连接;In the first aspect, this application provides an online consultation instant messaging system. The system includes: a communication component, a message processing component and a data storage component. The communication component and the data storage component are respectively connected to the message processing component;
通信组件用于接收IM问诊对话消息,将IM问诊对话消息发送至消息处理组件和数据存储组件;The communication component is used to receive IM consultation dialogue messages and send IM consultation dialogue messages to the message processing component and data storage component;
数据存储组件用于提取IM问诊对话消息中的患者身份标识和医生身份标识,将患者身份标识和医生身份标识拼接成会话标识,基于会话标识,以数据分片和数据路由的方式,将IM问诊对话消息存储至预设IM数据库中;The data storage component is used to extract the patient identity and doctor's identity in the IM consultation conversation message, and splice the patient's identity and doctor's identity into a session identity. Based on the session identity, the IM is stored in the form of data fragmentation and data routing. The consultation conversation messages are stored in the default IM database;
消息处理组件用于接收携带医生身份标识或患者身份标识的数据查询请求,根据医生身份标识或患者身份标识在预设IM数据库中进行查询,得到查询结果,通过通信组件推送查询结果。The message processing component is used to receive a data query request carrying a doctor's identity or patient's identity, query the preset IM database based on the doctor's identity or patient's identity, obtain the query results, and push the query results through the communication component.
上述在线问诊即时通讯系统,将传统的IM服务单体架构分割成独立的组件模块,使得 在线问诊即时通讯系统同时具备通信、消息处理和存储的功能,各组件之间能够保持消息的一致性,且支持高并发的数据查询。此外,基于患者身份标识和医生身份标识,以数据分片和数据路由的方式存储IM问诊对话消息,能够在极大地分散读写压力的同时,使得在接收到携带医生身份标识或患者身份标识的数据查询请求时,根据医生身份标识或患者身份标识在预设IM数据库中进行查询,得到相应的查询结果,实现特定医生和特定患者的问诊对话消息的个性化查询。综上所述,通过采用上述系统,能够支持高并发的高效查询。The above-mentioned online consultation instant messaging system divides the traditional IM service monolithic architecture into independent component modules, so that the online consultation instant messaging system has the functions of communication, message processing and storage at the same time, and the consistency of messages between each component can be maintained and supports high-concurrency data query. In addition, based on the patient's identity and the doctor's identity, IM consultation conversation messages are stored in the form of data sharding and data routing, which can greatly disperse the reading and writing pressure, so that when receiving the message carrying the doctor's identity or the patient's identity When making a data query request, the query is performed in the preset IM database based on the doctor's identity or patient's identity, and the corresponding query results are obtained, thereby realizing personalized query of the consultation dialogue messages between a specific doctor and a specific patient. In summary, by adopting the above system, it is possible to support high-concurrency and efficient queries.
第二方面,本申请还提供了一种在线问诊即时通讯系统的消息处理方法,在线问诊即时通讯系统包括通信组件、消息处理组件和数据存储组件,通信组件和数据存储组件分别与消息处理组件连接,方法包括:In the second aspect, this application also provides a message processing method for an online consultation instant messaging system. The online consultation instant messaging system includes a communication component, a message processing component and a data storage component. The communication component and the data storage component are respectively related to the message processing component. Component connection methods include:
通信组件接收IM问诊对话消息,将IM问诊对话消息发送至消息处理组件和数据存储组件;The communication component receives the IM consultation dialogue message and sends the IM consultation dialogue message to the message processing component and the data storage component;
数据存储组件提取IM问诊对话消息中的患者身份标识和医生身份标识,将患者身份标识和医生身份标识拼接成会话标识,基于会话标识,以数据分片和数据路由的方式,将IM问诊对话消息存储至预设IM数据库中;The data storage component extracts the patient identity and doctor's identity in the IM consultation conversation message, splices the patient's identity and doctor's identity into a session identity, and based on the session identity, the IM consultation is stored in the form of data sharding and data routing. Conversation messages are stored in the default IM database;
当消息处理组件接收到携带医生身份标识或患者身份标识的数据查询请求时,根据医生身份标识或患者身份标识在预设IM数据库中进行查询,得到查询结果,并通过通信组件推送查询结果。When the message processing component receives a data query request carrying a doctor's identity or patient's identity, it queries the preset IM database based on the doctor's identity or patient's identity, obtains the query results, and pushes the query results through the communication component.
第三方面,本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a third aspect, this application also provides a computer-readable storage medium. The computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by the processor, the following steps are implemented:
通信组件接收IM问诊对话消息,将所述IM问诊对话消息发送至消息处理组件和数据存储组件;The communication component receives the IM consultation dialogue message and sends the IM consultation dialogue message to the message processing component and the data storage component;
所述数据存储组件提取所述IM问诊对话消息中的患者身份标识和医生身份标识,将所述患者身份标识和所述医生身份标识拼接成会话标识,基于所述会话标识,以数据分片和数据路由的方式,将所述IM问诊对话消息存储至预设IM数据库中;The data storage component extracts the patient identity and the doctor's identity in the IM consultation conversation message, splices the patient's identity and the doctor's identity into a session identity, and segments the data based on the session identity. and data routing, storing the IM consultation conversation message in a preset IM database;
当所述消息处理组件接收到携带医生身份标识或患者身份标识的数据查询请求时,根据所述医生身份标识或所述患者身份标识在预设IM数据库中进行查询,得到查询结果,并通过所述通信组件推送所述查询结果。When the message processing component receives a data query request carrying a doctor's identity or a patient's identity, it performs a query in the preset IM database based on the doctor's identity or the patient's identity, obtains the query results, and passes the required The communication component pushes the query results.
上述在线问诊即时通讯系统的消息处理方法,在线问诊即时通讯系统包括相互独立的组件,同时具备通信、消息处理和存储的功能,各组件之间能够保持消息的一致性,且支持高并发的数据查询。数据存储组件基于患者身份标识和医生身份标识,以数据分片和数据路由的方式存储IM问诊对话消息,不仅能够极大地分散读写压力,还能使消息处理组件在接收到携带医生身份标识或患者身份标识的数据查询请求时,根据医生身份标识或患者身份标识在预设IM数据库中进行查询,得到相应的查询结果,实现特定医生和特定患者的问诊对话消息的个性化查询。综上所述,采用上述方法,能够支持高并发的高效查询。According to the message processing method of the above-mentioned online consultation instant messaging system, the online consultation instant messaging system includes independent components and has the functions of communication, message processing and storage at the same time. The components can maintain message consistency and support high concurrency. data query. The data storage component stores IM consultation conversation messages based on patient identity and doctor identity in the form of data sharding and data routing, which not only greatly disperses the reading and writing pressure, but also enables the message processing component to receive the doctor's identity when it receives the message. When a data query request is made for a specific doctor or a patient's identity, the query is performed in the preset IM database based on the doctor's identity or the patient's identity, and the corresponding query results are obtained, thereby realizing personalized query of the consultation dialogue messages between a specific doctor and a specific patient. In summary, using the above method can support high-concurrency and efficient queries.
附图说明Description of the drawings
图1为一个实施例中在线问诊即时通讯系统的结构框图;Figure 1 is a structural block diagram of an online consultation instant messaging system in one embodiment;
图2为一个实施例中在线问诊场景的场景示意图;Figure 2 is a schematic diagram of an online consultation scenario in one embodiment;
图3为一个实施例中在线问诊即时通讯系统的消息处理方法的流程示意图。Figure 3 is a schematic flowchart of a message processing method of the online consultation instant messaging system in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
在其中一个实施例中,如图1所示,提供了一种在线问诊即时通讯系统,包括系统包括:通信组件200、消息处理组件202和数据存储组件204,通信组件200和所述数据存储组件204分别与消息处理组件202连接;In one embodiment, as shown in Figure 1, an online consultation instant messaging system is provided, including the system including: a communication component 200, a message processing component 202 and a data storage component 204. The communication component 200 and the data storage Component 204 is connected to message processing component 202 respectively;
通信组件用于接收IM问诊对话消息,将IM问诊对话消息发送至消息处理组件和数据存储组件;The communication component is used to receive IM consultation dialogue messages and send IM consultation dialogue messages to the message processing component and data storage component;
数据存储组件用于提取IM问诊对话消息中的患者身份标识和医生身份标识,将患者身份标识和医生身份标识拼接成会话标识,基于会话标识,以数据分片和数据路由的方式,将IM问诊对话消息存储至预设IM数据库中;The data storage component is used to extract the patient identity and doctor's identity in the IM consultation conversation message, and splice the patient's identity and doctor's identity into a session identity. Based on the session identity, the IM is stored in the form of data fragmentation and data routing. The consultation conversation messages are stored in the default IM database;
消息处理组件用于接收携带医生身份标识或患者身份标识的数据查询请求,根据医生身份标识或患者身份标识在预设IM数据库中进行查询,得到查询结果,通过通信组件推送查询结果。The message processing component is used to receive a data query request carrying a doctor's identity or patient's identity, query the preset IM database based on the doctor's identity or patient's identity, obtain the query results, and push the query results through the communication component.
即时通信系统是一款跨平台(Linux Server,Windows Server),可定制的P2P即时通信系统(集成多人视频会议功能),为各行业门户网站和企事业单位提供“一站式”定制解决方案,打造一个稳定,安全,高效,可扩展的即时通信系统,在用户使用习惯的设计上接近或兼容MSN,TM,贸易通和淘宝旺旺等即时通讯产品。但是,传统的IM服务框架一般都是服务单体框架,当本实施例中,通信组件负责消息的推送到达,是中心化的服务。所有类型的用户消息都会通过这个中心化的通信组件来完成消息的流转和投递,但每条消息处理是交给数据存储组件和消息处理组件的。需要说明的是,常规的IM服务是从来不提供API(Application Programming Interface,应用程序编程接口)向外的,只提供基础的长链接通信功能。为了满足模板消息的投递,就必须让IM服务暴露独立的服务端接口,该接口面向其他相关业务应用,提供发送模板消息的功能。因此,本实施例中,通信组件增加有独立的服务端API接口后,该接口对外暴露给各个服务后台,用来发送机器人消息(模板消息)和卡片消息等,该接口能够满足接口调用方的容错和负载均衡并支持横向扩展API层,此外,为了防止信息轰炸,该接口还可以满足安全的、流控、脱敏等功能支持。The instant messaging system is a cross-platform (Linux Server, Windows Server), customizable P2P instant messaging system (integrated multi-person video conferencing function), providing "one-stop" customized solutions for various industry portals and enterprises and institutions , to create a stable, safe, efficient and scalable instant messaging system that is close to or compatible with instant messaging products such as MSN, TM, Tradelink and Taobao Want Want in terms of user habits. However, traditional IM service frameworks are generally service monolithic frameworks. In this embodiment, the communication component is responsible for the push and arrival of messages, which is a centralized service. All types of user messages will be transferred and delivered through this centralized communication component, but the processing of each message is handed over to the data storage component and message processing component. It should be noted that conventional IM services never provide API (Application Programming Interface, Application Programming Interface) to the outside world, and only provide basic long link communication functions. In order to meet the delivery of template messages, the IM service must expose an independent server interface. This interface provides the function of sending template messages for other related business applications. Therefore, in this embodiment, after the communication component is added with an independent server API interface, the interface is exposed to each service background and used to send robot messages (template messages) and card messages, etc. This interface can meet the needs of the interface caller. It has fault tolerance and load balancing and supports horizontal expansion of the API layer. In addition, in order to prevent information bombing, the interface can also support security, flow control, desensitization and other functions.
消息处理组件又可称为计算组件,提供IM问诊对话消息的相关查询服务,并负责对查询结果进行数据脱敏处理。在部署上面,根据各自服务负载的不同单独预估容量并规划服务器资源。由于IM问诊对话消息是根据患者身份标识和医生身份标识进行存储的,因此,当 用户想要查询特定的医生和患者发送的消息时,可发送携带医生身份标识或患者身份标识的数据查询请求至消息处理组件,消息处理组件可根据数据查询请求中的医生身份标识或患者身份标识在预设IM数据库中进行查询,得到相应的查询结果,然后,将查询结果通过通信组件发送至客户端,以满足用户的查询需求。The message processing component, also known as the computing component, provides query services related to IM consultation dialogue messages and is responsible for data desensitization of query results. In terms of deployment, capacity is estimated individually and server resources are planned based on the respective service loads. Since IM consultation conversation messages are stored based on patient identification and doctor identification, when the user wants to query messages sent by a specific doctor and patient, he or she can send a data query request carrying the doctor's identification or patient's identification. To the message processing component, the message processing component can query the preset IM database according to the doctor identity or patient identity in the data query request, obtain the corresponding query results, and then send the query results to the client through the communication component. To meet the user's query needs.
对于待存储处理的海量数据,需要通过数据分片(Shard/Partition)将数据进行切分并分配到各个机器中区,数据分片后,通过数据路由的方式,能够找到某条记录的存储位置。因此,本实施例中,数据存储组件接收到IM问诊对话消息后,提取IM问诊对话消息实体中的患者身份标识patientId和医生身份标识doctorId,将患者身份标识patientId和医生身份标识patientId拼接成会话标识,将会话标识作为数据分片和数据路由的KEY,以数据分片和数据路由的方式,将IM问诊对话消息存储至预设IM数据库中。如此,不仅极大地分散了数据读写压力,也能会话消息与医生和患者关联起来。For massive data to be stored and processed, the data needs to be divided and distributed to each machine area through data sharding (Shard/Partition). After the data is sharded, the storage location of a certain record can be found through data routing. . Therefore, in this embodiment, after receiving the IM consultation dialogue message, the data storage component extracts the patient identity identifier patientId and doctor identity identifier patientId in the IM consultation dialogue message entity, and splices the patient identity identifier patientId and doctor identity identifier patientId into The session identifier is used as the KEY for data fragmentation and data routing, and the IM consultation dialogue message is stored in the preset IM database in the form of data fragmentation and data routing. In this way, it not only greatly disperses the pressure of data reading and writing, but also associates conversational messages with doctors and patients.
上述在线问诊即时通讯系统,将传统的IM服务单体架构分割成独立的组件模块,使得在线问诊即时通讯系统具备通信、消息处理和存储的功能,各组件之间能够达到消息的一致性,支持高并发的数据查询。此外,基于患者身份标识和医生身份标识,以数据分片和数据路由的方式存储IM问诊对话消息,能够在极大地分散读写压力的同时,使得在接收到携带医生身份标识或患者身份标识的数据查询请求时,根据医生身份标识或患者身份标识在预设IM数据库中进行查询,得到相应的查询结果,实现特定医生和特定患者的问诊对话消息的个性化查询。综上所述,通过采用上述系统,能够支持高并发的高效查询。The above-mentioned online consultation instant messaging system divides the traditional IM service monolithic architecture into independent component modules, so that the online consultation instant messaging system has the functions of communication, message processing and storage, and can achieve message consistency between components. , supports high-concurrency data query. In addition, based on the patient's identity and the doctor's identity, IM consultation conversation messages are stored in the form of data sharding and data routing, which can greatly disperse the reading and writing pressure, so that when receiving the message carrying the doctor's identity or the patient's identity When making a data query request, the query is performed in the preset IM database based on the doctor's identity or patient's identity, and the corresponding query results are obtained, thereby realizing personalized query of the consultation dialogue messages between a specific doctor and a specific patient. In summary, by adopting the above system, it is possible to support high-concurrency and efficient queries.
在其中一个实施例中,消息处理组件还用于在通过通信组件推送查询结果之前,对查询结果进行数据脱敏处理,通信组件还用于推送数据脱敏后的查询结果。In one of the embodiments, the message processing component is also used to perform data desensitization processing on the query results before pushing the query results through the communication component, and the communication component is also used to push the query results after data desensitization.
数据脱敏是指对某些敏感信息通过脱敏规则进行数据的变形,实现敏感隐私数据的可靠保护。在涉及客户安全数据或者一些商业性敏感数据的情况下,在不违反系统规则条件下,对真实数据进行改造并提供测试使用,如身份证号、手机号、卡号、客户号等个人信息都需要进行数据脱敏。敏感信息依赖于实际业务场景和安全维度,以自然人为例,用户个体的敏感字段包括:姓名、身份证号、手机号、邮箱地址等等;在银行系统,作为客户,可能还涉及银行卡号、过期时间、支付密码等等;在公司系统,作为员工,可能还涉及薪资、教育背景等;在医疗系统,作为患者,可能还涉及就诊信息等等。具体的,数据脱敏分为静态数据脱敏和动态数据脱敏。静态数据脱敏,是数据的“搬移并仿真替换”,是将数据抽取进行脱敏处理后,下发给下游环节,随意取用和读写的,脱敏后数据与生产环境相隔离,满足业务需求的同时保障生产数据库的安全。动态数据脱敏,在访问敏感数据的同时实时进行脱敏处理,可以为不同角色、不同权限、不同数据类型执行不同的脱敏方案,从而确保返回的数据可用而安全。Data desensitization refers to the deformation of certain sensitive information through desensitization rules to achieve reliable protection of sensitive private data. When customer security data or some commercially sensitive data is involved, real data must be transformed and used for testing without violating system rules, such as ID number, mobile phone number, card number, customer number and other personal information. Perform data desensitization. Sensitive information depends on the actual business scenario and security dimensions. Taking natural persons as an example, the sensitive fields of individual users include: name, ID number, mobile phone number, email address, etc.; in the banking system, as a customer, it may also involve bank card number, Expiration time, payment password, etc.; in the company system, as an employee, it may also involve salary, educational background, etc.; in the medical system, as a patient, it may also involve medical treatment information, etc. Specifically, data desensitization is divided into static data desensitization and dynamic data desensitization. Static data desensitization is the "movement and simulation replacement" of data. After the data is extracted and desensitized, it is sent to downstream links for free access, reading and writing. After desensitization, the data is isolated from the production environment, which satisfies meet business needs while ensuring the security of the production database. Dynamic data desensitization performs desensitization processing in real time while accessing sensitive data. It can implement different desensitization schemes for different roles, different permissions, and different data types, thereby ensuring that the returned data is available and safe.
本实施例中,可以是按照动态数据脱敏的方式,在接收到查询请求,执行查询语句的过程中,根据判断预设的生效条件是否满足,实现实时的脱敏处理。生效条件,通常是针对当前用户角色的判断。敏感数据的可见范围,即是针对不同用户预设的。系统管理员,具有最高权限,任何时刻对任何表的任何字段都可见。本实施例中,可以是确认客户端的用户的身 份后,在执行查询语句的过程中,按照脱敏规则对查询结果进行实时脱敏处理,实现数据的可靠保护。在另一个实施例中,还可以是消息处理组件在IM问诊对话消息进行存储之前,对IM问诊对话消息进行脱敏处理,将脱敏后的IM问诊消息发送至数据存储组件,以便数据存储组件将脱敏后的IM问诊对话消息存储至预设IM数据库中,具体的,常用的脱敏规则包括替换、重排、加密、截断、掩码,本实施例中,可以是通过重排、加密或掩码等方式对医生身份标识和患者身份标识进行脱敏处理。In this embodiment, the dynamic data desensitization method may be used. During the process of receiving the query request and executing the query statement, real-time desensitization processing can be implemented based on determining whether the preset validity conditions are met. Validation conditions are usually based on the judgment of the current user role. The visible range of sensitive data is preset for different users. The system administrator has the highest authority and can see any field in any table at any time. In this embodiment, after confirming the identity of the client user, during the process of executing the query statement, the query results are desensitized in real time according to the desensitization rules to achieve reliable protection of the data. In another embodiment, the message processing component may also desensitize the IM consultation dialogue message before storing it, and send the desensitized IM consultation message to the data storage component, so that The data storage component stores the desensitized IM consultation conversation messages into the preset IM database. Specifically, commonly used desensitization rules include replacement, rearrangement, encryption, truncation, and masking. In this embodiment, it can be Desensitize doctor identification and patient identification by means of rearrangement, encryption or masking.
在其中一个实施例中,数据存储组件还用于提取会话标识中预设数量的字符,将预设数量的字符确定为数据分片和数据路由的主键,根据主键,以数据分片和数据路由的方式,将IM问诊对话消息存储至对应的预设IM数据库中。In one of the embodiments, the data storage component is also used to extract a preset number of characters in the session identification, determine the preset number of characters as the primary key of data fragmentation and data routing, and use the data fragmentation and data routing according to the primary key. method, the IM consultation conversation message is stored in the corresponding default IM database.
具体实施时,可以是提取由会话标识中末4位,将其作为数据分片和数据路由的主键即key,然后,划分IM问诊对话消息,以数据分片和数据路由的方式将IM问诊对话消息存储至IM数据库中,本实施例中,以会话标识的末4位为唯一标识,存储IM数据能够在保障IM问诊对话消息的有序存储的同时,做到将IM问诊对话消息与展开会话的医生和患者相关联起来,便于后续的数据查询。In specific implementation, the last 4 bits of the session identifier can be extracted and used as the primary key for data fragmentation and data routing. Then, the IM consultation dialogue message is divided, and the IM consultation message is divided into data fragmentation and data routing methods. The medical consultation dialogue messages are stored in the IM database. In this embodiment, the last 4 digits of the session identifier are used as the unique identifier. Storing the IM data can ensure the orderly storage of the IM medical consultation dialogue messages, and at the same time, the IM medical consultation dialogue can be stored in an orderly manner. Messages are associated with the doctor and patient who initiated the session to facilitate subsequent data queries.
在其中一个实施例中,数据存储组件还用于还包括IM问诊对话消息存储模型,IM问诊对话消息存储模型用于将IM问诊对话消息按照问诊会话标识字段、患者身份标识字段、医生身份标识字段、终端标识字段和消息业务类型字段的格式存储至预设IM数据库。In one of the embodiments, the data storage component is also used to further include an IM consultation dialogue message storage model. The IM consultation dialogue message storage model is used to store the IM consultation dialogue message according to the consultation session identification field, the patient identity identification field, The formats of the doctor identity field, terminal identification field and message service type field are stored in the default IM database.
目前,非医疗场景下的经典IM问诊对话消息存储模型是:MessageId(消息ID)、From(发送者)、To(接收者)、Message(消息内容)、Time(发送时间)和Status(消息状态)。上述IM问诊对话消息存储模型的无法明确消息收发者的身份,如果用户要查询特定医生发送的所有消息、特定患者收到的特定医生的消息、或特定某次问诊过程中所有的消息,便无法满足用户的查询需求。因此,本实施例中,对IM问诊对话消息存储模型进行扩展,本实施例中的IM问诊对话消息存储模型包括的字段有:MessageId(消息ID)、ConsultId(问诊ID)、appId(终端类型)、bizType(消息业务类型)、doctorId(医生ID)、patientId(患者ID)、From(发送者)、To(接收者)、Message(消息内容)、Time(发送时间)、Status(消息状态)。其中doctorId和patientId会在存储中用作数据路由分片的key。AppId会用在后期的推送中,用来表明推送的设备终端类型。BizType和consultID会用在风险控制和AI(Artificial Intelligence,人工智能)场景中,用来细化消息的业务所属、业务类型。其中,人工智能场景可以包括开展智能问诊会话,发送机器人模板消息。通过新引入的、ConsultId(问诊ID)、appId(终端类型)、bizType(消息业务类型)、doctorId(医生ID)、patientId(患者ID)这5个字段,可以扩充出更为丰富的医疗数据维度,从而更好满足医疗相关特定场景。Currently, the classic IM consultation dialogue message storage model in non-medical scenarios is: MessageId (message ID), From (sender), To (receiver), Message (message content), Time (sending time) and Status (message state). The above IM consultation dialogue message storage model cannot clarify the identity of the message sender and receiver. If the user wants to query all messages sent by a specific doctor, messages from a specific doctor received by a specific patient, or all messages during a specific consultation process, It cannot meet the user's query needs. Therefore, in this embodiment, the IM consultation dialogue message storage model is expanded. The IM consultation dialogue message storage model in this embodiment includes fields: MessageId (message ID), ConsultId (consultation ID), appId ( Terminal type), bizType (message service type), doctorId (doctor ID), patientId (patient ID), From (sender), To (receiver), Message (message content), Time (sending time), Status (message state). The doctorId and patientId will be used as keys for data routing shards in storage. The AppId will be used in later pushes to indicate the device terminal type being pushed. BizType and consultID will be used in risk control and AI (Artificial Intelligence, artificial intelligence) scenarios to refine the business affiliation and business type of the message. Among them, artificial intelligence scenarios can include conducting intelligent consultation sessions and sending robot template messages. Richer medical data can be expanded through the newly introduced five fields: ConsultId (consultation ID), appId (terminal type), bizType (message service type), doctorId (doctor ID), and patientId (patient ID). dimensions to better meet specific medical-related scenarios.
在其中一个实施例中,通信组件还用于当模板消息生成事件触发时,获取消息模板,根据消息模板生成对应的模板消息,推送模板消息。In one embodiment, the communication component is also used to obtain a message template when a template message generation event is triggered, generate a corresponding template message according to the message template, and push the template message.
具体实施时,IM问诊对话消息的发送者,有的时候,不是人为发出的,而是通讯组件在特定规则触发的、并根据特定模版规则生成并发出来的模板消息,也就是AI机器人模板消息, 例如,可以是在患者点击展开会话时,触发问候消息发送事件,根据问候消息模板生成问候消息,例如“您好,请问有什么可以帮到您?”,本实施例中,通过发送模板消息能够提高沟通效率,节省沟通时长。In specific implementation, the sender of the IM consultation dialogue message is sometimes not a human sender, but a template message triggered by the communication component under specific rules and generated and sent according to specific template rules, that is, the AI robot template message For example, when the patient clicks to expand the session, a greeting message sending event can be triggered, and a greeting message is generated according to the greeting message template, such as "Hello, how can I help you?" In this embodiment, by sending the template message It can improve communication efficiency and save communication time.
在其中一个实施例中,通信组件还用于当会话结束达到预设时长时,提取会话的IM问诊对话消息体中的消息业务类型和问诊标识,根据消息业务类型和问诊标识,查找到对应的目标消息模板,基于目标消息模板,生成模板消息,推送模板消息。In one embodiment, the communication component is also used to extract the message service type and consultation identifier in the IM consultation dialogue message body of the session when the session ends and reaches the preset duration, and search based on the message service type and consultation identifier. Go to the corresponding target message template, generate a template message based on the target message template, and push the template message.
本实施例中,例如在问诊结束后的评价信息场景中,此时的触发规则由通信组件来应用并触发的,当问诊结束后,开始计时,当问诊结束后满了20分钟,会立刻根据IM问诊对话消息体中的biztype、consultid字段查询对应业务的消息模板,此模板以占位符替换的方式来提供。例如:您好,$User,您的问诊$ConsultID已经结束,您对此次服务评价如何?然后,当查询到此模板后,结合consultid等变量信息,替换模板中的占位符生成最终的模板消息。可以理解的是,在其他实施例中,可以是在问诊结束后的10分钟或5分钟后,发送模板消息,具体可根据实际情况而设定,在此不做限定。In this embodiment, for example, in the evaluation information scene after the consultation, the triggering rules at this time are applied and triggered by the communication component. When the consultation ends, the timer starts, and when 20 minutes have passed after the consultation, The message template for the corresponding business will be immediately queried based on the biztype and consultid fields in the IM consultation conversation message body. This template is provided in the form of placeholder replacement. For example: Hello, $User, your consultation $ConsultID has ended. What is your evaluation of this service? Then, when the template is queried, the placeholders in the template are replaced with variable information such as consultid to generate the final template message. It can be understood that in other embodiments, the template message may be sent 10 minutes or 5 minutes after the consultation is completed. The specific setting can be set according to the actual situation, and is not limited here.
在其中一个实施例中,IM数据库包括多个子数据库和子数据表,数据存储组件还用于按照分库分表的方式将IM问诊对话消息存储至预设IM数据库。In one embodiment, the IM database includes multiple sub-databases and sub-data tables, and the data storage component is also used to store the IM consultation conversation messages into the preset IM database in a sub-database and sub-table manner.
在实际应用中,对于一个用户规模较大的IM平台来说,IM问诊对话消息的存储至关重要,存储必须满足存储空间可扩展、读写时效低、历史数据归档等特性。本方案立足于这三点特性,在存储层面,将底层的数据库拆分为若干的子库和子表,并在应用层面利用了分库分表的写入数据方案。具体的,可以是将IM数据库拆分为10库10表,并给每个表都加上单独的表名,例如:msg_1010、msg_0103、msg_0204,数字的前两位表征子库的序号,后两位表征子表的编号,然后,提取IM问诊对话消息中的doctorId、patientId两个用户id拼接成会话id,然后根据会话id的尾4位来做数据的分片路由写入和读取。可以理解的是,在其他实施例中,还可以是将IM数据库拆分为更多的子库和子表。本实施例中,通过将IM数据库拆分为多个子库和子表的方式,能够进一步分散数据读写压力。In practical applications, for an IM platform with a large user base, the storage of IM consultation conversation messages is crucial. The storage must meet the characteristics of scalable storage space, low read and write timeliness, and historical data archiving. This solution is based on these three characteristics. At the storage level, the underlying database is split into several sub-databases and sub-tables, and at the application level, the data writing scheme of sub-databases and sub-tables is used. Specifically, you can split the IM database into 10 databases and 10 tables, and add a separate table name to each table, for example: msg_1010, msg_0103, msg_0204. The first two digits of the number represent the serial number of the sub-database, and the last two The bit represents the number of the sub-table. Then, the two user IDs doctorId and patientId in the IM consultation conversation message are extracted and spliced into a session ID, and then the data is written and read based on the last 4 bits of the session ID. It can be understood that in other embodiments, the IM database can also be split into more sub-databases and sub-tables. In this embodiment, by splitting the IM database into multiple sub-databases and sub-tables, data reading and writing pressure can be further dispersed.
在其中一个实施例中,通信组件还用于监听客户端的连接状态,当监听到客户端处于离线状态,则发送用户注销事件消息至客户端,将连接状态更新为离线状态。In one embodiment, the communication component is also used to monitor the connection status of the client. When it is detected that the client is offline, it sends a user logout event message to the client and updates the connection status to the offline status.
具体实施时,IM的通信组件会实时监听所有用户终端的连接情况,一旦发现用户终端断联一段时间,就会发送用户注销事件消息至用户终端,并将用户状态更新为离线状态。本实施例中,通信组件监听用户终端的连接情况,能够及时更新用户终端的状态,以便离线消息的推送。During specific implementation, IM's communication component will monitor the connection status of all user terminals in real time. Once it is found that the user terminal has been disconnected for a period of time, it will send a user logout event message to the user terminal and update the user status to offline. In this embodiment, the communication component monitors the connection status of the user terminal and can update the status of the user terminal in time to facilitate the push of offline messages.
在其中一个实施例中,通信组件还用于当监听到客户端处于离线状态时,获取当前的IM文本消息内容和预设离线消息推送字段,根据当前的IM文本消息内容和预设离线消息推送字段合成离线消息,并推送离线消息至客户端。In one of the embodiments, the communication component is also used to obtain the current IM text message content and the preset offline message push field when it is detected that the client is offline, and push the current IM text message content and the preset offline message push field according to the current IM text message content and the preset offline message push field. Fields synthesize offline messages and push offline messages to the client.
具体实施时,每条消息在数据流的处理中,都会判断当前用户的在线状态,一旦发现用户离线,会获取当前的IM文本消息和预设的离线消息推送字段(如appId、设备号、设备类型、推送的标题等),并基于当前IM文本消息内容,并加以补充appId、设备号、设备类型、 推送的标题等内容,合成完整的离线消息后,调用推送平台的接口完成离线的消息推送。如此,即使用户终端在离线状态下,也能完成消息的推送和存储。During the specific implementation, each message will determine the online status of the current user during the processing of the data stream. Once the user is found to be offline, the current IM text message and the preset offline message push fields (such as appId, device number, device number, etc.) will be obtained. type, pushed title, etc.), and based on the current IM text message content, and supplementing the appId, device number, device type, pushed title, etc., after synthesizing the complete offline message, the interface of the push platform is called to complete the offline message push . In this way, even if the user terminal is offline, the push and storage of messages can be completed.
在其中一个实施例中,通信组件和数据存储组件通过RPC或消息队列的方式与消息处理组件进行通信。In one embodiment, the communication component and the data storage component communicate with the message processing component through RPC or message queue.
在实际应用中,为了解决IM服务单体架构下的负载过大问题,对IM问诊对话消息的通信、存储、计算三块主要功能切割为3块独立的组件模块,彼此之间通过RPC(Remote Procedure Call,远程进程调用)、消息队列等方式维持通信。RPC提供了一种进程间通信机制,程序可使用这种协议向网络中的另一台计算机上的程序请求服务,通过这一机制,在一台计算机上运行的程序可以顺畅地执行某个远程系统上的代码。“消息队列”是在消息的传输过程中保存消息的容器。消息被发送到队列中,消息队列管理器再将消息从它的源中继到它的目标时充当中间人。队列的主要目的是提供路由并保证消息的传递;如果发送消息时,接收者无法接收消息,消息队列会保留消息,直到可以成功地传递它。本实施例中,通过RPC或消息队列的方式,能够保证IM问诊对话消息的成功传递。In practical applications, in order to solve the problem of excessive load under the IM service monolithic architecture, the three main functions of communication, storage, and calculation of IM consultation dialogue messages are cut into three independent component modules, which are interconnected through RPC ( Remote Procedure Call, remote process call), message queue, etc. maintain communication. RPC provides an inter-process communication mechanism. A program can use this protocol to request services from a program on another computer in the network. Through this mechanism, a program running on one computer can smoothly execute a remote code on the system. A "message queue" is a container that saves messages during their transmission. Messages are sent to the queue, and the message queue manager acts as an intermediary in relaying the message from its source to its destination. The main purpose of a queue is to provide routing and ensure the delivery of messages; if a message is sent and the recipient is unable to receive it, the message queue retains the message until it can be successfully delivered. In this embodiment, the successful delivery of the IM consultation dialogue message can be ensured through RPC or message queue.
在一个实施例中,如图3所示,本申请还提供了一种在线问诊即时通讯系统的消息处理方法,在线问诊即时通讯系统包括通信组件、消息处理组件和数据存储组件,通信组件和数据存储组件分别与消息处理组件连接,以该方法应用于如图1所示的在线即时通讯系统为例进行说明,包括以下步骤:In one embodiment, as shown in Figure 3, this application also provides a message processing method for an online consultation instant messaging system. The online consultation instant messaging system includes a communication component, a message processing component and a data storage component. The communication component The data storage component and the data storage component are respectively connected to the message processing component. This method is explained using the online instant messaging system shown in Figure 1 as an example, including the following steps:
步骤302,通信组件接收IM问诊对话消息,将IM问诊对话消息发送至消息处理组件和数据存储组件;Step 302: The communication component receives the IM consultation dialogue message and sends the IM consultation dialogue message to the message processing component and the data storage component;
步骤304,数据存储组件提取IM问诊对话消息中的患者身份标识和医生身份标识,将患者身份标识和医生身份标识拼接成会话标识,基于会话标识,以数据分片和数据路由的方式,将IM问诊对话消息存储至预设IM数据库中;Step 304: The data storage component extracts the patient identity and the doctor's identity in the IM consultation conversation message, splices the patient's identity and the doctor's identity into a session identity, and based on the session identity, uses data fragmentation and data routing. IM consultation conversation messages are stored in the default IM database;
步骤306,当消息处理组件接收到携带医生身份标识或患者身份标识的数据查询请求时,根据医生身份标识或患者身份标识在预设IM数据库中进行查询,得到查询结果,并通过通信组件推送查询结果。Step 306: When the message processing component receives a data query request carrying a doctor's identity or a patient's identity, it queries the preset IM database based on the doctor's identity or patient's identity, obtains the query results, and pushes the query through the communication component. result.
具体实施时,通信组件、数据存储组件和消息处理组件,彼此通过RPC、消息队列等方式维持通信。数据存储组件接收到IM问诊对话消息后,提取IM问诊对话消息实体中的患者身份标识patientId和医生身份标识doctorId,将患者身份标识patientId和医生身份标识patientId拼接成会话标识,将会话标识作为数据分片和数据路由的KEY,以数据分片和数据路由的方式,将IM问诊对话消息存储至预设IM数据库中。当用户想要查询特定的医生和患者发送的消息时,可发送携带医生身份标识或患者身份标识的数据查询请求至消息处理组件,消息处理组件可根据数据查询请求中的医生身份标识或患者身份标识在预设IM数据库中进行查询,得到相应的查询结果,然后,将查询结果通过通信组件发送至客户端,以满足用户的查询需求。进一步的,在另一个实施例中,消息处理组件在推送查询结果之前,还对查询结果进行数据脱敏处理,通过通信组件推送进行数据脱敏处理后的查询结果。During specific implementation, the communication component, data storage component and message processing component maintain communication with each other through RPC, message queue and other methods. After receiving the IM consultation dialogue message, the data storage component extracts the patient identity identifier patientId and doctor identity identifier doctorId in the IM consultation dialogue message entity, splices the patient identity identifier patientId and doctor identity identifier patientId into a session identifier, and uses the session identifier as The KEY of data fragmentation and data routing stores IM consultation conversation messages in the default IM database in the form of data fragmentation and data routing. When a user wants to query messages sent by a specific doctor and patient, he or she can send a data query request carrying the doctor's identity or patient's identity to the message processing component. The message processing component can query the message based on the doctor's identity or patient's identity in the request. The logo is queried in the preset IM database to obtain the corresponding query results, and then the query results are sent to the client through the communication component to meet the user's query needs. Furthermore, in another embodiment, before pushing the query results, the message processing component also performs data desensitization processing on the query results, and pushes the query results after the data desensitization processing through the communication component.
上述在线问诊即时通讯系统的消息处理方法,在线问诊即时通讯系统包括相互独立的组 件,同时具备通信、消息处理和存储的功能,各组件之间能够保持消息的一致性,且支持高并发的数据查询。数据存储组件基于患者身份标识和医生身份标识,以数据分片和数据路由的方式存储IM问诊对话消息,不仅能够极大地分散读写压力,还能使消息处理组件在接收到携带医生身份标识或患者身份标识的数据查询请求时,根据医生身份标识或患者身份标识在预设IM数据库中进行查询,得到相应的查询结果,实现特定医生和特定患者的问诊对话消息的个性化查询。综上所述,采用上述方法,能够支持高并发的高效查询。According to the message processing method of the above-mentioned online consultation instant messaging system, the online consultation instant messaging system includes independent components and has the functions of communication, message processing and storage at the same time. The components can maintain message consistency and support high concurrency. data query. The data storage component stores IM consultation conversation messages based on patient identity and doctor identity in the form of data sharding and data routing, which not only greatly disperses the reading and writing pressure, but also enables the message processing component to receive the doctor's identity when it receives the message. When a data query request is made for a specific doctor or a patient's identity, the query is performed in the preset IM database based on the doctor's identity or the patient's identity, and the corresponding query results are obtained, thereby realizing personalized query of the consultation dialogue messages between a specific doctor and a specific patient. In summary, using the above method can support high-concurrency and efficient queries.
为了对本申请提供的在线问诊即时通讯系统和在线问诊即时通讯系统的消息处理方法进行更为清楚的说明,下面结合一个具体实施例以及图2进行说明:In order to explain more clearly the online consultation instant messaging system and the message processing method of the online consultation instant messaging system provided by this application, the following is explained in conjunction with a specific embodiment and Figure 2:
本实施例中,为了解决传统的IM服务单体架构下,在高并发的消息传递时的负载过大问题,将IM问诊对话消息的通信、存储和计算三块主要功能切割为3块独立的组件模块,包括通信组件、数据存储组件和消息处理组件,通信组件、数据存储组件和消息处理组件,彼此通过RPC、消息队列等方式维持通信。并且,常规的IM服务是从来不提供API向外的,本实施例中,通信组件增加有独立的服务端API接口,该接口对外暴露给各个服务后台,用来发送机器人消息(模板消息)和卡片消息等,该接口能够满足接口调用方的容错和负载均衡并支持横向扩展API层,此外,为了防止信息轰炸,该接口还可以满足安全的、流控、脱敏等功能支持。In this embodiment, in order to solve the problem of excessive load during high-concurrency message transmission under the traditional IM service monolithic architecture, the three main functions of communication, storage and calculation of IM consultation dialogue messages are cut into three independent blocks. The component module includes communication component, data storage component and message processing component. Communication component, data storage component and message processing component maintain communication with each other through RPC, message queue and other methods. Moreover, conventional IM services never provide external APIs. In this embodiment, the communication component is added with an independent server-side API interface. This interface is exposed to various service backgrounds and is used to send robot messages (template messages) and Card messages, etc., this interface can meet the fault tolerance and load balancing of the interface caller and support horizontal expansion of the API layer. In addition, in order to prevent information bombing, this interface can also meet security, flow control, desensitization and other functional support.
用户终端与通信组件建立连接,此时,通信组件可触发问候消息发送事件,根据问候消息模板生成问候消息,例如“您好,请问有什么可以帮到您?”,以此开展在线问诊会话,同时将会话中的IM问诊对话消息实时发送至计算组件和数据存储组件。在会话过程中,通信组件实时监听所有用户终端的连接情况,一旦发现用户终端断联一段时间,就会发送用户注销事件至用户终端,并将用户状态更新为离线状态,并且,会获取当前的IM文本消息和预设的离线消息推送字段(如appId、设备号、设备类型、推送的标题等),并基于当前IM文本消息内容,并加以补充appId、设备号、设备类型、推送的标题等内容,合成完整的离线消息后,调用推送平台的接口完成离线的消息推送。当问诊结束后,开始计时,当问诊结束后满了20分钟,会立刻根据IM问诊对话消息体中的biztype、consultid字段查询对应业务的消息模板,此模板以占位符替换的方式来提供。例如:您好,$User,您的问诊$ConsultID已经结束,您对此次服务评价如何?然后,当查询到此模板后,结合consultid等变量信息,替换模板中的占位符生成最终的模板消息。The user terminal establishes a connection with the communication component. At this time, the communication component can trigger a greeting message sending event and generate a greeting message according to the greeting message template, such as "Hello, how can I help you?" to start an online consultation session. , and at the same time, the IM consultation conversation messages in the session are sent to the computing component and the data storage component in real time. During the session, the communication component monitors the connection status of all user terminals in real time. Once it is found that the user terminal has been disconnected for a period of time, it will send a user logout event to the user terminal, update the user status to offline, and obtain the current IM text messages and preset offline message push fields (such as appId, device number, device type, pushed title, etc.) are based on the current IM text message content and supplemented with appId, device number, device type, pushed title, etc. Content, after synthesizing the complete offline message, call the interface of the push platform to complete the offline message push. When the consultation ends, the timer starts. When 20 minutes have elapsed after the consultation, the message template for the corresponding business will be queried immediately based on the biztype and consultid fields in the IM consultation dialogue message body. This template is replaced by placeholders. to provide. For example: Hello, $User, your consultation $ConsultID has ended. What is your evaluation of this service? Then, when the template is queried, the placeholders in the template are replaced with variable information such as consultid to generate the final template message.
数据存储组件在接收到IM问诊对话消息后,提取IM问诊对话消息的消息实体中的患者身份标识patientId和医生身份标识doctorId,将患者身份标识patientId和医生身份标识patientId拼接成会话标识,将会话标识的末4位,作为数据分片和数据路由的KEY,以数据分片和数据路由的方式,将IM问诊对话消息存储至预设IM数据库中。此外,IM问诊对话消息的存储是根据已构建的IM问诊对话消息存储模型,以分库分表的形式进行存储的。IM问诊对话消息存储模型包括的字段有:MessageId(消息ID)、ConsultId(问诊ID)、appId(终端类型)、bizType(消息业务类型)、doctorId(医生ID)、patientId(患者ID)、From(发送者)、To(接收者)、Message(消息内容)、Time(发送时间)、Status(消息状 态)。其中doctorId和patientId会在存储中用作数据路由分片的key。AppId会用在后期的推送中,用来表明推送的设备终端类型。BizType和consultID会用在风控和AI场景中,用来细化消息的业务所属、业务类型。After receiving the IM consultation dialogue message, the data storage component extracts the patient identity identifier patientId and doctor identity identifier doctorId in the message entity of the IM consultation dialogue message, splices the patient identity identifier patientId and doctor identity identifier patientId into a session identifier, and The last 4 digits of the session identifier are used as the KEY for data fragmentation and data routing. The IM consultation conversation message is stored in the default IM database in the form of data fragmentation and data routing. In addition, the IM consultation dialogue messages are stored in the form of separate databases and tables based on the built IM consultation dialogue message storage model. The fields included in the IM consultation dialogue message storage model are: MessageId (message ID), ConsultId (consultation ID), appId (terminal type), bizType (message business type), doctorId (doctor ID), patientId (patient ID), From (sender), To (receiver), Message (message content), Time (sending time), Status (message status). The doctorId and patientId will be used as keys for data routing shards in storage. The AppId will be used in later pushes to indicate the device terminal type being pushed. BizType and consultID will be used in risk control and AI scenarios to refine the business affiliation and business type of the message.
消息处理组件在接收到客户端发送的携带医生身份标识或患者身份标识的数据查询请求时,根据医生身份标识或患者身份标识在预设IM数据库中进行查询,得到查询结果,将查询结果通过通信组件发送至客户端,以满足用户的查询需求。When the message processing component receives the data query request carrying the doctor's identity or the patient's identity sent by the client, it queries the preset IM database based on the doctor's identity or the patient's identity, obtains the query results, and communicates the query results The component is sent to the client to satisfy the user's query needs.
在一个实施例中,提供了一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性,其上存储有计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile. A computer program is stored thereon and the computer program is executed by a processor. When implementing the steps in each of the above method embodiments.
应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts involved in the above-mentioned embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments may include multiple steps or stages. These steps or stages are not necessarily executed at the same time, but may be completed at different times. The execution order of these steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined in any way. To simplify the description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, all possible combinations should be used. It is considered to be within the scope of this manual.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above-described embodiments only express several implementation modes of the present application, and their descriptions are relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be noted that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all fall within the protection scope of the present application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims (20)

  1. 一种在线问诊即时通讯系统,其中,所述系统包括通信组件、消息处理组件和数据存储组件,所述通信组件和所述数据存储组件分别与所述消息处理组件连接;An online consultation instant messaging system, wherein the system includes a communication component, a message processing component and a data storage component, and the communication component and the data storage component are respectively connected to the message processing component;
    所述通信组件用于接收IM问诊对话消息,将所述IM问诊对话消息发送至所述消息处理组件和所述数据存储组件;The communication component is configured to receive an IM consultation dialogue message and send the IM consultation dialogue message to the message processing component and the data storage component;
    所述数据存储组件用于提取所述IM问诊对话消息中的患者身份标识和医生身份标识,将所述患者身份标识和所述医生身份标识拼接成会话标识,基于所述会话标识,以数据分片和数据路由的方式,将所述IM问诊对话消息存储至预设IM数据库中;The data storage component is used to extract the patient identity identifier and the doctor identity identifier in the IM consultation dialogue message, splice the patient identity identifier and the doctor identity identifier into a session identifier, and use the data based on the session identifier. Using fragmentation and data routing methods, the IM consultation conversation messages are stored in the preset IM database;
    所述消息处理组件用于接收携带医生身份标识或患者身份标识的数据查询请求,根据所述医生身份标识或所述患者身份标识在预设IM数据库中进行查询,得到查询结果,通过所述通信组件推送所述查询结果。The message processing component is used to receive a data query request carrying a doctor's identity or a patient's identity, perform a query in a preset IM database based on the doctor's identity or the patient's identity, and obtain query results. Through the communication The component pushes the query results.
  2. 根据权利要求1所述的在线问诊即时通讯系统,其中,所述数据存储组件还用于提取所述会话标识中预设数量的字符,将所述预设数量的字符确定为数据分片和数据路由的主键,根据所述主键,以数据分片和数据路由的方式,将IM问诊对话消息存储至对应的预设IM数据库中。The online consultation instant messaging system according to claim 1, wherein the data storage component is further used to extract a preset number of characters in the session identification, and determine the preset number of characters into data fragments and The primary key of data routing, according to the primary key, the IM consultation dialogue message is stored in the corresponding preset IM database in the form of data fragmentation and data routing.
  3. 根据权利要求1所述的在线问诊即时通讯系统,其中,所述数据存储组件包括IM问诊对话消息存储模型;所述IM问诊对话消息存储模型用于将所述IM问诊对话消息按照问诊会话标识字段、患者身份标识字段、医生身份标识字段、终端标识字段和消息业务类型字段的格式存储至预设IM数据库。The online consultation instant messaging system according to claim 1, wherein the data storage component includes an IM consultation dialogue message storage model; the IM consultation dialogue message storage model is used to store the IM consultation dialogue message according to The formats of the consultation session identification field, the patient identification field, the doctor identification field, the terminal identification field and the message service type field are stored in the preset IM database.
  4. 根据权利要求1所述的在线问诊即时通讯系统,其中,所述通信组件还用于当模板消息生成事件触发时,获取消息模板,根据所述消息模板生成对应的模板消息,推送所述模板消息。The online consultation instant messaging system according to claim 1, wherein the communication component is also used to obtain a message template when a template message generation event is triggered, generate a corresponding template message according to the message template, and push the template information.
  5. 根据权利要求1所述的在线问诊即时通讯系统,其中,所述通信组件还用于当会话结束达到预设时长时,提取会话的IM问诊对话消息体中的消息业务类型和问诊标识,根据所述消息业务类型和所述问诊标识,查找到对应的目标消息模板,基于所述目标消息模板,生成模板消息,推送所述模板消息。The online consultation instant messaging system according to claim 1, wherein the communication component is also used to extract the message service type and consultation identification in the IM consultation dialogue message body of the session when the session ends and reaches a preset duration. , find the corresponding target message template according to the message service type and the consultation identification, generate a template message based on the target message template, and push the template message.
  6. 根据权利要求1所述的在线问诊即时通讯系统,其中,所述预设IM数据库包括多个子数据库和子数据表,所述数据存储组件还用于按照分库分表的方式将IM问诊对话消息存储至预设IM数据库。The online consultation instant messaging system according to claim 1, wherein the preset IM database includes a plurality of sub-databases and sub-data tables, and the data storage component is also used to store the IM consultation dialogue in a sub-database and sub-table manner. The message is stored in the default IM database.
  7. 根据权利要求1至6任意一项所述的在线问诊即时通讯系统,其中,所述通信组件还用于监听客户端的连接状态,若监听到所述客户端处于离线状态,则发送用户注销事件消息至所述客户端,将所述连接状态更新为离线状态。The online consultation instant messaging system according to any one of claims 1 to 6, wherein the communication component is also used to monitor the connection status of the client, and if the client is detected to be offline, send a user logout event. Send a message to the client to update the connection status to offline status.
  8. 根据权利要求1至6任意一项所述的在线问诊即时通讯系统,其中,所述通信组件还用于当监听到客户端处于离线状态时,获取当前的IM文本消息内容和预设离线消息推送字段,根据所述当前的IM文本消息内容和所述预设离线消息推送字段合成离线消息,推送所述离线消息至所述客户端。The online consultation instant messaging system according to any one of claims 1 to 6, wherein the communication component is also used to obtain the current IM text message content and the preset offline message when the client is detected to be offline. Push field: synthesize an offline message according to the current IM text message content and the preset offline message push field, and push the offline message to the client.
  9. 根据权利要求1至6任意一项所述的在线问诊即时通讯系统,其中,所述消息处理 组件还用于对所述查询结果进行数据脱敏处理;所述通信组件用于推送数据脱敏后的查询结果。The online consultation instant messaging system according to any one of claims 1 to 6, wherein the message processing component is also used to perform data desensitization processing on the query results; the communication component is used to push data desensitization The subsequent query results.
  10. 一种在线问诊即时通讯系统的消息处理方法,其中,所述在线问诊即时通讯系统包括通信组件、消息处理组件和数据存储组件,所述通信组件和所述数据存储组件分别与所述消息处理组件连接,所述方法包括:A message processing method for an online consultation instant messaging system, wherein the online consultation instant messaging system includes a communication component, a message processing component and a data storage component, and the communication component and the data storage component are respectively connected to the message Processing component connections, the method includes:
    所述通信组件接收IM问诊对话消息,将所述IM问诊对话消息发送至所述消息处理组件和所述数据存储组件;The communication component receives the IM consultation dialogue message, and sends the IM consultation dialogue message to the message processing component and the data storage component;
    所述数据存储组件提取所述IM问诊对话消息中的患者身份标识和医生身份标识,将所述患者身份标识和所述医生身份标识拼接成会话标识,基于所述会话标识,以数据分片和数据路由的方式,将所述IM问诊对话消息存储至预设IM数据库中;The data storage component extracts the patient identity and the doctor's identity in the IM consultation conversation message, splices the patient's identity and the doctor's identity into a session identity, and segments the data based on the session identity. and data routing, storing the IM consultation conversation message in a preset IM database;
    当所述消息处理组件接收到携带医生身份标识或患者身份标识的数据查询请求时,根据所述医生身份标识或所述患者身份标识在预设IM数据库中进行查询,得到查询结果,并通过所述通信组件推送所述查询结果。When the message processing component receives a data query request carrying a doctor's identity or a patient's identity, it performs a query in the preset IM database based on the doctor's identity or the patient's identity, obtains the query results, and passes the required The communication component pushes the query results.
  11. 根据权利要求10所述的在线问诊即时通讯系统的消息处理方法,其中,所述数据存储组件提取所述会话标识中预设数量的字符,将所述预设数量的字符确定为数据分片和数据路由的主键,根据所述主键,以数据分片和数据路由的方式,将IM问诊对话消息存储至对应的预设IM数据库中。The message processing method of the online consultation instant messaging system according to claim 10, wherein the data storage component extracts a preset number of characters in the session identifier and determines the preset number of characters as data fragments and the primary key of data routing. According to the primary key, the IM consultation dialogue message is stored in the corresponding preset IM database in the form of data fragmentation and data routing.
  12. 根据权利要求10所述的在线问诊即时通讯系统的消息处理方法,其中,所述数据存储组件包括IM问诊对话消息存储模型;所述IM问诊对话消息存储模型将所述IM问诊对话消息按照问诊会话标识字段、患者身份标识字段、医生身份标识字段、终端标识字段和消息业务类型字段的格式存储至预设IM数据库。The message processing method of the online consultation instant messaging system according to claim 10, wherein the data storage component includes an IM consultation dialogue message storage model; the IM consultation dialogue message storage model stores the IM consultation dialogue The message is stored in the preset IM database in the format of consultation session identification field, patient identification field, doctor identification field, terminal identification field and message service type field.
  13. 根据权利要求10所述的在线问诊即时通讯系统的消息处理方法,其中,所述通信组件在模板消息生成事件触发时,获取消息模板,根据所述消息模板生成对应的模板消息,推送所述模板消息。The message processing method of an online consultation instant messaging system according to claim 10, wherein the communication component obtains a message template when a template message generation event is triggered, generates a corresponding template message according to the message template, and pushes the Template message.
  14. 根据权利要求10所述的在线问诊即时通讯系统的消息处理方法,其中,所述通信组件在会话结束达到预设时长时,提取会话的IM问诊对话消息体中的消息业务类型和问诊标识,根据所述消息业务类型和所述问诊标识,查找到对应的目标消息模板,基于所述目标消息模板,生成模板消息,推送所述模板消息。The message processing method of the online consultation instant messaging system according to claim 10, wherein the communication component extracts the message service type and consultation in the IM consultation dialogue message body of the session when the session ends and reaches the preset duration. identification, find the corresponding target message template according to the message service type and the consultation identification, generate a template message based on the target message template, and push the template message.
  15. 根据权利要求10所述的在线问诊即时通讯系统的消息处理方法,其中,所述预设IM数据库包括多个子数据库和子数据表,所述数据存储组件按照分库分表的方式将IM问诊对话消息存储至预设IM数据库。The message processing method of the online consultation instant messaging system according to claim 10, wherein the preset IM database includes a plurality of sub-databases and sub-data tables, and the data storage component stores the IM consultation in a sub-database and sub-table manner. Conversation messages are stored in the default IM database.
  16. 根据权利要求10至15任意一项所述的在线问诊即时通讯系统的消息处理方法,其中,所述通信组件监听客户端的连接状态,若监听到所述客户端处于离线状态,则发送用户注销事件消息至所述客户端,将所述连接状态更新为离线状态。The message processing method of the online consultation instant messaging system according to any one of claims 10 to 15, wherein the communication component monitors the connection status of the client, and if it detects that the client is offline, sends the user to log out. The event message is sent to the client, and the connection status is updated to an offline status.
  17. 根据权利要求10至15任意一项所述的在线问诊即时通讯系统的消息处理方法,其 中,所述通信组件在监听到客户端处于离线状态时,获取当前的IM文本消息内容和预设离线消息推送字段,根据所述当前的IM文本消息内容和所述预设离线消息推送字段合成离线消息,推送所述离线消息至所述客户端。The message processing method of the online consultation instant messaging system according to any one of claims 10 to 15, wherein the communication component acquires the current IM text message content and the preset offline state when monitoring that the client is offline. The message push field is used to synthesize an offline message according to the current IM text message content and the preset offline message push field, and push the offline message to the client.
  18. 根据权利要求10至15任意一项所述的在线问诊即时通讯系统的消息处理方法,其中,所述消息处理组件对所述查询结果进行数据脱敏处理;所述通信组件推送数据脱敏后的查询结果。The message processing method of the online consultation instant messaging system according to any one of claims 10 to 15, wherein the message processing component performs data desensitization processing on the query results; the communication component pushes the desensitized data query results.
  19. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现以下步骤:A computer-readable storage medium on which a computer program is stored, wherein the following steps are implemented when the computer program is executed by a processor:
    通信组件接收IM问诊对话消息,将所述IM问诊对话消息发送至消息处理组件和数据存储组件;The communication component receives the IM consultation dialogue message and sends the IM consultation dialogue message to the message processing component and the data storage component;
    所述数据存储组件提取所述IM问诊对话消息中的患者身份标识和医生身份标识,将所述患者身份标识和所述医生身份标识拼接成会话标识,基于所述会话标识,以数据分片和数据路由的方式,将所述IM问诊对话消息存储至预设IM数据库中;The data storage component extracts the patient identity and the doctor's identity in the IM consultation conversation message, splices the patient's identity and the doctor's identity into a session identity, and segments the data based on the session identity. and data routing, storing the IM consultation conversation message in a preset IM database;
    当所述消息处理组件接收到携带医生身份标识或患者身份标识的数据查询请求时,根据所述医生身份标识或所述患者身份标识在预设IM数据库中进行查询,得到查询结果,并通过所述通信组件推送所述查询结果。When the message processing component receives a data query request carrying a doctor's identity or a patient's identity, it performs a query in the preset IM database based on the doctor's identity or the patient's identity, obtains the query results, and passes the required The communication component pushes the query results.
  20. 根据权利要求19所述的可读存储介质,其中,所述数据存储组件提取所述会话标识中预设数量的字符,将所述预设数量的字符确定为数据分片和数据路由的主键,根据所述主键,以数据分片和数据路由的方式,将IM问诊对话消息存储至对应的预设IM数据库中。The readable storage medium according to claim 19, wherein the data storage component extracts a preset number of characters in the session identification and determines the preset number of characters as a primary key for data fragmentation and data routing, According to the primary key, the IM consultation dialogue message is stored in the corresponding preset IM database in the form of data fragmentation and data routing.
PCT/CN2022/121760 2022-03-22 2022-09-27 Online consulting instant messaging system and message processing method WO2023178973A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210283140.9A CN114629867A (en) 2022-03-22 2022-03-22 On-line inquiry instant communication system and message processing method
CN202210283140.9 2022-03-22

Publications (1)

Publication Number Publication Date
WO2023178973A1 true WO2023178973A1 (en) 2023-09-28

Family

ID=81904006

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/121760 WO2023178973A1 (en) 2022-03-22 2022-09-27 Online consulting instant messaging system and message processing method

Country Status (2)

Country Link
CN (1) CN114629867A (en)
WO (1) WO2023178973A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114629867A (en) * 2022-03-22 2022-06-14 康键信息技术(深圳)有限公司 On-line inquiry instant communication system and message processing method
CN115208846B (en) * 2022-07-08 2023-06-09 武汉联影医疗科技有限公司 Session interaction method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763524A (en) * 2018-05-31 2018-11-06 康键信息技术(深圳)有限公司 Electronic device, chat data processing method and computer readable storage medium
CN108899064A (en) * 2018-05-31 2018-11-27 平安医疗科技有限公司 Electronic health record generation method, device, computer equipment and storage medium
CN110620719A (en) * 2019-09-09 2019-12-27 深圳安泰创新科技股份有限公司 Instant communication system and instant communication connection establishing method
CN110636106A (en) * 2019-08-15 2019-12-31 平安普惠企业管理有限公司 Information pushing method and device, computer equipment and storage medium
CN114629867A (en) * 2022-03-22 2022-06-14 康键信息技术(深圳)有限公司 On-line inquiry instant communication system and message processing method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296200B (en) * 2008-06-30 2011-02-02 腾讯科技(深圳)有限公司 System and method for establishing multi-user conversation
CN111641689A (en) * 2020-05-20 2020-09-08 中山大学肿瘤防治中心 Instant messaging method, device and system based on medical role and electronic equipment
CN112035636B (en) * 2020-08-28 2023-06-02 康键信息技术(深圳)有限公司 Question and answer management method, device and equipment of medical question and answer system and storage medium
CN113284633A (en) * 2021-06-11 2021-08-20 杭州智多心网络科技有限公司 Patient online inquiry system for internet hospital

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763524A (en) * 2018-05-31 2018-11-06 康键信息技术(深圳)有限公司 Electronic device, chat data processing method and computer readable storage medium
CN108899064A (en) * 2018-05-31 2018-11-27 平安医疗科技有限公司 Electronic health record generation method, device, computer equipment and storage medium
CN110636106A (en) * 2019-08-15 2019-12-31 平安普惠企业管理有限公司 Information pushing method and device, computer equipment and storage medium
CN110620719A (en) * 2019-09-09 2019-12-27 深圳安泰创新科技股份有限公司 Instant communication system and instant communication connection establishing method
CN114629867A (en) * 2022-03-22 2022-06-14 康键信息技术(深圳)有限公司 On-line inquiry instant communication system and message processing method

Also Published As

Publication number Publication date
CN114629867A (en) 2022-06-14

Similar Documents

Publication Publication Date Title
WO2023178973A1 (en) Online consulting instant messaging system and message processing method
US10673786B2 (en) Artificial intelligence system for automatically generating custom travel documents
EP1492298A2 (en) Server and control method for managing permission setting of personal information disclosure
US8954494B2 (en) Method and system for synchronizing operations of multiple groups
EP3637679A1 (en) Creation of enterprise group
US20090082051A1 (en) Mobile group data distribution
US20120254221A1 (en) Systems and methods for performing record actions in a multi-tenant database and application system
KR20050004060A (en) Instant messaging object store
US20120259918A1 (en) Business process management system with improved communication and collaboration
US11609941B2 (en) Natural language interface for a data management system
US20210303720A1 (en) Access controls for a dedicated database system storing user-generated content input to a multitenant service of a collaborative work environment
EP3028437A1 (en) Messaging api over http protocol to establish context for data exchange
WO2022250868A1 (en) Dynamic control of access permissions for split message threads of a communication system
US20120047169A1 (en) System for Replication and Delivery of Remote Data and Accumulated Metadata with Enhanced Display
CN112929257B (en) Multi-scene message sending method, device, server and storage medium
JP2011145802A (en) Message mediation apparatus and control method therefor
WO2023172615A1 (en) Creation of content resources for messaging in a software as a service platform
WO2023024057A1 (en) Cross-domain authorization processing method and cross-domain call processing method
CN108881344B (en) Service processing method and device, storage equipment and processing server
US11743218B2 (en) Message capture in a multi channel communication environment
US11831774B2 (en) System and method of authenticating devices for secure data exchange
US20240056525A1 (en) Securely controlling communication sessions using user domain
US11785143B2 (en) System and method for secure storage and management of transitory data using a blockchain
WO2018132304A1 (en) Creating groups in a messaging system
US20230342683A1 (en) Method and system for participant identification and record augmentation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22933025

Country of ref document: EP

Kind code of ref document: A1