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

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

Info

Publication number
CN112559913A
CN112559913A CN202011460979.2A CN202011460979A CN112559913A CN 112559913 A CN112559913 A CN 112559913A CN 202011460979 A CN202011460979 A CN 202011460979A CN 112559913 A CN112559913 A CN 112559913A
Authority
CN
China
Prior art keywords
comment
comment information
data storage
storage device
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.)
Granted
Application number
CN202011460979.2A
Other languages
Chinese (zh)
Other versions
CN112559913B (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 HULIAN (BEIJING) SCIENCE & TECHNOLOGY CO LTD
Original Assignee
CHEZHI HULIAN (BEIJING) SCIENCE & 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 HULIAN (BEIJING) SCIENCE & TECHNOLOGY CO LTD filed Critical CHEZHI HULIAN (BEIJING) SCIENCE & 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

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

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 is respectively connected with a client and a comment management terminal, and the method comprises the following steps: the method comprises the steps of obtaining first comment information of a user from a client, wherein fields of the first comment information comprise: the method comprises the steps of identifying main content, identifying main comment, identifying reply object, commenting user, commenting content and commenting time; storing the first comment information in a first data storage device so as to view the first comment information through a management terminal; and synchronizing the first comment information to the second data storage equipment through message middleware so as to display the first comment information 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 and 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, an apparatus, a computing device, and a readable storage medium.
Background
Since the information age is entered, data information in various forms appears on the internet, discussion areas, such as message boards, comment areas, barrage and the like of news, videos and the like, are reserved for readers by each content, discussion spaces in different modes are provided for users, and opinion interaction among the users is met.
When the comments published by the user are stored specifically, the comments can be displayed item by item 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 usually to store the comment data in a row-column structure form 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 in each column. And storing the superior node data of the comment in each comment, and backtracking whether the comment is a comment of the main content or a comment of a certain comment when the comment is published through the superior node.
When browsing the comments at the client, the user needs to request the data from the storage terminal and display the data according to the superior-inferior relation between the comments, and the storage mode needs to backtrack the display relation of the comments according to the superior node of each comment.
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 mitigate, 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 including a first data storage device, a second data storage device, and a message middleware, the server being connected to a client and a comment management terminal, respectively, the method including: obtaining first comment information of a user from the client, wherein fields of the first comment information comprise: the method comprises the steps of identifying main content, identifying main comment, identifying reply object, commenting user, commenting content and commenting 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-increment 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; 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, the storing the first comment information and a main key ID in 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 review 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-primary comment, the storing the first comment information and a primary key ID in the second data storage device includes: acquiring a first-level comment record corresponding to the first comment information in 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; adding the second comment record to a reply field of the previous comment record.
Optionally, in the data processing method according to the present invention, the method further includes: acquiring second comment information from the management terminal, wherein the second comment information is the update content of the original comment information of the user by an administrator, the 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 the comment information in the first data storage equipment according to the second comment information, and synchronizing to the second data storage equipment.
Optionally, in the data processing method according to the present invention, when the update type is modification, 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: finding 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 to the message middleware; and acquiring a corresponding comment record from the second data storage equipment according to the primary key ID in the second comment information of the message middleware, and updating.
Optionally, in the data processing method according to the present invention, when the update type 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: finding a comment record corresponding to the primary key ID from the first data storage equipment according to the primary key ID, and setting the comment record in a deleted state; synchronizing the second comment information to the information system; and acquiring a corresponding comment record from the second data storage device according to the primary key ID in the second comment information in the information system, and juxtaposing the comment record in a deleted state.
Optionally, in the data processing method according to the present invention, the method further includes: and displaying the comment information in the second data storage equipment at the client according to a viewing request of a user at 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, the server being connected to a client and a comment management terminal, respectively, the apparatus including: 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 a client, 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 a manager can manage the comment information through a management terminal; message middleware adapted to synchronize data in the first data storage device to the second data storage device; and the second data storage device is suitable for storing the comment messages in the first data storage device synchronized through the message middleware so as to improve the query efficiency when the client performs comment display.
According to yet another aspect of the 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 execute the above-described data processing method.
According to the data management method, the comment information of the user is firstly stored in the first data storage device and is synchronized into the second data storage device through the message middleware, the comment information is displayed at the client side according to the user request and is searched for by the second data storage device, when the administrator views the comment information through the management terminal, the comment information is displayed to the administrator according to the data storage on the first data storage device, and the two data storage devices can be respectively set to be suitable for the data storage modes of the user client side and the management terminal according to needs so as to meet the needs of different data searching.
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 are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a schematic diagram of a data processing system 100, in accordance with one embodiment of the present invention;
FIG. 2 illustrates a block diagram of a computing device 200, according to one embodiment of the invention;
FIG. 3 shows a flow diagram of a data processing method 300 according to one embodiment of the invention;
FIG. 4 shows a flow diagram of a data processing method 400 according to one embodiment of the invention;
FIG. 5 illustrates a data storage diagram in a second data storage device, according to one embodiment of the present invention;
FIG. 6 illustrates a data storage diagram in a second data storage device, according to one embodiment of the present 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.
Currently, most application of data storage of comment areas of network information is storing comment information through a relational database, and storing is usually performed according to a time sequence.
Another storage method of the comment information is to adopt a tree-shaped storage method, which divides the comments into main comments and non-main comments, wherein the main comments are comments on the subject of the content, for example, in a comment area of a certain news content, the comments on the news content are directly taken as main comments, and the non-main comments refer to replies to the comments (including the main comments and the non-main comments). The comment content does not need to record the data of the superior node, and only needs to store the concerned content in the comment, so that the query speed is much faster than the scheme of using a relational database because the relationship between the superior node and the inferior node does not need to be processed during the query of the structure.
However, for the background manager, because the data is stored loosely, the content of the single data is not comprehensive, and the data needs to be judged according to the context of the content, and cannot be directly used by the manager, after the data needs to be processed and completed, the original data is typeset by using the data display structure which is convenient for the background manager to manage, and the stored data cannot be directly used.
According to the characteristics of the two data storage modes, two sets of data storage are established and are synchronized through the message middleware, so that the problem of efficiency of repeated query of the database when a client side displays is solved, and 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, the server 110 being 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 only an example, in practice, there may be a plurality of clients and management terminals, and the present invention does not limit 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, such as an application server, a Web server, and the like, but is not limited thereto. The server 110 may be implemented as one server, or may be implemented as a cluster or distributed system formed by a plurality of servers; when the number of servers is multiple, 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 and a notebook computer, a mobile terminal such as a mobile phone, a tablet computer, a multimedia player, and a smart wearable device, and a device such as a smart 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 an embodiment of the present invention, a user may comment on data information such as news and videos on a network through a client 120, for example, leave a message or comment on a message board or comment area of the information such as news and videos, the data information of the leave message or comment is sent to a 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 obtaining the message or comment, the server 110 stores data in the first data storage device and synchronizes to the second data storage device. When browsing at the client 120, the user acquires comment data from the first data storage device, and when the administrator filters sensitive information of comment information of the user at the management terminal, the administrator acquires comment data from the second 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, according to 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 for implementing the data processing method 300/400 of the present invention may be any type of device, and the hardware configuration thereof may be the same as the computing device 200 shown in fig. 2 or different from the computing device 200 shown in fig. 2. The computing device used to implement the data processing method 300/400 of the present invention may be implemented with additions or deletions to the hardware components of the computing device 200 shown in fig. 2, and the present invention is not limited to the specific hardware configuration of the computing device.
As shown in FIG. 2, in a basic configuration 202, a 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 Signal Processor (DSP), or any combination thereof. The processor 204 may include one or more levels of cache, such as a level one cache 210 and a level two cache 212, a processor core 214, and registers 216. Example processor cores 214 may include Arithmetic Logic Units (ALUs), Floating Point Units (FPUs), digital signal processing cores (DSP cores), 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. The physical memory in the computing device is usually referred to as a volatile memory RAM, and data in the disk needs to be loaded into the physical memory to be read by the processor 204. System memory 206 may include an operating system 220, one or more applications 222, and program data 224. In some implementations, the application 222 can be arranged to execute instructions on the operating system with the program data 224 by the one or more processors 204. Operating system 220 may be, for example, Linux, Windows, or the like, which includes program instructions for handling basic system services and for performing hardware-dependent tasks. The application 222 includes program instructions for implementing various user-desired functions, and the application 222 may be, for example, but not limited to, a browser, instant messenger, a software development tool (e.g., an integrated development environment IDE, a compiler, etc.), and the like. When the application 222 is installed into the computing device 200, a driver module may be added to the operating system 220.
When the computing device 200 is started, the processor 204 reads program instructions of the operating system 220 from the memory 206 and executes them. Applications 222 run on top of operating system 220, utilizing the interface provided by operating system 220 and the underlying hardware to implement various user-desired functions. When the user starts the application 222, the application 222 is loaded into the memory 206, and the processor 204 reads the program instructions of the application 222 from the memory 206 and executes the program instructions.
Computing device 200 also includes storage device 232, storage device 232 including removable storage 236 and non-removable storage 238, each of removable storage 236 and non-removable storage 238 being 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 the basic configuration 202 via the 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. Example peripheral interfaces 244 can include a serial interface controller 254 and a parallel interface controller 256, which can be configured to facilitate communications with 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.) via one or more I/O ports 258. An example communication device 246 may include a network controller 260, which may be arranged to facilitate communications with one or more other computing devices 262 over a network communication link via one or more communication ports 264.
A 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, such as carrier waves or other transport mechanisms, in a modulated data signal. A "modulated data signal" may be a signal that has one or more of its data set or its changes made 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 private-wired network, and various 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 a computing device 200 according to the invention, the application 222 includes instructions for performing the data processing method 300/400 of the invention, which may instruct the processor 204 to perform the data processing method 300/400 of the invention.
Fig. 3 shows a flowchart of a data processing method 300 according to an embodiment of the present invention, where the method 300 is suitable for being executed in a server (for example, implemented by the computing device in fig. 2), the server is communicatively connected to a client, and a user browses main content such as news and videos in a website through the client, and comments or messages of the user in the main content and also posts comments through the client, and the comment information is finally stored in the server, where the server includes a first data storage device, a second data storage device, and a message middleware, and information in the first data storage device is stored in the second data storage device through the message middleware.
According to the embodiment of the present invention, the first data storage device may be implemented by a relational database, which may be any one of, but not limited to, Oracle, SQLServer, DB2, Mysql, and the like. The second data storage device may be implemented by a non-relational database, and may be any one of CouchDB, mongoddb, SequoiaDB, and the like, but is not limited thereto. The invention does not limit the concrete 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 the user, referred to as first comment information, is acquired from the client. 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, so that the server can correspondingly store the currently received comment information according to the information, update the comment information to a website and facilitate browsing of the user.
According to the embodiment of the present invention, the main content identifier is the unique identifier of the top level main content, for example, the today's focus interview video corresponds to a unique identifier 010101 to distinguish other main contents on the same website, and then the 010101 is the main content identifier of the today's focus interview, and the unique identifier of the main content is generally generated when the main content is sent to the website.
Each main body content corresponds to one comment area, the comment area comprises direct comments on the main body content, called main comments (also called primary comments), and also comprises comments on the main comments (primary comments), called secondary comments, and the comments on the secondary comments are called tertiary comments, and so on, and the comments after the primary comments are collectively called non-main comments. Each comment (including both the main comment and the non-main comment) of the comment area corresponds to a primary 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 identifier carried by the currently received first comment information is '0', the comment information is a main comment.
And if the main comment identification carried by the currently received comment information is '0', the comment information is shown as the main comment.
The comment object is a user network name of a previous-level 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 user is the network name of the user who gives the current comment information, the comment content is the related content given by the user, and the comment time is the time for giving the comment by the user.
After receiving the first comment information, the process proceeds to step S320, and stores the received first comment information in the first data storage device.
According to an embodiment of the present invention, there exists a main content with a main content identification of 030303 on the a website, which currently includes three comments, including a main comment of user "zhang three", a comment of user "liquad" on the main comment of "zhang three", and a comment of user "wang five" on the main comment of zhang three. In the present embodiment, the first storage device is implemented as a relational database, the relational database is usually stored in a list manner according to time, and data in the first storage device is stored as shown in table 1 according to the current comment information.
TABLE 1
Figure BDA0002831748110000101
According to an embodiment of the present invention, in the first comment information received in step S310, the main content is "030303", the main comment is identified as "1", the reply object is identified as "2", the comment object is "liquad", the comment user is "Xiaoming", the comment content is "together you", and the comment time is "2020/1/1/12: 03". In this step, first, a primary key ID is generated for the currently received first comment information, a primary key ID "4" of the comment information is generated in a manner of self-increment of the primary key ID, and a new comment information record is generated and stored in the first storage device according to the primary key ID and a field in the first comment information.
According to another embodiment of the present invention, in step S310, after the received comment information, the main content is "040404", the main comment identifier is "0", the reply object identifier is "0", the comment object is "comment", the comment user is "small white", the comment content is "today has a daily diet", the comment time is "2020/1/1/12: 04", and the comment information of the small white "enters this step, the main key ID" 5 "of the comment information is also generated first, and an instruction of adding a record corresponding to the first data storage device implementation manner is generated according to the main key ID and the received first comment information, for example, if the first data storage device has an sqlser implementation, an instruction of adding a record of the sqlser is generated, 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
Figure BDA0002831748110000111
In step S320, 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 between 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 publishes comments is reduced, and the operation of the user is responded more quickly. The message middleware may use any one of ActiveMQ, RabbitMQ, Kafka, etc., which is not limited by the present invention.
According to an embodiment of the present invention, the first comment message and the corresponding primary key ID are stored in a message middleware (for example, RabbitMQ), which may also be understood as storing a newly created comment record in the first data storage device (relational database) in the message middleware to activate synchronization of the comment information by the second data storage device, and when a message is synchronized into the message middleware, an operation type is added, and when new comment information is added, the operation type may be identified by "a".
Subsequently, step S340 is entered, and the comment information and the primary key ID in the message middleware are synchronized into the second data storage device. According to the embodiment of the invention, the second data storage device is realized by a non-relational database and is stored in a tree structure, so that one more 'reply' field is added to the comment information in the data structure for storing the next-level comment information. In the specific implementation, any one of CouchDB, mongoddb, sequoia db, and the like may be used, but the invention is not limited thereto.
Continuing with the above embodiment, before updating the comment of "Xiaoming" on lie four and the comment of "Xiaobai" on the subject content "040404", the data in the second data storage device is as shown in FIG. 5.
Taking the comment of "xiaoming" to "liquad" as an example, in this step, firstly, the operation type is obtained as the comment adding information, then, according to the reply object identifier in the comment information, the comment information of the previous level is obtained, as can be seen from fig. 4, the primary key ID of the comment information of the previous level is 2, a "reply" field is added to the comment information, and the comment of "xiaoming" to "liquad" is added to the "reply" field.
According to the embodiment of the invention, the comment of the 'small white' on the subject content '040404' is a main comment of the user on another subject content, a new data record is directly created, the comment information is recorded, and the updated data storage in the second data storage device is as shown in fig. 6.
The comment information published by each user is stored according to the method 300, so that when the corresponding content is opened by the user, the user comments in the comment area can be quickly obtained from the non-relational database of the server side.
FIG. 4 shows a flow diagram of a data processing method 400 according to one embodiment of the invention; the method 400 is suitable for being executed in a server (for example, implemented by a computing device in fig. 2), the server is in communication connection with a management terminal, and an administrator can acquire comment information of a user from a first data storage device of the server through the management terminal, because the first data storage device is implemented by a relational database, and comment data are stored according to a time sequence, which makes an information search process simpler for an administrator who focuses on newly released information. And the administrator correspondingly modifies or deletes the corresponding comment information by filtering the sensitive information in the user comment.
As shown in fig. 4, the method 400 begins at step S410, in this step, updated comment information (i.e. second comment information) submitted by an administrator is obtained from a management terminal, the second comment information includes a primary key ID, an operation identifier, and/or a modified field, the modified field is one or more of a main content identifier, a primary comment identifier, a reply object identifier, a comment object, a comment user, a comment content, and a comment time, 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 wants to delete the comment record with the primary key of 4, the second comment information submitted through 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. And when the operation identifier in the acquired second comment information is 'U', acquiring corresponding comment information according to the ID of the main key, and modifying the response field in the comment information according to the field carried in the second comment information. And if the operation identifier is 'D', acquiring corresponding comment information according to the ID of the main key, and setting the comment information to be in a 'deletion' state or directly deleting the comment information.
Then, the process proceeds to step S430, where the second comment information is stored in the message middleware and synchronized into the second data storage device. And when the second comment information is written into the message middleware, the second data storage equipment is triggered to acquire corresponding information from the message middleware for synchronization.
According to an embodiment of the present invention, the second comment information includes a primary key ID "5", an operation identifier "U", and a comment content "no-daily-food today", and after acquiring the synchronization message, the second data storage device finds the comment record according to the primary key ID, and modifies the comment content therein to "no-daily-food today", which should be noted that this embodiment is merely an exemplary illustration.
It should be noted that, during the deletion operation, the comment content may be directly deleted or the corresponding comment record may be set to the deleted state as needed during the data operation, if the comment content is set to the "deleted" state, when the client acquires the comment content from the second data storage device, the comment content is not displayed, but the comment of the next level of the comment is still normally displayed, and when the comment content is directly deleted, the comment and the following comment are directly deleted in the second data storage device, and the client may not acquire the deleted comment information and the following comment.
Fig. 5 shows a schematic diagram of a data processing apparatus 500 according to an embodiment of the present invention, the apparatus 500 being adapted to reside in a server, which is communicatively connected to a client and a management terminal, respectively, and to execute a method 300/400.
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.
And the first data storage device 510 is suitable for acquiring first comment information of the user from the client, generating a primary key ID for the comment information, and storing 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 present invention, the first data storage device is implemented by a relational database, which may be any one of, but not limited to, Oracle, SQLServer, DB2, Mysql, and the like.
Message middleware 520 adapted to synchronize data in the first data storage device 510 to the second data storage device 520. The message middleware can shield the difference of characteristics between 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 publishes comments is reduced, and the operation of the user is responded more quickly.
According to an embodiment of the present invention, the message middleware 520 may use any one of ActiveMQ, RabbitMQ, Kafka, etc., which is not limited by the present invention.
And the second data storage device 520 is suitable for storing the comment data synchronized by the message middleware 520, and finally 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, mongoddb, SequoiaDB, etc., but is not limited thereto.
According to the data processing method, the comment information published by the 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, and 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 inquire the sensitive information and update the comment information, and meanwhile, because the data in the non-relational database is stored in a tree structure according to the relation among the comment information, the processing speed of acquiring the comment information from the non-relational database by the user through a client 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 thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, 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 present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store 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 this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, 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 foregoing 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 interpreted as reflecting an intention that: that the invention as claimed 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 multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. 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. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements 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 one of a1-a7, wherein 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 when the update type is modification comprises:
finding 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 to the message middleware;
and acquiring a corresponding comment record from the second data storage equipment according to the primary key ID in the second comment information of the message middleware, and updating.
A9, the method as in a7 or A8, wherein 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 when the type of the update is delete comprises:
finding a comment record corresponding to the primary key ID from the first data storage equipment according to the primary key ID, and setting the comment record in a deleted state;
synchronizing the second comment information to the information system;
and acquiring a corresponding comment record from the second data storage device according to the primary key ID in the second comment information in the information system, and juxtaposing the comment record in a deleted state.
A10, the method of any one of a1-a9, further comprising:
and displaying the comment information in the second data storage equipment at the client according to a viewing request of a user at 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 included in other embodiments, rather than other features, 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 may be used in any combination.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, 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 this description, will appreciate that other embodiments can be devised which do not depart from 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 present invention has been disclosed in an illustrative rather than a restrictive sense, and the scope of the present invention is defined by the appended claims.

