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

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

Info

Publication number
CN112559913B
CN112559913B CN202011460979.2A CN202011460979A CN112559913B CN 112559913 B CN112559913 B CN 112559913B CN 202011460979 A CN202011460979 A CN 202011460979A CN 112559913 B CN112559913 B CN 112559913B
Authority
CN
China
Prior art keywords
comment
data storage
storage device
comment information
information
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
CN202011460979.2A
Other languages
Chinese (zh)
Other versions
CN112559913A (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.)
Chezhi Interconnection Beijing Technology Co ltd
Original Assignee
Chezhi Interconnection Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chezhi Interconnection Beijing Technology Co ltd filed Critical Chezhi Interconnection Beijing Technology Co ltd
Priority to CN202011460979.2A priority Critical patent/CN112559913B/en
Publication of CN112559913A publication Critical patent/CN112559913A/en
Application granted granted Critical
Publication of CN112559913B publication Critical patent/CN112559913B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9538Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a data processing method, which is suitable for being executed in a server, wherein the server comprises a first data storage device, a second data storage device and a message middleware, and the server is respectively connected with a client and a comment management terminal, and the method comprises the following steps: acquiring first comment information of a user from a client, wherein fields of the first comment information comprise: the method comprises the steps of main body content identification, main comment identification, reply object identification, comment objects, comment users, comment content and comment time; storing the first comment information to a first data storage device so as to view the first comment information through a management terminal; the first comment information is synchronized to the second data storage device through the message middleware so that the first comment information is presented at the client according to the user request. The invention also discloses a corresponding device, a computing device and a readable storage medium.

Description

