CN105869057B - Comment storage device, comment reading method and device, and comment writing method and device - Google Patents

Comment storage device, comment reading method and device, and comment writing method and device Download PDF

Info

Publication number
CN105869057B
CN105869057B CN201610214442.5A CN201610214442A CN105869057B CN 105869057 B CN105869057 B CN 105869057B CN 201610214442 A CN201610214442 A CN 201610214442A CN 105869057 B CN105869057 B CN 105869057B
Authority
CN
China
Prior art keywords
comment
user
ith
subject information
content
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
CN201610214442.5A
Other languages
Chinese (zh)
Other versions
CN105869057A (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 Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610214442.5A priority Critical patent/CN105869057B/en
Publication of CN105869057A publication Critical patent/CN105869057A/en
Application granted granted Critical
Publication of CN105869057B publication Critical patent/CN105869057B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism

Landscapes

  • Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a comment storage device, a comment reading method and a comment writing method and device, and belongs to the field of the Internet. The comment reading method comprises the following steps: receiving a comment acquisition request sent by a user client, wherein the comment acquisition request comprises a user identifier of an ith user and a subject information identifier of subject information; according to the subject information identification and the user identification of the ith user, searching the user identification of each user in the ith comment group corresponding to the ith user from the comment record table; inquiring the comment content of all users in the ith comment group on the topic information from the comment content table according to the topic information identification and the user identification of each user in the ith comment group; and sending the comment content to the user client. According to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.

Description

Comment storage device, comment reading method and device, and comment writing method and device
Technical Field
The embodiment of the invention relates to the field of internet, in particular to comment storage equipment, a comment reading method and a comment writing method and device.
Background
Dynamic information exposure functionality is a common functionality in social-type applications. The user can release own dynamic information on the dynamic information platform, and other users with friend relationships can check the dynamic information on the dynamic information platform.
The dynamic information platform not only comprises the dynamic information of the user, but also comprises subject information pushed by the platform, and the subject information can be advertisement information, application program recommendation information or activity promotion information and the like. Users can comment on such subject information, and the comment content of the users can be visible to friends of the users. In the comment storage server, the comment on the subject information by the user is usually stored with "user identification + subject information identification" as a key (main key) and the comment content as a value. Different users can correspond to different keys for the comment content of the subject information.
Because the users with friend relationships can mutually view the comment content of the opposite party to the subject information, and the comment content of each user to the subject information is dispersedly stored in different comment storage servers, the user client needs to use a large number of keys to access all comment storage servers to obtain the corresponding value each time the user client obtains the comment content of the friend to the subject information. For example, the user a has 200 friends, and the comment contents of the 200 friends for each piece of topic information are dispersedly stored in 20 comment storage servers, and when the user a needs to obtain the comment contents of the friends for a certain piece of topic information, the user a needs to access the 20 comment storage servers through 200 keys to obtain the corresponding comment contents.
Because only a small part of friends can comment the theme information, the comments of the friends corresponding to the theme information can be finally obtained from the small part of comment storage servers, and each obtaining process needs to access all comment storage servers, which causes waste of processing resources of the comment storage servers.
Disclosure of Invention
In order to solve the problem that processing resources of a comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process, the embodiment of the invention provides comment storage equipment, a comment reading method and a comment writing method and a comment reading device. The technical scheme is as follows:
according to a first aspect of the embodiments of the present invention, a comment storage device is provided, in which a comment content table and a comment recording table are stored;
the comment content table comprises a first main key and a first value corresponding to the first key, the first key is a combination of a subject information identifier and a user identifier, and the first value is comment content of subject information indicated by the user identifier to the subject information identifier;
the comment recording table comprises a second key and a second value corresponding to the second key, the second key is a user identifier of an ith user, the second value comprises the subject information identifier and user identifiers of users in an ith comment group, the users in the ith comment group comment the subject information, the ith comment group comment comprises the ith user and/or a jth user having a preset social relationship with the ith user, i, j is an integer, and i ≠ j.
According to a second aspect of embodiments of the present invention, there is provided a comment reading method for reading comment content from the comment storage device of the first aspect, the method including:
receiving a comment acquisition request sent by a user client, wherein the comment acquisition request comprises a user identifier of the ith user and a subject information identifier of the subject information;
according to the subject information identification and the user identification of the ith user, searching the user identification of each user in the ith comment group corresponding to the ith user from the comment record table;
inquiring comment contents of all users in the ith comment group on the theme information from the comment content table according to the theme information identification and the user identification of each user in the ith comment group;
and sending the comment content to the user client.
According to a third aspect of embodiments of the present invention, there is provided a comment writing method for writing comment content from the comment storage device described in the first aspect, the method including:
receiving comment information sent by a user client, wherein the comment information comprises a user identifier of the ith user and comment content of the ith user on the subject information;
writing the comment content of the ith user to the subject information into the comment content table according to the comment information;
and writing the user identification of the ith user into the comment record table according to the comment information.
According to a fourth aspect of the embodiments of the present invention, there is provided a comment reading apparatus for reading comment content from the comment storage device described in the first aspect, the apparatus including:
the request receiving module is used for receiving a comment acquisition request sent by a user client, wherein the comment acquisition request comprises a user identifier of the ith user and a subject information identifier of the subject information;
the identification searching module is used for searching the user identification of each user in the ith comment group corresponding to the ith user from the comment record table according to the subject information identification and the user identification of the ith user;
a content query module, configured to query, according to the topic information identifier and user identifiers of users in the ith comment group, comment contents of all users in the ith comment group on the topic information from the comment content table;
and the content sending module is used for sending the comment content to the user client.
According to a fifth aspect of embodiments of the present invention, there is provided a comment writing apparatus for writing comment content into a comment storage device as described in the first aspect, the apparatus including:
the comment receiving module is used for receiving comment information sent by a user client, wherein the comment information comprises a user identifier of the ith user and comment content of the ith user on the theme information;
a content writing module, configured to write the comment content of the ith user on the topic information into the comment content table according to the comment information;
and the record writing module is used for writing the user identification of the ith user into the comment record table according to the comment information.
According to a sixth aspect of an embodiment of the present invention, there is provided a comment reading system including: the system comprises a user client, a read-write control server and a comment storage server;
the read-write control server comprises the comment reading device of the fourth aspect;
the comment storage server includes the comment storage device according to the first aspect.
According to a seventh aspect of an embodiment of the present invention, there is provided a comment writing system including: the system comprises a user client, a read-write control server and a comment storage server;
the read-write control server comprises the comment writing device according to the fifth aspect;
the comment storage server includes the comment storage device according to the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
setting a comment content table and a comment recording table in comment storage equipment, and when receiving a comment acquisition request sent by a user client, acquiring a user who has performed comment from the comment recording table, and then acquiring corresponding comment content from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a comment reading and writing system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a presentation interface provided by one embodiment of the present invention;
FIG. 3 is a schematic diagram of a presentation interface provided by another embodiment of the present invention;
FIG. 4 is a flow diagram of a comment reading method provided by one embodiment of the present invention;
fig. 5A is a flowchart of a comment reading method provided by another embodiment of the present invention;
FIG. 5B is a schematic diagram of an implementation of the comment reading method shown in FIG. 5A;
fig. 6A is a flowchart of a comment reading method provided by yet another embodiment of the present invention;
FIG. 6B is a schematic diagram of an implementation of the comment reading method shown in FIG. 6A;
FIG. 7 is a flow chart of a comment writing method provided by one embodiment of the present invention;
fig. 8A is a flowchart of a comment writing method provided by another embodiment of the present invention;
fig. 8B is a flowchart of a comment record writing process involved in the comment writing method shown in fig. 8A;
fig. 9 is a block diagram showing the structure of a comment reading apparatus provided in an embodiment of the present invention;
fig. 10 is a block diagram showing the structure of a comment reading apparatus provided in another embodiment of the present invention;
fig. 11 is a block diagram showing the structure of a comment writing apparatus according to an embodiment of the present invention;
fig. 12 is a block diagram showing a structure of a comment writing apparatus according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
For convenience of understanding, terms appearing in the embodiments of the present invention are explained below.
A user client: the application refers to a client application installed in a user terminal, and the user client in the embodiment of the invention refers to a social client with social attributes. The social client side generally has an instant messaging function and a dynamic information presentation function. For example, the social client may be an instant messenger, a voice messenger, a team voice tool, a rich media social tool, a gaming platform, a micro blogging or trading platform, and so forth.
The dynamic information display function: a user publishes own dynamic information on a dynamic information platform, and other users with social relations can consult the function of the dynamic information on the platform. On the dynamic information display platform, each user corresponds to a dynamic information stream corresponding to the account of the user, the dynamic information stream comprises dynamic information published by other users having a predetermined social relationship with the user, and the dynamic information is displayed generally according to a time line form. Wherein the predetermined social relationship comprises: at least one of a friend relationship, a same group relationship in the dynamic information platform and a relationship for obtaining a user-granted reference authority exists in the dynamic information platform. In some embodiments, the user has the right to set the dynamic messages of other users to appear or not appear in the dynamic information flow corresponding to the own account. The names of the dynamic information presentation platform on different social clients may be different, such as a friend circle, a people circle, a life circle, and the like.
Theme information: the dynamic information platform pushes information to each user, and the subject information can be advertisement information, application program recommendation information or activity promotion information and the like. Each user can comment on the topic information, and the comment content of the user on the topic information can be consulted by other users having a predetermined social relationship with the user, wherein the predetermined social relationship comprises: and the dynamic information platform has at least one of a friend relationship with the user, a same group relationship with the user in the dynamic information platform and a relationship of obtaining the reference authority granted by the user. The embodiments of the present invention are only schematically illustrated by taking the predetermined social relationship as an example of the presence of a friend relationship in the dynamic information platform, but not limited thereto.
Referring to fig. 1, a schematic structural diagram of a comment reading and writing system according to an embodiment of the present invention is shown, where the comment reading and writing system includes: at least one user terminal 110, a read-write control server 120, and a comment storage server 130.
The user terminal 110 is an electronic device running a user client, which is a social client having social attributes. Each user logs in and uses the social client through the own account, and a preset social relationship can be established among different users. The user can receive the theme information pushed by the corresponding dynamic information platform through the social client side, and can comment on the theme information.
The user terminal 110 is connected to the read-write control server 120 through a wired or wireless network.
The read-write control server 120 is a server for controlling reading and writing of the comment, and optionally, the read-write control server 120 is at least one server, a server cluster, a distributed server platform, a cloud computing center, or a combination of several server clusters. The read-write control server 120 is configured to receive a comment of the user on the specified subject information in the user client, and write the comment into the comment storage server 130. The read-write control server 120 is further configured to receive a comment acquisition request of the user for the specified subject information in the user client, acquire a corresponding comment from the comment storage server 130 according to the comment acquisition request, and return the comment to the user client used by the user. It should be noted that the read-write control server 120 may specifically include a read control server and a write control server, which are respectively used for reading the comment from the comment storage server 130 and writing the comment into the comment storage server 130, and this embodiment only takes the example that the read-write control server 120 is responsible for reading and writing the comment at the same time as an example to perform schematic description.
The read-write control server 120 is connected with the comment storage server 130 through a wired or wireless network.
The comment storage server 130 is a server for storing comments on the subject information by the respective users. The comment storage server 130 may specifically include a comment content storage server and a comment record storage server, where the comment content storage server is configured to store a comment content table, and the comment content table stores detailed comments of users on the subject information, such as comment text, comment voice, comment pictures, comment time, reply time, and the like; the comment record storage server is used for storing a comment record table, and the comment record table stores the subject information identification of the subject information and the user identification of the user who has commented on the subject information. It should be noted that, because the amount of data for storing comments is huge, a plurality of comment storage servers 130 are arranged in the comment reading and writing system, and comments of each user on the subject information are dispersedly stored in the comment storage servers 130.
In the existing comment storage server, comment contents of users on the subject information are packaged and stored in a value corresponding to a key, for example, comment contents of users 001 on the subject information a are stored in a value corresponding to a key of "users 001 subject information a". And comments of different users to different subject information are dispersedly stored in different comment storage servers. When a user client needs to acquire all comments of a user and friends of the user on certain subject information, the read-write control server needs to call a huge social relation chain to generate a large number of keys, and corresponding comment contents are acquired from all comment storage servers according to the generated keys. For example, the user 001 has 200 friends, and when the user 001 needs to obtain the comment content of the friends of the user on the topic information a, the read-write control server needs to generate 200 different keys, and access all comment storage servers to obtain corresponding comment content (value). However, for the topic information, since only a small part of friends usually exist for commenting, only a small part of comment storage servers can obtain the value corresponding to the key finally, and most comment storage servers cannot return the value (i.e. invalid access) because the corresponding key is not found. For the information with huge push quantity such as theme information, frequent access to all comment storage servers causes great processing pressure, and a great amount of invalid access causes great resource waste.
The comment storage server provided by the embodiment of the invention not only comprises a comment content table for storing comment contents, but also introduces a comment record table for storing comment records of users and friends thereof. When the read-write control server acquires the comment content, the read-write control server firstly acquires the user identification of the user who has performed the comment from the comment recording table, then generates a corresponding key according to the acquired user identification and the identification of the subject information, and finally acquires the corresponding comment content from the comment content table. The users who have not been commented are filtered by accessing the comment record table, so that the number of generated read requests (keys) is reduced, the comment content can be obtained by accessing a small number of comment storage servers, and resource waste caused by invalid access is avoided. The display interface of the theme information and the comment content of the user and the friends thereof on the theme information is schematically shown in fig. 2: the friend circle of the user Alice comprises subject information 21, and the subject information 21 comprises comment content 22 of the user Alice to the subject information 21, comment content 23 of the user Bob to the subject information 21, comment content 24 of the user Carol to the subject information 21, and comment information 25 of the user Alice and the user Bob to the subject information 21, wherein the user Alice and the user Bob are in a friend relationship with each other in a dynamic information platform, and the user Alice and the user Carol are in a friend relationship with each other in the dynamic information platform.
The following describes a storage structure of the review content table and the review record table in the embodiment of the present invention.
The comment content table provided by the embodiment of the invention stores comment content by adopting a key-value structure. The comment content table comprises a first key and a first value corresponding to the first key. The first key indicates a comment relation between the user and the subject information by adopting the combination of the subject information identifier and the user identifier; the first value is used for storing the comment content of the user on the subject information, wherein the comment content not only contains the comment content of the user on the subject information, but also contains the reply content of the user on other users (having a predetermined social relationship with the user) under the subject information. For example, the first value corresponding to the first key "super-run-Alice" is the evaluation content of the user Alice on the topic information of super-run and the reply content of the user Alice on the friend user under the topic of super-run.
Illustratively, the table structure of the review content table may be as shown in table one.
Watch 1
Figure BDA0000959614760000081
The comment content may specifically include a comment ID, comment data, a user ID, comment time, a reply user ID, a comment reply ID, comment deletion time, and the like, and may adopt a storage structure shown in table two.
Watch two
Figure BDA0000959614760000082
In addition, the first value may further include praise information of the user on the topic information, and a storage structure of the praise information may be as shown in table three.
Watch III
Like information Time of like Like sequence Canceling praise time
The praise sequence indicates the position of the praise of the user on the theme information in the total praise, and the praise canceling time is the time for canceling the praise on the theme information by the user.
The comment record table provided by the embodiment of the invention also adopts a key-value structure to store the comment records of the user. The comment recording table includes a second key and a second value corresponding to the second key.
Illustratively, the table structure of the review record table may be as shown in table four.
Watch four
Figure BDA0000959614760000083
The second key is the user identification of the ith user; the second value comprises a topic information identifier and a user identifier of each user in an ith comment group, each user in the ith comment group is a user who has commented on the topic information, the ith comment group comprises an ith user and/or a jth user having a predetermined social relationship with the ith user, i and j are integers, and i is not equal to j.
For example, the topic information included in the second value corresponding to the second key "Alice" is identified as "overtaking", and the user identifiers of the users in the comment group included in the second value are "Bob" and "Carol", respectively, which indicate that, among the users having a predetermined social relationship with the user Alice, both the user Bob and the user Carol comment on the topic information of "overtaking", and the user Alice itself also comments on the topic information of "overtaking".
Optionally, according to a time sequence of the comment content recently published by the user in the comment content of the subject information of all users in the ith comment group, the second value further includes comment version numbers corresponding to the users in the ith comment group, and a total comment version number of the subject information of the ith comment group. Illustratively, the table structure of the review record table may also be as shown in table five.
Watch five
Figure BDA0000959614760000091
And for each user in the ith comment group, the comment version number corresponding to the user is used for indicating the time sequence of the comment content which is published by the user last time in the comment content of the subject information of all users in the ith comment group. For example, the comment version number corresponding to the user identifier "Alice" in the ith comment group is 1, the comment version number corresponding to the user identifier "Bob" is 2, the comment version number corresponding to the user identifier "Carol" is 3, and it indicates that the comment sequence of each user in the ith comment group to the subject information of "overtaking" is Alice-Bob-Carol.
The total comment version number is used to indicate the total number of the comment contents of all the users on the topic information in the ith comment group, for example, the ith comment group contains comments on the topic information by Alice, Bob and Carol, that is, the total comment version number of the topic information in the ith comment group is 3. When Alice reviews the subject information again, the total review version number of the subject information is updated to 4 (including 4 pieces of review content) by the i-th review group, and the review version number corresponding to Alice is also updated to 4 (the latest review content of Alice is ranked fourth in the total review content).
For example, as shown in fig. 3, when the user Alice refreshes the circle of friends at 10:12, the subject information 31 only includes the comment content 32 of the user Alice on the subject information 31, at this time, the comment version number corresponding to the user Alice is 1, and the total comment version number of the comment group corresponding to the user Alice on the subject information 31 is also 1; when the user Alice refreshes the friend circle at a ratio of 10:14, the comment content 33 of the user Bob to the theme information 31 and the comment content 34 of the user Carol to the theme information 31 are added below the theme information 31, at this time, in the comment group corresponding to the user Alice, the comment version number corresponding to the user Alice is 1, the comment version number corresponding to the user Bob is 2, the comment version number corresponding to the user Carol is 3, and the total comment version number of the comment group corresponding to the user Alice to the theme information 31 is 3.
With reference to the comment reading and writing system shown in fig. 1, the comment content table and the comment record table provided in the above embodiment are stored and maintained in the comment storage server, and when the reading and writing control server receives a comment acquisition request for specified subject information sent by a user client, the reading and writing control server first acquires a comment group (including a user identifier of a user who has commented on the specified subject information) from the comment record table, and then acquires corresponding comment content from the comment content table according to the comment group and the subject information identifier of the specified subject information. The following describes a process of reading the comment content by the read/write control server using an embodiment.
Referring to fig. 4, a flowchart of a comment reading method according to an embodiment of the present invention is shown. The present embodiment is exemplified by applying the comment reading method to the read-write control server 120 shown in fig. 1. The method comprises the following steps:
step 402, receiving a comment acquisition request sent by a user client, where the comment acquisition request includes a user identifier of an ith user and a subject information identifier of subject information.
The ith user is a user corresponding to the user client, and the user identifier can be an account used when the ith user logs in the user client.
And step 404, searching the user identification of each user in the ith comment group corresponding to the ith user from the comment record table according to the subject information identification and the user identification of the ith user.
The found users in the ith comment group are the ith user and/or the jth user with a preset social relationship with the ith user, and the users in the ith comment group comment the subject information.
And step 406, inquiring the comment content of all the users in the ith comment group on the subject information from the comment content table according to the subject information identification and the user identification of each user in the ith comment group.
The obtained comment content contains comment content of each user in the ith comment group to the subject information.
Step 408, the comment content is sent to the user client.
Correspondingly, the user client displays the received comment content.
In summary, in the comment reading method provided in this embodiment, the comment content table and the comment record table are set in the comment storage device, and when a comment acquisition request sent by a user client is received, a user who has performed a comment is first acquired from the comment record table, and then corresponding comment content is acquired from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
Referring to fig. 5A, a flowchart of a comment reading method according to another embodiment of the present invention is shown. The present embodiment is exemplified by applying the comment reading method to the read-write control server 120 shown in fig. 1. The method comprises the following steps:
step 501, receiving a comment acquisition request sent by a user client, where the comment acquisition request includes a user identifier of an ith user and a subject information identifier of subject information.
After the user client acquires the theme information from the dynamic information platform, the user client can comment or approve the theme information. When the comment content of the subject information of other users having a predetermined social relationship with the user needs to be acquired, the user client sends a comment acquisition request to the read-write control server, where the comment acquisition request carries a user identifier of a user corresponding to the user client and a subject information identifier of the subject information, where the user identifier may refer to an account used when the user logs in the user client, such as a microblog account, a WeChat account, a Paibao account, and so on.
Correspondingly, the read-write control server receives a comment acquisition request sent by the user client
For example, taking a user client as a WeChat client, and taking an example that a user corresponding to the WeChat client is Alice, the WeChat client obtains the topic information 'overtaking run' actively pushed by the dynamic information platform from the dynamic information platform, and displays the topic information 'overtaking run' in a friend circle. Meanwhile, the WeChat client sends a comment acquisition request to the read-write control server, and the comment acquisition request is used for acquiring comment contents of Alice and friends thereof on the topic information.
Because there are few friends who comment on the subject information and there are few comment contents of the corresponding friends on the subject information, the comment contents are only stored in a few comment storage servers, and are not dispersedly stored in all the storage servers. In order to avoid resource waste caused by accessing all the storage servers, the read-write control server first screens out friends who have reviewed the subject information from all friends of the user, that is, the following steps 502 to 504 are performed.
Step 502, the user identifier of the ith user is determined as a second key.
After the read-write control server obtains the comment obtaining request, the user identification of the ith user contained in the comment obtaining request is determined as a second key, and the user identification of the user (the ith user and/or the jth user having social relation with the ith user) who has commented on the subject information is further obtained from the comment recording table according to the second key and the subject information identification.
For example, the comment acquisition request includes a user identifier "Alice", and the read-write control server determines Alice as the second key.
And step 503, inquiring a corresponding second value in the comment recording table according to the second key.
And the read-write control server inquires a corresponding second value from the comment record table according to the second key.
For example, the read-write control server determines that the second key is Alice, and obtains a second value corresponding to Alice from the comment record table shown in table four.
And step 504, according to the subject information identification, obtaining the user identification of each user in the ith comment group from the second value.
Further, the read-write control server obtains, from the second value, the user identifier of each user in the ith comment group corresponding to the subject information identifier, according to the subject information identifier included in the comment obtaining request.
For example, the read-write control server receives that the topic identifier included in the comment acquisition request is "overtaking", that is, the i-th comment group corresponding to "overtaking" in the second value is acquired from table four, and the user identifiers of the users in the i-th comment group are Alice, Bob, and Carol, that is, only Bob and Carol comment on the topic information of "overtaking".
And 505, respectively combining the subject information identifier and the user identifier of each user in the ith comment group to generate at least one first key.
And combining each user identifier with the subject information identifier by the read-write control server according to the obtained user identifier of each user in the ith comment group to generate at least one first key, and obtaining a corresponding first value from the comment content table according to the first key.
For example, the read-write control server obtains that the user identifiers of the users in the ith comment group are respectively Alice, Bob, and Carol, and the topic information identifier included in the comment obtaining request is "overtaking", and generates the following three first keys: "Superrun-Alice", "Hyperrun-Bob", "Hyperrun-Carol".
Step 506, a corresponding first value is inquired from the comment content table according to at least one first key, and the first value contains the comment content of the user in the ith comment group to the subject information.
According to the generated at least one first key, the read-write control server inquires a first value corresponding to the first key from the comment content table, so that comment contents of each user in the ith comment group on the subject information are obtained.
For example, the read-write control server obtains the comment content corresponding to the "hyperspace-Alice" from the comment content table shown in table one as "Alice: good stick! - "get the comment content corresponding to" overtaking-Bob "as" Bob replying Alice: buy and buy! "obtaining the comment content corresponding to" hyperspace-Carol "as" Carol replies Alice: stick! ".
And step 507, sending the comment content to the user client.
And the read-write control server sends the acquired comment content to the user client for display by the user client.
Obviously, according to the comment records stored in the comment record table, friends who have commented on the subject information are screened out from a large number of friends of the user (steps 502 to 504), so that the number of generated keys can be remarkably reduced (assuming that Alice has 200 friends, 201 keys need to be generated to obtain 200 friends and the comment content of Alice per se by adopting the prior art, but in the technical scheme provided by the embodiment of the invention, only 3 keys need to be generated according to the found commented user), and the number of accessed comment storage servers is reduced; moreover, since the screened users all have comments, the comment storage server can acquire comment content according to the generated key, namely, effective access is performed according to the generated key, and resource waste caused by invalid access is avoided.
In summary, in the comment reading method provided in this embodiment, the comment content table and the comment record table are set in the comment storage device, and when a comment acquisition request sent by a user client is received, a user who has performed a comment is first acquired from the comment record table, and then corresponding comment content is acquired from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
In conjunction with the comment reading method shown in fig. 5A, a process in which the user client acquires comment content for specified subject information from the comment storage server is schematically shown in fig. 5B.
The comment storage server comprises a comment record storage server and a comment content storage server, and the comment record storage server and the comment content storage server are respectively used for storing a comment record table and a comment content table.
In step 511, the user client sends a comment acquisition request carrying a user identifier Alice and a subject information identifier "overtaking" to the read-write control server; in step 512 and step 513, the read-write control server obtains the user identifier of the user who has commented on the "overtaking" from the comment record storage server according to the user identifier and the subject information identifier; in step 514, the read-write control server generates a key according to the acquired user identifier; in step 515, the read-write control server searches for corresponding comment content from the comment content storage server according to the generated key; in step 516, the read-write control server sends the found comment content to the user client.
When the second value in the comment record table contains the comment version number corresponding to each user in the ith comment group and the total comment version of the subject information of the ith comment group, the read-write control server can further reduce the number of generated keys according to the history comment version number carried in the comment acquisition request, so that the number of accessed comment storage servers is reduced.
Referring to fig. 6A, a flowchart of a comment reading method according to still another embodiment of the present invention is shown. The present embodiment is exemplified by applying the comment reading method to the read-write control server 120 shown in fig. 1. The method comprises the following steps:
step 601, receiving a comment acquisition request sent by a user client, where the comment acquisition request includes a user identifier of an ith user and a subject information identifier of subject information.
Step 602, the user identifier of the ith user is determined as the second key.
Step 603, querying a corresponding second value in the comment recording table according to the second key.
And the read-write control server inquires a corresponding second value from the comment record table according to the second key.
For example, the read-write control server determines that the second key is Alice, and obtains a second value corresponding to Alice from the comment record table shown in table four.
The implementation of steps 601 to 603 is similar to that of steps 501 to 503, and is not repeated here.
And step 604, acquiring the user identification of each user in the ith comment group from the second value according to the subject information identification.
Different from the step 504, the read-write control server obtains the user identifier of each user in the ith comment group and also obtains the comment version number corresponding to each user.
For example, the read-write control server obtains the user identifiers of each user in the ith comment group as Alice, Bob and Carol, where Alice corresponds to a comment version number of 1, Bob corresponds to a comment version number of 2, and Carol corresponds to a comment version number of 3.
Step 605, according to the historical comment version number included in the comment acquisition request, screening out a target comment user from the user identifiers of the users in the ith comment group, wherein the comment version number corresponding to the target comment user is greater than the historical comment version number.
The comment acquisition request sent by the user client comprises a historical comment version number, wherein the historical comment version number is the total comment version number of the subject information of the ith comment group when the user client acquires the comment content of the subject information of the user in the ith comment group last time.
For example, when the user client acquires the comment content of Alice and friends thereof for the topic information "overtaking", only Alice has commented on the topic information (the i-th comment group only contains Alice, the corresponding comment version number is 1, the total comment version number is also 1, and the comment content table only contains the comment content of Alice). When the user client side obtains the comment content of Alice and friends thereof for the subject information 'super-run', the sent comment obtaining request contains the history comment version number 1.
And the read-write control server determines the user with the comment version number larger than the historical comment version number as the target comment user according to the historical comment version number and the comment version number corresponding to the user in the ith comment group.
For example, the read-write control server obtains that the history version number is 1 from the comment obtaining request, and the comment recording table is shown in table five, that is, the read-write control server determines the users Bob and Carol corresponding to the comment version numbers 2 and 3 as the target comment users.
And 606, combining the subject information identification and the user identification of each target comment user respectively to generate at least one first key.
Similar to the step 505, the read-write control server combines the subject information identifier and the user identifier of each target comment user, respectively, to generate at least one first key.
For example, the read-write control server obtains that the user identifiers of the target comment users are Bob and Carol, respectively, and the topic information identifier included in the comment obtaining request is "overtaking", and generates the following two first keys: "Superrun-Bob", "Superrun-Carol".
Step 607, a corresponding first value is inquired from the comment content table according to at least one first key, and the first value contains the comment content of the target comment user on the subject information.
According to the generated at least one first key, the read-write control server inquires a first value corresponding to the first key from the comment content table, so that comment content of the target comment user on the subject information is obtained.
For example, the read-write control server obtains the comment content corresponding to the "hyperspace-Bob" from the comment content table shown in table one as "Bob replies Alice: buy and buy! "obtaining the comment content corresponding to" hyperspace-Carol "as" Carol replies Alice: stick! ".
Step 608, the comment content is sent to the user client.
And the read-write control server sends the acquired comment content to the user client for display by the user client.
Obviously, after the comment version number is set for the comment record of the user, the read-write control server only needs to acquire the comment content increased from the last acquisition time to the current time every time the comment content is acquired, and the number of the acquired comment content is further reduced.
In summary, in the comment reading method provided in this embodiment, the comment content table and the comment record table are set in the comment storage device, and when a comment acquisition request sent by a user client is received, a user who has performed a comment is first acquired from the comment record table, and then corresponding comment content is acquired from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
In this embodiment, by setting the comment version number for the comment record of the user, the read-write control server only needs to acquire the comment content that is added between the last acquisition time and the current time each time the comment content is acquired, and the number of the acquired comment content is further reduced.
In conjunction with the comment reading method shown in fig. 6A, a process in which the user client acquires comment content for specified subject information from the comment storage server is schematically shown in fig. 6B.
The comment storage server comprises a comment record storage server and a comment content storage server, and the comment record storage server and the comment content storage server are respectively used for storing a comment record table and a comment content table.
In step 611, the user client sends a comment acquisition request carrying a user identifier Alice, a topic information identifier "super-run" and a historical comment version number 1 to the read-write control server; in step 612 and step 613, the read-write control server obtains the user identifier of the user who has commented on the overtaking race from the comment record storage server according to the user identifier and the subject information identifier, and screens out the target comment user according to the historical comment version number; in step 614, the read-write control server generates a key according to the acquired user identifier of the target comment user; in step 615, the read-write control server searches corresponding comment content from the comment content storage server according to the generated key; in step 616, the read-write control server sends the found comment content and the current total comment version number to the user client.
Referring to fig. 7, a flowchart of a comment writing method according to an embodiment of the present invention is shown. The present embodiment is exemplified by applying the comment writing method to the read-write control server 120 shown in fig. 1. The method comprises the following steps:
step 702, receiving comment information sent by a user client, wherein the comment information comprises a user identifier of an ith user and comment content of the ith user on the subject information.
Step 704, writing the comment content of the ith user on the subject information into the comment content table according to the comment information.
And step 706, writing the user identification of the ith user into a comment record table according to the comment information.
The above steps 704 and 706 have no strict precedence relationship, that is, the steps 704 and 706 can be performed simultaneously.
In summary, in the comment writing method provided in this embodiment, the comment content table and the comment record table are set in the comment storage device, and when a comment acquisition request sent by a user client is received, a user who has performed a comment is first acquired from the comment record table, and then corresponding comment content is acquired from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
Referring to fig. 8A, a flowchart of a comment writing method according to another embodiment of the present invention is shown. The present embodiment is exemplified by applying the comment writing method to the read-write control server 120 shown in fig. 1. The method comprises the following steps:
step 801, receiving comment information sent by a user client, wherein the comment information includes a user identifier of an ith user and comment content of the ith user on subject information.
When a user comments on certain theme information, the user client sends corresponding comment information to the read-write control server and indicates the read-write control server to write corresponding content into the comment content table and the comment record table. The comment information comprises user identification of the user and comment content of the user on the subject information.
For example, when the user Alice reviews the topic information of "super-run", the user client sends a review content containing the user identifier "Alice" and the topic information of "super-run" to the read-write control server.
Step 802, combining the subject information identifier of the subject information with the user identifier of the ith user to generate a first key.
Because a key-value storage structure is adopted in the comment content table, and the first key in the comment content table adopts a combination of 'subject information identifier-user identifier', after the read-write control server acquires the comment information, the subject information identifier of the subject information is combined with the user identifier of the ith user to generate the first key.
For example, the read-write control server generates a first key "hyperspace-Alice" according to the received comment information.
Step 803, whether the review content table contains the first key is detected.
After the read-write control server generates the first key, detecting whether the comment content table contains the first key, if the comment content table does not contain the first key, indicating that the user has not commented on the subject information before, and executing step 804; if the comment content table contains the first key, indicating that the user has previously commented on the subject information, step 805 is performed.
Step 804, if the comment content table does not contain the first key, determining the comment content of the ith user on the subject information as a first value; and writing the first key and the first value into the comment content table.
If the comment content table does not contain the first key, the fact that the user does not comment on the subject information before is indicated, the read-write control server determines the comment content of the ith user on the subject information as a first value, and the first key and the first value are written into the comment content table together and are stored in an associated mode.
Step 805, if the comment content table contains the first key, adding the comment content of the ith user on the subject information to a first value corresponding to the first key.
If the comment content table contains the first key and indicates that the user has previously commented on the subject information, the read-write control server adds the comment content of the ith user on the subject information into a first value corresponding to the first key.
Step 806, determining the user identification of the ith user as a second key.
Since the comment recording table adopts a key-value storage structure and the second key is the user identifier of the ith user, the read-write control server determines the user identifier of the ith user as the first key after acquiring the comment information.
For example, the read-write control server generates a second key "Alice" according to the received comment information.
Step 807, it is detected whether the review record table contains a second value corresponding to the second key.
Similar to step 603, after the read-write control server generates the second key, detecting whether the comment recording table includes the second value corresponding to the second key, if the comment content table does not include the second value corresponding to the second key, indicating that the user has not previously commented on the topic information, and performing step 808; if the review record table includes the second value corresponding to the second key, indicating that the user has reviewed the topic information before, step 809 is executed.
Step 808, if the comment recording table does not contain a second value corresponding to the second key, creating an ith comment group; adding the ith user to the ith comment group; and determining the subject information identification of the subject information and the user identification of the users in the ith comment group as a second value.
If the comment content table does not contain the second value corresponding to the second key, the read-write control server indicates the comment storage server to create an ith comment group corresponding to the ith user in the comment record table, the ith user is added to the comment group (at this time, the ith comment group only contains the user identifier of the ith user), the subject information identifier of the subject information and the user identifier of the user in the ith comment group are determined as the second value, and the second key and the second value are stored in an associated manner.
Step 809, if the comment recording table contains a second value corresponding to the second key, adding the ith user to the ith comment group in the second value.
And if the comment content table contains a second value corresponding to the second key, the read-write control server adds the user identifier of the ith user to the ith comment group, so that the comment record of the ith user on the theme information is updated.
In summary, in the comment writing method provided in this embodiment, the comment content table and the comment record table are set in the comment storage device, and when a comment acquisition request sent by a user client is received, a user who has performed a comment is first acquired from the comment record table, and then corresponding comment content is acquired from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
Because the comment record table not only stores the comment record of the ith user to the subject information, but also contains the comment record of the friend user of the ith user to the subject information, after the ith user comments the subject information, the read-write control server also needs to update the comment record of the friend user to the subject information. As shown in fig. 8B, the following steps are further included after the step 801.
And step 810, determining a jth user having a predetermined social relationship with the ith user according to the user identification of the ith user.
The reading and writing control server stores the social relationship between the users in advance, and when comment information sent by the ith user is received, the jth user with a preset social relationship with the ith user is determined according to the social relationship.
Step 811, determine the user identifier of the jth user as the second key.
Similar to the above step 806, the read-write control server determines the user identifier of the jth user as the second key.
Step 812, detecting whether the review record table contains a second value corresponding to the second key.
After the read-write control server generates a second key, detecting whether a comment recording table contains a second value corresponding to the second key, if the comment content table does not contain the second value corresponding to the second key, indicating that a jth user has not previously commented on the subject information, and executing step 813; if the comment recording table contains a second value corresponding to the second key, indicating that the jth user has previously commented on the topic information, step 814 is executed.
Step 813, if the comment recording table does not contain the second value corresponding to the second key, creating a jth comment group, wherein the jth comment group corresponds to a jth user; adding the jth user to the jth comment group; and taking the subject information identification of the subject information and the user identification of the users in the jth comment group as a second value.
Similar to step 808, if the comment content table does not include the second value corresponding to the second key, the read-write control server instructs the comment storage server to create a jth comment group corresponding to the jth user in the comment record table, add the ith user to the comment group (at this time, the jth comment group only includes the user identifier of the ith user), determine the subject information identifier of the subject information and the user identifier of the jth comment group as the second value, and store the second key and the second value in an associated manner.
Step 814, if the comment recording table contains a second value corresponding to the second key, adding the ith user to the jth comment group in the second value.
Similar to the step 809, if the comment content table includes the second value corresponding to the second key, the read-write control server adds the user identifier of the ith user to the jth comment group, so as to update the comment record of the jth user on the subject information.
As shown in the above table five, the review record table may further include a total version number of the subject information of the ith review group. And the comment copy number corresponding to each user in the ith comment group, so that after the read-write control server receives the comment information of the ith user, the total version number in the comment record table and the comment version number corresponding to the user in the comment group need to be updated. After steps 808 and 809, step 815 is further included; after the above steps 813 and 814, step 816 is further included.
Step 815, updating the total comment version number of the ith comment group on the subject information; and assigning the total comment version number of the updated ith comment group to the corresponding comment version number of the ith user in the ith comment group.
For the ith user, after receiving the comment information of the ith user on the topic information, the read-write control server updates the total comment version number of the topic information in the ith comment group corresponding to the ith user. Wherein, updating the general comment version number may mean adding one to the current general comment version number.
After the total comment version number of the subject information in the ith comment group is updated, the read-write control server assigns the updated total comment version number to the comment version number corresponding to the ith user in the ith comment group to indicate that the comment of the ith user on the subject information is latest, and the comment version numbers corresponding to other jth users in the ith comment group are kept unchanged.
Step 816, updating the total comment version number of the jth comment group on the subject information; and assigning the total comment version number of the updated jth comment group to the theme information to the comment version number corresponding to the ith user in the jth comment group.
Similar to the book reading step 815, for the jth user, after receiving the comment information of the ith user on the topic information, the read-write control server updates the total comment version number of the topic information in the jth comment group corresponding to the jth user. Wherein, updating the general comment version number may mean adding one to the current general comment version number.
After the total comment version number of the topic information in the jth comment group is updated, the read-write control server assigns the updated total comment version number to the comment version number corresponding to the ith user in the jth comment group to indicate that the comment of the ith user on the topic information is latest, and the comment version numbers corresponding to other users in the jth comment group are kept unchanged.
In this embodiment, by setting the comment version number for the comment record of the user, the read-write control server only needs to acquire the comment content that is added between the last acquisition time and the current time each time the comment content is acquired, and the number of the acquired comment content is further reduced.
By introducing the comment recording table, the number of read requests is reduced from a hundred to thousand level (determined by the number of friends of a user) to a single digit level (determined by the number of friends who actually comment) each time the comment content is read; by introducing the comment version number, each time the comment is read, only the comment content increased from the last reading time to the current time needs to be read. Through the two points, the writing and reading of the whole comment reading and writing system are balanced, the load of the comment reading and writing system is reduced, and the flexibility of the comment reading and writing system is improved.
Referring to fig. 9, a block diagram of a structure of a comment reading apparatus according to an embodiment of the present invention is shown. The comment reading device is implemented by software, hardware, or a combination of the two, and becomes all or a part of the read/write control server 120 in fig. 1. The comment reading apparatus includes:
a request receiving module 901, configured to receive a comment acquisition request sent by a user client, where the comment acquisition request includes a user identifier of the ith user and a subject information identifier of the subject information;
an identifier searching module 902, configured to search, according to the subject information identifier and the user identifier of the ith user, a user identifier of each user in the ith comment group corresponding to the ith user from the comment record table;
a content query module 903, configured to query, according to the topic information identifier and the user identifier of each user in the ith comment group, comment contents of all users in the ith comment group for the topic information from the comment content table;
a content sending module 904, configured to send the comment content to the user client.
In summary, the comment reading apparatus provided in this embodiment sets the comment content table and the comment record table in the comment storage device, and when receiving a comment acquisition request sent by a user client, first acquires a user who has performed a comment from the comment record table, and then acquires corresponding comment content from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
Referring to fig. 10, a block diagram of a structure of a comment reading apparatus according to another embodiment of the present invention is shown. The comment reading device is implemented by software, hardware, or a combination of the two, and becomes all or a part of the read/write control server 120 in fig. 1. The comment reading apparatus includes:
a request receiving module 1001, configured to receive a comment acquisition request sent by a user client, where the comment acquisition request includes a user identifier of the ith user and a subject information identifier of the subject information;
an identifier searching module 1002, configured to search, according to the subject information identifier and the user identifier of the ith user, a user identifier of each user in the ith comment group corresponding to the ith user from the comment record table;
a content query module 1003, configured to query, according to the topic information identifier and the user identifier of each user in the ith comment group, comment contents of all users in the ith comment group for the topic information from the comment content table;
a content sending module 1004, configured to send the comment content to the user client.
Optionally, the content query module 1003 includes:
a first generating unit 1003a, configured to combine the topic information identifier and the user identifier of each user in the ith comment group, respectively, to generate at least one first key;
the first query unit 1003b is configured to query the corresponding first value from the comment content table according to the at least one first key, where the first value includes comment content of the subject information by the user in the ith comment group.
Optionally, the identifier lookup module 1002 includes:
a first determining unit 1002a, configured to determine the user identifier of the ith user as the second key;
the second query unit 1002b is configured to query the corresponding second value in the comment record table according to the second key;
an obtaining unit 1002c, configured to obtain, according to the topic information identifier, a user identifier of each user in the i-th comment group from the second value.
Optionally, the comment acquisition request includes a historical comment version number, where the historical comment version number is a total comment version number of the subject information by the ith comment group when the user client acquires the comment content of the subject information by the user in the ith comment group last time;
the device, still include:
a screening module 1005, configured to screen a target comment user from the user identifiers of the users in the ith comment group according to the historical comment version number, where a comment version number corresponding to the target comment user is greater than the historical comment version number.
In summary, the comment reading apparatus provided in this embodiment sets the comment content table and the comment record table in the comment storage device, and when receiving a comment acquisition request sent by a user client, first acquires a user who has performed a comment from the comment record table, and then acquires corresponding comment content from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
In this embodiment, by setting the comment version number for the comment record of the user, the read-write control server only needs to acquire the comment content that is added between the last acquisition time and the current time each time the comment content is acquired, and the number of the acquired comment content is further reduced.
Referring to fig. 11, a block diagram of a structure of a comment writing apparatus according to an embodiment of the present invention is shown. The comment writing device is implemented by software, hardware, or a combination of both, and becomes all or a part of the read/write control server 120 in fig. 1. The comment writing apparatus includes:
a comment receiving module 1101, configured to receive comment information sent by a user client, where the comment information includes a user identifier of the ith user and comment content of the ith user on the topic information;
a content writing module 1102, configured to write, into the comment content table according to the comment information, comment content of the ith user on the topic information;
a record writing module 1103, configured to write the user identifier of the ith user into the comment record table according to the comment information.
In summary, the comment writing device provided in this embodiment sets the comment content table and the comment record table in the comment storage device, and when receiving a comment acquisition request sent by the user client, first acquires a user who has performed a comment from the comment record table, and then acquires corresponding comment content from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
Referring to fig. 12, a block diagram of a comment writing apparatus according to another embodiment of the present invention is shown. The comment writing device is implemented by software, hardware, or a combination of both, and becomes all or a part of the read/write control server 120 in fig. 1. The comment writing apparatus includes:
a comment receiving module 1201, configured to receive comment information sent by a user client, where the comment information includes a user identifier of the ith user and comment content of the ith user on the topic information;
a content writing module 1202, configured to write the comment content of the ith user on the topic information into the comment content table according to the comment information;
a record writing module 1203, configured to write the user identifier of the ith user into the comment record table according to the comment information.
Optionally, the content writing module 1202 includes:
a second generating unit 1202a, configured to combine a topic information identifier of the topic information with a user identifier of the ith user, and generate the first key;
a first detecting unit 1202b configured to detect whether the comment content table contains the first key;
a first writing unit 1202c, configured to determine, if the comment content table does not include the first key, the comment content of the ith user on the topic information as the first value; writing the first key and the first value to the comment content table;
a second writing unit 1202d, configured to add, if the comment content table includes the first key, the comment content of the ith user on the topic information to the first value corresponding to the first key.
Optionally, the record writing module 1203 includes:
a second determining unit 1203a, configured to determine the user identifier of the ith user as the second key;
a second detecting unit 1203b, configured to detect whether the comment record table includes the second value corresponding to the second key;
a third writing unit 1203c, configured to create the i-th comment group if the comment record table does not include the second value corresponding to the second key; adding the ith user to the ith comment group; determining the subject information identification of the subject information and the user identification of the users in the ith comment group as the second value;
a fourth writing unit 1203d, configured to add the ith user to the ith comment group in the second value if the comment record table includes the second value corresponding to the second key.
Optionally, the apparatus further comprises:
a first determining module 1204, configured to determine, according to the user identifier of the ith user, the jth user who has a predetermined social relationship with the ith user;
a second determining module 1205, configured to determine the user identifier of the jth user as the second key;
a detecting module 1206, configured to detect whether the comment record table includes the second value corresponding to the second key;
a first writing module 1207, configured to create a jth comment group if the comment record table does not include the second value corresponding to the second key, where the jth comment group corresponds to the jth user; adding the jth user to a jth comment group; taking the subject information identification of the subject information and the user identification of the users in the jth comment group as the second value;
a second writing module 1208, configured to add the ith user to a jth comment group in the second value if the comment record table includes the second value corresponding to the second key.
Optionally, the device further comprises
A first updating module 1209, configured to update a total comment version number of the topic information in the ith comment group; assigning the updated total comment version number of the subject information to the comment version number corresponding to the ith user in the ith comment group;
a second updating module 12010, configured to update a total review version number of the topic information for the jth review group; and assigning the total comment version number of the updated jth comment group to the theme information to a comment version number corresponding to the ith user in the jth comment group.
In summary, the comment writing device provided in this embodiment sets the comment content table and the comment record table in the comment storage device, and when receiving a comment acquisition request sent by the user client, first acquires a user who has performed a comment from the comment record table, and then acquires corresponding comment content from the comment content table according to a user identifier of the user; the problem that processing resources of the comment storage server are wasted due to the fact that all comment storage servers need to be accessed in each acquisition process is solved; according to the comment content obtaining method and device, the comment content of the user who has performed the subject information comment is obtained only when the comment content is obtained from the comment storage server according to the introduced comment recording table, and therefore processing resources of the comment storage server are saved.
In this embodiment, by setting the comment version number for the comment record of the user, the read-write control server only needs to acquire the comment content that is added between the last acquisition time and the current time each time the comment content is acquired, and the number of the acquired comment content is further reduced.
It should be noted that: the comment reading and comment writing device provided in the above embodiment is exemplified by only the division of the above functional modules, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the read-write control server is divided into different functional modules to complete all or part of the above described functions. In addition, the comment reading apparatus and the comment reading method provided by the above embodiment belong to the same concept, the comment writing apparatus and the comment writing method embodiment belong to the same concept, and the specific implementation process thereof is described in the method embodiment and is not described herein again.
It should be understood that, as used herein, the singular forms "a," "an," "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (22)

1. A comment storage device is characterized in that a comment content table and a comment recording table are stored in the comment storage device;
the comment content table comprises a first key and a first value corresponding to the first key, the first key is a combination of a subject information identifier and a user identifier, and the first value is comment content of subject information indicated by the user identifier to the subject information indicated by the subject information identifier;
the comment recording table comprises a second key and a second value corresponding to the second key, the second key is a user identifier of an ith user, the second value comprises the subject information identifier and user identifiers of users in an ith comment group, the users in the ith comment group are users who have commented the subject information, the ith comment group comprises the ith user and/or a jth user having a predetermined social relationship with the ith user, i, j is an integer, and i ≠ j;
the second value also comprises the comment version numbers corresponding to the users in the ith comment group and the total comment version number of the subject information in the ith comment group;
for each user in the ith comment group, the comment version number corresponding to the user is used for indicating the time sequence of the comment content which is published by the user last time in the comment content of the subject information of all users in the ith comment group;
the total comment version number is used for indicating the total number of the comment contents of all the users in the ith comment group on the subject information.
2. A comment reading method for reading comment content from the comment storage device according to claim 1, the method comprising:
receiving a comment acquisition request sent by a user client, wherein the comment acquisition request comprises a user identifier of the ith user and a subject information identifier of the subject information;
according to the subject information identification and the user identification of the ith user, searching the user identification of each user in the ith comment group corresponding to the ith user from the comment record table;
inquiring comment contents of all users in the ith comment group on the theme information from the comment content table according to the theme information identification and the user identification of each user in the ith comment group;
and sending the comment content to the user client.
3. The method according to claim 2, wherein said querying the comment content of all users in the ith comment group for the subject information from the comment content table according to the subject information identification and the user identification of each user in the ith comment group comprises:
respectively combining the subject information identifier and the user identifier of each user in the ith comment group to generate at least one first key;
and inquiring the corresponding first value from the comment content table according to the at least one first key, wherein the first value comprises the comment content of the users in the ith comment group to the subject information.
4. The method according to claim 2, wherein the searching, according to the subject information identifier and the user identifier of the ith user, the user identifier of each user in the ith comment group corresponding to the ith user from the comment record table includes:
determining the user identification of the ith user as the second key;
inquiring the corresponding second value in the comment record table according to the second key;
and acquiring the user identification of each user in the ith comment group from the second value according to the subject information identification.
5. The method according to any one of claims 2 to 4, wherein the comment acquisition request includes a historical comment version number, and the historical comment version number is a total comment version number of the subject information of the ith comment group when the user client acquires comment content of the subject information of the user in the ith comment group last time;
after searching the user identifier of each user in the ith comment group corresponding to the ith user from the comment record table according to the subject information identifier and the user identifier of the ith user, the method further includes:
and screening target comment users from the user identifications of the users in the ith comment group according to the historical comment version numbers, wherein the comment version numbers corresponding to the target comment users are larger than the historical comment version numbers.
6. A comment writing method for writing comment content into the comment storage device according to claim 1, the method comprising:
receiving comment information sent by a user client, wherein the comment information comprises a user identifier of the ith user and comment content of the ith user on the subject information;
writing the comment content of the ith user to the subject information into the comment content table according to the comment information;
and writing the user identification of the ith user into the comment record table according to the comment information.
7. The method according to claim 6, wherein said writing the comment content of the ith user on the subject information into the comment content table according to the comment information comprises:
combining the subject information identification of the subject information with the user identification of the ith user to generate the first key;
detecting whether the review content table contains the first key;
if the comment content table does not contain the first key, determining the comment content of the ith user on the subject information as the first value; writing the first key and the first value to the comment content table;
and if the comment content table contains the first key, adding the comment content of the ith user on the subject information to the first value corresponding to the first key.
8. The method according to claim 6 or 7, wherein said writing the user identifier of the ith user into the comment record table according to the comment information comprises:
determining the user identification of the ith user as the second key;
detecting whether the second value corresponding to the second key is contained in the comment record table or not;
if the comment record table does not contain the second value corresponding to the second key, the ith comment group is created; adding the ith user to the ith comment group; determining the subject information identification of the subject information and the user identification of the users in the ith comment group as the second value;
and if the comment record table contains the second value corresponding to the second key, adding the ith user to the ith comment group in the second value.
9. The method of claim 8, wherein after receiving the comment information sent by the user client, the method further comprises:
determining the jth user with a preset social relationship with the ith user according to the user identification of the ith user;
determining the user identification of the jth user as the second key;
detecting whether the second value corresponding to the second key is contained in the comment record table or not;
if the comment record table does not contain the second value corresponding to the second key, a jth comment group is created, and the jth comment group corresponds to the jth user; adding the jth user to a jth comment group; taking the subject information identification of the subject information and the user identification of the users in the jth comment group as the second value;
and if the comment record table contains the second value corresponding to the second key, adding the ith user to a jth comment group in the second value.
10. The method of claim 9, wherein after writing the user identifier of the ith user into the comment record table according to the comment information, further comprising
Updating the total comment version number of the subject information by the ith comment group; assigning the updated total comment version number of the subject information to the comment version number corresponding to the ith user in the ith comment group;
updating the total comment version number of the subject information by the jth comment group; and assigning the total comment version number of the updated jth comment group to the theme information to a comment version number corresponding to the ith user in the jth comment group.
11. A comment reading apparatus for reading comment content from the comment storage device according to claim 1, the apparatus comprising:
the request receiving module is used for receiving a comment acquisition request sent by a user client, wherein the comment acquisition request comprises a user identifier of the ith user and a subject information identifier of the subject information;
the identification searching module is used for searching the user identification of each user in the ith comment group corresponding to the ith user from the comment record table according to the subject information identification and the user identification of the ith user;
a content query module, configured to query, according to the topic information identifier and user identifiers of users in the ith comment group, comment contents of all users in the ith comment group on the topic information from the comment content table;
and the content sending module is used for sending the comment content to the user client.
12. The apparatus of claim 11, wherein the content query module comprises:
the first generating unit is used for respectively combining the topic information identifier and the user identifier of each user in the ith comment group to generate at least one first key;
and the first query unit is used for querying the corresponding first value from the comment content table according to the at least one first key, wherein the first value comprises the comment content of the users in the ith comment group to the subject information.
13. The apparatus of claim 11, wherein the identity lookup module comprises:
a first determining unit, configured to determine the user identifier of the ith user as the second key;
the second query unit is used for querying the corresponding second value in the comment record table according to the second key;
and the obtaining unit is used for obtaining the user identification of each user in the ith comment group from the second value according to the subject information identification.
14. The apparatus according to any one of claims 11 to 13, wherein the comment acquisition request includes a historical comment version number, and the historical comment version number is a total comment version number of the subject information of the ith comment group when the user client acquires comment content of the subject information of the user in the ith comment group last time;
the device, still include:
and the screening module is used for screening target comment users from the user identifications of the users in the ith comment group according to the historical comment version numbers, wherein the comment version numbers corresponding to the target comment users are larger than the historical comment version numbers.
15. A comment writing apparatus for writing comment content into the comment storage device according to claim 1, the apparatus comprising:
the comment receiving module is used for receiving comment information sent by a user client, wherein the comment information comprises a user identifier of the ith user and comment content of the ith user on the theme information;
a content writing module, configured to write the comment content of the ith user on the topic information into the comment content table according to the comment information;
and the record writing module is used for writing the user identification of the ith user into the comment record table according to the comment information.
16. The apparatus of claim 15, wherein the content writing module comprises:
the second generating unit is used for combining the subject information identifier of the subject information with the user identifier of the ith user to generate the first key;
a first detection unit configured to detect whether the comment content table contains the first key;
a first writing unit, configured to determine, if the comment content table does not include the first key, the comment content of the subject information by the ith user as the first value; writing the first key and the first value to the comment content table;
and a second writing unit, configured to add, if the comment content table includes the first key, the comment content of the ith user on the topic information to the first value corresponding to the first key.
17. The apparatus of claim 15 or 16, wherein the recording writing module comprises:
a second determining unit, configured to determine the user identifier of the ith user as the second key;
a second detecting unit, configured to detect whether the comment record table includes the second value corresponding to the second key;
a third writing unit, configured to create the i-th comment group if the comment record table does not include the second value corresponding to the second key; adding the ith user to the ith comment group; determining the subject information identification of the subject information and the user identification of the users in the ith comment group as the second value;
a fourth writing unit, configured to add the ith user to the ith comment group in the second value if the comment recording table includes the second value corresponding to the second key.
18. The apparatus of claim 17, further comprising:
the first determining module is used for determining the jth user with a preset social relationship with the ith user according to the user identification of the ith user;
the second determining module is used for determining the user identification of the jth user as the second key;
the detection module is used for detecting whether the comment record table contains the second value corresponding to the second key;
a first writing module, configured to create a jth comment group if the comment record table does not include the second value corresponding to the second key, where the jth comment group corresponds to the jth user; adding the jth user to a jth comment group; taking the subject information identification of the subject information and the user identification of the users in the jth comment group as the second value;
and the second writing module is used for adding the ith user to a jth comment group in the second value if the comment recording table contains the second value corresponding to the second key.
19. The apparatus of claim 18, further comprising
The first updating module is used for updating the total comment version number of the subject information of the ith comment group; assigning the updated total comment version number of the subject information to the comment version number corresponding to the ith user in the ith comment group;
the second updating module is used for updating the total comment version number of the jth comment group on the theme information; and assigning the total comment version number of the updated jth comment group to the theme information to a comment version number corresponding to the ith user in the jth comment group.
20. A review reading and writing system, the system comprising: the system comprises a user client, a read-write control server and a comment storage server;
the read-write control server includes the comment reading apparatus of any one of claims 11 to 14 and the comment writing apparatus of any one of claims 15 to 19;
the comment storage server is the comment storage device according to claim 1 or 2.
21. The system of claim 20, wherein the comment storage server comprises a comment content storage server and a comment record storage server;
the comment content storage server is used for storing the comment content table;
the comment record storage server is used for storing the comment record table.
22. A computer-readable storage medium, characterized in that a program is stored in the computer-readable storage medium, the program being executed by hardware to implement the comment reading method of any one of claims 2 to 5 or to implement the comment writing method of any one of claims 6 to 10.
CN201610214442.5A 2016-04-07 2016-04-07 Comment storage device, comment reading method and device, and comment writing method and device Active CN105869057B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610214442.5A CN105869057B (en) 2016-04-07 2016-04-07 Comment storage device, comment reading method and device, and comment writing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610214442.5A CN105869057B (en) 2016-04-07 2016-04-07 Comment storage device, comment reading method and device, and comment writing method and device

Publications (2)

Publication Number Publication Date
CN105869057A CN105869057A (en) 2016-08-17
CN105869057B true CN105869057B (en) 2020-10-09

Family

ID=56636580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610214442.5A Active CN105869057B (en) 2016-04-07 2016-04-07 Comment storage device, comment reading method and device, and comment writing method and device

Country Status (1)

Country Link
CN (1) CN105869057B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107872473B (en) * 2016-09-23 2021-01-19 阿里巴巴集团控股有限公司 Message processing method, device and system
CN108111574A (en) * 2017-11-29 2018-06-01 链家网(北京)科技有限公司 A kind of information push method and system
CN110148024B (en) * 2019-05-21 2023-01-24 北京字节跳动网络技术有限公司 Method and device for providing comment input mode
CN110688832B (en) * 2019-10-10 2023-06-09 河北省讯飞人工智能研究院 Comment generation method, comment generation device, comment generation equipment and storage medium
CN112307394A (en) * 2019-10-21 2021-02-02 北京字节跳动网络技术有限公司 Information display method and device and electronic equipment
CN111309932B (en) * 2020-02-07 2023-08-22 抖音视界有限公司 Comment data query method, comment data query device, comment data query equipment and storage medium
CN111460322B (en) * 2020-04-16 2022-08-12 腾讯科技(成都)有限公司 Data processing method, device, equipment and readable storage medium
JP7467775B2 (en) 2020-11-06 2024-04-15 北京字跳▲網▼絡技▲術▼有限公司 Information processing method, device, terminal and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101950308A (en) * 2010-09-30 2011-01-19 深圳市戴文科技有限公司 Method, device, server and system for displaying network comment information
CN103034672A (en) * 2011-09-29 2013-04-10 云壤(北京)信息技术有限公司 Social search system and social search method
CN103620598A (en) * 2011-10-28 2014-03-05 乐天株式会社 Review text output system, review text output method, program and computer-readable information storage medium
CN104239348A (en) * 2013-06-21 2014-12-24 镇江新晔网络科技有限公司 Computing method for comments participated by relevant users
CN105260136A (en) * 2015-09-24 2016-01-20 北京百度网讯科技有限公司 Data read-write method and distributed storage system
CN105468740A (en) * 2015-11-24 2016-04-06 网易(杭州)网络有限公司 Game player data storage and analysis method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120088218A1 (en) * 2007-12-12 2012-04-12 Russell Acree System and method of penalty data compilation, analysis and report generation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101950308A (en) * 2010-09-30 2011-01-19 深圳市戴文科技有限公司 Method, device, server and system for displaying network comment information
CN103034672A (en) * 2011-09-29 2013-04-10 云壤(北京)信息技术有限公司 Social search system and social search method
CN103620598A (en) * 2011-10-28 2014-03-05 乐天株式会社 Review text output system, review text output method, program and computer-readable information storage medium
CN104239348A (en) * 2013-06-21 2014-12-24 镇江新晔网络科技有限公司 Computing method for comments participated by relevant users
CN105260136A (en) * 2015-09-24 2016-01-20 北京百度网讯科技有限公司 Data read-write method and distributed storage system
CN105468740A (en) * 2015-11-24 2016-04-06 网易(杭州)网络有限公司 Game player data storage and analysis method and apparatus

Also Published As

Publication number Publication date
CN105869057A (en) 2016-08-17

Similar Documents

Publication Publication Date Title
CN105869057B (en) Comment storage device, comment reading method and device, and comment writing method and device
US11416676B2 (en) Using text messages to interact with spreadsheets
CN111385186B (en) Project group creating method, project management method and device
US9129234B2 (en) Representation of people in a spreadsheet
US12019684B2 (en) Application programming interface arranged to interface with a plurality of data sources
US9385985B2 (en) Systems and methods for assisting users with contact, access, and distribution lists
CN113259139B (en) Group creating method and device
US11675666B2 (en) Including metadata in data resources
CN107800610B (en) Server, client and mail display method and system
JP7374232B2 (en) Content item sharing with context
US10855637B2 (en) Architecture for large data management in communication applications through multiple mailboxes
CN110192190B (en) Partitioning storage
US10931615B1 (en) Organizing self-replying messages
US8856112B2 (en) Considering document endorsements when processing queries
US10530724B2 (en) Large data management in communication applications through multiple mailboxes
US20170083870A1 (en) Social planning
CN110928895A (en) Data query method, data table establishing method, device and equipment
US20180060770A1 (en) News Delivery in Enterprise Setting
CN113905022A (en) Group chat construction method, equipment and storage medium
CN115373831A (en) Data processing method, device and computer readable storage medium
CN112189195A (en) Application programming interface for identifying, using and managing trusted sources in online and network content
JP5596578B2 (en) Address book creation system, address book creation method and program
EP3834150A1 (en) Scalable system for dynamic user audience determination
CN114385637A (en) Message processing method and device, electronic equipment and storage medium
CN117950985A (en) Storage performance test method of search engine and related equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant