CN111460322B - Data processing method, device, equipment and readable storage medium - Google Patents

Data processing method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN111460322B
CN111460322B CN202010301311.7A CN202010301311A CN111460322B CN 111460322 B CN111460322 B CN 111460322B CN 202010301311 A CN202010301311 A CN 202010301311A CN 111460322 B CN111460322 B CN 111460322B
Authority
CN
China
Prior art keywords
comment
time
data
service
real
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.)
Active
Application number
CN202010301311.7A
Other languages
Chinese (zh)
Other versions
CN111460322A (en
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.)
Tencent Technology Chengdu Co Ltd
Original Assignee
Tencent Technology Chengdu 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 Tencent Technology Chengdu Co Ltd filed Critical Tencent Technology Chengdu Co Ltd
Priority to CN202010301311.7A priority Critical patent/CN111460322B/en
Publication of CN111460322A publication Critical patent/CN111460322A/en
Application granted granted Critical
Publication of CN111460322B publication Critical patent/CN111460322B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9536Search customisation based on social or collaborative filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a data processing method, a device, equipment and a readable storage medium, wherein the method comprises the following steps: receiving a service reading operation request sent by a target user terminal; if the fact that the comment identification is mapped to the target identity information of the target user terminal is detected according to the service reading operation request, a first comment set used for being fed back to the target user terminal is obtained from a real-time comment set of a real-time cache server; if the fact that the comment identification is not mapped to the target identity information is detected according to the service reading operation request, a second comment set used for feeding back to the target user terminal is obtained from a delay comment set of the delay cache server; the delay comment set is obtained by pulling the delay cache server from the real-time comment set in the real-time cache server through a delay mechanism. By the method and the device, the data access pressure can be relieved, and meanwhile, the timeliness of viewing comment data can be improved for users who have published comments.

Description