Data processing method, device, computing equipment and readable storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a data processing method, a data processing device, a computing device, and a readable storage medium.
Background
In the information age, various forms of data information appear on the Internet, and each content leaves discussion areas for readers, such as message boards, comment areas, barrages and the like of news, videos and the like, so that discussion spaces in different modes are provided for users, and opinion interaction among the users is satisfied.
When the comments posted by the user are stored specifically, the comments can be displayed one by one according to a certain dimension of the comments, for example, the comments are displayed in a list form according to the sequence of the comment time, the storage mode is generally that comment data are stored in a row-column structure mode by using a relational database, one piece of comment information is recorded in each row, and field information such as a main key, comment content, comment time and the like of each comment is recorded on the column. And storing the upper node data of the comment in each comment, and backtracking whether the comment is a comment aiming at the main content or a comment aiming at a certain comment when the comment is published through the upper node.
When a user browses the comments, the user needs to request the data from the storage end and display the data according to the upper-level and lower-level relation between the comments, and the storage mode needs to backtrack the display relation of the comments according to the upper-level node of each comment, because the storage structure is stored according to time and is not stored according to the tree structure between the comments, the data needs to be queried for many times and spliced in the tree structure, the more tree levels are, the more complicated the logic of query is, and the higher the pressure on a database is.
Disclosure of Invention
To this end, the present invention provides a data processing method, apparatus, computing device, and readable storage medium in an effort to solve or at least alleviate the above-identified problems.
According to an aspect of the present invention, there is provided a data processing method adapted to be executed in a server comprising a first data storage device, a second data storage device and message middleware, the server being connected to a client, a comment management terminal, respectively, the method comprising: acquiring first comment information of a user from the client, wherein fields of the first comment information comprise: the method comprises the steps of main body content identification, main comment identification, reply object identification, comment objects, comment users, comment content and comment time; storing the first comment information to the first data storage device so as to view the first comment information through the management terminal; and synchronizing the first comment information to the second data storage device through the message middleware so as to display the first comment information on the client according to a user request.
Optionally, in the data processing method according to the present invention, the storing the first comment information in the first data storage device includes: generating a primary key ID of the first comment information; generating a new first comment record according to the primary key ID and the first comment information, and storing the new first comment record in the first data storage device; and returning the processing result of the first comment information.
Optionally, in the data processing method according to the present invention, the generating the primary key ID of the first comment information includes: and generating the primary key ID of the first comment information in a self-increasing mode.
Optionally, in the data processing method according to the present invention, the synchronizing the first comment information to the second data storage device through the message middleware includes: storing the first comment information and the corresponding primary key ID to the message middleware; the second data storage device acquires first comment information and a corresponding primary key ID from the message middleware; and storing the first comment information and the primary key ID to the second data storage device.
Optionally, in the data processing method according to the present invention, the type of the first comment information includes a main comment and a non-main comment, and when the comment information is a main comment, storing the first comment information and a main key ID to the second data storage device includes: generating a second comment record according to the first comment information and the primary key ID; and storing the second comment record to the second data storage device.
Optionally, in the data processing method according to the present invention, when the first comment information is a non-main comment, the storing the first comment information and a main key ID in the second data storage device includes: acquiring a previous comment record corresponding to the first comment information from the second data storage device according to the content identifier, the main comment identifier and the reply object identifier; generating a second comment record according to the first comment information and the primary key ID; and adding the second comment record into a reply field of the previous comment record.
Optionally, in the data processing method according to the present invention, further includes: acquiring second comment information from the management terminal, wherein the second comment information is updated content of original comment information of a user by an administrator, and fields included in the second comment information comprise a main key ID, an update type and comment content, and the update type comprises modification and deletion; and updating comment information in the first data storage device according to the second comment information, and synchronizing the comment information to the second data storage device.
Optionally, in the data processing method according to the present invention, when the update type is modification, the updating comment information in the first data storage device according to the second comment information, and synchronizing to the second data storage device includes: searching a comment record corresponding to the primary key ID from the first data storage device according to the primary key ID, and updating data in the comment record according to the second comment information; synchronizing the second comment information with the message middleware; and acquiring a corresponding comment record from the second data storage device according to the primary key ID in the second comment information of the message middleware, and updating the comment record.
Optionally, in the data processing method according to the present invention, when the type of the update is deletion, the updating the comment information in the first data storage device according to the second comment information, and synchronizing to the second data storage device includes: searching comment records corresponding to the primary key ID from the first data storage device according to the primary key ID, and setting the comment records into a deleting state; synchronizing the second comment information with the information system; and acquiring corresponding comment records from the second data storage equipment according to the primary key ID in the second comment information in the information system, and placing the comment records in a deleting state.
Optionally, in the data processing method according to the present invention, further includes: and displaying the comment information in the second data storage equipment on the client according to the viewing request of the user on the client.
Optionally, in the data processing method according to the present invention, the first data storage device is a relational database.
Optionally, in the data processing method according to the present invention, the second data storage device is a non-relational database.
According to another aspect of the present invention, there is provided a data processing apparatus adapted to reside in a server connected to a client, a comment management terminal, respectively, the apparatus comprising: the system comprises a first data storage device, a second data storage device and a message middleware, wherein the first data storage device is suitable for acquiring first comment information of a user from the client, the first comment information comprises a main body content identifier, a main comment identifier, a reply object identifier, a comment object, a comment user, comment content and comment time, and the first comment information is also suitable for being stored, so that an administrator manages the comment information through the management terminal; message middleware adapted to synchronize data in the first data storage device into the second data storage device; and the second data storage device is suitable for storing comment messages in the first data storage device which are synchronized through the message middleware so as to improve the query efficiency when the client side performs comment presentation.
According to yet another aspect of the present invention, there is provided a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the data processing method described above.
According to still another aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the above-described data processing method.
According to the data management method, comment information of a user is firstly stored in the first data storage device and is synchronized to the second data storage device through the message middleware, when the comment information is displayed on the client according to a user request, the comment information is displayed to the manager according to data storage on the first data storage device when the manager views the comment information through the management terminal, and the two data storage devices can be respectively set to be suitable for data storage modes of the user client and the management terminal according to requirements, so that different data searching requirements are met.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which set forth the various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to fall within the scope of the claimed subject matter. The above, as well as additional objects, features, and advantages of the present disclosure will become more apparent from the following detailed description when read in conjunction with the accompanying drawings. Like reference numerals generally refer to like parts or elements throughout the present disclosure.
FIG. 1 shows a schematic diagram of a data processing system 100 according to one embodiment of the invention;
FIG. 2 illustrates a block diagram of a computing device 200 in accordance with one embodiment of the invention;
FIG. 3 illustrates a flow chart of a data processing method 300 according to one embodiment of the invention;
FIG. 4 shows a flow chart of a data processing method 400 according to one embodiment of the invention;
FIG. 5 illustrates a schematic diagram of data storage in a second data storage device, according to one embodiment of the invention;
FIG. 6 illustrates a schematic diagram of data storage in a second data storage device, according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Regarding the data storage of the evaluation area of the network information, the most widely used method is to store the comment information through a relational database at present, and the comment information is usually stored according to a time sequence, and when the storage mode is displayed on a client, complex query logic is needed for tree splicing, and the query pressure of data storage equipment is overlarge.
Another storage mode of comment information is a tree-shaped storage mode, wherein comments are divided into main comments and non-main comments, the main comments are comments on a content subject, for example, in an evaluation area of a certain news content, the comments on the news content are directly main comments, the non-main comments refer to replies to the comments (including the main comments and the non-main comments), the storage mode generally adopts a non-relational database, and the comments are stored in the non-relational database in a displayed tree structure. The comment content does not need to record the data of the upper node, and only needs to store the concerned content in the comment, so that the relation between the upper node and the lower node is not required to be processed when the structure is queried, and the query speed is much faster than that of a scheme using a relational database.
However, for the background manager, because the storage of the data is loose, the content of the single data is not comprehensive, the single data needs to be judged according to the context of the content, the single data cannot be directly used by the manager, the data needs to be processed and complemented, then the data display structure convenient for the background manager to manage is used for typesetting the original data, and the stored data cannot be directly used.
According to the invention, two sets of data storage are established according to the characteristics of two data storage modes, and the synchronization is carried out through the message middleware, so that the problem of efficiency of repeated inquiry of the database when the client side displays is solved, and the management of comment data by an administrator is facilitated.
FIG. 1 shows a schematic diagram of a data processing system 100 according to one embodiment of the invention. As shown in fig. 1, the data processing system 100 includes a server 110, a client 120, and a management terminal 130, and the server 110 is communicatively connected to the client 120 and the management terminal 130, respectively. It should be noted that the data processing system shown in fig. 1 is merely exemplary, and in practice, there may be a plurality of clients and management terminals, and the present invention is not limited to the clients and management terminals included in the data processing system.
The server 110 is a device having communication, calculation, and storage functions, and may be implemented as a server, for example, an application server, a Web server, or the like, but is not limited thereto. The server 110 may be implemented as one server, or may be implemented as a cluster or a distributed system formed by a plurality of servers; in the case of multiple servers, the multiple servers may be deployed in the same geographic location, or may be distributed in multiple geographic locations, and the number of servers included in the server 110 and the deployment location of each server are not limited in the present invention.
The client 120 may be, for example, a personal computer such as a desktop computer or a notebook computer, a mobile terminal such as a mobile phone, a tablet computer, a multimedia player, an intelligent wearable device, or a device such as an intelligent television, but is not limited thereto.
The management terminal 130 is typically a personal configured computer such as a desktop computer, a notebook computer, or the like.
According to one embodiment of the present invention, a user may comment on data information such as news, video, etc. on a network through the client 120, for example, leave a message or comment on a message board or comment area of the information such as news, video, etc., where the data information of the message or comment is sent to the server 110, the server 110 includes two data storage devices (not shown in fig. 1), a first data storage device and a second data storage device, and after the server 110 acquires the message or comment information, the server stores the data in the first data storage device and synchronizes to the second data storage device. When the user browses through the client 120, the comment data is obtained from the second data storage device, and when the management terminal filters the sensitive information of the comment information of the user, the administrator obtains the comment data from the first data storage device.
The server 110 in FIG. 1 may be implemented by a computing device, and FIG. 2 illustrates a block diagram of a computing device 200 in accordance with one embodiment of the invention. It should be noted that the computing device 200 shown in fig. 2 is only an example, and in practice, the computing device used to implement the data processing method 300/400 of the present invention may be any type of device, and the hardware configuration of the computing device may be the same as the computing device 200 shown in fig. 2 or may be different from the computing device 200 shown in fig. 2. In practice, a computing device implementing the data processing method 300/400 of the present invention may add or delete hardware components of the computing device 200 shown in fig. 2, and the present invention is not limited to a specific hardware configuration of the computing device.
As shown in FIG. 2, in a basic configuration 202, computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 may be used for communication between the processor 204 and the system memory 206.
Depending on the desired configuration, the processor 204 may be any type of processing including, but not limited to: a microprocessor (μp), a microcontroller (μc), a digital information processor (DSP), or any combination thereof. Processor 204 may include one or more levels of cache, such as a first level cache 210 and a second level cache 212, a processor core 214, and registers 216. The example processor core 214 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 218 may be used with the processor 204, or in some implementations, the memory controller 218 may be an internal part of the processor 204.
Depending on the desired configuration, system memory 206 may be any type of memory including, but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. Physical memory in a computing device is often referred to as volatile memory, RAM, and data in disk needs to be loaded into physical memory in order to be read by processor 204. The system memory 206 may include an operating system 220, one or more applications 222, and program data 224. In some implementations, the application 222 may be arranged to execute instructions on an operating system by the one or more processors 204 using the program data 224. The operating system 220 may be, for example, linux, windows or the like, which includes program instructions for handling basic system services and performing hardware-dependent tasks. The application 222 includes program instructions for implementing various user desired functions, and the application 222 may be, for example, a browser, instant messaging software, a software development tool (e.g., integrated development environment IDE, compiler, etc.), or the like, but is not limited thereto. When an application 222 is installed into computing device 200, a driver module may be added to operating system 220.
When the computing device 200 starts up running, the processor 204 reads the program instructions of the operating system 220 from the memory 206 and executes them. Applications 222 run on top of operating system 220, utilizing interfaces provided by operating system 220 and underlying hardware, to implement various user-desired functions. When the user launches the application 222, the application 222 is loaded into the memory 206, and the processor 204 reads and executes the program instructions of the application 222 from the memory 206.
Computing device 200 also includes a storage device 232, where storage device 232 includes removable storage 236 and non-removable storage 238, where removable storage 236 and non-removable storage 238 are each connected to storage interface bus 234.
Computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to basic configuration 202 via bus/interface controller 230. The example output device 242 includes a graphics processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 252. The example peripheral interface 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication via one or more I/O ports 258 and external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.). The example communication device 246 may include a network controller 260 that may be arranged to facilitate communication with one or more other computing devices 262 over a network communication link via one or more communication ports 264.
The network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media in a modulated data signal, such as a carrier wave or other transport mechanism. A "modulated data signal" may be a signal that has one or more of its data set or changed in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or special purpose network, and wireless media such as acoustic, radio Frequency (RF), microwave, infrared (IR) or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
In the computing device 200 according to the invention, the application 222 comprises instructions for performing the data processing method 300/400 of the invention, which instructions may instruct the processor 204 to perform the data processing method 300/400 of the invention.
Fig. 3 illustrates a flow chart of a data processing method 300 according to one embodiment of the invention, the method 300 being adapted to be performed in a server (e.g., implemented by the computing device of fig. 2), the server being communicatively coupled to a client, a user browsing subject content such as news, video, etc. in a website via the client, and comment information or messages of the user in the subject content, which comment information may eventually be stored in the server via the client, the server comprising a first data storage device, a second data storage device, and message middleware, the information in the first data storage device being stored in the second data storage device via the message middleware.
According to the embodiment of the invention, the first data storage device may be implemented by a relational database, which may be any relational database such as Oracle, SQLServer, DB2, mysql, but is not limited thereto. The second data storage device may be implemented by a non-relational database, and may be any of CouchDB, mongoDb, sequoiaDB, etc., but is not limited thereto. The invention is not limited to the specific implementation of the data storage mode, and other data storage modes with similar functions are also within the protection scope of the invention.
As shown in fig. 3, the method 300 begins at step S310. In step S310, comment information posted by a user is acquired from a client, which is referred to as first comment information. The first comment information comprises a main content identifier, a main comment identifier, a reply object identifier, a comment object, comment users, comment content and comment time, so that the server side can correspondingly store the currently received comment information according to the information and update the currently received comment information to a website, and the user can browse the comment information conveniently.
According to an embodiment of the present invention, the body content identifier is the unique identifier of the top level body content, such as the unique identifier 010101 corresponding to the video of the focus interview today, for distinguishing other body contents on the same website, then 010101 is the body content identifier of the focus interview today, and the unique identifier of the body content is generally generated when the body content is transmitted to the website.
Each subject content corresponds to an evaluation area, wherein the evaluation area comprises direct comments (also called primary comments) of the subject content, comments (primary comments) of the subject content, secondary comments, tertiary comments and so on, and comments after the primary comments are collectively called non-primary comments. Each comment (including both a main comment and a non-main comment) in the comment area corresponds to a main key ID to uniquely identify the comment. The main comment identification contained in the comment information refers to the main key ID of the main comment corresponding to the currently acquired comment information. If the main comment carried by the currently received first comment information is marked with 0, the comment information is the main comment.
The reply object identifier is a main key ID of the previous-level comment information of the currently received first comment information, and if the main comment identifier carried by the currently received comment information is '0', the comment information is a main comment.
The comment object is a user network name of the previous comment of the comment information, and when the first comment information is the main comment, the comment object carried by the first comment information is empty.
The comment users are network names of users who post current comment information, comment content is related content posted by the users, and comment time is time when the users post comments.
After receiving the first comment information, the flow advances to step S320, where the received first comment information is stored in the first data storage device.
According to one embodiment of the invention, there is a subject content whose subject content identifier is 030303 on the a website, which currently includes three comments including a main comment of the user ' Zhang san ', a comment of the user ' Lisi four ' to the Zhang san ', and a comment of the user ' Wang Wu ' to the Zhang san main comment. In this embodiment, the first storage device is implemented in a relational database, where the relational database is generally stored in a list manner according to time, and according to current comment information, data in the first data storage device is stored as shown in table 1.
TABLE 1
According to one embodiment of the present invention, the first comment information received in step S310 has a main content of "030303", a main comment identification of "1", a reply object identification of "2", a comment object of "litu", a comment user of "Xiaoming", a comment content of "homonym you", and a comment time of "2020/1/1/12:03". In this step, a primary key ID is first generated for the first comment information currently received, a primary key ID "4" of the comment information is generated in a self-increasing manner by the primary key ID, and a new comment information record is generated according to the primary key ID and fields in the first comment information and is stored in the first storage device.
According to yet another embodiment of the present invention, in step S310, after receiving comment information of a comment information, the main content is "040404", the main comment identifier is "0", the reply object identifier is "0", the comment object is "", the comment user is "small white", the comment content is "daily diet today", the comment time is "2020/1/1/12:04", and the comment information of small white "after entering this step, the main key ID"5 "of the comment information is generated first, and an instruction corresponding to the addition record of the first data storage device implementation mode is generated according to the main key ID and the received first comment information, for example, an instruction corresponding to the addition record of the first data storage device implementation mode is generated if the first data storage device has an SQLserver implementation, and the newly generated comment record is stored in the first data storage device. Finally, the data in the first data storage device is updated as shown in table 2.
TABLE 2
In step S320, the method further includes returning the comment information processing result to the client.
In step S330, the first comment information is synchronized into the message middleware. The message middleware can shield the difference of characteristics among different storage devices, so that the coupling degree between the first storage device and the second storage device is reduced, the logic responsibility degree when a user issues comments is reduced, and the operation of the user is responded more quickly. Message middleware may use any of ActiveMQ, rabbitMQ, kafka, etc., as the present invention is not limited in this regard.
According to one embodiment of the present invention, the first comment message and the corresponding primary key ID are stored in a message middleware (such as a database, for example), which may also be understood as storing a comment record newly created in a first data storage device (a relational database) in the message middleware, so as to activate synchronization of the comment information by a second data storage device, and when synchronizing a message in the message middleware, an operation type is added, and when adding new comment information, the operation type may be identified by "a".
Step S340 is then entered to synchronize the comment information and the primary key ID in the message middleware into the second data storage device. When the middleware receives the message update, that is, when the first data storage device synchronizes to the middleware, the second storage device is activated to perform message synchronization according to the message in the message middleware, and according to the embodiment of the invention, the second data storage device is implemented in a non-relational database and is stored in a tree structure, so that comment information is added with a reply field in the data structure to store next-level comment information. In particular, any of CouchDB, mongoDb, sequoiaDB and the like may be used, but the present invention is not limited thereto.
Continuing with the above description of the embodiment, the data in the second data storage device is shown in FIG. 5 before the comments on Lifour by "Ming" and the comments on body content "040404" by "Ming" are updated.
Taking the comment of 'Xiaoming' on 'Liqu' as an example, in the step, firstly, obtaining operation type as adding comment information, then obtaining the comment information of the previous stage according to the reply object identification in the comment information, according to fig. 4, obtaining the main key ID of the comment information of the previous stage as 2, adding a 'reply' field in the comment information, and adding the comment of 'Xiaoming' on 'Liqu' to the 'reply' field.
According to an embodiment of the present invention, when the comment of "xiaobai" to the subject content "040404" is a main comment of the user to another subject content, a new data record is directly created, the comment information is recorded, and the data in the updated second data storage device is stored as shown in fig. 6.
The comment information posted by each user is stored according to the method 300, so that when the user opens the corresponding content, the user comment in the comment area can be quickly obtained from the non-relational database at the server side, and because the storage structure is directly stored in a tree structure, the tree structure is not needed to be spliced according to the node relation between the upper level and the lower level, the logic complexity of the query is greatly reduced, the query speed of the client is increased, and the user experience is improved.
FIG. 4 shows a flow chart of a data processing method 400 according to one embodiment of the invention; the method 400 is suitably performed in a server (e.g., implemented by a computing device in fig. 2) in communication with a management terminal through which an administrator may obtain user comment information from a first data storage device of the server, because the first data storage device is implemented by a relational database, the comment data being stored according to a chronological order, which is simpler for an administrator focusing on the latest posting information. And the administrator carries out operations such as corresponding modification or deletion on the corresponding comment information through filtering the sensitive information in the user comment.
As shown in fig. 4, the method 400 begins with step S410, in which updated comment information (i.e., second comment information) submitted by an administrator is obtained from a management terminal, where the second comment information includes a primary key ID, an operation identifier, and/or a modified field, and the modified field is one or more of a main content identifier, a main comment identifier, a reply object identifier, a comment object, a comment user, a comment content, and a comment time, and the operation identifier may be modified by "U" and deleted by "D". Taking the comment information in table 2 as an example, for example, if the administrator is to delete the comment record with the primary key of 4, the second comment information submitted by the management terminal includes the primary key ID "4", the operation identifier "D", and for the deletion operation, the modified field may not be included.
In step S420, the data in the first data storage device is updated according to the data in the second comment information. When the operation identifier in the acquired second comment information is U, acquiring corresponding comment information according to the main key ID, and modifying the response field in the comment information according to the field carried in the second comment information. If the operation identifier is "D", corresponding comment information is obtained according to the main key ID, and is set to be in a "delete" state or is directly deleted.
Step S430 is then entered to store the second comment information in the message middleware and synchronize to the second data storage device. And when the second comment information is written into the message middleware, triggering the second data storage device to acquire corresponding information from the message middleware for synchronization.
According to one embodiment of the present invention, the second comment information includes a main key ID "5", an operation identifier "U" and comment content "no daily diet today", and after the second data storage device acquires the synchronization message, the second data storage device searches the comment record according to the main key ID, and modifies the comment content therein to "no daily diet today", which is only an exemplary illustration.
It should be noted that, during the deletion operation, the comment record in response may be deleted directly or set to a deletion state when the data operation is performed as required, if the comment record is set to a "deletion" state, when the client acquires the comment content from the second data storage device, the comment content is only not displayed, but the comment of the next level of the comment is still normally displayed, when the comment record is deleted directly, the comment record and the comment record below the comment record are deleted directly in the second data storage device, and the client may not acquire the comment information and the comment record below the comment record deleted in specific practice.
Fig. 5 shows a schematic diagram of a data processing apparatus 500 according to an embodiment of the invention, the apparatus 500 being adapted to reside in a server, performing the method 300/400, the server being communicatively connected to a client and a management terminal, respectively.
As shown in fig. 5, the data processing apparatus 500 includes a first data storage device 510, a message middleware 520, and a second data storage device 530.
The first data storage device 510 is adapted to obtain first comment information of a user from the client, generate a primary key ID for the comment information, and store the first comment information. And the method is also suitable for receiving the update of the comment information by the administrator from the management terminal and carrying out corresponding update according to the received update content.
According to the embodiment of the invention, the first data storage device is implemented by a relational database, which may be any relational database such as Oracle, SQLServer, DB2, mysql, but is not limited thereto.
Message middleware 520 is adapted to synchronize data in the first data storage device 510 into the second data storage device 520. The message middleware can shield the difference of characteristics among different storage devices, so that the coupling degree between the first storage device and the second storage device is reduced, the logic responsibility degree when a user issues comments is reduced, and the operation of the user is responded more quickly.
Message middleware 520 may use any of ActiveMQ, rabbitMQ, kafka, etc., according to embodiments of the present invention, which is not limited in this regard.
The second data storage device 520 is adapted to store comment data synchronized by the message middleware 520, and eventually keeps consistent with the data in the first data storage device 510.
According to an embodiment of the present invention, the second data storage device 520 may be any one of CouchDB, mongoDb, sequoiaDB and the like, but is not limited thereto.
According to the data processing method, comment information published by a user is firstly stored in the first data storage device realized by the relational database and is synchronized to the second data storage device realized by the non-relational database through the message middleware, because the data in the relational database is stored according to time, an administrator can acquire the latest comment information through the relational database at a management terminal to perform sensitive information inquiry and update the comment information, and meanwhile, because the data in the non-relational data are stored in a tree structure according to the relation among the comment information, the processing rate of acquiring the comment information from the non-relational database through a client by the user can be improved, and the user experience is improved.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U-drives, floppy diskettes, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the data processing method of the invention in accordance with instructions in said program code stored in the memory.
By way of example, and not limitation, readable media comprise readable storage media and communication media. The readable storage medium stores information such as computer readable instructions, data structures, program modules, or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with examples of the invention. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
It should be appreciated that in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into a plurality of sub-modules.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
A8, the method of any of A1-A7, wherein when the update type is modified, the updating comment information in the first data storage device according to the second comment information and synchronizing to the second data storage device includes:
searching a comment record corresponding to the primary key ID from the first data storage device according to the primary key ID, and updating data in the comment record according to the second comment information;
synchronizing the second comment information with the message middleware;
and acquiring a corresponding comment record from the second data storage device according to the primary key ID in the second comment information of the message middleware, and updating the comment record.
A9, the method of A7 or A8, wherein when the type of the update is deletion, the updating the comment information in the first data storage device according to the second comment information, and synchronizing to the second data storage device includes:
searching comment records corresponding to the primary key ID from the first data storage device according to the primary key ID, and setting the comment records into a deleting state;
synchronizing the second comment information with the information system;
And acquiring corresponding comment records from the second data storage equipment according to the primary key ID in the second comment information in the information system, and placing the comment records in a deleting state.
The method of any one of A1-A9, further comprising:
and displaying the comment information in the second data storage equipment on the client according to the viewing request of the user on the client.
A11, the method of any one of A1-A10, wherein the first data storage device is a relational database.
A12, the method of any one of A1-A11, wherein the second data storage device is a non-relational database.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
Furthermore, some of the embodiments are described herein as methods or combinations of method elements that may be implemented by a processor of a computer system or by other means of performing the functions. Thus, a processor with the necessary instructions for implementing the described method or method element forms a means for implementing the method or method element. Furthermore, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is for carrying out the functions performed by the elements for carrying out the objects of the invention.
As used herein, unless otherwise specified the use of the ordinal terms "first," "second," "third," etc., to describe a general object merely denote different instances of like objects, and are not intended to imply that the objects so described must have a given order, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the above description, will appreciate that other embodiments are contemplated within the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is defined by the appended claims.

