CN114429814A - Message processing method and device and electronic equipment - Google Patents

Message processing method and device and electronic equipment Download PDF

Info

Publication number
CN114429814A
CN114429814A CN202210094290.5A CN202210094290A CN114429814A CN 114429814 A CN114429814 A CN 114429814A CN 202210094290 A CN202210094290 A CN 202210094290A CN 114429814 A CN114429814 A CN 114429814A
Authority
CN
China
Prior art keywords
message
service
time
sequence
display
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210094290.5A
Other languages
Chinese (zh)
Inventor
吕泽峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202210094290.5A priority Critical patent/CN114429814A/en
Publication of CN114429814A publication Critical patent/CN114429814A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G16H40/00ICT specially adapted for the management or administration of healthcare resources or facilities; ICT specially adapted for the management or operation of medical equipment or devices
    • G16H40/60ICT specially adapted for the management or administration of healthcare resources or facilities; ICT specially adapted for the management or operation of medical equipment or devices for the operation of medical equipment or devices
    • G16H40/67ICT specially adapted for the management or administration of healthcare resources or facilities; ICT specially adapted for the management or operation of medical equipment or devices for the operation of medical equipment or devices for remote operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • G06F16/24578Query processing with adaptation to user needs using ranking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/70ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for mining of medical data, e.g. analysing previous cases of other patients

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Medical Informatics (AREA)
  • Public Health (AREA)
  • General Health & Medical Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Fuzzy Systems (AREA)
  • Primary Health Care (AREA)
  • Epidemiology (AREA)
  • General Business, Economics & Management (AREA)
  • Business, Economics & Management (AREA)
  • Pathology (AREA)
  • Computing Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure provides a message processing method, a device and an electronic device, wherein the method is applied to a client, and the method comprises the following steps: acquiring an order event; generating an original service message according to the order event, and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state; receiving a time sequence service message returned by a message center station, wherein the time sequence service message is the original service message of a plurality of clients received by the message center station, and processing and generating the original service message according to a message batch identifier, a message batch serial number and a message display state; and displaying the time-sequence service message according to the message batch identifier, the message batch serial number and the message display state of the time-sequence service message. The message display of the instant messaging system of the plurality of clients is orderly.

Description