Data processing method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method, apparatus, device, and readable storage medium.
Background
With the rapid development of computer technology, intelligent terminals occupy an important part in people's daily life. People use the intelligent terminal to look up news data, watch games, promote activities and the like, and people can comment on watched data (such as news or videos) and express their thoughts through the comments. This is beneficial for people to show their own voice to the world, and also beneficial for different people to discuss the same thing.
For a hot news (such as a match result, game welfare and other news), a large number of users can inquire or comment the hot news, so that the ultrahigh frequency centralized access brings great pressure to the background server and the database, and the background server and the database are likely to crash due to excessive operation, so that the background server cannot respond to the inquiry or comment making request of the users, the users cannot watch the news content, and even if the users see the news content, the comments cannot be made; that is, the centralized access of a large number of users may bring great data access pressure to the database, resulting in crash of the background server and the database, and thus, feedback cannot be made in time for the access request of the user.
Content of application
The application provides a data processing method, a data processing device and a readable storage medium, which can relieve data access pressure and timely respond to an access request of a user.
An embodiment of the present application provides a data processing method, including:
receiving a service reading operation request sent by a target user terminal;
if it is detected that the target identity information of the target user terminal is mapped with a comment identifier according to the service reading operation request, acquiring a first comment set for feeding back to the target user terminal from a real-time comment set of a real-time cache server; the comment identification is an identification corresponding to a user terminal with a comment posting behavior; the real-time comment set is used for storing comment data requested to be published by the business write operation request when the business write operation request is initiated by at least one user terminal;
if the target identity information is detected not to be mapped with the comment identifier according to the service reading operation request, acquiring a second comment set used for feeding back to the target user terminal from a delay comment set of a delay cache server; the delay comment set is obtained by the delay cache server through a delay mechanism and pulling from the real-time comment set in the real-time cache server.
An embodiment of the present application provides a data processing apparatus, including:
a read request receiving module, configured to receive a service read operation request sent by a target user terminal;
a first comment set obtaining module, configured to, if it is detected that the comment identifier is mapped to the target identity information of the target user terminal according to the service reading operation request, obtain, from a real-time comment set of a real-time cache server, a first comment set used for being fed back to the target user terminal; the comment identification is an identification corresponding to a user terminal with a comment posting behavior; the real-time comment set is used for storing comment data requested to be published by the business write operation request when the business write operation request is initiated by at least one user terminal;
a second comment set obtaining module, configured to, if it is detected that the comment identifier is not mapped to the target identity information according to the service reading operation request, obtain, from a delay comment set of a delay cache server, a second comment set used for being fed back to the target user terminal; the delay comment set is obtained by the delay cache server through a delay mechanism and pulling from the real-time comment set in the real-time cache server.
Wherein, still include:
a write request receiving module, configured to receive the service write operation request sent by the at least one user terminal; the service write operation request carries identity information and the comment data;
and the information storage module is used for storing the identity information in the service write operation request and the comment data in the real-time comment set in the real-time cache server in a correlated manner, and setting the comment identifier for the identity information in the service write operation request.
Wherein, the information storage module comprises:
the information checking unit is used for checking the identity information in the service write operation request;
the data verification unit is used for verifying the comment data if the identity information in the service write operation request belongs to a legal identity and has a comment publishing authority;
and an information storage unit, configured to, when the comment data is legal comment data, associate and store the identity information in the service write operation request and the comment data to the real-time comment set in the real-time cache server, and set the comment identifier for the identity information in the service write operation request.
Wherein, the information checking unit includes:
a set acquisition subunit, configured to acquire a set of banned users; the language forbidden user set comprises identity information of users forbidden to publish comment data;
an information matching subunit, configured to match the identity information in the service write operation request with the talk-banning user set;
an abnormal identity determining subunit, configured to determine, if identity information that is the same as the identity information in the service write operation request exists in the no-word user set, the identity information in the service write operation request as abnormal identity information;
and a legal identity determining subunit, configured to determine, if identity information that is the same as the identity information in the service write operation request does not exist in the talk inhibiting user set, the identity information in the service write operation request as legal identity information.
Wherein, the information storage unit includes:
a write request sending subunit, configured to send the service write operation request to the real-time cache server, so that the real-time cache server stores, in the real-time comment set, the identity information and the comment data in the service write operation request in an associated manner according to the service write operation request;
and the identifier setting subunit is configured to receive the storage success information returned by the real-time cache server, and set the comment identifier for the identity information in the service write operation request according to the storage success information.
Wherein, above-mentioned first comment and collect and obtain module includes:
a first read operation request sending unit, configured to send the service read operation request to the real-time cache server, so that the real-time cache server obtains M pieces of associated comment data from the real-time comment set according to the service read operation request; m is a positive integer and is less than or equal to the total amount of the associated comment data in the real-time comment set;
a first comment data receiving unit, configured to receive the M pieces of associated comment data returned by the real-time cache server;
an associated comment data determining unit configured to determine, from the M pieces of associated comment data, associated comment data having a time association relationship with the target associated comment data, according to the comment posting time of the M pieces of associated comment data and the comment posting time of the target associated comment data;
a first comment set determination unit configured to take the associated comment data having a time association relationship with the target associated comment data and the target associated comment data as the first comment set.
Wherein, the above-mentioned associated comment data determination unit includes:
an absolute value determining subunit, configured to determine absolute values of time differences between the comment posting times of the M pieces of associated comment data and the comment posting time of the target associated comment data, respectively;
and the associated comment data determining subunit is used for determining the associated comment data of which the absolute value of the time difference is smaller than the time difference threshold as the associated comment data having a time association relationship with the target associated comment data.
Wherein, the second comment set obtaining module includes:
a second read request sending unit, configured to send the service read operation request to the delay cache server, so that the delay cache server obtains K pieces of associated comment data from the delay comment set according to the service read operation request; k is the total amount of the associated comment data contained in the delay comment set; k is a positive integer less than or equal to M;
a second comment data receiving unit, configured to receive the K pieces of associated comment data returned by the delay cache server;
the sorting unit is used for sorting the K pieces of associated comment data in a descending order according to the comment posting time in the K pieces of associated comment data;
a second comment set determining unit, configured to obtain Q pieces of associated comment data in order from the sorted K pieces of associated comment data, where the Q pieces of associated comment data serve as the second comment set; q is a positive integer less than K.
Wherein, still include:
a time obtaining module, configured to obtain an identifier setting start time of the comment identifier mapped by the target identity information, and obtain a request receiving time of receiving the service read operation request of the target user terminal;
a difference determination module for determining a time difference between the identifier setting start time and the request reception time;
an identifier determining module, configured to determine that the comment identifier mapped by the target identity information is an effective identifier if the time difference is smaller than or equal to a difference threshold, and perform the step of obtaining, from a real-time comment set of the real-time cache server, a first comment set for feedback to the target user terminal;
the identifier determining module is further configured to determine that the comment identifier mapped by the target identity information is an invalid identifier if the time difference is greater than the difference threshold, delete the comment identifier mapped by the target identity information, and perform the step of obtaining, from the delay comment set of the delay cache server, a second comment set for feedback to the target user terminal.
One aspect of the present application provides a computer device, comprising: a processor, a memory, a network interface;
the processor is connected to a memory and a network interface, wherein the network interface is used for providing a data communication function, the memory is used for storing a computer program, and the processor is used for calling the computer program to execute the method in the aspect in the embodiment of the present application.
An aspect of the present application provides a computer-readable storage medium storing a computer program comprising program instructions that, when executed by a processor, perform the method of the above-mentioned aspect of the embodiments of the present application.
In the embodiment of the application, a real-time cache server and a time delay cache server are additionally arranged, and write operation requests of different user terminals are processed by the real-time cache server; for the read operation requests of different user terminals, the read operation request of the user who has made a comment (the identity information is mapped with the comment identifier) can be processed by the real-time cache server, and the read operation request of the user who has not made a comment can be processed by the delay cache server. Because the real-time cache server processes the write operation request of the user and the read operation request of the user who sends the comment, and the delay cache server only processes the read operation request of the user who does not send the comment, the delay cache server does not have the situation of simultaneously responding to the read operation and the write operation of different users, and the data access pressure of the delay cache server is reduced; for the write operation request of the user and the read operation request of the user who sends the comment, the real-time cache server can immediately feed back the comment data to the user terminal, so that the user who makes the comment can browse the comment made by the user in real time. And because in the normal condition, users who make comments occupy a small amount, the pressure of reading operation and the pressure of writing operation on the real-time cache server are not large. Meanwhile, the comment data are regularly pulled from the real-time cache server by the delay cache server to be fed back to the user terminal, so that although the comment data fed back to the user terminal by the delay cache server have delay, users corresponding to the delay cache server do not make comments, the users cannot find that the comment data viewed by the users have delay, and the user experience cannot be influenced. In summary, the real-time cache server and the time delay cache server can relieve data access pressure mutually and timely respond to an access request of a user; meanwhile, the user can check the comments made by the user in real time, namely, the user who has made the comment data can be guaranteed to check the comment data made by the user in real time, and the timeliness of checking the comment data can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a diagram of a network architecture provided by an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 3a is a schematic relationship diagram of a server provided in an embodiment of the present application;
FIG. 3b is a schematic diagram illustrating a relationship between a database and a server according to an embodiment of the present application;
FIG. 4 is a flow chart of a comment identification setting provided by an embodiment of the present application;
FIG. 5a is a schematic diagram of a comment identification setting scene provided by an embodiment of the present application;
FIG. 5b is a schematic diagram of a storage form provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a scenario provided in an embodiment of the present application;
FIG. 7 is a schematic view of a scenario provided by an embodiment of the present application;
FIG. 8 is a timing flow diagram provided by an embodiment of the present application;
fig. 9 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a computer device provided by an embodiment of the present application;
fig. 11 is a schematic structural diagram of a data processing system according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a diagram of a network architecture according to an embodiment of the present application. As shown in fig. 1, the network architecture may include a service server 1000, a background server cluster, and a cache server, where the background server cluster may include a plurality of background servers, and as shown in fig. 1, the network architecture may specifically include a background server 100a, a background server 100b, background servers 100c and …, and a background server 100 n. As shown in fig. 1, the backend server 100a, the backend server 100b, the backend servers 100c, …, and the backend server 100n may be respectively connected to the service server 1000 through a network, so that each backend server may perform data interaction with the service server 1000 through the network connection, so that the service server 1000 may receive service data from each backend server. As shown in fig. 1, the real-time cache server 10a and the delay cache server 10b may be respectively in network connection with the service server 1000, so that the real-time cache server 10a and the delay cache server 10b may perform data interaction with the service server 1000; and the real-time cache server 10a and the delay server 10b are connected through a network, so that data interaction can be performed between the real-time cache server 10a and the delay server 10 b.
Each background server shown in fig. 1 corresponds to a user terminal, and may be configured to store service data of the corresponding user terminal. Each user terminal may be integrally installed with a target application, and when the target application runs in each user terminal, the background server corresponding to each user terminal may store service data in the application and perform data interaction with the service server 1000 shown in fig. 1. The target application may include an application having a function of displaying data information such as text, images, audio, and video. For example, the application may be an entertainment application, such as a video playing application, and may be used for a user to play audio and video, view and make comments, and the like; the application can also be a reading application, and can be used for users to check news, read books, check and make comments and the like. The business server 1000 in the present application may collect business data from the backgrounds of the applications (such as the above background server cluster), for example, the business data may be comment data published by a user, comment reply data for comments made by the user, and the like. The service server 1000 may store the service data in the real-time cache server 10a, and feed back different service data to different users through the real-time cache server 10a and the delay cache server 10b, so that the users can view the service data. For example, for a user who has published comment data, the service server 1000 may obtain real-time comment data from the real-time cache server 10a and return the real-time comment data to the user terminal, so that the user can view the comment data published by the user in real time after publishing a comment; for the users who have not published the comment data, the service server 1000 may obtain the comment data from the delay cache server 10b and return the comment data to the user terminal, so that the user may view the comment data. The latency cache server 10b is used for processing a data query request of a user who has not published comment data, where the data query request may refer to a query for business information (comment data including business information). Because in a scenario where a user reads a news or video, the number of users who will post a comment is much smaller than the number of users who only read the news or video. The time-delay cache server can only inquire the data of the users who have not published the comments, and the real-time cache server only inquires the data of the users who have published the comment and the comment. The real-time cache server and the time delay cache server can relieve data access pressure mutually by processing different user requests through the real-time cache server and the time delay cache server, so that the real-time cache server can also realize timely feedback for users who make comments, and the users can inquire comment data made by themselves in real time.
In the embodiment of the present application, one user terminal may be selected from a plurality of user terminals as a target user terminal, and the target user terminal may include: and intelligent terminals with data information display and playing functions are carried by smart phones, tablet computers, desktop computers and the like. For example, in the embodiment of the present application, a user terminal corresponding to the backend server 100a shown in fig. 1 may be used as the target user terminal, and the target application may be integrated in the target user terminal, and at this time, the backend server 100a corresponding to the target user terminal may perform data interaction with the service server 1000. For example, when a user a plays a video a by using a target application (e.g., a video playing application) in the user terminal 100a, the user a submits a service write operation request (e.g., a request for making a comment) for the video a, the service server 1000 detects the request for making a comment by the user a and comment data a input by the user a through a background server corresponding to the user terminal 100a, and the service server 1000 may store the identity information a of the user and the comment data a in a real-time comment set of the real-time cache server 10a in an associated manner, and set a comment identifier for the identity information a of the user to indicate that the user a is a user who has made a comment, and return comment success information to the user terminal 100a corresponding to the user a to notify the user a that the comment has been made successfully. The user a may query the comment data after receiving the comment success information. If a user a sends a service reading operation request (such as a comment data query request) to the service server 1000 through the user terminal 100a, after receiving the comment data query request, the service server 1000 detects that the comment identifier is mapped in the identity information a of the user a, the service server 1000 can determine that the user a is a user who has made a comment through the comment identifier, and the service server 1000 needs to feed back a comment set including the comment data a of the user a to the user a who has made a comment, so that the user a can view the comment data a after making a comment; the service server 1000 may obtain the comment set a including the comment data a of the user from the real-time comment set of the real-time cache server 10a, and return the comment set to the user terminal 100a corresponding to the user a, so that the user a may view the comment set a on the display page of the user terminal 100 a. Meanwhile, if the user B plays the video a by using the video playing application in the user terminal 100B, and the user B wants to view comment data in a comment area of the video a when clicking the comment area, the service server 1000 may detect a service reading operation request (such as a comment data query request) of the user B, because the user B has not made a comment on the video a, the identity information B of the user B is not mapped with the comment identifier; the service server 1000 may determine that the user B is a user who has not published a comment, and then the service server 1000 may obtain the comment set B from the delay comment set of the delay cache server 10B and feed back the comment set B to the user terminal B, and the user B may view the comment set B on a display page of the user terminal B. The delay comment set of the delay cache server is obtained by pulling the delay cache server from the real-time comment set in the real-time cache server through a delay mechanism. That is, the total number of the comment data included in the time-lapse comment set is smaller than or equal to the total number of the comment data in the real-time comment set.
It is understood that the method provided by the embodiment of the present application can be executed by a computer device, including but not limited to a terminal or a server.
Please refer to fig. 2, which is a flowchart illustrating a data processing method according to an embodiment of the present application. As shown in fig. 2, the data processing method may include:
step S101, the service server receives the service reading operation request sent by the target user terminal.
In the present application, the service reading operation request may refer to a query request of a user for one service information (e.g., news, video, audio, etc.), and the query request may be used for the user to view the service information and comment data of the service information. The user clicks a viewing key on a display page of the user terminal, a background server corresponding to the user terminal can generate a service reading operation request, and the service reading operation request is sent to the service server.
Step S102, if it is detected that the target identity information of the target user terminal is mapped with a comment identifier according to the service reading operation request, the service server acquires a first comment set used for being fed back to the target user terminal from a real-time comment set of a real-time cache server; the comment identification is an identification corresponding to a user terminal with a comment posting behavior; the real-time comment set is used for storing comment data requested to be published by the business write operation request when the business write operation request is initiated by at least one user terminal.
In the application, the comment identifier may be in the form of numbers, characters, letters, and the like, if the user terminal has a comment posting behavior, the service server may set a comment identifier for the user identity information corresponding to the user terminal, and then the comment identifier may be used to represent that the user is a user who posts a comment, and if the comment identifier may be a comment, after the service server sets a comment identifier for the identity information user ID1 of the user a, the identity information of the user a is "user ID 1-comment", the comment identifier is a suffix of the user ID1, and the identity information of the user a mapped with the comment identifier comment may represent that the user a is a user who posts a comment. Here, the service writing operation request of the at least one user terminal may refer to a request of a user for publishing data of service information (e.g., news, game results, video, etc.), such as a comment publishing request and a comment replying request. If a user sends a service write operation request (such as a comment publishing request) to a service server through a user terminal, the service server can store comment data of the user and identity information in the service write operation request in a real-time comment set of a real-time cache server in an associated manner, set a comment identifier for the identity information of the user after successful storage, and determine the user as having a comment publishing behavior. The specific method for the business server to store the identity information and the comment data in the business write operation request in an associated manner can be that according to an associated comment generation format of the business information to which the comment data belongs, the identity information, the comment data and comment posting time of the comment data in the business write operation request are fused to generate associated comment data, and then the associated comment data are stored in a real-time comment set of the real-time cache server, namely the associated comment data are stored in the real-time comment set. For a specific implementation manner of associating the identity information and the comment data in the storage service write operation request and setting the comment identifier, reference may be made to the description in the embodiment corresponding to fig. 4 in the following.
If the at least one user terminal includes the target user terminal, that is, the target user terminal sends a service write operation request to the service server, and the target identity information successfully issues a comment to the service information, then the service server may detect that a comment identifier is mapped in the target identity information in the service read operation request, and then target associated comment data corresponding to the target identity information is also stored in a real-time comment set of the real-time cache server, and then the service server may send a service read operation request to the real-time cache server, so that the real-time cache server obtains M associated comment data from the real-time comment set according to the service read operation request; wherein M is a positive integer and is less than or equal to the total amount of the associated comment data in the real-time comment set; the real-time cache server can return the M associated comment data to the business server, and after receiving the M associated comment data, the business server can determine the associated comment data having a time association relation with the target associated comment data in the M associated comment data according to the comment posting time of the M associated comment data and the comment posting time of the target associated comment data; the business server may regard the associated comment data having a time association relationship with the target associated comment data and the target associated comment data as the first comment set, and return the first comment set to the target user terminal, so that the user may display the first comment set on a display page of the target user terminal. The time association relationship here may mean that an absolute value of a time difference is smaller than a time difference threshold, and the associated comment data having a time association relationship with the target associated comment data may mean that an absolute value of a time difference between comment posting times of the target associated comment data is smaller than a time difference threshold. The specific method for the service server to determine the associated comment data with the time difference smaller than the time difference threshold between the absolute value of the time difference between the comment posting times of the target associated comment data and the comment posting time of the target associated comment data may be that the service server determines the comment posting times of the M associated comment data and the absolute value of the time difference between the comment posting times of the target associated comment data, and then determines the associated comment data with the time difference smaller than the time difference threshold as the associated comment data having a time association relationship with the target associated comment data.
It is understood that, for example, the target associated comment data is "user a-2020.3.20,11: 00", and the M acquired associated comment data are { user B-2020.3.20,10:58}, { user C-2020.3.20,10:30}, { user D-2020.3.20,9:58}, and { user E-2020.3.20,11:01 }. It can be seen that the time difference between the comment posting time 10:58 of the user B and the posting time 11:00 of the target associated comment data is 2 seconds, the time difference between the comment posting time 10:30 of the user C and the posting time 11:00 of the target associated comment data is 30 minutes, the time difference between the comment posting time 9:58 of the user D and the posting time 11:00 of the target associated comment data is 1 hour 2 seconds, and the time difference between the comment posting time 11:01 of the user E and the posting time 11:00 of the target associated comment data is 2 seconds. The time difference threshold is 1 hour, and it can be seen that only if the absolute value of the time difference between the comment posting time of the user C and the target associated comment data is 1 hour and 2 seconds, and is greater than the time difference threshold by 1 hour, the associated comment data corresponding to the users (such as the user B, the user D, and the user E) other than the user C can be determined as the associated comment data having a time association relationship with the target associated comment data. Determine { "user B-2020.3.20,10: 58", "user D-2020.3.20,9: 58", "user E-2020.3.20,11: 01", "A-2020.3.20, 11: 00" } as the first set of comments.
Optionally, it may be understood that the real-time cache server may determine, according to the service reading operation request, a first comment set from the real-time comment sets, and then return the first comment set to the service server. For a specific implementation manner of determining the first comment set by the real-time cache server, reference may be made to the above description of determining the first comment set by the service server, and details will not be described here.
Step 103, if it is detected that the comment identifier is not mapped to the target identity information according to the service reading operation request, the service server acquires a second comment set for feeding back to the target user terminal from a delay comment set of a delay cache server; the delay comment set is obtained by the delay cache server through a delay mechanism and pulling from the real-time comment set in the real-time cache server.
In this application, if the at least one user terminal does not include the target user terminal, that is, the target identity information corresponding to the target user terminal does not comment on the service information, the service server may detect that a comment identifier is not mapped in the target identity information in the service reading operation request, and the service server may send the service reading operation request to the delay cache server, so that the delay cache server obtains K pieces of associated comment data from the delay comment set according to the service reading operation request; k is the total amount of the associated comment data contained in the delay comment set; k is a positive integer less than or equal to M (K can also be 0). The time delay cache server can return the K pieces of associated comment data to the service server, and after the service server receives the K pieces of associated comment data, the K pieces of associated comment data can be sorted in a descending order according to comment publishing time in the K pieces of associated comment data; and obtaining Q associated comment data in sequence from the sequenced K associated comment data to serve as a second comment set, and returning the second comment set to the service server. Wherein Q is a positive integer less than or equal to K (Q may also be 0). The delay cache server may be a cache server for storing user comments, and the delay comment set in the delay cache server may be obtained by pulling the delay cache server from a real-time comment set in the real-time cache server through a delay mechanism. That is to say, the number of the comment data included in the delay comment set is less than or equal to the number of the comment data in the real-time comment set, and the delay cache server may update the delay comment set according to the comment data pulled from the real-time cache server. The time delay mechanism comprises a heartbeat cycle, and the heartbeat cycle can be used for pulling comment data from the real-time cache server by the time delay cache server. The specific method for pulling the comment data from the real-time cache server by the time delay cache server may be that when the time delay cache server reaches a heartbeat cycle, a data query request is triggered to be generated, and the time delay cache server may send the data query request to the real-time cache server; the data query request carries latest time delay associated comment data, and the latest time delay associated comment data can be associated comment data with the latest comment posting time in a time delay comment set; the real-time cache server can determine the comment posting time in the latest time delay associated comment data according to the data query request, and the comment posting time is used as the target comment posting time; the real-time cache server can take the associated comment data of which the comment posting time is later than that of the target comment in the real-time comment set as an updated comment set; the real-time cache server can send the updated comment set to the delay cache server, and the delay cache server can update the delay comment set according to the updated comment set.
It can be understood that, if K is 4, the associated comment data returned by the delay cache server are { a, b, c, d }, respectively, where the comment posting time of the associated comment data a is less than that of the associated comment data b, the comment posting time of the associated comment data b is less than that of the associated comment data c, and the comment posting time of the associated comment data c is less than that of the associated comment data d, the order of the associated comment data { a, b, c, d } sorted in a descending order according to the comment posting time is { d, c, b, a }. In the sorted d, c, b, a, the top 3 related comment data are obtained, i.e., d, c, b is obtained. A set { d, c, b } of the associated comment data d, the associated comment data c, and the associated comment data b may be determined as the second comment set.
Optionally, it may be understood that, for the K pieces of associated comment data returned by the delay cache server, ascending sorting may also be performed according to comment posting time, and then Q pieces of associated comment data are obtained in sequence from the K pieces of associated comment data after ascending sorting, and are used as the second comment set. For example, the associated comment data returned by the delay cache server are { a, b, c, d }, respectively, wherein the comment posting time of the associated comment data a is less than that of the associated comment data b, the comment posting time of the associated comment data b is less than that of the associated comment data c, and the comment posting time of the associated comment data c is less than that of the associated comment data d, the order of the associated comment data { a, b, c, d } sorted in descending order is { a, b, c, d } according to the comment posting time, and the last 3, i.e., { b, c, d } are selected from the sorted associated comment data { a, b, c, d } as a second comment set.
Optionally, it may be understood that a valid time may be set for the comment identifier of the user, and only in this time, the comment identifier mapped by the user has validity, and when the service server detects that the comment identifier is mapped in the target user identity, it may further verify whether the comment identifier has validity. The specific method for the service server to verify the validity of the comment identifier may be that the service server obtains the identifier setting start time of the comment identifier mapped by the target identity information and obtains the request receiving time of receiving the service reading operation request of the target user terminal; the service server can determine a time difference value between the identifier setting starting time and the request receiving time; if the time difference is smaller than or equal to the difference threshold, the service server can determine that the comment identifier is an effective identifier, and then the service server can send the read operation request to the real-time cache server and return the first comment set to the target user terminal; if the time difference is greater than the difference threshold, the service server may determine that the comment identifier mapped by the target identity information is an invalid identifier, delete the comment identifier mapped by the target identity information, send the service read operation request of the target user terminal to the delay cache server, and return a second comment set to the target user terminal. If the difference threshold is 24 hours, the service server receives that the service reading operation request sent by the target user terminal is No. 3/20 in 2020, and the identifier setting time of the comment identifier mapped by the target identity information is No. 3/17 in 2020 (the user makes a comment in No. 3/17 in 2020). Because the time difference between No. 3/20 in 2020 and No. 3/17 in 2020 is 3 days, which is much longer than 24 hours, even if the target identity information is mapped with the comment identifier, the service server still considers that the user has not published a comment, and sends the service read operation request of the target user terminal to the delay cache server, and obtains the second comment set from the delay comment set of the delay cache server and returns the second comment set to the target user terminal.
For easy understanding, please refer to fig. 3a, which is a schematic relationship diagram of a server provided in an embodiment of the present application. As shown in fig. 3a, the service server may be connected with a background service server cluster. The background service server cluster comprises a background service server 1, background service servers 2 and … and a background service server n. The background service server 1, the background service servers 2, … and the background service server n may be respectively connected to the service servers, so that each background service server may perform data interaction with the service server, and the background service server 1, the background service servers 2, … and the background service server n may be respectively connected to the real-time cache server, so that each background service server may perform data interaction with the real-time cache server; the background service server 1, the background service servers 2 and …, and the background service server n may be connected to the delay cache server, respectively, so that each background service server may perform data interaction with the delay cache server. The service server may be configured to receive a service read operation request or a service write operation request of the user terminal, distribute the service read operation request or the service write operation request to the background service server, and send the service server operation request or the service write operation request to the real-time cache server or the delay cache server by the background service server. The real-time cache server is used for receiving a service write operation request of a user and a service read operation request of the user who has made a comment (the identity information is mapped with a comment identifier), and the delay cache server is used for receiving a service read operation request of the user who has not made a comment (the identity information is not mapped with a comment identifier). When the heartbeat cycle of the time delay mechanism arrives, the time delay cache server can pull the latest comment data (such as an updated comment set) from the real-time cache server, and update the data (such as the time delay comment set) in the time delay cache server according to the latest comment data. That is to say, the delay cache server sends a data query request to the real-time cache server at regular time, and updates itself according to the data returned by the real-time cache server.
For easy understanding, please refer to fig. 3b together, which is a schematic diagram of a relationship between a database and a server according to an embodiment of the present application. As shown in fig. 3b, the real-time cache server may be connected to the database server, and the real-time cache server may be configured to store comment data published by the user, where the comment data may be slowly written into the database server; the time delay cache server can be connected with the database server, and can acquire data from the database server at regular time through a time delay mechanism and update according to the acquired data; if the database server crashes, the delay cache server may retrieve the data from the real-time cache server. That is, the delay cache server may first obtain data from the database server, and when the database server crashes, obtain data from the real-time cache server. It can be seen that the database server only needs to complete the work of acquiring and storing data from the real-time cache server, and then sending the data to the time delay cache server at regular time. The database is not exposed to excessive data access, and the data access pressure of the database server is greatly reduced.
The embodiment of the application identifies whether the user is a comment-made user or an unpublished user by adding the comment identification parameter. And distributing the read operation request and the write operation request of different users to a real-time cache server or a time delay cache server for processing. The real-time cache server processes the write operation request of the user and the read operation request of the user who sends a comment (with a comment identifier), and the time delay cache server only processes the read operation request of the user who does not send the comment, so that the time delay cache server does not have the condition of simultaneously responding to the read operation and the write operation of different users, the data access request of the time delay cache server is reduced, and the data access pressure of the time delay cache server is reduced; in addition, under normal conditions, users who send write operation requests occupy a small number of users, and the read operation pressure and the write operation pressure of the real-time cache server are not large; because the system pressure of the delay cache server is reduced, the time length (the interval time of the heartbeat cycle) for updating data at regular time is also reduced, and thus the comment data in the delay cache server is also the newer comment data, so that the comment viewing experience of the user who does not make comments is not influenced; for the write operation request of the user and the read operation request of the user who sends the comment, the real-time cache server can also feed back the comment data to the user terminal immediately, so that the user who makes the comment can browse the comment made by the user in real time. By additionally arranging the comment identifier, the real-time cache server and the time delay cache server, the data access pressure of the database server can be reduced, and the real-time cache server and the time delay cache server can also mutually relieve the data access pressure and timely respond to the access request of a user; meanwhile, the user can check the comments made by the user in real time, namely, the user who has made the comment data can be guaranteed to check the comment data made by the user in real time, and the timeliness of checking the comment data can be improved.
Further, please refer to fig. 4, which is a schematic flow chart illustrating a comment identification setting according to an embodiment of the present application. As shown in fig. 4, the process may include:
step S201, the service server receives a service write operation request sent by at least one user terminal; the service write operation request carries identity information and comment data.
In the application, the service write operation request may refer to a request of a user for publishing data, such as a comment publishing request and a comment replying request. For a service information (such as news, match results, videos and the like), a user can send out own comments, and if the user inputs comment data through a user terminal, a background server of the user terminal can generate a service write operation request and send the service write operation request to a service server. The identity information may refer to identity information of a user who makes a comment using the user terminal, and the identity information may be in the form of a user ID, a user name, a user communication signal, and the like.
Step S202, associating the identity information in the service write operation request with the comment data, storing the associated identity information and comment data in a real-time comment set in a real-time cache server, and setting a comment identifier for the identity information in the service write operation request.
In the application, after receiving the service write operation request, the service server may verify the identity information in the service write operation request to determine whether the identity of the user is a legal identity. If the identity information in the service write operation request belongs to a legal identity and has a comment publishing authority, the service server can verify the comment data to determine whether illegal words exist in the comment data; if the comment data does not contain the illegal words, the business server can determine the comment data as legal comment data, and the business server can associate and store the identity information in the business write operation request and the comment data into a real-time comment set in a real-time cache server and set a comment identifier for the identity information in the business write operation request; if the comment data contains the illegal word, the business server can determine the comment data as the illegal comment, the business server does not store the comment data into the real-time cache server, and meanwhile, the business server returns notification information of storage failure to the user terminal to notify the user that the comment data contains the illegal word. Whether the user has the comment publishing authority or not can be determined according to the account number level of the user, and if the account number level reaches a level threshold value, the user is determined to have the comment publishing authority. The real-time cache server may be a cache server for storing user comments, and after the user passes the verification of the identity information and the comment data, the comments posted by the user may be stored in the real-time cache server, so that the real-time comment set is a set composed of the comment data of the user. The specific method for verifying the identity information in the service write operation request may be to acquire a forbidden user set; the language forbidden user set comprises identity information of users forbidden to publish comment data; matching the identity information in the service write operation request with the forbidden language user set, and determining the identity information in the service write operation request as abnormal identity information if the forbidden language user set has the identity information which is the same as the identity information in the service write operation request; and if the identity information which is the same as the identity information in the service write operation request does not exist in the language forbidden user set, determining the identity information in the service write operation request as legal identity information.
It can be understood that, for example, the identity information in the service write operation request is user a, user ID1 is an account ID of user a, and the set of language-forbidden users acquired by the service server is { user ID2, user ID5, and user ID6}, where a user corresponding to user ID2 is user B, a user corresponding to user ID5 is user C, and a user corresponding to user ID6 is user D. After the user ID1 is matched with the set of language-forbidden users { user ID2, user ID5, user ID6}, it can be determined that the user ID1 does not exist in the set of language-forbidden users { user ID2, user ID5, user ID6}, and then it can be determined that the user a corresponding to the user ID1 is a legal identity. Subsequently, it can be checked that the level corresponding to the user ID1 of the user a is level 6, and if the level exceeds the level threshold 5, it can be determined that the user a is a legal identity and has a comment publishing authority, and then comment data published by the user a can be verified. The comment data input by the user a is "wonderful that this match is true", because there is no illegal word in the comment data, the business server may store the comment data and the identity information of the user a (such as the user ID1) in association with the real-time comment set of the real-time cache server, and set a comment identifier for the identity information in the business write operation request.
The specific implementation method for storing the identity information and the comment data in the associated manner may be that, a service server may send the service write operation request to the real-time cache server, and after receiving the service write operation request, the real-time cache server may store the identity information (such as the user ID1 of the user a) and the comment data (such as the comment data a of the user a) in the service write operation request in the associated manner into a real-time comment set according to the service write operation request, and return storage success information to the service server; as for the specific method for the real-time cache server to store the identity information and the comment data in an associated manner, the real-time cache server may acquire the service information to which the comment data belongs, and then acquire an associated comment generation format corresponding to the service information; and the real-time cache server fuses the identity information in the service write operation request, the comment data and the posting time of the comment data according to the associated comment generation format to generate associated comment data in the associated comment generation format, and stores the associated comment data in a real-time comment set. The service information may refer to data such as news, videos, pictures, audio and the like corresponding to the comment data, the associated comment generation format may refer to a standard format in which comments, time and identity information are fused together, and each service information may have an associated comment generation format. For example, taking the time when the user a publishes the comment data a as 3/28/2020 as an example, the service information to which the comment data a of the user a belongs is news published by the game result, and the associated comment generation format corresponding to the news published by the game result is "identity information: publication time: comment data ", the service server merges the user ID1, comment data a, and comment posting time 2020, 3 month, 28 days according to the associated comment generation format, and then obtains associated comment data corresponding to the user a as" user ID1: 2020.3.28: comment data a ".
It should be noted that the format of the generated associated comment is an example for easy understanding, and is not representative, and the specific presentation manner of the format of the generated associated comment in the present application is not limited in the present application; and if the business information to which the comment data belongs does not have the associated comment generation format, the business server can set an associated comment generation format for the business information.
Further, the real-time cache server may send storage success information to the service server after successful storage, and after receiving the storage success information, the service server may set a comment identifier for the identity information in the service write operation request.
For convenience of understanding, please refer to fig. 5a together, which is a schematic view of a scene of a comment flag setting provided in an embodiment of the present application. As shown in fig. 5a, the user B browses to the result publication about a game on the display page of the user terminal, enters his/her own idea in the comment field, and clicks on the posting. According to the behavior issued by the user B, the background server corresponding to the user terminal may generate a service write operation request related to the user B, and send the service write operation request to the service server 3000, and after receiving the service write operation request, the service server 3000 may check the identity information (e.g., 102) of the user B. As shown in fig. 5a, the service server obtains a set of language-forbidden users {103, 104, 106}, where a user corresponding to the identity information 102 is a user C, a user corresponding to the identity information 104 is a user D, and a user corresponding to the identity information 106 is a user F. Because the identity information 102 of the user B does not exist in the set {103, 104, 106} of the banned users, the service server 3000 may determine that the identity information 102 of the user B is legal identity information, and the user B is a legal user, and may continue to perform level verification on the identity information 102 of the user B, because the comment posting level corresponding to the identity information is 6 levels and reaches a level threshold 5, the service server 3000 may determine that the user B has a comment posting authority, and may continue to perform verification on the comment data B posted by the user B. As shown in fig. 5a, if there is no illegal word in the comment data B, the business server 3000 may determine the comment data B as legal comment data, and may store the comment data.
Further, the service server 3000 may send the service write operation request to the real-time cache server 30a, after receiving the service write operation request, the real-time cache server 30a obtains that an associated comment generation format corresponding to the news about which the match result is published is "identity information-comment posting time-comment data", and according to the associated comment generation format, the real-time cache server 30a may generate associated comment data of the comment data B as "102-2020.3.27-comment data B", and store the associated comment data "102-2020.3.27-comment data B" in the real-time comment set. Subsequently, the real-time cache server 30a may send storage success information to the service server 3000, and after receiving the storage success information, the service server 3000 may set a comment identifier for the identity information 102 of the user B to represent that the user B is a user who has made a comment, as shown in fig. 5a, the comment identifier is "comment," and after setting a comment identifier for the identity information 102, the identity information "102-comment" mapped with the comment identifier may be obtained. The identity information "102-comment" may characterize that user B published a review of the news posting to the match result.
Optionally, it may be understood that, in order to make the comment posting time stored in the real-time comment set more accurate, a specific time of the comment posting time may be obtained, for example, 3/2020, 27/10, 32 min 43 sec; the service server 3000 may also obtain the associated comment generation format corresponding to the service information to which the comment data belongs, store the user's identity information, comment data, and comment posting time according to the associated comment generation format, and set a comment identifier for the user's identity information after successful storage.
Optionally, it may be understood that, when the identity information and the comment data are stored in an associated manner, a comment data generation format corresponding to the service information to which the comment data belongs may also be obtained, a comment ID is set for the comment data according to the comment data generation format, and the identity information, the comment posting time, the comment ID, and the comment data are fused to generate associated comment data. For example, the service information to which the comment data B belongs is a game result publishing news, the comment data generation format corresponding to the game result publishing news is "MC, number", where MC is a uniform prefix of the comment data generation format and is used to represent that the news corresponding to the comment data generation format is the game result publishing news, and the "number" in "MC, number" is a number of a comment in the game result publishing news. If the comment posting time of the above comment data B is 10:50 sec at 27/3/2020, 20 comments already exist in the game result posted news, and this comment data B is the 21 st comment of the game result posted news, the format "MC, number" is generated from the comment data, and the comment ID of this comment data B may be set to "MC, 21". When the associated comment format "identity information-comment posting time-comment ID-comment data" is acquired, associated comment data "102-2020.3.27, 10:50:50-MC, 21-comment data B" of the comment data B can be generated. It can be seen that all comment data corresponding to one service information can be determined according to the comment ID in the associated comment data. The comment IDs can be used for representing the uniqueness of the comment data, and one comment ID corresponds to one comment data content; for the same user, one user may publish one or more than two comments on one service information (such as the above-mentioned game result published news), so that the identity information of one user may correspond to one or more than two comment IDs, and for the corresponding manner of the user, the comment ID, and the comment data content, see fig. 5b, where fig. 5b is a schematic diagram of a storage form provided in the embodiment of the present application. As shown in fig. 5b, the service information ID may be used to represent the uniqueness of the service information, and one service information ID corresponds to one service information; for one piece of service information, a user A publishes two comments, and the corresponding comment IDs of the user A are comment ID1 and comment ID2, wherein the comment ID1 corresponds to one comment content, and the comment ID2 corresponds to one comment content; when the user B publishes a comment, 1 comment ID corresponding to the user B is the comment ID3, and the comment ID3 corresponds to a comment content; if the user N issues a comment, the number of the comment IDs corresponding to the user N is 1, and the comment IDN corresponds to a comment content.
Further, please refer to fig. 6, which is a scene diagram provided in the embodiment of the present application. As shown in fig. 6, the user B may be the user B in the embodiment corresponding to fig. 5a, that is, the user B sends a request for comment posting to the service server 3000 at 11 o' clock 27/3/2020, and the comment data of the user B is already stored in the live comment collection in the live cache server. After the user B clicks the published comment data, a refresh button can be clicked on a display page of the user terminal to check the latest comment of the user B. As shown in fig. 6, the comment data viewed by the user B on the display page of the user terminal is the comment data of the user G and the comment data of the user H, the user B can click the refresh button after posting the comment data, and the background server corresponding to the user terminal can generate the service read operation request according to the behavior that the user B clicks the refresh button, and send the service read operation request to the service server 3000. After receiving the service reading operation request, the service server 3000 may verify the identity information of the user B, and after the verification is passed, because the user B is a user who has made a comment, that is, the identity information of the user B is "102-comment," and a comment identifier "comment" is mapped, the service server 3000 may send the service reading operation request to the real-time cache server 30 a. The real-time cache server 30a returns all the comment data in the real-time comment set to the service server 3000 according to the service reading operation request, as shown in fig. 6, the comment data included in the real-time comment set are the associated comment data "102-11: 00-comment data B" of the user B (identity information 102), the associated comment data "107-10: 57-comment data G" of the user G (identity information 107), and the associated comment data "108-10: 58-comment data G" of the user H (identity information 108). Because the comment posting time of the user G and the user H is 3, 27 days 2020 and is consistent with the date of posting the comment data by the user B, the associated comment data of the user G and the user H can be determined to be the associated comment data having a time association relationship with the comment data of the user B, and the service server 3000 can sort the associated comment data of the user B, the user G and the user H in a descending order according to the comment posting time. As shown in fig. 6, after sorting in descending order, the associated comment data of user B is located at the first position, the associated comment data of user G is located at the second position, and the associated comment data of user H is located at the third position. The service server 3000 may determine the sorted associated comment data as a first comment set, and return the first comment set to the user terminal corresponding to the user B, as shown in fig. 6, the user B may see the comment data of the user B on a display page of the user terminal, and the comment data of the user B is located at the top of the comment area.
Further, for convenience of understanding, please refer to fig. 7 together, which is a schematic view of a scene provided in the embodiment of the present application. As shown in fig. 7, the user C uses the user terminal to view the news (such as a game result publication) browsed by the user B, and the user C clicks the review comment button on the service server 3000 at 11 o 'clock, 27 o' clock, 3 m clock, 2020, so that the background server corresponding to the user terminal used by the user C can generate a service reading operation request of the user C, and send the service reading operation request to the service server 3000. After receiving the service reading operation request, the service server 3000 may verify the identity information of the user C, and after the verification is passed, because the user C has not published a comment, that is, the identity information of the user C is "103", and no comment identifier "comment" is mapped, the service server 3000 may send the service reading operation request to the delay cache server 30 b. The delay cache server 30b returns all the comment data in the delay comment set to the service server 3000 according to the service reading operation request, as shown in fig. 7, the comment data included in the delay comment set is the associated comment data "107-10: 57-comment data G" of the user G (identity information 107), and the associated comment data "108-10: 58-comment data G" of the user H (identity information 108). Because the time for the user C to check the comment is consistent with the time for the user B to make the comment, the real-time cache server 30a already stores the associated comment data "102-11: 00-comment data B" of the user B, but because the heartbeat cycle of the time delay mechanism has not yet arrived, that is, the time for the time delay cache server 30B to pull the data from the real-time cache server 30a has not yet arrived, the time delay cache server has not yet pulled the associated comment data "102-11: 00-comment data B" of the user B. Then as shown in fig. 7, the associated comment data "102-11: 00-comment data B" of the user B is not included in the delayed comment set of the delayed cache server. After receiving all the associated comment data returned by the delay cache server 30b, the service server 3000 may sort the associated comment data in a descending order according to the comment posting time of each associated comment data, as shown in fig. 7, after the sorting, the associated comment data of the user G is located at the first place, and the associated comment data of the user H is located at the second place. The service server 3000 may use the sorted associated comment data as a second comment set, and return the second comment set to the user terminal of the user C, so that the user C may view the comment data of the user G and the comment data of the user H on the display page of the user terminal as shown in fig. 7.
As can be seen from fig. 5a, fig. 6, and fig. 7, the present solution may add a comment identification parameter to identify whether the user is a comment-made user or a comment-unpublished user. If a user has a comment publishing request, the comment publishing request is distributed to the real-time cache server, the comment data published by the user is stored by the real-time cache server, and the comment identifier is set for the user, so that the request for the comment or data query of the user can be distributed to the real-time cache server, and the comment data of the user is returned by the real-time cache server. That is to say, the user can make a comment when reading a piece of news or information, and can check the content of the comment made by the user in real time through the real-time cache server after making the comment. For users who do not make comments, the data query request is distributed to the delay cache server, so that even if the comment data returned by the delay cache server is not the latest comment data, a certain delay exists, but because the users corresponding to the delay cache server are all the users who do not make comment data, the users do not know that the comment data checked by the users have a delay, and therefore the experience of the users is not influenced. In summary, by identifying the parameter through the comment, the real-time cache server and the delay cache server process different requests respectively, so that the user can check comment data issued by the user in real time, and meanwhile, the real-time cache server and the delay cache server process different user requests respectively, so that the delay cache server of the real-time cache server can relieve data access pressure mutually. The situation that the time delay cache server generates larger system pressure due to the large number of read requests can be reduced; because the system pressure of the delay cache server is reduced, the time length (the interval time of the heartbeat cycle) for updating data at regular time is also reduced, and the comment data in the delay cache server is also the newer comment data, so that the comment viewing experience of the user who does not make comments is not influenced; by additionally arranging the comment identifier and the real-time cache server, the data access pressure can be relieved, and the access request of a user can be responded in time; meanwhile, the user can be ensured to check the comment data published by the user in real time, and the timeliness of checking the comment data can be improved.
Further, please refer to fig. 8, which is a timing flow chart provided in the embodiment of the present application. As shown in fig. 8, the process may include:
step S301, the user terminal B sends a service write operation request to the service server.
Specifically, it can be understood that the service write operation request carries the identity information of the user B and the comment data.
Step S302, the service server checks the parameters according to the service write operation request.
In particular, it is understood that the parameters herein include identity information of user B and comment data. The service server can verify whether the identity information of the user B is legal identity information, can verify whether the user B has the comment publishing authority, and can verify whether comment data published by the user B is legal.
Step S303, the service server sends a service write operation request to the real-time cache server.
Specifically, it may be understood that, after the check is passed, the service server may send a service write operation request to the real-time cache server.
Step S304, the real-time cache server stores the identity information of the user B and the comment data into a real-time comment set in an associated mode.
Specifically, it can be understood that, after receiving a service write operation request sent by a service server, the real-time cache server may perform associated storage on identity information (e.g., identity information of a user B) and comment data (e.g., comment data issued by the user B) in the service write operation request according to the service write operation request.
Step S305, the real-time cache server returns the storage success information to the service server.
Step S306, the service server sets comment identification for the identity information in the service write operation request.
Specifically, it can be understood that, after receiving the storage success information returned by the real-time cache server, the service server may set a comment identifier for the identity information (e.g., the identity information of the user B) in the service write operation request, so as to represent that the user B is a user who has made a comment.
For a specific implementation manner of steps S301 to S306, refer to the description in steps S201 to S202 in the embodiment corresponding to fig. 4, which will not be described herein again.
Step S307, the service server returns the storage success information to the user terminal B.
Specifically, it can be understood that after the comment data of the user B is successfully stored in the real-time cache server, it may be indicated that the comment of the user B has been successfully published, and then after the service server sets the comment identifier for the identity information of the user B, the service server may return storage success information to the user terminal B corresponding to the user B, so as to notify the user B that the comment data has been successfully published, and may check through the user terminal B.
Step S308, the user terminal B sends a service reading operation request to the service server.
Specifically, it can be understood that after the user B checks the storage success information sent by the service server through the user terminal B, it can be determined that the comment data input by the user B has been successfully published, and then the user B can input a check request (service read operation request) through the user terminal B to request to check the comment data.
Step S309, the service server checks the parameter according to the service reading operation request of the user terminal B.
In particular, it is understood that the parameter herein may refer to identity information of the user B. After receiving the service reading operation request of the user terminal B, the service server can verify whether the identity information of the user B is a legal identity or not and whether the login state of the user B is normal or not. If the identity information of the user B is legal and the login state is also a normal state after the verification is passed, the subsequent steps can be carried out; if the identity information of the user B is illegal or the login state is abnormal, the service server can return reading failure information to the user terminal B and remind the user B that the login state is abnormal or the identity information is illegal.
Step S310, the service server sends a service reading operation request of the user terminal B to the real-time cache server.
Specifically, it can be understood that, since the user B issues a comment and the identity information is mapped with a comment identifier, the service server may send the service read operation request of the user terminal B to the real-time cache server.
Step 311, the real-time cache server obtains the first comment set.
Specifically, it may be understood that, after receiving the service reading operation request of the user terminal B, the real-time cache server may obtain the first comment set from the real-time comment set of the real-time cache server. The first comment set includes comment data published by the user B.
Step S312, the real-time cache server returns the first comment set to the business server.
Step S313, the service server returns the first comment set to the user terminal B.
Specifically, it can be understood that the service server returns the first comment set to the user terminal B, and the user B can view the first comment set on a display page of the user terminal B.
For a specific implementation manner of steps S311 to S313, refer to the description in steps S101 to S102 in the embodiment corresponding to fig. 2, which will not be described herein again.
Step S314, the user terminal a sends a service reading operation request to the service server.
Specifically, it can be understood that the user a may send a service reading operation request to the service server through the user terminal a, where the service information that the user a requests to read is consistent with the service information that the user B requests to read. That is, the user B and the user a use different user terminals to read the same service information.
Step S315, the service server performs parameter verification according to the service reading operation request of the user terminal a.
Specifically, it is understood that the parameter may refer to the identity information of the user a. Here, the specific way for the service server to verify the identity information of the user a may refer to the description of the service server to verify the identity information of the user B, which will not be described herein again.
Step S316, the service server sends a service read operation request of the user terminal a to the delay cache server.
Specifically, it can be understood that, because the user a has not published comment data on the service information, the service server may send the service read operation request of the user terminal a to the delay cache server.
In step S317, the latency cache server obtains the second comment set.
Specifically, it may be understood that the delay cache server may obtain the second comment set from the delay comment set of the delay cache server. The time delay comment set is obtained by the time delay cache server from the real-time comment set of the real-time cache server through a time delay mechanism.
Step S318, the time delay cache server returns the second comment set to the service server.
Step S319, the service server returns the second comment set to the user terminal a.
Specifically, it can be understood that after the service server returns the second comment set to the user terminal a, the user a can view the second comment set on the display page of the user terminal a.
For a specific implementation manner of steps S314 to S319, refer to the description in step S101 and step S103 in the embodiment corresponding to fig. 2, which will not be described again here.
Step S320, the time delay cache server sends a data query request to the real-time cache server.
Specifically, it may be understood that the delay comment set in the delay cache server is obtained by pulling, by the delay cache server, the real-time comment set of the real-time cache server through a delay mechanism. When a heartbeat cycle of a delay mechanism is reached, a delay cache server is triggered to generate a data query request, and the delay cache server acquires latest associated comment data from a delay comment set; and sending the latest associated comment data and the data query request to a real-time cache server. The latest associated comment data refers to associated comment data with the latest comment posting time in a delay comment set. For example, the associated comment data included in the delay comment set of the delay cache server are { "1-11: 01-comment data m", "2-11: 06-comment data n" }, where "1" is the identity information of the user 1, and "2" is the identity information of the user 2; 11:01 (3/10/2020) is the time when the user 1 posts the comment data m, and 11:06 (3/10/2020) is the time when the user 2 posts the comment data n. Because 11:01 is less than 11:06, the time-lapse caching server may take the associated comment data "2-11: 06-comment data n" as the latest associated comment data in the time-lapse comment set.
Step S321, the real-time cache server determines an updated comment set from the real-time comment sets according to the data query request of the time delay cache server.
The real-time cache server can determine the comment posting time of the latest associated comment data as the target comment posting time according to the data query request sent by the delay cache server; and taking the associated comment data with the comment posting time later than that of the target comment in the real-time comment set as an updated comment set. For example, when the heartbeat cycle is reached, the time delay cache server sends a data query request carrying the latest associated comment data "2-11: 06-comment data n" to the real-time cache server, and when the real-time cache server receives the data query request, the comment posting time 11:06 (3/10/2020/3) of the latest associated comment data "2-11: 06-comment data n" can be used as the target comment posting time. At this time, the associated comment data included in the real-time comment set of the real-time cache server is { "1-11: 01-comment data m", "2-11: 06-comment data n", "3-13: 08-comment data p", "3-14: 00-comment data q" }. Since both 13:08 (3/10/2020) and 14:00 (3/10/2020) are greater than 11:06, and the two pieces of associated comment data, namely "3-13: 08-comment data p" and "3-14: 00-comment data q", are not yet included in the time-lapse caching server, the real-time caching server can use the associated comment data "3-13: 08-comment data p" and the associated comment data "3-14: 00-comment data q" as the updated comment set for feedback to the time-lapse caching server.
Step S322, the real-time cache server returns the updated comment set to the time delay cache server.
And step S323, the time delay cache server updates data according to the updated comment set.
Specifically, it can be understood that the delay cache server may update the delay comment set according to the update comment set returned by the real-time cache server. For example, after the delay cache server updates according to the updated comment set { "3-13: 08-comment data p", "3-14: 00-comment data q" }, the updated delay comment set can be obtained as { "1-11: 01-comment data m", "2-11: 06-comment data n", "3-13: 08-comment data p", and "3-14: 00-comment data q" }.
The embodiment of the application identifies whether the user is a comment-made user or an unpublished user by adding the comment identification parameter. And distributing the read operation requests and the write operation requests of different users to a real-time cache server or a time delay cache server for processing. The real-time cache server processes the write operation request of the user and the read operation request of the user who sends a comment (with a comment identifier), and the time delay cache server only processes the read operation request of the user who does not send the comment, so that the time delay cache server does not have the condition of simultaneously responding to the read operation and the write operation of different users, the data access request of the time delay cache server is reduced, and the data access pressure of the time delay cache server is reduced; in addition, under a normal condition, users who send write operation requests occupy a small number, and the read operation pressure and the write operation pressure of the real-time cache server are not large; because the system pressure of the delay cache server is reduced, the time length (the interval time of the heartbeat cycle) for updating data at regular time is also reduced, and thus the comment data in the delay cache server is also the newer comment data, so that the comment viewing experience of the user who does not make comments is not influenced; for the write operation request of the user and the read operation request of the user who sends the comment, the real-time cache server can also feed back the comment data to the user terminal immediately, so that the user who makes the comment can browse the comment made by the user in real time. By additionally arranging the comment identifier, the real-time cache server and the time delay cache server, the data access pressure of the database server can be reduced, and the real-time cache server and the time delay cache server can also mutually relieve the data access pressure and timely respond to the access request of a user; meanwhile, the user can check the comments made by the user in real time, namely, the user who has made the comment data can be guaranteed to check the comment data made by the user in real time, and the timeliness of checking the comment data can be improved.
Fig. 9 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application. The data processing apparatus may be a computer program (including program code) running on a computer device, for example, the data processing apparatus is an application software; the apparatus may be used to perform the corresponding steps in the methods provided by the embodiments of the present application. The data processing apparatus 1 may be applied to a service server, and the data processing apparatus 1 may include: the system comprises a reading request receiving module 11, a first comment set obtaining module 12 and a second comment set obtaining module 13.
A read request receiving module 11, configured to receive a service read operation request sent by a target user terminal;
a first comment set obtaining module 12, configured to, if it is detected that the comment identifier is mapped to the target identity information of the target user terminal according to the service reading operation request, obtain, from a real-time comment set of a real-time cache server, a first comment set used for being fed back to the target user terminal; the comment identification is an identification corresponding to a user terminal with a comment posting behavior; the real-time comment set is used for storing comment data requested to be published by the service write operation request when the service write operation request is initiated by at least one user terminal;
a second comment set obtaining module 13, configured to, if it is detected that the comment identifier is not mapped to the target identity information according to the service reading operation request, obtain, from a delay comment set of a delay cache server, a second comment set used for being fed back to the target user terminal; the delay comment set is obtained by the delay cache server through a delay mechanism and pulling from the real-time comment set in the real-time cache server.
For a specific implementation manner of the read request receiving module 11, the first comment set obtaining module 12, and the second comment set obtaining module 13, reference may be made to the description of step S101 to step S103 in the embodiment corresponding to fig. 2, which will not be described herein again.
Referring to fig. 9, the data processing apparatus 1 may include a reading request receiving module 11, a first comment set obtaining module 12, and a second comment set obtaining module 13, and may further include: a write request receiving module 14 and an information storage module 15.
A write request receiving module 14, configured to receive the service write operation request sent by the at least one user terminal; the service write operation request carries identity information and the comment data;
and the information storage module 15 is configured to associate and store the identity information in the service write operation request and the comment data into the real-time comment set in the real-time cache server, and set the comment identifier for the identity information in the service write operation request.
For specific implementation of the write request receiving module 14 and the information storing module 15, reference may be made to the description of step S201 to step S202 in the embodiment corresponding to fig. 4, which will not be described herein again.
Referring to fig. 9, the information storage module 15 may include: an information verification unit 151, a data verification unit 152, and an information storage unit 153.
An information verification unit 151, configured to verify the identity information in the service write operation request;
a data verification unit 152, configured to verify the comment data if the identity information in the service write operation request belongs to a legal identity and has a comment publishing authority;
an information storage unit 153, configured to, when the comment data is legal comment data, associate and store the identity information in the service write operation request and the comment data into the real-time comment set in the real-time cache server, and set the comment identifier for the identity information in the service write operation request.
For specific implementation of the information checking unit 151, the data verifying unit 152, and the information storing unit 153, reference may be made to the description in step S202 in the embodiment corresponding to fig. 4, which will not be described herein again.
Referring to fig. 9, the information verification unit 151 may include: a set acquisition subunit 1511, an information matching subunit 1512, an anomaly identity determination subunit 1513, and a legal identity determination subunit 1514.
A set acquiring subunit 1511, configured to acquire a set of language-forbidden users; the language forbidden user set comprises identity information of users forbidden to publish comment data;
an information matching subunit 1512, configured to match the identity information in the service write operation request with the talk inhibiting user set;
an abnormal identity determining subunit 1513, configured to determine, if identity information that is the same as the identity information in the service write operation request exists in the no-word user set, the identity information in the service write operation request as abnormal identity information;
a legal identity determining subunit 1514, configured to determine, if identity information that is the same as the identity information in the service write operation request does not exist in the barring user set, the identity information in the service write operation request is legal identity information.
For specific implementation manners of the set obtaining subunit 1511, the information matching subunit 1512, the abnormal identity determining subunit 1513, and the legal identity determining subunit 1514, reference may be made to the description in step S202 in the embodiment corresponding to fig. 4, which will not be described herein again.
Referring to fig. 9, the information storage unit 153 may include: a write request sending subunit 1531, and an identification setting subunit 1532.
A write request sending subunit 1531, configured to send the service write operation request to the real-time cache server, so that the real-time cache server stores, in the real-time comment set, the identity information and the comment data in the service write operation request in an associated manner according to the service write operation request;
the identifier setting subunit 1532 is configured to receive the storage success information returned by the real-time cache server, and set the comment identifier for the identity information in the service write operation request according to the storage success information.
The specific implementation manners of the write request sending subunit 1531 and the identifier setting subunit 1532 may refer to the description in step S202 in the embodiment corresponding to fig. 4, and will not be described herein again.
Referring to fig. 9, the first review set obtaining module 12 may include: a first read operation request transmitting unit 121, a first comment data receiving unit 122, an associated comment data determining unit 123, and a first comment set determining unit 124.
A first read operation request sending unit 121, configured to send the service read operation request to the real-time cache server, so that the real-time cache server obtains M associated comment data from the real-time comment set according to the service read operation request; m is a positive integer and is less than or equal to the total amount of the associated comment data in the real-time comment set;
a first comment data receiving unit 122, configured to receive the M pieces of associated comment data returned by the real-time cache server;
an associated comment data determining unit 123, configured to determine, from the comment posting times of the M pieces of associated comment data and the comment posting time of the target associated comment data, associated comment data having a time association relationship with the target associated comment data in the M pieces of associated comment data;
a first comment set determining unit 124 configured to take the associated comment data having a time association relationship with the target associated comment data and the target associated comment data as the first comment set.
For specific implementation manners of the first read operation request sending unit 121, the first comment data receiving unit 122, the associated comment data determining unit 123, and the first comment set determining unit 124, reference may be made to the description in step S102 in the embodiment corresponding to fig. 2, and details will not be described here.
Referring to fig. 9, the above-mentioned associated comment data determining unit 123 may include: an absolute value determination subunit 1231, and an associated comment data determination subunit 1232.
An absolute value determining subunit 1231, configured to determine absolute values of time differences between the comment posting times of the M pieces of associated comment data and the comment posting time of the target associated comment data, respectively;
the associated comment data determining subunit 1232 is configured to determine, as associated comment data having a time association relationship with the target associated comment data, associated comment data in which the absolute value of the time difference is smaller than the time difference threshold.
For specific implementation manners of the absolute value determining subunit 1231 and the associated comment data determining subunit 1232, reference may be made to the description in step S102 in the embodiment corresponding to fig. 2, and details will not be described here.
Referring to fig. 9, the second comment set obtaining module 13 may include: a second read request sending unit 131, a second comment data receiving unit 132, a sorting unit 133, and a second comment set determining unit 134.
A second read request sending unit 131, configured to send the service read operation request to the delay cache server, so that the delay cache server obtains K pieces of associated comment data from the delay comment set according to the service read operation request; k is the total amount of the associated comment data contained in the time delay comment set; k is a positive integer less than or equal to M;
a second comment data receiving unit 132, configured to receive the K pieces of associated comment data returned by the delay cache server;
the sorting unit 133 is configured to sort the K pieces of associated comment data in a descending order according to the comment posting time in the K pieces of associated comment data;
a second comment set determining unit 134, configured to obtain Q pieces of associated comment data in order from the sorted K pieces of associated comment data, where the Q pieces of associated comment data serve as the second comment set; q is a positive integer less than K.
For a specific implementation manner of the second read request sending unit 131, the second comment data receiving unit 132, the sorting unit 133, and the second comment set determining unit 134, reference may be made to the description of step S103 in the embodiment corresponding to fig. 2, which will not be described herein again.
Referring to fig. 9, the data processing apparatus 1 may include a read request receiving module 11, a first comment set obtaining module 12, a second comment set obtaining module 13, a write request receiving module 14, and an information storage module 15, and may further include: a time acquisition module 16, a difference determination module 17 and an identification determination module 18.
A time obtaining module 16, configured to obtain an identifier setting start time of the comment identifier mapped by the target identity information, and obtain a request receiving time of receiving the service read operation request of the target user terminal;
a difference value determining module 17, configured to determine a time difference value between the identifier setting start time and the request receiving time;
an identifier determining module 18, configured to determine that the comment identifier mapped by the target identity information is an effective identifier if the time difference is smaller than or equal to a difference threshold, and execute the step of obtaining, from a real-time comment set of the real-time cache server, a first comment set for feedback to the target user terminal;
the identifier determining module 18 is further configured to determine that the comment identifier mapped by the target identity information is an invalid identifier if the time difference is greater than the difference threshold, delete the comment identifier mapped by the target identity information, and perform the step of obtaining, from the delay comment set of the delay cache server, a second comment set for feedback to the target user terminal.
For a specific implementation manner of the time obtaining module 16, the difference determining module 17, and the identifier determining module 18, reference may be made to the description in step S103 in the embodiment corresponding to fig. 2, which will not be described herein again.
The embodiment of the application identifies whether the user is a comment-made user or an unpublished user by adding the comment identification parameter. And distributing the read operation request and the write operation request of different users to a real-time cache server or a time delay cache server for processing. The real-time cache server processes the write operation request of the user and the read operation request of the user who sends a comment (with a comment identifier), and the time delay cache server only processes the read operation request of the user who does not send the comment, so that the time delay cache server does not have the condition of simultaneously responding to the read operation and the write operation of different users, the data access request of the time delay cache server is reduced, and the data access pressure of the time delay cache server is reduced; in addition, under a normal condition, users who send write operation requests occupy a small number, and the read operation pressure and the write operation pressure of the real-time cache server are not large; because the system pressure of the delay cache server is reduced, the time length (the interval time of the heartbeat cycle) for updating data at regular time is also reduced, and thus the comment data in the delay cache server is also the newer comment data, so that the comment viewing experience of the user who does not make comments is not influenced; for the write operation request of the user and the read operation request of the user who sends the comment, the real-time cache server can also feed back the comment data to the user terminal immediately, so that the user who makes the comment can browse the comment made by the user in real time. By additionally arranging the comment identifier, the real-time cache server and the time delay cache server, the data access pressure of the database server can be reduced, and the real-time cache server and the time delay cache server can also mutually relieve the data access pressure and timely respond to the access request of a user; meanwhile, the user can check the comments posted by the user in real time, namely, the user who posts the comment data can be guaranteed to check the comment data posted by the user in real time, and the timeliness of checking the comment data can be improved.
Further, please refer to fig. 10, which is a schematic diagram of a computer device according to an embodiment of the present application. As shown in fig. 10, the computer device 1000 may be the service server in the embodiment corresponding to fig. 5a, and the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, memory 1005, at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display (Display) and a Keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface and a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The memory 1005 may optionally also be at least one storage device located remotely from the aforementioned processor 1001. As shown in fig. 10, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the computer device 1000 shown in fig. 10, the network interface 1004 is mainly used for network communication with the service server; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
receiving a service reading operation request sent by a target user terminal;
if it is detected that the target identity information of the target user terminal is mapped with a comment identifier according to the service reading operation request, acquiring a first comment set for feeding back to the target user terminal from a real-time comment set of a real-time cache server; the comment identification is an identification corresponding to a user terminal with a comment posting behavior; the real-time comment set is used for storing comment data requested to be published by the business write operation request when the business write operation request is initiated by at least one user terminal;
if the target identity information is detected not to be mapped with the comment identifier according to the service reading operation request, acquiring a second comment set used for feeding back to the target user terminal from a delay comment set of a delay cache server; the delay comment set is obtained by the delay cache server through a delay mechanism and pulling from the real-time comment set in the real-time cache server.
It should be understood that the computer device 1000 described in this embodiment of the present application may perform the description of the data processing method in the embodiment corresponding to fig. 2 to fig. 8, and may also perform the description of the data processing apparatus 1 in the embodiment corresponding to fig. 9, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: an embodiment of the present application further provides a computer-readable storage medium, where a computer program executed by the aforementioned data processing computer device 1000 is stored in the computer-readable storage medium, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the data processing method in the embodiments corresponding to fig. 2 to fig. 8 can be performed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application.
Further, please refer to fig. 11, which is a schematic structural diagram of a data processing system according to an embodiment of the present application. The data processing system 2 may comprise a service server 1a, a real-time cache server 2a and a latency cache server 3 a.
The system comprises a service server 1a, a real-time cache server and a client side, wherein the service server 1a is used for receiving a service write operation request sent by at least one user terminal and sending the service write operation request to the real-time cache server;
the real-time cache server 2a is used for storing the identity information and the comment data in the service write operation request in a real-time comment set in an associated manner and returning storage success information to the service server;
the service server 1a is further configured to set a comment identifier for the identity information in the service write operation request according to the storage success information;
the service server 1a is further configured to receive a service read operation request sent by a target user terminal;
the service server 1a is further configured to, when detecting that the comment identifier is mapped to the target identity information of the target user terminal according to the service reading operation request, send the service reading operation request to the real-time cache server;
the real-time cache server 2a is further configured to obtain, according to the service reading operation request, a first comment set used for being fed back to the target user terminal from the real-time comment set;
the service server 1a is further configured to, when detecting that the target identity information is not mapped with the comment identifier according to the service reading operation request, send the service reading operation request to a delay cache server;
the delay cache server 3a is configured to obtain, according to the service read operation request, a second comment set used for feeding back to the target user terminal from the delay comment set; the delay comment set is obtained by the delay cache server through a delay mechanism and pulling from the real-time comment set in the real-time cache server.
The real-time cache server 2a is further configured to obtain service information to which the comment data belongs, and obtain an associated comment generation format corresponding to the service information;
the real-time cache server 2a is further configured to fuse, according to the associated comment generation format, the identity information in the service write operation request, the comment data, and the comment posting time of the comment data, generate associated comment data having the associated comment generation format, and store the associated comment data in the real-time comment set.
Wherein, the time delay mechanism comprises a heartbeat cycle;
the time delay cache server 3a is further configured to trigger generation of a data query request when the heartbeat cycle is reached, and send the data query request to the real-time cache server; the data query request carries latest time delay associated comment data; the latest time delay associated comment data is associated comment data with the latest comment publication time in the time delay comment set;
the real-time cache server 2a is further configured to determine, according to the data query request, comment posting time in the latest time delay associated comment data, where the comment posting time is used as target comment posting time;
the real-time cache server 2a is further configured to use, in the real-time comment set, associated comment data whose comment posting time is later than the posting time of the target comment as the updated comment set;
the real-time cache server 2a is further configured to return the updated comment set to the delay cache server;
the real-time cache server 2a is further configured to update data of the time delay comment set according to the update comment set.
For specific implementation manners of the service server 1a, the real-time cache server 2a, and the delay cache server 3a, reference may be made to the descriptions of step S301 to step S323 in the embodiment corresponding to fig. 8, which will not be described herein again.
It should be noted that the service server 1a, the real-time cache server 2a, and the delay cache server 3a may all be a block chain node, and the comment data may be stored in a form in which the block chain node generates a block according to the comment data and adds the block to the block chain for storage. The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm, and is mainly used for sorting data according to a time sequence and encrypting the data into an account book, so that the data cannot be falsified or forged, and meanwhile, the data can be verified, stored and updated. A blockchain is essentially a decentralized database in which each node stores an identical blockchain, and the blockchain network divides the nodes into core nodes, data nodes, and light nodes. The core nodes, the data nodes and the light nodes jointly form a block chain node. The core node is responsible for the consensus of the whole block chain network, that is, the core node is a consensus node in the block chain network. The process of writing the transaction data in the block link network into the account book may be that the client sends the transaction data to a data node or a light node connected to the block link network, and then the transaction data is transmitted in the block link network (that is, the nodes transmit in a baton manner) until the consensus node receives the transaction data, and then the consensus node packs the transaction data into a block to perform consensus, and writes the transaction data into the account book after the consensus is completed, and then returns the account book to the client. The comment data can be transaction data, the user terminal sends the transaction data to the business server, the data node sends the comment data to the real-time cache server, and the comment data is generated into blocks and stored in the block chain network after consensus is passed; and for the reading of the comment data, the blocks containing the comment data can be acquired in the block chain network through the block chain link points, and the comment data are read according to the blocks.
The terms "first," "second," and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or apparatus that comprises a list of steps or elements is not limited to the listed steps or modules, but may alternatively include other steps or modules not listed or inherent to such process, method, apparatus, product, or apparatus.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The method and the related apparatus provided by the embodiments of the present application are described with reference to the flowchart and/or the structural diagram of the method provided by the embodiments of the present application, and specifically, each flow and/or block of the flowchart and/or the structural diagram of the method, and the combination of the flows and/or blocks in the flowchart and/or the block diagram, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block or blocks.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (15)