Claims (12)

1. A data processing method adapted to be executed in a server comprising a first data storage device, a second data storage device and message middleware, the server being connected to a client, a comment management terminal, respectively, the method comprising:
Acquiring first comment information of a user from the client, wherein fields of the first comment information comprise: the method comprises the steps of main body content identification, main comment identification, reply object identification, comment objects, comment users, comment content and comment time;
storing the first comment information to the first data storage device so as to view the first comment information through the management terminal;
synchronizing the first comment information to the second data storage device through the message middleware so as to display the first comment information on the client according to a user request;
wherein said synchronizing said first comment information to said second data storage device through said message middleware comprises:
storing the first comment information and the corresponding primary key ID to the message middleware;
the second data storage device acquires first comment information and a corresponding primary key ID from the message middleware;
storing the first comment information and a primary key ID to the second data storage device;
wherein the types of the first comment information include a main comment and a non-main comment, and when the comment information is the main comment, the storing the first comment information and the main key ID to the second data storage device includes:
Generating a second comment record according to the first comment information and the primary key ID;
storing the second comment record to the second data storage device;
wherein when the first comment information is a non-master comment, the storing the first comment information and the master key ID into the second data storage device includes:
acquiring a previous comment record corresponding to the first comment information from the second data storage device according to the content identifier, the main comment identifier and the reply object identifier;
generating a second comment record according to the first comment information and the primary key ID;
and adding the second comment record into a reply field of the previous comment record.
2. The method of claim 1, wherein the storing the first comment information to the first data storage device includes:
generating a primary key ID of the first comment information;
generating a new first comment record according to the primary key ID and the first comment information, and storing the new first comment record in the first data storage device;
and returning the processing result of the first comment information.
3. The method of claim 2, wherein the generating the primary key ID of the first comment information includes:
And generating the primary key ID of the first comment information in a self-increasing mode.
4. A method as claimed in any one of claims 1 to 3, further comprising:
acquiring second comment information from the management terminal, wherein the second comment information is updated content of original comment information of a user by an administrator, and fields included in the second comment information comprise a main key ID, an update type and comment content, and the update type comprises modification and deletion;
and updating comment information in the first data storage device according to the second comment information, and synchronizing the comment information to the second data storage device.
5. The method of claim 4, wherein when the update type is modified, the updating comment information in the first data storage device according to the second comment information and synchronizing to the second data storage device includes:
searching a comment record corresponding to the primary key ID from the first data storage device according to the primary key ID, and updating data in the comment record according to the second comment information;
synchronizing the second comment information with the message middleware;
and acquiring a corresponding comment record from the second data storage device according to the primary key ID in the second comment information of the message middleware, and updating the comment record.
6. The method of claim 5, wherein when the type of update is delete, the updating comment information in the first data storage device according to the second comment information and synchronizing to the second data storage device includes:
searching comment records corresponding to the primary key ID from the first data storage device according to the primary key ID, and setting the comment records into a deleting state;
synchronizing the second comment information with the message middleware;
and acquiring corresponding comment records from the second data storage equipment according to the primary key ID in the second comment information in the message middleware, and placing the comment records in a deleting state.
7. A method as claimed in any one of claims 1 to 3, further comprising:
and displaying the comment information in the second data storage equipment on the client according to the viewing request of the user on the client.
8. A method as claimed in any one of claims 1 to 3, wherein the first data storage device is a relational database.
9. A method as claimed in any one of claims 1 to 3, wherein the second data storage device is a non-relational database.
10. A data processing apparatus adapted to reside in a server connected to a client, a comment management terminal, respectively, the apparatus comprising: a first data storage device, a second data storage device, and message middleware, wherein,
the first data storage device is suitable for acquiring first comment information of a user from the client, wherein the first comment information comprises a main content identifier, a main comment identifier, a reply object identifier, a comment object, a comment user, comment content and comment time, and is also suitable for storing the first comment information so that an administrator manages the comment information through the management terminal;
message middleware adapted to synchronize data in the first data storage device into the second data storage device;
the second data storage device is suitable for storing comment messages in the first data storage device which are synchronized through the message middleware so as to improve the query efficiency when the client side performs comment display;
wherein said synchronizing said first comment information to said second data storage device through said message middleware comprises:
storing the first comment information and the corresponding primary key ID to the message middleware;
The second data storage device acquires first comment information and a corresponding primary key ID from the message middleware;
storing the first comment information and a primary key ID to the second data storage device;
wherein the types of the first comment information include a main comment and a non-main comment, and when the comment information is the main comment, the storing the first comment information and the main key ID to the second data storage device includes:
generating a second comment record according to the first comment information and the primary key ID;
storing the second comment record to the second data storage device;
wherein when the first comment information is a non-master comment, the storing the first comment information and the master key ID into the second data storage device includes:
acquiring a previous comment record corresponding to the first comment information from the second data storage device according to the content identifier, the main comment identifier and the reply object identifier;
generating a second comment record according to the first comment information and the primary key ID;
and adding the second comment record into a reply field of the previous comment record.
11. A computing device, comprising:
At least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-9.
12. A readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-9.
CN202011460979.2A 2020-12-11 2020-12-11 Data processing method, device, computing equipment and readable storage medium Active CN112559913B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011460979.2A CN112559913B (en) 2020-12-11 2020-12-11 Data processing method, device, computing equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011460979.2A CN112559913B (en) 2020-12-11 2020-12-11 Data processing method, device, computing equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112559913A CN112559913A (en) 2021-03-26
CN112559913B true CN112559913B (en) 2023-10-20