Claims (10)

1. A data processing method is suitable for being executed in a server, the server comprises a first data storage device, a second data storage device and message middleware, the server is respectively connected with a client and a comment management terminal, and the method comprises the following steps:
obtaining first comment information of a user from the client, wherein fields of the first comment information comprise: the method comprises the steps of identifying main content, identifying main comment, identifying reply object, commenting user, commenting content and commenting 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.
2. The method of claim 1, wherein said storing the first comment information to the first data storage device comprises:
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 of the primary key ID of the first comment information includes:
and generating the primary key ID of the first comment information in a self-increment mode.
4. The method of any of claims 1-3, wherein said synchronizing the first comment information to the second data storage device through the 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 the primary key ID to the second data storage device.
5. The method of claim 4, wherein the type of the first comment information includes a prime comment and a non-prime comment, and when the comment information is a prime comment, the storing the first comment information and a prime 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 review record to the second data storage device.
6. The method of claim 4 or 5, wherein, when the first comment information is a non-primary comment, the storing the first comment information and a primary key ID into the second data storage device comprises:
acquiring a first-level comment record corresponding to the first comment information in 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;
adding the second comment record to a reply field of the previous comment record.
7. The method of any of claims 1-6, further comprising:
acquiring second comment information from the management terminal, wherein the second comment information is the update content of the original comment information of the user by an administrator, the 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 the comment information in the first data storage equipment according to the second comment information, and synchronizing to the second data storage equipment.
8. A data processing device is suitable for residing in a server, the server is respectively connected with a client and a comment management terminal, and the device comprises: 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, and 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 can manage the comment information through the management terminal;
message middleware adapted to synchronize data in the first data storage device to the second data storage device;
and the second data storage device is suitable for storing the comment messages in the first data storage device synchronized through the message middleware so as to improve the query efficiency when the client performs comment display.
9. 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 method of any of claims 1-7.
10. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-7.
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 true CN112559913A (en) 2021-03-26
CN112559913B 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)