1. A data processing method, comprising:
receiving a service reading operation request sent by a target user terminal;
if it is detected that the target identity information of the target user terminal is mapped with a comment identifier according to the service reading operation request, acquiring a first comment set for feeding back to the target user terminal from a real-time comment set of a real-time cache server; the comment identification is an identification corresponding to a user terminal with a comment publishing behavior; the real-time comment set is used for storing comment data requested to be published by a service write operation request when the service write operation request is initiated by at least one user terminal;
if the comment identifier is not mapped to the target identity information according to the service reading operation request, acquiring a second comment set for feeding back to the target user terminal from a delay comment set of a delay cache server; the time delay comment set is obtained by pulling the time delay cache server from the real-time comment set in the real-time cache server through a time delay mechanism.
2. The method of claim 1, further comprising:
receiving the service write operation request sent by the at least one user terminal; the service write operation request carries identity information and the comment data;
and associating the identity information in the service write operation request with the comment data, storing the identity information and the comment data in the real-time comment set in the real-time cache server, and setting the comment identifier for the identity information in the service write operation request.
3. The method according to claim 2, wherein the associating the identity information in the service write operation request with the comment data and storing the real-time comment set in the real-time cache server, and setting the comment identifier for the identity information in the service write operation request includes:
checking the identity information in the service write operation request;
if the identity information in the service write operation request belongs to a legal identity and has a comment publishing authority, verifying the comment data;
and when the comment data is legal comment data, associating the identity information in the service write operation request with the comment data and storing the identity information and the comment data in the real-time cache server, and setting the comment identifier for the identity information in the service write operation request.
4. The method of claim 3, wherein the verifying the identity information in the service write operation request comprises:
acquiring a language forbidden user set; the language forbidden user set comprises identity information of users forbidden to make comments;
matching the identity information in the service write operation request with the language forbidden user set;
if identity information which is the same as the identity information in the service write operation request exists in the language forbidden user set, determining the identity information in the service write operation request as abnormal identity information;
and if the identity information which is the same as the identity information in the service write operation request does not exist in the language forbidden user set, determining the identity information in the service write operation request as legal identity information.
5. The method according to claim 3, wherein the associating the identity information in the service write operation request with the comment data and storing the identity information in the service write operation request in the live comment set in the live cache server, and setting a comment identifier for the identity information in the service write operation request includes:
sending the service write operation request to the real-time cache server, so that the real-time cache server stores the identity information in the service write operation request and the comment data in the real-time comment set in an associated manner according to the service write operation request;
and receiving storage success information returned by the real-time cache server, and setting the comment identifier for the identity information in the service write operation request according to the storage success information.
6. The method of claim 5, wherein the target ue is included in the at least one ue; the real-time comment set comprises target associated comment data corresponding to the target user terminal;
acquiring a first comment set for feeding back to the target user terminal from a real-time comment set of a real-time cache server, wherein the first comment set comprises:
sending the service reading operation request to the real-time cache server so that the real-time cache server obtains M associated comment data from the real-time comment set according to the service reading operation request; m is a positive integer and is less than or equal to the total number of associated comment data in the real-time comment set;
receiving the M associated comment data returned by the real-time cache server;
determining associated comment data having a time association relation with the target associated comment data in the M associated comment data according to the comment posting time of the M associated comment data and the comment posting time of the target associated comment data;
and taking the associated comment data having a time association relationship with the target associated comment data and the target associated comment data as the first comment set.
7. The method according to claim 6, wherein the determining, from the comment posting times of the M pieces of associated comment data and the comment posting time of the target associated comment data, associated comment data having a time association relationship with the target associated comment data among the M pieces of associated comment data includes:
respectively determining the comment posting time of the M pieces of associated comment data and the absolute value of the time difference between the comment posting time of the target associated comment data;
and determining the associated comment data with the absolute value of the time difference smaller than the time difference threshold as the associated comment data with the time association relation with the target associated comment data.
8. The method according to claim 6, wherein the obtaining, by the service server, a second comment set for feedback to the target user terminal from a delay comment set of a delay cache server includes:
sending the service reading operation request to the delay cache server so that the delay cache server obtains K pieces of associated comment data from the delay comment set according to the service reading operation request; k is the total amount of the associated comment data contained in the delay comment set; k is a positive integer less than or equal to M;
receiving the K pieces of associated comment data returned by the time delay cache server;
according to the comment posting time in the K pieces of associated comment data, sorting the K pieces of associated comment data in a descending order;
obtaining Q associated comment data in sequence from the K ordered associated comment data to serve as the second comment set; q is a positive integer less than K.
9. The method of claim 1, further comprising:
acquiring identifier setting starting time of the comment identifier mapped by the target identity information, and acquiring request receiving time of receiving the service reading operation request of the target user terminal;
determining a time difference between the identification setting start time and the request reception time;
if the time difference is smaller than or equal to a difference threshold value, determining that the comment identifier mapped by the target identity information is an effective identifier, and executing a step of acquiring a first comment set for feeding back to the target user terminal from a real-time comment set of a real-time cache server;
if the time difference is larger than the difference threshold, determining that the comment identifier mapped by the target identity information is an invalid identifier, deleting the comment identifier mapped by the target identity information, and executing the step of obtaining a second comment set for feedback to the target user terminal from a delay comment set of the delay cache server.
10. A data processing method, comprising:
the method comprises the steps that a service server receives a service write operation request sent by at least one user terminal and sends the service write operation request to a real-time cache server;
the real-time cache server stores the identity information and comment data in the service write operation request in a real-time comment set in an associated manner, and returns successful storage information to the service server;
the service server sets a comment identifier for the identity information in the service write operation request according to the storage success information;
the service server receives a service reading operation request sent by a target user terminal;
if the service server detects that the comment identifier is mapped to the target identity information of the target user terminal according to the service reading operation request, the service server sends the service reading operation request to the real-time cache server;
the real-time cache server acquires a first comment set used for feeding back to the target user terminal from the real-time comment set according to the service reading operation request;
if the service server detects that the target identity information is not mapped with the comment identifier according to the service reading operation request, the service server sends the service reading operation request to a delay cache server;
the time delay cache server acquires a second comment set used for feeding back to the target user terminal from a time delay comment set according to the service reading operation request; the time delay comment set is obtained by pulling the time delay cache server from the real-time comment set in the real-time cache server through a time delay mechanism.
11. The method of claim 10, wherein the storing, by the real-time cache server, the identity information and comment data in the business write operation request in association with a real-time comment set comprises:
the real-time cache server acquires the business information to which the comment data belongs, and acquires an associated comment generation format corresponding to the business information;
and the real-time cache server fuses the identity information in the business write operation request, the comment data and the comment publishing time of the comment data according to the associated comment generation format, generates associated comment data in the associated comment generation format, and stores the associated comment data in the real-time comment set.
12. The method of claim 10, wherein the latency mechanism comprises a heartbeat cycle; the method further comprises the following steps:
when the time delay cache server reaches the heartbeat cycle, triggering to generate a data query request, and sending the data query request to the real-time cache server; the data query request carries latest time delay associated comment data; the latest time delay associated comment data refers to associated comment data with the latest comment publication time in the time delay comment set;
the real-time cache server determines comment posting time in the latest time delay associated comment data according to the data query request, and the comment posting time is used as target comment posting time;
the real-time cache server takes the associated comment data with the comment posting time later than the target comment posting time in the real-time comment set as an updated comment set;
the real-time cache server returns the updated comment set to the time delay cache server;
and the time delay cache server updates the data of the time delay comment set according to the updated comment set.
13. A data processing apparatus, comprising:
a read request receiving module, configured to receive, by a service server, a service read operation request sent by a target user terminal;
a first comment set acquisition module, configured to, if it is detected that comment identification is mapped to target identity information of the target user terminal according to the service read operation request, acquire, by the service server, a first comment set for feedback to the target user terminal from a real-time comment set of a real-time cache server; the comment identification is an identification corresponding to a user terminal with a comment publishing behavior; the real-time comment set is used for storing comment data requested to be published by a service write operation request when the service write operation request is initiated by at least one user terminal;
a second comment set obtaining module, configured to, if it is detected that the comment identifier is not mapped to the target identity information according to the service read operation request, obtain, by the service server, a second comment set for feedback to the target user terminal from a delay comment set of a delay cache server; the time delay comment set is obtained by pulling the time delay cache server from the real-time comment set in the real-time cache server through a time delay mechanism.
14. A computer device, comprising: a processor and a memory;
the memory stores a computer program which, when executed by the processor, causes the processor to perform the steps of the method of any one of claims 1 to 9.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method of any of claims 1 to 9.
CN202010301311.7A 2020-04-16 2020-04-16 Data processing method, device, equipment and readable storage medium Active CN111460322B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010301311.7A CN111460322B (en) 2020-04-16 2020-04-16 Data processing method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010301311.7A CN111460322B (en) 2020-04-16 2020-04-16 Data processing method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN111460322A CN111460322A (en) 2020-07-28
CN111460322B true CN111460322B (en) 2022-08-12