Family

ID=75062526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011460979.2A Active CN112559913B (en) 2020-12-11 2020-12-11 Data processing method, device, computing equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112559913B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113570201A (en) * 2021-06-30 2021-10-29 北京达佳互联信息技术有限公司 Data processing method, device, equipment, storage medium and program product
CN116563118A (en) * 2023-07-12 2023-08-08 浙江华诺康科技有限公司 Endoscopic image stitching method and device and computer equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945251A (en) * 2012-10-12 2013-02-27 浪潮电子信息产业股份有限公司 Method for optimizing performance of disk database by memory database technology
CN103390041A (en) * 2013-07-18 2013-11-13 杭州东信北邮信息技术有限公司 Method and system for providing data service based on middleware
CN103699572A (en) * 2013-11-26 2014-04-02 北京航空航天大学 Digital media content and resource integration and sharing method in cloud environment
CN105610917A (en) * 2015-12-22 2016-05-25 腾讯科技(深圳)有限公司 Method and system for achieving repair of synchronous data in system
CN106557530A (en) * 2015-09-30 2017-04-05 腾讯科技(深圳)有限公司 Operation system, data recovery method and device
CN106815218A (en) * 2015-11-27 2017-06-09 华为技术有限公司 Data bank access method, device and Database Systems
CN108932309A (en) * 2018-06-15 2018-12-04 上海陆家嘴国际金融资产交易市场股份有限公司 Platform database management method, device, computer equipment and storage medium
CN110647827A (en) * 2019-09-09 2020-01-03 北京达佳互联信息技术有限公司 Comment information processing method and device, electronic equipment and storage medium
CN111913837A (en) * 2020-08-17 2020-11-10 普元信息技术股份有限公司 System for realizing distributed middleware message recovery policy management in big data environment
CN112035563A (en) * 2020-08-28 2020-12-04 南京华盾电力信息安全测评有限公司 Real-time database system based on shared storage

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120054118A1 (en) * 2010-08-31 2012-03-01 International Business Machines Corporation Automated user registration and course enrollment in learning management system (lms)
WO2012170964A2 (en) * 2011-06-10 2012-12-13 Mophie, Inc. Wireless communication accessory for a mobile device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945251A (en) * 2012-10-12 2013-02-27 浪潮电子信息产业股份有限公司 Method for optimizing performance of disk database by memory database technology
CN103390041A (en) * 2013-07-18 2013-11-13 杭州东信北邮信息技术有限公司 Method and system for providing data service based on middleware
CN103699572A (en) * 2013-11-26 2014-04-02 北京航空航天大学 Digital media content and resource integration and sharing method in cloud environment
CN106557530A (en) * 2015-09-30 2017-04-05 腾讯科技(深圳)有限公司 Operation system, data recovery method and device
CN106815218A (en) * 2015-11-27 2017-06-09 华为技术有限公司 Data bank access method, device and Database Systems
CN105610917A (en) * 2015-12-22 2016-05-25 腾讯科技(深圳)有限公司 Method and system for achieving repair of synchronous data in system
CN108932309A (en) * 2018-06-15 2018-12-04 上海陆家嘴国际金融资产交易市场股份有限公司 Platform database management method, device, computer equipment and storage medium
CN110647827A (en) * 2019-09-09 2020-01-03 北京达佳互联信息技术有限公司 Comment information processing method and device, electronic equipment and storage medium
CN111913837A (en) * 2020-08-17 2020-11-10 普元信息技术股份有限公司 System for realizing distributed middleware message recovery policy management in big data environment
CN112035563A (en) * 2020-08-28 2020-12-04 南京华盾电力信息安全测评有限公司 Real-time database system based on shared storage

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Emmanuel Cecchet 等.Middleware-based database replication: the gaps between theory and practice.《SIGMOD '08: Proceedings of the 2008 ACM SIGMOD international conference on Management of data》.2008,739–752. *
Simon Malkowski 等.Empirical analysis of database server scalability using an N-tier benchmark with read-intensive workload.《SAC '10: Proceedings of the 2010 ACM Symposium on Applied Computing》.2010,1680–1687. *
基于多源异构的MES物料管理数据集成系统设计与实现;余军;《中国优秀硕士学位论文全文数据库 信息科技辑》(第07期);I138-489 *
基于快照隔离的分布式数据库同步协议研究与实现;王珏 等;《计算机应用研究》;第29卷(第08期);3012-3017 *
基于流复制技术的存储分离方法研究;宁健;《中国优秀硕士学位论文全文数据库 信息科技辑》(第05期);I138-987 *