Message processing method and device and electronic equipment
Technical Field
The present disclosure relates to the field of information processing technologies, and in particular, to a message processing method and apparatus, and an electronic device.
Background
With the development of internet technology, the application of internet medical treatment is becoming more and more extensive. In the inquiry scene of internet medical treatment, a plurality of roles and corresponding clients can simultaneously complete the inquiry flow in an instant messaging system. Instant messaging systems are designed with a distributed architecture. Under a distributed architecture, due to factors such as clock inconsistency, multi-client, service clustering, uncertainty of network transmission and multithreading, and the like, the time sequence of messages in the instant messaging system cannot be guaranteed during message display.
Therefore, it is crucial to solve the problem of the disorder of message presentation of instant messaging systems of multiple clients.
Disclosure of Invention
The present disclosure provides a message processing method, a device and an electronic device, which are used to solve the defect that the time sequence of instant messaging system messages in the prior art cannot be guaranteed, and achieve that a plurality of client instant messaging system messages have sequence.
The present disclosure provides a message processing method, applied to a client, the method including:
acquiring an order event;
generating an original service message according to the order event, and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state;
receiving a time-sequence service message returned by the message center, wherein the time-sequence service message is the original service message of a plurality of clients received by the message center, and the original service message is processed and generated according to the service scene value, the message batch identifier, the message batch serial number and the message display state;
and displaying the time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the time-sequence service message.
According to the message processing method provided by the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the displaying the chronological service message according to the service scene value, the message batch identifier, the message batch sequence number and the message display state of the chronological service message includes:
sequencing the time-sequence service messages according to the service scene value, the message batch identification and the message batch serial number to obtain a sequencing result;
and displaying the time-sequence service message with the message display state being displayed according to the sequencing result.
According to a message processing method provided by the present disclosure, before displaying the time-series service message whose message display status is displayed according to the sorting result, the method further includes:
receiving a display state change event sent by the message center station;
determining the time sequence service message needing to be changed according to the display state change event;
and changing the message display state of the time-sequence service message needing to be changed into display.
According to a message processing method provided by the present disclosure, after the step of receiving the display state change event sent by the message center, the method further includes:
and if the display state change event is not received within a first preset time, determining the message display states of all the time-sequence service messages in the sequencing result as display.
According to a message processing method provided by the present disclosure, the original service message and the time-series service message further include a session identifier, and the method further includes:
sending a query request to the message center, wherein the query request comprises a session identifier to be queried;
receiving historical time-sequence service messages sent by the message center station, wherein the historical time-sequence service messages are a plurality of time-sequence service messages matched by the message center station according to the session identification needing to be inquired in the inquiry request;
and displaying the historical time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the historical time-sequence service message.
According to the message processing method provided by the present disclosure, the message display state comprises three states of null, display and non-display;
the step of displaying the time-series service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the historical time-series service message comprises:
sequencing the historical time-sequence service messages according to the service scene value, the message batch identification and the message batch serial number to obtain a historical sequencing result;
and displaying the historical time-sequence service message with the message display state as display according to the historical sorting result.
The present disclosure also provides a message processing method, applied to a message center, the method including:
receiving original service messages of a plurality of clients, wherein the original service messages comprise service scene values, message batch identifiers, message batch serial numbers and message display states;
and processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients.
According to the message processing method provided by the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients includes:
if the message batch sequence number of the original service message is a preset value, changing the message display state of the original service message from space to display to obtain the time-sequence service message;
storing the time sequence service message into a distributed cache;
and sending the time sequence service message to the plurality of clients.
According to the message processing method provided by the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients includes:
if the message batch serial number of the original service message is not a preset value, inquiring the message display state of a pre-service message in a distributed cache, wherein the pre-service message is the original service message or the time-sequence service message corresponding to the original service message after the message batch serial number of the original service message is reduced by one under the same service scene value and the same message batch identifier;
when the message display state of the preposed service message is display, changing the message display state of the original service message into display to obtain the time-sequence service message; storing the time sequence service message into a distributed cache; sending the time-sequence service message to the plurality of clients;
when the message display state of the prepositive service message is empty or not displayed, changing the message display state of the original service message into non-display to obtain the time-sequence service message; and sending the time sequence service message to the plurality of clients.
According to the message processing method provided by the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
after the step of processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-ordered service message and sending the time-ordered service message to the plurality of clients, the method further comprises:
sending the time-sequence service message to a message queue;
storing the time-sequence service messages in the message queue into a database;
when the message display state of the time-series service message is display, acquiring the message display state of the post-service message in a distributed cache, wherein the post-service message is the original service message or the time-series service message corresponding to the time-series service message after adding one to the message batch serial number under the same service scene value and the same message batch identifier;
if the message display state of the post-business message is not displayed, changing the message display state of the post-business message in the distributed cache and the database into display, sending a display state change event to the plurality of clients, and re-executing the step of acquiring the message display state of the post-business message in the distributed cache;
and if the message display state of the post-service message is empty or display, ending.
According to the message processing method provided by the present disclosure, the method further comprises:
selecting the time-sequence service message of which the message display state is still not displayed within a first preset time in the database, changing the selected message display state of the time-sequence service message into display, and generating an abnormal change log.
According to a message processing method provided by the present disclosure, the original service message and the time-series service message further include a session identifier, and the method further includes:
receiving a query request sent by the client, wherein the query request comprises a session identifier needing to be queried;
matching the time-sequence service message consistent with the session identifier to be inquired in the inquiry request as a historical time-sequence service message;
and sending the historical time sequence service message to the client.
The present disclosure further provides a message processing apparatus, which is disposed at a client, and the apparatus includes:
the acquisition unit is used for acquiring order events;
the generating unit is used for generating an original service message according to the order event and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state;
a first receiving unit, configured to receive a time-series service message returned by the message center, where the time-series service message is the original service message of multiple clients received by the message center, and the original service message is processed and generated according to the service scene value, the message batch identifier, the message batch serial number, and the message display state;
and the display unit is used for displaying the time-series service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the time-series service message.
According to the message processing device provided by the present disclosure, the device further comprises:
a query request sending unit, configured to send a query request to the message center, where the query request includes a session identifier that needs to be queried;
a history receiving unit, configured to receive a history time-series service message sent by the message center station, where the history time-series service message is a plurality of time-series service messages that are matched by the message center station according to the session identifier to be queried in the query request;
and the history display unit is used for displaying the history time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the history time-sequence service message.
The present disclosure also provides a message processing apparatus, which is disposed in a message center, the apparatus includes:
the second receiving unit is used for receiving original service messages of a plurality of clients, wherein the original service messages comprise service scene values, message batch identifiers, message batch serial numbers and message display states;
and the processing unit is used for processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients.
According to the message processing device provided by the present disclosure, the device further comprises:
a query request receiving unit, configured to receive a query request sent by the client, where the query request includes a session identifier that needs to be queried;
a history matching unit, configured to match the time-series service message that is consistent with the session identifier that needs to be queried in the query request, as a history time-series service message;
and the history sending unit is used for sending the history time sequence service message to the client.
The present disclosure also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the message processing method according to any one of the above methods when executing the program.
The present disclosure also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the message processing method as any one of the above.
According to the message processing method, the message processing device and the electronic equipment, the order event is obtained; generating an original service message according to the order event, and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state; receiving a time-sequence service message returned by the message center, wherein the time-sequence service message is the original service message of a plurality of clients received by the message center, and the original service message is processed and generated according to the service scene value, the message batch identifier, the message batch serial number and the message display state; and displaying the time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the time-sequence service message. The message display of the instant messaging system of the plurality of clients is orderly.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is one of the flow diagrams of a message processing method provided by the present disclosure;
FIG. 2 is a schematic diagram of a message processing flow provided by the present disclosure;
fig. 3 is a second schematic flow chart of a message processing method provided by the present disclosure;
fig. 4 is a third schematic flow chart of a message processing method provided by the present disclosure;
FIG. 5 is a fourth flowchart of a message processing method provided by the present disclosure;
FIG. 6 is a schematic diagram of a message center architecture provided by the present disclosure;
fig. 7 is a fifth flowchart of a message processing method provided by the present disclosure;
fig. 8 is a sixth schematic flow chart of a message processing method provided by the present disclosure;
fig. 9 is a seventh schematic flow chart of a message processing method provided by the present disclosure;
fig. 10 is an eighth schematic flow chart of a message processing method provided by the present disclosure;
FIG. 11 is a ninth schematic flow chart diagram of a message processing method provided by the present disclosure;
FIG. 12 is a tenth flow chart of a message processing method provided by the present disclosure;
fig. 13 is one of the schematic structural diagrams of a message processing apparatus provided by the present disclosure;
fig. 14 is a second schematic structural diagram of a message processing apparatus provided in the present disclosure;
fig. 15 is a third schematic structural diagram of a message processing apparatus provided in the present disclosure;
fig. 16 is a fourth schematic structural diagram of a message processing device provided by the present disclosure;
fig. 17 is a schematic structural diagram of an electronic device provided by the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments, which can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present disclosure, belong to the protection scope of the embodiments of the present disclosure.
With the development of internet technology, the application of internet medical treatment is becoming more and more extensive. One of the most important functions in the inquiry and consultation provider scenario of internet hospitals is instant messaging. In the whole inquiry scene, a plurality of roles such as patients, doctors, medical assistants, pharmacists and the like and corresponding clients can complete the whole inquiry process in one instant communication session at the same time. Therefore, the instant messaging system has the characteristics of high concurrency, strong real-time performance, strong time sequence and high availability requirement, and the instant messaging system is designed by adopting a distributed architecture. Under a distributed architecture, due to factors such as clock inconsistency, multiple clients, service clustering, uncertainty of network transmission and multithreading and the like, the time sequence of instant messaging messages cannot be guaranteed. The message is the most critical bridge in the doctor-patient inquiry link, the system message has an indispensable position in the inquiry instant messaging session, and the generation and the change of each event in the inquiry process can trigger the system message reminding. The system messages are different from the user messages, the generation and the change of one event can trigger the system messages of a plurality of different service lines, and once the display of the system messages is out of order, the system messages bring extremely bad experience to a plurality of users such as doctors, patients and the like.
Therefore, it is crucial to solve the problem of the disorder of message presentation of the instant messaging system of multiple clients.
The embodiment of the present disclosure provides a message processing method, which is applied to a client, and as shown in fig. 1, the method includes the following steps:
s11, obtaining order events;
specifically, the client may retrieve the order event. Order events may include generating an order, receiving a visit, canceling or completing, etc.
S12, generating an original service message according to the order event, and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state;
specifically, the client may generate an original service message according to the order event, and send the original service message to the message center, where the original service message includes a service scene value, a message batch identifier, a message batch serial number, and a message display state.
The original service message may further include information such as a message identifier, a session identifier, a message sender user identifier, a message receiver user identifier, message content, and message creation time.
The complete original service message may include the following contents as shown in table 1 below:
TABLE 1
Field(s) Description of the invention
msgId Message identification, identifying uniqueness of a message
sessionId Session identification, identifying uniqueness of a chat session
msgFrom Message sender
msgFromUserId Message sender user identification
msgTo Message receiver
msgToUserId Message recipient user identification
msgContent MessageContent providing method and apparatus
createTime Message creation time
businessKey Business scenario value
msgBatchId Message batch identification
msgBatchOrder Message batch sequence number
msgShowStatus Message display status
S13, receiving a time sequence service message returned by the message center, wherein the time sequence service message is the original service message of a plurality of clients received by the message center, and the original service message is processed and generated according to the service scene value, the message batch identifier, the message batch serial number and the message display state;
specifically, the client may receive a time-series service message returned by the station in the message. The time-sequence service message is generated by processing an original service message according to a service scene value, a message batch identifier, a message batch serial number and a message display state after the message center receives the original service messages of a plurality of clients.
S14, displaying the time-series service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the time-series service message;
specifically, the client may display the time-series service message according to the service scene value, the message batch identifier, the message batch sequence number, and the message display state of the time-series service message.
In one example, as shown in fig. 2, the plurality of clients includes a patient client, a doctor client, a medical assistance client, and a pharmacist client. After obtaining the order event, each client generates respective original service message according to the order event, sends the original service message to the message center, and receives the time sequence service message processed by the message center.
In the embodiment of the disclosure, a client acquires an order event, generates an original service message according to the order event, sends the original service message including a message batch identifier, a message batch serial number and a message display state to a message center, receives a time-series service message returned by the message center, and displays the time-series service message according to the message batch identifier, the message batch serial number and the message display state of the time-series service message. The message display of the instant messaging system of the plurality of clients is orderly.
According to the message processing method provided by the embodiment of the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null; step S14 specifically includes the following steps:
s141, sequencing the time-sequence service messages according to the service scene value, the message batch identification and the message batch serial number to obtain a sequencing result;
specifically, the message presentation state includes three states of null, presentation, and non-presentation. A message exhibiting a state of null indicates that it is not processed. After receiving the time-series service messages, the client can determine the time-series service messages of the same service scene according to the service scene values, determine the time-series service messages of the same batch according to the message batch identifiers, and sort the time-series service messages of the same batch according to the sequence of the message batch serial numbers from small to large to obtain a sorting result.
S142, displaying the time-sequence service message with the message display state as display according to the sequencing result;
specifically, the client may display the time-series service message whose message display state is the display according to the sorting result.
In the embodiment of the disclosure, the client sorts the time-series service messages according to the service scene value, the message batch identifier and the message batch serial number to obtain a sorting result, and displays the time-series service messages with the message display state being displayed according to the sorting result. The message display of the instant messaging system of the plurality of clients is orderly.
According to a message processing method provided by the embodiment of the present disclosure, as shown in fig. 3, before step S142, the following steps are further included:
s31, receiving a display state change event sent by the message center station;
specifically, the client may receive a message state change event sent by the station in the message.
S32, determining the time sequence service message needing to be changed according to the display state change event;
specifically, the client may determine the time-series service message that needs to be changed according to the display state change event.
S33, changing the message display state of the time sequence service message needing to be changed into display;
specifically, the client may change the message display status of the chronological service message that needs to be changed from null or non-display to display.
In the embodiment of the disclosure, the client may receive the display state change event, determine the time-series service message that needs to be changed according to the display state change event, change the display state of the time-series service message into a display, and then display the time-series service message in the subsequent steps. And when a special condition occurs, restoring and displaying the time-sequence service message which needs to be displayed but is set to be not displayed according to the state change event, so that the message display of the instant messaging system of the plurality of clients is orderly.
According to a message processing method provided by the embodiment of the present disclosure, after step S31, the method further includes:
s311, if the display state change event is not received within a first preset time, determining the message display states of all the time-sequence service messages in the sequencing result as display;
specifically, the client does not receive the presentation state change event within the first preset time includes two cases.
In the first case, the display states of all the time-series service messages are displayed, and no change is needed, that is, no display state change event occurs. At this time, the display state change event is not received within the first preset time, the client does not need to perform an operation, and the display states of all the time-series service messages are already the display states.
In the second case, the display state change event is not received within the first preset time due to network failures such as network delay and network disconnection. At this time, the client changes the display state of the time-series service message of which the display state is not the display state in the time-series service message in the sequencing result into the display state if the display state change event is not received within the first preset time.
The first preset time can be set according to actual needs, and is not limited.
In the embodiment of the present disclosure, the client may determine, as the presentation, the presentation states of all the time-series service messages when the client does not receive the presentation change event within the first preset time. And furthermore, when the network fails, the time-ordered service messages can still be displayed according to the sequencing queue, so that the message display of the instant communication system of the plurality of clients is ordered.
According to a message processing method provided by the embodiment of the present disclosure, as shown in fig. 4, the method further includes the following steps:
s41, sending a query request to the message center station, wherein the query request comprises a session identifier required to be queried;
specifically, the client may actively send a query request to the message center to view the historical time-series service message, where the query request includes a session identifier that needs to be queried.
S42, receiving a historical time sequence service message sent by the message center station, wherein the historical time sequence service message is a plurality of time sequence service messages matched by the message center station according to the session identifier needing to be inquired in the inquiry request;
specifically, the client may receive a historical time-ordered service message sent by the station in the message. The historical time sequence service message is a plurality of time sequence service messages matched by the message center station according to the session identification needing to be inquired in the inquiry request.
S43, displaying the historical time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the historical time-sequence service message;
specifically, the client may display the historical time-series service message according to the service scene value, the message batch identifier, the message batch sequence number, and the message display state of the historical time-series service message.
In the embodiment of the disclosure, the client may actively send a query request containing a session identifier to be queried to the message center, receive a historical time-series service message that is matched and sent by the message center according to the session identifier, and display the historical time-series service message according to a service scene value, a message batch identifier, a message batch serial number, and a message display state of the historical time-series service message. When the historical time-sequence service messages are actively inquired, the displayed historical time-sequence service messages are also orderly, and the message display of the instant messaging system of the plurality of clients is further orderly.
According to the message processing method provided by the embodiment of the disclosure, the message display states comprise three states of empty, display and non-display; step S43 may specifically include the following steps:
s431, sequencing the historical time-sequence service messages according to the service scene value, the message batch identification and the message batch serial number to obtain a historical sequencing result;
specifically, the client may determine the historical time-series service messages in the same scene according to the service scene values of the historical time-series service messages, determine the historical time-series service messages in the same batch according to the message batch identifiers, and sort the historical time-series service messages in the same batch according to the arrangement manner that the message batch serial numbers are small to large, so as to obtain a historical sorting result.
S432, displaying the historical time-sequence service message with the message display state as display according to the historical sorting result;
specifically, the client may display the historical time-series service message whose display state is the display state according to the historical sorting result.
In the embodiment of the disclosure, the client may sort the historical time-series service messages according to the message batch identifiers and the message batch serial numbers, and display the historical time-series service messages whose display states are displayed according to the historical sorting result. The displayed historical time-sequence service messages are also orderly, and the message display of the instant messaging system of the plurality of clients is further orderly.
The embodiment of the present disclosure further provides a message processing method, which is applied to a message center, as shown in fig. 5, the method includes the following steps:
s51, receiving original service messages of a plurality of clients, wherein the original service messages comprise service scene values, message batch identifiers, message batch serial numbers and message display states;
specifically, in one example, the architecture of a station in a message is shown in fig. 6. The messaging station has an Application Programming Interface (API) that includes both messaging and historical message lists. The message center station has service functions including synchronous service and asynchronous update service. The message center station also comprises a basic component, and the basic component consists of a database, a distributed cache, a message queue and a pushing component.
The message center station can receive original service messages of a plurality of clients, wherein the original service messages comprise service scene values, message batch identifications, message batch serial numbers and message display states.
In one example, received raw traffic messages for multiple clients may be saved to a distributed cache.
S52, processing the original service message according to the service scene value, the message batch identification, the message batch serial number and the message display state, generating a time sequence service message and sending the time sequence service message to the plurality of clients;
specifically, the message center can process the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generate the time-series service message and send the time-series service message to the plurality of clients.
In the embodiment of the disclosure, the message center can receive the original service messages of a plurality of clients, process the original service messages according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generate the time-sequence service messages and send the time-sequence service messages to the plurality of clients. The generated time sequence service messages are orderly, so that the order of the time sequence service messages is ensured in the process that the subsequent client receives and displays the time sequence service messages, and the message display of the instant communication system of a plurality of clients is orderly.
According to the message processing method provided by the embodiment of the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null; as shown in fig. 7, step S52 specifically includes the following steps:
s71, if the message batch sequence number of the original service message is a preset value, changing the message display state of the original service message from a space-time change to display to obtain the time-sequence service message;
specifically, when the message batch sequence number of the original service message is a preset value, the message center can change the message display state of the original service message from a null state to a display state, so as to obtain a time-series service message.
Wherein the message presentation state is null indicating that it is not processed. The preset value can be set according to actual needs.
In a preferred example, the preset value may be 1. The message center station receives an original service message, if the message batch serial number of the original service message is 1, the original service message is represented as the first message in the message batch represented by the message batch identifier, and the message center station changes the display state of the original service message from space to display to obtain a time-series service message.
S72, storing the time sequence service message into a distributed cache;
specifically, the message center can store the time-series service message into a distributed cache to temporarily store the time-series service message, so that the time-series service message can be persisted.
S73, sending the time sequence service message to the plurality of clients;
specifically, the message center can send a time-ordered service message to a plurality of clients. In one example, the message center station may determine a client to be sent according to a message receiver and a message receiver identity in the time-series service message, and send the time-series service message to a plurality of clients.
In the embodiment of the disclosure, the message center receives original service messages of a plurality of clients, changes the message display state corresponding to the original service message with the message batch serial number as the preset value from a space-time change to a display state, persistently stores the display state in a distributed cache, and sends the time-sequence service message to the plurality of clients. The method and the system ensure that the time sequence service messages can be stored persistently and sent to the plurality of clients, ensure the orderliness of the time sequence service messages in the process that the subsequent clients receive and display the time sequence service messages, and further realize the orderliness of the message display of the instant messaging system of the plurality of clients.
According to the message processing method provided by the embodiment of the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null; as shown in fig. 8, step S52 specifically includes the following steps:
s81, if the message batch serial number of the original service message is not a preset value, inquiring the message display state of a pre-service message in a distributed cache, wherein the pre-service message is the original service message or the time-sequence service message corresponding to the original service message after the message batch serial number of the original service message is reduced by one under the same service scene value and the same message batch identifier;
specifically, when the message batch sequence number of the original service message is not a preset value, the message center may query, in the distributed cache, a message display state of a pre-service message, where the pre-service message is the original service message or a time-series service message corresponding to the original service message after the message batch sequence number of the original service message under the same service scene value and the same message batch identifier is decremented by one.
In a preferred example, the preset value may be 1. The message center station receives the original service message, if the message batch serial number of the original service message is 2 and not a preset value of 1, the message center station inquires a message display state, namely the message display state of the pre-service message, with the same service scene value and the message batch serial number of the same message batch identifier of 1 in the distributed cache.
S82, when the message display state of the preposed service message is display, changing the message display state of the original service message into display to obtain the time-sequence service message; storing the time sequence service message into a distributed cache; sending the time-sequence service message to the plurality of clients;
specifically, when the message display state of the pre-service message is display, the message center can change the message display state of the original service message to display, so as to obtain the time-series service message. Then, the message center station can store the time-sequence service message into the distributed cache, so as to realize the persistent storage of the time-sequence service message. Then, the message center station can send the time-sequence service message to a plurality of clients.
In one example, the message center station may determine a client to be sent according to a message receiver and a message receiver identity in the time-series service message, and send the time-series service message to a plurality of clients.
S83, when the message display state of the preposed service message is null or not displayed, changing the message display state of the original service message into non-display to obtain the time-sequence service message; sending the time-sequence service message to the plurality of clients;
specifically, when the message display state of the pre-service message is non-display, the message center can change the message display state of the original service message to non-display, so as to obtain the time-series service message. The message center may then send the time-ordered service message to a plurality of clients.
In one example, the station in the message may determine a client to be sent according to the message recipient and the identity of the message recipient in the time-series service message, and send the time-series service message to a plurality of clients. The synchronous traffic service as shown in fig. 6 may include the above-described steps S81-S83.
In one example, as shown in fig. 9, the message center acquires message details msgInfo of the original service message to be sent to each client this time, where the message details msgInfo include various data as described in table one.
The message intermediate station judges whether a message batch serial number msgInfo. msgBatchOrder in the original service message is 1, and when the judgment result is yes, the message is the first message in the corresponding message batch and can be displayed. The message center station sets the message display state msgInfo. msgShowStatus of the original service message to 1, namely displaying, and at the moment, the original service message is converted into a time sequence service message. The message center station caches a service scene value, a message batch identifier, a message batch sequence number and a message display state msgInfo. msgShowStatus state in msgInfo data corresponding to the time-series service message into a distributed cache Redis in a format of a name-value pair key, wherein the cache key is { businessKey }: { msgBatchId }: { msgBatchOrder }, the value is 1, and the validity period of the cache can be set according to actual needs, for example, to 60 minutes. The message center station sends the time-sequence service message to the client and sends the time-sequence service message to the message queue.
The message center judges that the result of the message batch serial number msgInfo. msgBatchOrder in the original service message is negative, which indicates that the message is not the first message in the corresponding message batch, and at this time, whether the message is displayed needs to be further confirmed. The message center station acquires the message display state of the message detail msgInfo-X of the preposed service message with the same service scene value and the same message batch identification, wherein the message batch serial number is minus one (msgInfo. msgBatchOrder-1).
When the message display state msgInfo-x. msgshwowstatus value of the current service message is 1, that is, the presentation, the message center sets the message display state msgInfo. msgshwowstatus of the original service message to 1, that is, the presentation, and at this time, the original service message is converted into a time-sequential service message. The message intermediate station caches msgInfo data of the time-ordered service message, particularly a service scene value, a message batch identifier, a message batch sequence number and a message display state msgInfo. msgShowStatus state in a key-value format into a distributed cache Redis, wherein the cache key is { businessKey }: { msgBatchId }: msgBatchOrder } and the value is 1, and the message intermediate station sends the time-ordered service message to a client and sends the time-ordered service message to a message queue.
When the value of the message display state msgInfo-x. msgshwestatus of the current service message is not 1 (i.e., not shown) but 0 (not shown) or null (not processed), the message center sets the message display state msgInfo. msgshwestatus of the original service message to 0, i.e., not shown, and then the original service message is converted into a time-ordered service message. The message center station sends the time-sequence service message to the client and sends the time-sequence service message to the message queue.
In the embodiment of the disclosure, when the message batch serial number of the original service message is not a preset value, the message center station queries the message display state of the preposed service message in the distributed cache; if the message display state of the preposed service message is display, changing the message display state of the original service message into display to obtain a time sequence service message, storing the time sequence service message into a distributed cache, and simultaneously sending the time sequence service message to a client; and if the message display state of the preposed service message is not displayed, changing the message display state of the original service message to be not displayed to obtain a time sequence service message, and sending the time sequence service message to the client. The message display state of the original service message is synchronized with the preposed message, so that the orderliness of the time sequence service message is ensured in the process that the subsequent client receives and displays the time sequence service message, and the message display of the instant communication system of a plurality of clients is ordered.
According to a message processing method provided by the embodiment of the present disclosure, after step S52, as shown in fig. 10, the method further includes the following steps:
s101, sending the time-sequence service message to a message queue;
in particular, the message center station may send the time-ordered service message to a message queue.
S102, storing the time-sequence service messages in the message queue into a database;
specifically, the message center station may store the time-series service message in the message queue in the database, so that the time-series service message is persistently stored in the database.
S103, when the message display state of the time-series service message is display, acquiring the message display state of the post-service message in a distributed cache, wherein the post-service message is the original service message or the time-series service message corresponding to the time-series service message after adding one to the same service scene value and the same message batch serial number under the same message batch identifier;
specifically, when the message display state of the time-series service message is display, the message center may obtain the message display state of the post-message in the distributed cache, where the post-message is an original service message or a time-series service message corresponding to the time-series service message after adding one to the same service scene value and the same message batch serial number under the message batch identifier.
S104, if the message display state of the post-business message is not displayed, changing the message display state of the post-business message in the distributed cache and the database into display, sending a display state change event to the plurality of clients, and re-executing the step of acquiring the message display state of the post-business message in the distributed cache;
specifically, if the message display status of the post-service message is not displayed, the message center can change the message display status of the post-service message in the distributed cache and the database to display, and send a display status change event to the plurality of clients. And then, the message center re-executes the step of acquiring the message display state of the post-service message in the distributed cache.
S105, if the message display state of the post-service message is empty or display, ending;
specifically, if the message display status of the post-service message is null or displayed, the process is ended.
In one example, the message batch sequence number of one of the chronological business messages in the message queue is 2, and the message presentation status of the chronological business message is presentation. The message center station queries the message display state of the original service message or the time-series service message, namely the message display state of the post-service message, corresponding to the original service message or the time-series service message with the same service scene value and the same message batch identifier of 3 in the distributed cache.
And if the message display state of the post-service message is empty or display, ending the process.
And if the message display state of the postpositional service message is not displayed, the message center station changes the message display state of the postpositional service message in the distributed cache and the database into display and sends the display state to a plurality of clients. The plurality of clients can be determined according to the message receiver and the message receiver user identification of the post message. And re-executing the message display state of the post-service message obtained in the distributed cache until the end if the message display state of the post-service message is empty or displayed. Or, when the station in the message does not acquire the post-service message in the distributed cache, ending. The asynchronous update service as shown in fig. 6 may comprise the above-described steps S101-S105.
In one example, as shown in fig. 11, the midmessage station obtains message information (i.e., message details) msgInfo corresponding to the time-series service message from the message queue, and persistently stores the msgInfo into the database.
The message center station acquires msgInfo of the time sequence service message from the database and judges whether the message display state msgInfo. msgShowStatus value is 1. And if not, indicating that the time sequence service message is not displayed, temporarily not considering the subsequent messages of the time sequence service message, and ending.
If the current time-sequence service message is displayed, the post message is not displayed, and the message display state of the post message needs to be changed to display. For this purpose, the message center acquires, in a buffer, a message display state of message details msgInfo of a post-service message of the time-series service message in the same service scene value and the same message batch, where the sequence number of the message batch of the time-series service message is added by one (msgInfo.
And the message display state value of the post message is null, which indicates that the post message of the batch is absent temporarily, and the process is finished. The message presentation status value of the post message is 1, indicating that the post message has been set to be presented, and ends.
When the message display status of the post message is not null or 1, that is, the message display status is a non-display status of 0, the message center updates that the message display status in the msghinfo of the chronological service message in the buffer and the database is 1, that is, msghshowstatus is set to 1. And the message center sends a display state change eventMessage event to the client. And the message center re-executes the message display state of the message detail msgInfo of the acquired post message in the cache, acquires the post message of the original post message at the moment, and continues the steps until the acquired message display state is empty, namely the batch of post messages does not exist.
In the embodiment of the disclosure, the message center sends the time sequence service message to the message queue, stores the time sequence service message in the message queue into the database, and acquires the message display state of the post-service message in the distributed cache when the message display state of the time sequence service message is display. If the message display state of the post-business message is not displayed, the message center station changes the message display state of the post-business message in the distributed cache and the database into display and sends a display state change event to a plurality of clients; and if the message display state of the post-service message is empty or display, ending. And changing the message display state of the post-service message according to the message display state of the current time-sequence service message, and sending a state change event. The subsequent client receives the state change event and changes the time sequence service message according to the state change event, the order of the time sequence service message is ensured in the subsequent display process, and the message display of the instant communication system of the plurality of clients is ordered.
According to a message processing method provided by the embodiment of the present disclosure, the method further includes the following steps:
s106, selecting the time-series service message in the database, the message display state of which is still not displayed within a first preset time, changing the selected message display state of the time-series service message into display, and generating an abnormal change log;
specifically, the message center can select the time-series service message whose message display state is still not displayed within the first preset time from the database, change the message display state of the selected time-series service message into display, and generate an abnormal change log.
In one example, the first preset time is set to be 20 seconds, the database has 4 time-series service messages with the same service scene value and the same message batch identifier, and the message batch sequence numbers of the 4 time-series service messages are 1, 2, 4, and 5, respectively. The message display status of the time-series service messages with the message batch serial numbers 1 and 2 is display, because of network failure and other reasons, the message center station does not receive the original service message with the message batch serial number 3, and the message display status of the time-series service messages with the message batch serial numbers 4 and 5 is non-display according to the steps.
After 20 seconds, when the message center station has not received the original service message with the message batch serial number of 3, the message display status of the time-series service messages with the message batch serial numbers of 4 and 5 is still not displayed. At this time, the message center selects the time-series service messages with the message batch serial numbers of 4 and 5, changes the message display state into display, and generates an abnormal change log.
In the embodiment of the disclosure, the message center selects the time-series service message in the database, the message display state of which is still not displayed within the first preset time, changes the message display state of the selected time-series service message into display, and generates the abnormal change log. When the message center station does not receive individual original service messages, the time sequence service messages in the database can change the message display states, and developers can check clients and networks according to the abnormal change logs. And providing an ordering basis when querying the historical time-ordering messages by utilizing the database in the subsequent process, so that the message display of the instant messaging system of the plurality of clients is ordered.
According to a message processing method provided by the embodiment of the present disclosure, the original service message and the time-series service message further include a session identifier, as shown in fig. 12, the method further includes:
s121, receiving a query request sent by the client, wherein the query request comprises a session identifier required to be queried;
specifically, the original service message and the time-series service message further include a session identifier. The message center station can receive a query request sent by the client, wherein the query request comprises a session identifier needing to be queried.
S122, matching the time-sequence service message consistent with the session identifier to be inquired in the inquiry request as a historical time-sequence service message;
specifically, the message center can match the time-sequence service message consistent with the session identifier to be queried in the database as the historical time-sequence service message.
In one example, the historical time-ordered service messages may be stored in a historical message list of the gateway API as shown in fig. 6.
S123, sending the historical time-sequence service message to the client;
in particular, the message center may send a historical time-ordered service message to the client.
In one example, the push component as shown in fig. 6 may perform step S123.
In the embodiment of the disclosure, a message center station receives a query request sent by a client, the query request includes a session identifier to be queried, a time-series service message consistent with the session identifier to be queried in the query request is matched, and the time-series service message is used as a historical time-series service message and sent to the client. The inquired historical time sequence messages are also ordered, and the message display of the instant messaging system of the plurality of clients is ordered.
The following describes a message processing apparatus provided in an embodiment of the present disclosure, and the message processing apparatus described below and the message processing method described above may be referred to correspondingly.
An embodiment of the present disclosure further provides a message processing apparatus, which is disposed at a client, and as shown in fig. 13, the apparatus includes:
an obtaining unit 131, configured to obtain an order event;
a generating unit 132, configured to generate an original service message according to the order event, and send the original service message to a message center, where the original service message includes a service scene value, a message batch identifier, a message batch serial number, and a message display state;
a first receiving unit 133, configured to receive a time-series service message returned by the message center, where the time-series service message is the original service message of multiple clients received by the message center, and is generated by processing the original service message according to the service scene value, the message batch identifier, the message batch serial number, and the message display state;
a display unit 134, configured to display the time-series service message according to the service scene value, the message batch identifier, the message batch serial number, and the message display state of the time-series service message.
In the embodiment of the disclosure, a client acquires an order event, generates an original service message according to the order event, sends the original service message including a message batch identifier, a message batch serial number and a message display state to a message center, receives a time-series service message returned by the message center, and displays the time-series service message according to the message batch identifier, the message batch serial number and the message display state of the time-series service message. The message display of the instant messaging system of the plurality of clients is orderly.
According to the message processing device provided by the embodiment of the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the display unit 134 is specifically configured to:
sequencing the time-sequence service messages according to the service scene value, the message batch identification and the message batch serial number to obtain a sequencing result;
and displaying the time-sequence service message with the message display state being displayed according to the sequencing result.
According to the message processing device provided by the embodiment of the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the display unit 134 is further configured to:
receiving a display state change event sent by the message center station;
determining the time sequence service message needing to be changed according to the display state change event;
and changing the message display state of the time-sequence service message needing to be changed into display.
According to an embodiment of the present disclosure, the display unit 134 is further configured to:
and if the display state change event is not received within a first preset time, determining the message display states of all the time-sequence service messages in the sequencing result as display.
According to a message processing apparatus provided by an embodiment of the present disclosure, the original service message and the time-series service message further include a session identifier, as shown in fig. 14, the apparatus further includes:
a query request sending unit 141, configured to send a query request to the message center, where the query request includes a session identifier that needs to be queried;
a history receiving unit 142, configured to receive a history time-series service message sent by the message center station, where the history time-series service message is a plurality of time-series service messages that are matched by the message center station according to the session identifier that needs to be queried in the query request;
a history display unit 143, configured to display the historical time-series service message according to the service scene value, the message batch identifier, the message batch serial number, and the message display state of the historical time-series service message.
According to the message processing device provided by the embodiment of the present disclosure, the message display status includes three statuses of null, display and non-display;
the history display unit 143 is specifically configured to:
sequencing the historical time-sequence service messages according to the service scene value, the message batch identification and the message batch serial number to obtain a historical sequencing result;
and displaying the historical time-sequence service message with the message display state as display according to the historical sorting result.
An embodiment of the present disclosure further provides a message processing apparatus, which is disposed in a message center, and as shown in fig. 15, the apparatus includes:
a second receiving unit 151, configured to receive original service messages of multiple clients, where the original service messages include service scene values, message batch identifiers, message batch sequence numbers, and message display statuses;
and the processing unit 152 is configured to process the original service message according to the service scene value, the message batch identifier, the message batch serial number, and the message display state, generate a time-series service message, and send the time-series service message to the plurality of clients.
In the embodiment of the disclosure, the message center can receive the original service messages of a plurality of clients, process the original service messages according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generate the time-sequence service messages and send the time-sequence service messages to the plurality of clients. The generated time sequence service messages are orderly, so that the order of the time sequence service messages is ensured in the process that the subsequent client receives and displays the time sequence service messages, and the message display of the instant communication system of a plurality of clients is orderly.
According to the message processing device provided by the embodiment of the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the processing unit 152 is specifically configured to:
if the message batch sequence number of the original service message is a preset value, changing the message display state of the original service message from space to display to obtain the time-sequence service message;
storing the time sequence service message into a distributed cache;
and sending the time sequence service message to the plurality of clients.
According to the message processing device provided by the embodiment of the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the processing unit 152 is specifically configured to:
if the message batch serial number of the original service message is not a preset value, inquiring the message display state of a pre-service message in a distributed cache, wherein the pre-service message is the original service message or the time-sequence service message corresponding to the original service message after the message batch serial number of the original service message is reduced by one under the same service scene value and the same message batch identifier;
when the message display state of the preposed service message is display, changing the message display state of the original service message into display to obtain the time-sequence service message; storing the time sequence service message into a distributed cache; sending the time-sequence service message to the plurality of clients;
when the message display state of the preposed service message is empty or not displayed, changing the message display state of the original service message into non-display to obtain the time-sequence service message; and sending the time sequence service message to the plurality of clients.
According to the message processing device provided by the embodiment of the present disclosure, the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the processing unit 152 is further configured to:
sending the time-sequence service message to a message queue;
storing the time-sequence service messages in the message queue into a database;
when the message display state of the time-series service message is display, acquiring the message display state of the post-service message in a distributed cache, wherein the post-service message is the original service message or the time-series service message corresponding to the time-series service message after adding one to the message batch serial number under the same service scene value and the same message batch identifier;
if the message display state of the post-business message is not displayed, changing the message display state of the post-business message in the distributed cache and the database into display, sending a display state change event to the plurality of clients, and re-executing the step of acquiring the message display state of the post-business message in the distributed cache;
and if the message display state of the post-service message is empty or display, ending.
According to an embodiment of the present disclosure, the processing unit 152 is further configured to:
selecting the time-sequence service message of which the message display state is still not displayed within a first preset time in the database, changing the selected message display state of the time-sequence service message into display, and generating an abnormal change log.
According to a message processing apparatus provided by an embodiment of the present disclosure, as shown in fig. 16, the apparatus further includes:
a query request receiving unit 161, configured to receive a query request sent by the client, where the query request includes a session identifier that needs to be queried;
a history matching unit 162, configured to match the time-series service message that is consistent with the session identifier that needs to be queried in the query request, as a history time-series service message;
a history sending unit 163, configured to send the history time-series service message to the client.
Fig. 17 illustrates a physical structure diagram of an electronic device, and as shown in fig. 17, the electronic device may include: a processor (processor)1710, a communication Interface 1720, a memory (memory)1730, and a communication bus 1740, wherein the processor 1710, the communication Interface 1720, and the memory 1730 communicate with each other via the communication bus 1740. The processor 1710 may invoke the logic instructions in the memory 1730 to perform a message processing method, applied to a client, the method comprising: acquiring an order event; generating an original service message according to the order event, and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state; receiving a time-sequence service message returned by the message center, wherein the time-sequence service message is the original service message of a plurality of clients received by the message center, and the original service message is processed and generated according to the service scene value, the message batch identifier, the message batch serial number and the message display state; and displaying the time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the time-sequence service message.
Or the processor 1710 may invoke logic instructions in the memory 1730 to perform a message processing method for a message center, the method comprising: receiving original service messages of a plurality of clients, wherein the original service messages comprise service scene values, message batch identifiers, message batch serial numbers and message display states; and processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients.
In addition, the logic instructions in the memory 1730 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as a stand-alone product. Based on such understanding, the technical solutions of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present disclosure also provides a computer program product, including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer being capable of executing the message processing method provided by the above methods, the method being applied to a client, and the method including: acquiring an order event; generating an original service message according to the order event, and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state; receiving a time-sequence service message returned by the message center, wherein the time-sequence service message is the original service message of a plurality of clients received by the message center, and the original service message is processed and generated according to the service scene value, the message batch identifier, the message batch serial number and the message display state; and displaying the time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the time-sequence service message.
Or, the computer can execute the message processing method provided by the above methods, and the method is applied to a message center station, and the method comprises the following steps: receiving original service messages of a plurality of clients, wherein the original service messages comprise service scene values, message batch identifiers, message batch serial numbers and message display states; and processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients.
In yet another aspect, the present disclosure also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to execute the message processing method provided in the above, and the method is applied to a client, and the method includes: acquiring an order event; generating an original service message according to the order event, and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state; receiving a time-sequence service message returned by the message center, wherein the time-sequence service message is the original service message of a plurality of clients received by the message center, and the original service message is processed and generated according to the service scene value, the message batch identifier, the message batch serial number and the message display state; and displaying the time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the time-sequence service message.
Or, the computer program is implemented to perform the message processing methods provided by the above when executed by a processor, and the method is applied to a message center, and the method includes: receiving original service messages of a plurality of clients, wherein the original service messages comprise service scene values, message batch identifiers, message batch serial numbers and message display states; and processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solutions of the present disclosure, not to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.

Claims (19)

1. A message processing method is applied to a client, and the method comprises the following steps:
acquiring an order event;
generating an original service message according to the order event, and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state;
receiving a time-sequence service message returned by the message center, wherein the time-sequence service message is the original service message of a plurality of clients received by the message center, and the original service message is processed and generated according to the service scene value, the message batch identifier, the message batch serial number and the message display state;
and displaying the time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the time-sequence service message.
2. The message processing method according to claim 1, wherein the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the displaying the chronological service message according to the service scene value, the message batch identifier, the message batch sequence number and the message display state of the chronological service message includes:
sequencing the time-sequence service messages according to the service scene value, the message batch identification and the message batch serial number to obtain a sequencing result;
and displaying the time-sequence service message with the message display state being displayed according to the sequencing result.
3. The message processing method according to claim 2, wherein before the displaying the time-series service message whose message display status is displayed according to the sorting result, the method further comprises:
receiving a display state change event sent by the message center station;
determining the time sequence service message needing to be changed according to the display state change event;
and changing the message display state of the time-sequence service message needing to be changed into display.
4. The message processing method according to claim 3, wherein after the step of receiving the presentation status change event sent by the message center, the method further comprises:
and if the display state change event is not received within a first preset time, determining the message display states of all the time-sequence service messages in the sequencing result as display.
5. The message processing method according to claim 1, wherein the original service message and the time-ordered service message further include a session identifier, the method further comprising:
sending a query request to the message center, wherein the query request comprises a session identifier to be queried;
receiving historical time-sequence service messages sent by the message center station, wherein the historical time-sequence service messages are a plurality of time-sequence service messages matched by the message center station according to the session identification needing to be inquired in the inquiry request;
and displaying the historical time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the historical time-sequence service message.
6. The message processing method according to claim 5, wherein the message presentation state comprises three states of null, presentation and non-presentation;
the step of displaying the time-series service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the historical time-series service message comprises:
sequencing the historical time-sequence service messages according to the service scene value, the message batch identification and the message batch serial number to obtain a historical sequencing result;
and displaying the historical time-sequence service message with the message display state as display according to the historical sorting result.
7. A message processing method, applied to a message center, the method comprising:
receiving original service messages of a plurality of clients, wherein the original service messages comprise service scene values, message batch identifiers, message batch serial numbers and message display states;
and processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients.
8. The message processing method according to claim 7, wherein the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients includes:
if the message batch sequence number of the original service message is a preset value, changing the message display state of the original service message from space to display to obtain the time-sequence service message;
storing the time sequence service message into a distributed cache;
and sending the time sequence service message to the plurality of clients.
9. The message processing method according to claim 7, wherein the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
the processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients includes:
if the message batch serial number of the original service message is not a preset value, inquiring the message display state of a pre-service message in a distributed cache, wherein the pre-service message is the original service message or the time-sequence service message corresponding to the original service message after the message batch serial number of the original service message is reduced by one under the same service scene value and the same message batch identifier;
when the message display state of the preposed service message is display, changing the message display state of the original service message into display to obtain the time-sequence service message; storing the time sequence service message into a distributed cache; sending the time-sequence service message to the plurality of clients;
when the message display state of the preposed service message is empty or not displayed, changing the message display state of the original service message into non-display to obtain the time-sequence service message; and sending the time sequence service message to the plurality of clients.
10. The message processing method according to claim 7, wherein the message display status includes three statuses of null, display and non-display, and the message display status of the original service message is null;
after the step of processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-ordered service message and sending the time-ordered service message to the plurality of clients, the method further comprises:
sending the time-sequence service message to a message queue;
storing the time-sequence service messages in the message queue into a database;
when the message display state of the time-series service message is display, acquiring the message display state of the post-service message in a distributed cache, wherein the post-service message is the original service message or the time-series service message corresponding to the time-series service message after adding one to the message batch serial number under the same service scene value and the same message batch identifier;
if the message display state of the post-business message is not displayed, changing the message display state of the post-business message in the distributed cache and the database into display, sending a display state change event to the plurality of clients, and re-executing the step of acquiring the message display state of the post-business message in the distributed cache;
and if the message display state of the post-service message is empty or display, ending.
11. The message processing method of claim 10, wherein the method further comprises:
selecting the time-sequence service message of which the message display state is still not displayed within a first preset time in the database, changing the selected message display state of the time-sequence service message into display, and generating an abnormal change log.
12. The message processing method according to claim 7, wherein the original service message and the time-ordered service message further include a session identifier, the method further comprising:
receiving a query request sent by the client, wherein the query request comprises a session identifier needing to be queried;
matching the time-sequence service message consistent with the session identifier to be inquired in the inquiry request as a historical time-sequence service message;
and sending the historical time sequence service message to the client.
13. A message processing apparatus provided in a client, the apparatus comprising:
the acquisition unit is used for acquiring order events;
the generating unit is used for generating an original service message according to the order event and sending the original service message to a message center, wherein the original service message comprises a service scene value, a message batch identifier, a message batch serial number and a message display state;
a first receiving unit, configured to receive a time-series service message returned by the message center, where the time-series service message is the original service message of multiple clients received by the message center, and the original service message is processed and generated according to the service scene value, the message batch identifier, the message batch serial number, and the message display state;
and the display unit is used for displaying the time-series service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the time-series service message.
14. The message processing apparatus of claim 13, wherein the apparatus further comprises:
a query request sending unit, configured to send a query request to the message center, where the query request includes a session identifier that needs to be queried;
a history receiving unit, configured to receive a history time-series service message sent by the message center station, where the history time-series service message is a plurality of time-series service messages that are matched by the message center station according to the session identifier to be queried in the query request;
and the history display unit is used for displaying the history time-sequence service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state of the history time-sequence service message.
15. A message processing apparatus provided in a message center, the apparatus comprising:
a second receiving unit, configured to receive original service messages of multiple clients, where the original service messages include a service scene value, a message batch identifier, a message batch sequence number, and a message display state;
and the processing unit is used for processing the original service message according to the service scene value, the message batch identifier, the message batch serial number and the message display state, generating a time-sequence service message and sending the time-sequence service message to the plurality of clients.
16. The message processing apparatus of claim 15, wherein the apparatus further comprises:
a query request receiving unit, configured to receive a query request sent by the client, where the query request includes a session identifier that needs to be queried;
a history matching unit, configured to match the time-series service message that is consistent with the session identifier that needs to be queried in the query request, as a history time-series service message;
and the history sending unit is used for sending the history time-sequence service message to the client.
17. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the message processing method according to any of claims 1 to 12 are implemented when the processor executes the program.
18. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the message processing method according to any one of claims 1 to 12.
19. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the message processing method according to any one of claims 1 to 12 when executed by a processor.
CN202210094290.5A 2022-01-26 2022-01-26 Message processing method and device and electronic equipment Pending CN114429814A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210094290.5A CN114429814A (en) 2022-01-26 2022-01-26 Message processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210094290.5A CN114429814A (en) 2022-01-26 2022-01-26 Message processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114429814A true CN114429814A (en) 2022-05-03

Family

ID=81313073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210094290.5A Pending CN114429814A (en) 2022-01-26 2022-01-26 Message processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114429814A (en)

Similar Documents

Publication Publication Date Title
CN112328421B (en) System fault processing method and device, computer equipment and storage medium
US8849918B2 (en) Electronic mail management system
US9800488B2 (en) Method for setting heartbeat timer, terminal and server
CN101771622A (en) E-mail automatic replying method, device and system
CN111538563A (en) Event analysis method and device for Kubernetes
CN112486707B (en) Redis-based message asynchronous consumption method and device
CN112184445A (en) Asynchronous notification method and system based on dynamic configuration
CN112433885A (en) Block chain consensus processing method and device, electronic equipment and storage medium
CN112565327B (en) Access flow forwarding method, cluster management method and related device
EP2381630B1 (en) Monitoring a mobile data service associated with a mailbox
CN114429814A (en) Message processing method and device and electronic equipment
CN113672776B (en) Fault analysis method and device
CN113256240B (en) Message processing method and device and server
CN110519714B (en) Short message approval processing method and device, electronic equipment and storage medium
JP2011002970A (en) Distributed data management system, data management device, data management method, and program
CN111767580B (en) Physical object handover method and device based on blockchain
CN114338255B (en) Group management method and device
CN112929191A (en) Service monitoring method and system, and related equipment and device
JP2007323422A (en) Distributed database system and method of data synchronization thereof
CN113595870B (en) Push message processing method and device, electronic equipment and storage medium
CN111464579A (en) Message processing method and server
CN115775148B (en) Message machine-based hospital information system payment processing method, device and equipment
CN113938371B (en) Node monitoring method, system and equipment based on blockchain
CN108600077B (en) Timing message processing method and message management server
CN116070284A (en) Data verification method, storage medium and related equipment

Legal Events

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