Family

ID=71680291

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010301311.7A Active CN111460322B (en) 2020-04-16 2020-04-16 Data processing method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111460322B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515707B (en) * 2020-09-21 2024-02-09 腾讯科技(深圳)有限公司 Data processing method, intelligent device, intelligent equipment and storage medium
CN112333276B (en) * 2020-11-09 2021-09-14 珠海格力电器股份有限公司 Network access method, system, storage medium and electronic device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102158541A (en) * 2011-02-22 2011-08-17 宇龙计算机通信科技(深圳)有限公司 Shared information acquisition method, device, mobile terminal and server
CN102207937A (en) * 2010-03-29 2011-10-05 华为技术有限公司 Database access method and system
CN103631782A (en) * 2012-08-21 2014-03-12 腾讯科技(深圳)有限公司 Method, device and system for processing electronic book comments
CN105869057A (en) * 2016-04-07 2016-08-17 腾讯科技(深圳)有限公司 Comment storage device, comment reading method and apparatus, and comment writing method and apparatus
CN106126519A (en) * 2016-06-01 2016-11-16 腾讯科技(深圳)有限公司 The methods of exhibiting of media information and server
CN109408751A (en) * 2018-09-27 2019-03-01 腾讯科技(成都)有限公司 A kind of data processing method, terminal, server and storage medium
CN110392104A (en) * 2019-07-18 2019-10-29 腾讯科技(深圳)有限公司 Method of data synchronization, system, server and storage medium
CN110866193A (en) * 2019-11-20 2020-03-06 北京字节跳动网络技术有限公司 Feedback method, device and equipment based on online document comment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090271417A1 (en) * 2008-04-25 2009-10-29 John Toebes Identifying User Relationships from Situational Analysis of User Comments Made on Media Content
US9125123B2 (en) * 2012-06-13 2015-09-01 All Purpose Networks LLC Efficient delivery of real-time asynchronous services over a wireless network

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102207937A (en) * 2010-03-29 2011-10-05 华为技术有限公司 Database access method and system
CN102158541A (en) * 2011-02-22 2011-08-17 宇龙计算机通信科技(深圳)有限公司 Shared information acquisition method, device, mobile terminal and server
CN103631782A (en) * 2012-08-21 2014-03-12 腾讯科技(深圳)有限公司 Method, device and system for processing electronic book comments
CN105869057A (en) * 2016-04-07 2016-08-17 腾讯科技(深圳)有限公司 Comment storage device, comment reading method and apparatus, and comment writing method and apparatus
CN106126519A (en) * 2016-06-01 2016-11-16 腾讯科技(深圳)有限公司 The methods of exhibiting of media information and server
CN109408751A (en) * 2018-09-27 2019-03-01 腾讯科技(成都)有限公司 A kind of data processing method, terminal, server and storage medium
CN110392104A (en) * 2019-07-18 2019-10-29 腾讯科技(深圳)有限公司 Method of data synchronization, system, server and storage medium
CN110866193A (en) * 2019-11-20 2020-03-06 北京字节跳动网络技术有限公司 Feedback method, device and equipment based on online document comment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
my2cents — Digitizing consumer opinions and comments about retail products;Stephan Karpischek et al.;《2010 Internet of Things (IOT)》;20101230;1-7 *
基于Blog与RSS技术的网络教学系统研究;邓小艳;《中国优秀硕士学位论文全文数据库 信息科技辑》;20071215;I138-959 *