Also Published As

Publication number Publication date
CN112559913A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
US20200175223A1 (en) Animating Edits to Documents
RU2608668C2 (en) System and method for control and organisation of web-browser cache for offline browsing
US10726063B2 (en) Topic profile query creation
US9304979B2 (en) Authorized syndicated descriptions of linked web content displayed with links in user-generated content
RU2629448C2 (en) System and method of controlling and organizing web-browser cash
CN109947373B (en) Data processing method and device
US20140304247A1 (en) Method and System for Content Management
US10346763B2 (en) Dynamic query response with metadata
CN108536745B (en) Shell-based data table extraction method, terminal, equipment and storage medium
CN112559913B (en) Data processing method, device, computing equipment and readable storage medium
CN111263186A (en) Video generation, playing, searching and processing method, device and storage medium
US10152538B2 (en) Suggested search based on a content item
CN112835904A (en) Data processing method and data processing device
CN113779416B (en) Information recommendation method and device, electronic equipment and computer-readable storage medium
CN109116718B (en) Method and device for setting alarm clock
US20140136963A1 (en) Intelligent information summarization and display
CN113377876A (en) Domino platform-based data sub-database processing method, device and platform
CN111367606A (en) Application page display method, device, terminal and medium
JP2020123321A (en) Method and apparatus for search processing based on clipboard data
CN105378710A (en) Identifying search matches and altered search results
CN107749892B (en) Network reading method and device for conference record, intelligent tablet and storage medium
KR101862178B1 (en) Method for customized posting and server implementing the same
CN108462680B (en) Input information processing method, server and terminal equipment
CN108459928B (en) Related data association visualization method, terminal device and storage medium
CN109445757B (en) New design drawing generation method and device and terminal equipment

Legal Events

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