Cited By (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 (12)

* 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)
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
US20160043764A1 (en) * 2008-01-18 2016-02-11 Mophie, Inc. Wireless communication accessory for a mobile device
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

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160043764A1 (en) * 2008-01-18 2016-02-11 Mophie, Inc. Wireless communication accessory for a mobile device
US20120054118A1 (en) * 2010-08-31 2012-03-01 International Business Machines Corporation Automated user registration and course enrollment in learning management system (lms)
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》, pages 739 *
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》, pages 1680 *
余军: "基于多源异构的MES物料管理数据集成系统设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 07, pages 138 - 489 *
宁健: "基于流复制技术的存储分离方法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 05, pages 138 - 987 *
王珏 等: "基于快照隔离的分布式数据库同步协议研究与实现", 《计算机应用研究》, vol. 29, no. 08, pages 3012 - 3017 *

Cited By (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

Also Published As

Publication number Publication date
CN112559913B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
RU2608668C2 (en) System and method for control and organisation of web-browser cache for offline browsing
RU2629448C2 (en) System and method of controlling and organizing web-browser cash
US20080222212A1 (en) Peer-to-peer data synchronization architecture
US8819587B1 (en) Methods of managing items in a shared workspace
WO2020211236A1 (en) Read-write conflict resolution method and apparatus employing b+ tree and storage medium
CN109564566B (en) Discovery of calling applications for controlling file hydration behavior
US10878089B2 (en) Identifying malware based on content item identifiers
US11573961B2 (en) Delta graph traversing system
CN112559913B (en) Data processing method, device, computing equipment and readable storage medium
CN113377289A (en) Cache management method, system, computing device and readable storage medium
CN109116718B (en) Method and device for setting alarm clock
CN109472540B (en) Service processing method and device
CN109165259B (en) Index table updating method based on network attached storage, processor and storage device
CN111753141A (en) Data management method and related equipment
CN115098537B (en) Transaction execution method and device, computing equipment and storage medium
CN105354506A (en) File hiding method and apparatus
CN107749892B (en) Network reading method and device for conference record, intelligent tablet and storage medium
CN114547184A (en) Personnel information synchronization method, terminal device and storage medium
EP3289544A1 (en) Insertion of unsaved content via content channel
KR101862178B1 (en) Method for customized posting and server implementing the same
JP6075051B2 (en) Server apparatus, electronic conference system, and program
US20170154096A1 (en) Data service system and electronic apparatus
CN112965946B (en) Method, device, equipment and computer readable medium for processing document
US20240061891A1 (en) Synchronizing security groups
CN109710673B (en) Work processing method, device, equipment and medium

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