Also Published As

Publication number Publication date
CN111460322A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
JP2004501694A5 (en)
CN110851879B (en) Method, device and equipment for infringement and evidence preservation based on evidence preservation block chain
CN104838413A (en) Adjusting content delivery based on user submissions
CN105915634A (en) Data processing method, server and user terminal
CN110995781B (en) Praise information processing method, device and system
US20080215591A1 (en) Email interface for weblog entries
US20110191406A1 (en) Commenting method and system
CN111460322B (en) Data processing method, device, equipment and readable storage medium
JP2008090512A (en) Information distribution system, information distribution method, content distribution management device, content distribution management method, and program
US20140020079A1 (en) Method for providing network service and apparatus thereof
CN113315989B (en) Live broadcast processing method, live broadcast platform, device, system, medium and equipment
US11829411B2 (en) Data recovery method and apparatus, electronic device, and storage medium
KR20190126563A (en) Sns server, system for providing news using the same and method thereof
CN103559221A (en) Multi-media data processing method and device and browser
CN107172178B (en) A kind of content delivery method and device
CN111538645B (en) Data visualization method and related equipment
CN103561000A (en) Multimedia data authentication method and device and browser
CN106487653B (en) Message processing method and server
CN113204634A (en) Test paper processing method and device, electronic equipment and storage medium
CN111242678A (en) Data processing method, data processing device, computer equipment and storage medium
CN111885139B (en) Content sharing method, device and system, mobile terminal and server
CN111046200B (en) Data processing method, device and equipment
CN111008251B (en) Data processing method and device
CN116862679B (en) Block chain-based data processing method, device, equipment and readable storage medium
KR102079779B1 (en) Method for managing contest based URL

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40025867

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant