CN117171419B - Content processing method, device, electronic apparatus, storage medium, and program product - Google Patents

Content processing method, device, electronic apparatus, storage medium, and program product Download PDF

Info

Publication number
CN117171419B
CN117171419B CN202311428715.2A CN202311428715A CN117171419B CN 117171419 B CN117171419 B CN 117171419B CN 202311428715 A CN202311428715 A CN 202311428715A CN 117171419 B CN117171419 B CN 117171419B
Authority
CN
China
Prior art keywords
content
storage space
historical
history
target
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
CN202311428715.2A
Other languages
Chinese (zh)
Other versions
CN117171419A (en
Inventor
李朝江
王彦新
程佳林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202311428715.2A priority Critical patent/CN117171419B/en
Publication of CN117171419A publication Critical patent/CN117171419A/en
Application granted granted Critical
Publication of CN117171419B publication Critical patent/CN117171419B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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

  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a content processing method, a device, electronic equipment, a storage medium and a program product, which can be applied to various scenes such as cloud technology, artificial intelligence, intelligent transportation, internet of vehicles and the like; the application can acquire the page display request containing the content identifier, and inquire the historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request; when the history content exists, reading the history content in a preset storage space to obtain target history content, and displaying a content interaction page comprising the target history content through a main thread; when the fact that the target historical content in the content interaction page is updated is detected, updated content corresponding to the target historical content is obtained; determining a content storage thread based on content storage information generated by the main thread; and synchronously storing the updated content to a preset storage space through a content storage thread. The application can reduce the blocking of the content interaction page and improve the storage efficiency of updated content.

Description

Content processing method, device, electronic apparatus, storage medium, and program product
Technical Field
The present application relates to the field of data storage technology, and in particular, to a content processing method, apparatus, electronic device, storage medium, and program product.
Background
The device may display a content interaction page, such as a web page, and obtain the interaction content through the content interaction page. When the device acquires the interactive content through the content interaction page, if an object such as a user selects to save the interactive content, the device stores the interactive content in a local database of the device.
Under the condition that the storage amount of the interactive content is large, when the interactive content is stored, conflict can occur between the display of the content interactive page and the storage of the interactive content, so that the content interactive page is easy to be blocked, and the interactive content cannot be stored quickly.
In summary, the problem that the content interaction page is easy to be blocked and the storage efficiency of the interaction content is low exists at present.
Disclosure of Invention
The embodiment of the application provides a content processing method, a device, electronic equipment, a storage medium and a program product, which can avoid the occurrence of clamping of a content interaction page and improve the storage efficiency of content.
A content processing method, comprising:
Acquiring a page display request containing a content identifier, and respectively inquiring historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request;
When the history content exists, reading at least one history content in a preset storage space for storing the history content to obtain target history content, and displaying a content interaction page comprising the target history content through a main thread;
When the fact that the target historical content in the content interaction page is updated is detected, updated content corresponding to the target historical content is obtained;
Generating content storage information corresponding to updated content through a main thread, and determining a content storage thread corresponding to the updated content according to the content storage information;
And synchronously storing the updated content to a preset storage space through a content storage thread.
Accordingly, an embodiment of the present application provides a content processing apparatus, including:
The query unit can be used for acquiring a page display request containing the content identifier, and respectively querying historical contents corresponding to the content identifier in at least two preset storage spaces based on the page display request;
The reading unit can be used for reading at least one history content in a preset storage space for storing the history content when the history content exists, so as to obtain target history content, and displaying a content interaction page comprising the target history content through a main thread;
the acquisition unit can be used for acquiring updated content corresponding to the target historical content when the target historical content in the content interaction page is detected to be updated;
The determining unit can be used for generating content storage information corresponding to updated content through the main thread, and determining the content storage thread corresponding to the updated content according to the content storage information;
The storage unit can be used for synchronously storing updated contents to a preset storage space through the content storage thread.
Optionally, in some embodiments, the reading unit may be specifically configured to determine at least one target storage space in which the history content exists in the preset storage space; reading at least one historical content and content attribute information corresponding to the historical content from a target storage space; and screening target historical contents from the historical contents based on the content attribute information.
Optionally, in some embodiments, the target storage space includes a local storage space and a remote storage space corresponding to the server; the reading unit is specifically configured to read local history content and local content attribute information corresponding to the local history content from the local storage space; acquiring remote history content and remote content attribute information corresponding to the remote history content from a remote storage space through a server; the local history content and the remote history content are taken as history content, and the local content attribute information and the remote content attribute information are taken as content attribute information.
Optionally, in some embodiments, the reading unit may be specifically configured to determine a display priority of the historical content based on the content attribute information; and extracting target historical content from the historical content according to the display priority.
Optionally, in some embodiments, the reading unit may be specifically configured to compare the local content attribute information and the remote content attribute information to determine a display priority of the local content attribute information and the remote content attribute information; when the local content attribute information is prior to the remote content attribute information, taking the local content attribute information as target historical content; when the remote content attribute information is prioritized over the local content attribute information, the remote content attribute information is taken as target history content.
Optionally, in some embodiments, the storage unit may be specifically configured to clean the updated content through a content storage thread to obtain the preprocessed content; and storing the preprocessed content in a local storage space, and sending the preprocessed content to the server so that the server stores the preprocessed content in a remote storage space.
Optionally, in some embodiments, the storage unit may be specifically configured to detect, in the local storage space, historical content corresponding to the updated content; when the history content is detected, replacing the history content of the local storage space with the preprocessed content; when no history content is detected, the preprocessed content is stored to the local storage space.
Optionally, in some embodiments, the obtaining unit may be further specifically configured to detect, by using the main thread, a content update event corresponding to the target historical content in the content interaction page, to obtain a detection result; when a content update event is detected, determining that the target historical content is updated; when no content update event is detected, it is determined that there is no update to the target historical content.
Optionally, in some embodiments, the obtaining unit may be specifically configured to detect, by the main thread, an update operation for the target historical content in the content interaction page; when the updating operation is detected, determining that the detection result is that a content updating event is detected; when the update operation is not detected, it is determined that the detection result is that the content update event is not detected.
Optionally, in some embodiments, the storage unit may be further configured to display, by the main thread, a candidate content interaction page based on the page display request, where the candidate content interaction page includes a content editing area, when no history content exists; generating target content in response to an input operation for the content editing area; and synchronously storing the target content into a preset storage space through the content storage thread.
Optionally, in some embodiments, the query unit may be specifically configured to display an initial content interaction page, where the initial content interaction page includes a content display control; and responding to clicking operation for the content display control, and acquiring a page display request containing the content identification.
Optionally, in some embodiments, the preset storage space includes a local storage space and a remote storage space of the server; the query unit is specifically configured to query, based on the page display request, historical content corresponding to the content identifier in each local storage space; and sending a page display request to the server so as to query the remote storage space for the historical content corresponding to the content identification based on the page display request by the server.
In addition, the embodiment of the invention also provides electronic equipment, which comprises a processor and a memory, wherein the memory stores application programs, and the processor is used for running the application programs in the memory to realize the content processing method provided by the embodiment of the invention.
In addition, the embodiment of the application also provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute any content processing method provided by the embodiment of the application.
In addition, the embodiment of the application also provides a computer program product, which comprises a computer program, and when the computer program is executed by a processor, any one of the content processing methods provided by the embodiment of the application is realized.
The application can acquire the page display request containing the content identifier, and respectively inquire the historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request; when the history content exists, reading at least one history content in a preset storage space for storing the history content to obtain target history content, and displaying a content interaction page comprising the target history content through a main thread; when the fact that the target historical content in the content interaction page is updated is detected, updated content corresponding to the target historical content is obtained; generating content storage information corresponding to updated content through a main thread, and determining a content storage thread corresponding to the updated content according to the content storage information; and synchronously storing the updated content to a preset storage space through a content storage thread. According to the method and the device, the historical contents can be queried in at least two preset storage spaces, so that when the historical contents exist in the preset storage spaces, the target historical contents are obtained, and the main thread displays a content interaction page comprising the target historical contents, so that the availability and reliability of the historical contents stored in the preset storage spaces can be improved; after the content interaction page is displayed, when the fact that the target historical content in the content interaction page is updated is detected, under the condition that the display of the content interaction page by a main thread is not interfered, the updated content corresponding to the target historical content is synchronously stored into at least two preset storage spaces by using an independent content storage thread outside the main thread, so that the clamping of the content interaction page can be reduced, and the storage efficiency of the updated content is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of a scenario of a content processing method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a content processing method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a content interaction page provided by an embodiment of the present application;
FIG. 4 is a schematic two-diagram of a content interaction page provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a data structure provided by an embodiment of the present application;
FIG. 6 is a flow chart of a content processing method according to an embodiment of the present application;
FIG. 7 is a flowchart of a content processing method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a content processing apparatus according to an embodiment of the present application;
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
The embodiment of the application provides a content processing method, a content processing device, electronic equipment and a computer readable storage medium. The content processing device may be integrated in an electronic device, which may be a server or a terminal.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), basic cloud computing services such as big data and an artificial intelligent platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
For example, referring to fig. 1, taking an example that the content processing apparatus is integrated in an electronic device, the electronic device may obtain a page display request including a content identifier, and respectively query historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request; when the history content exists, reading at least one history content in a preset storage space for storing the history content to obtain target history content, and displaying a content interaction page comprising the target history content through a main thread; when the fact that the target historical content in the content interaction page is updated is detected, updated content corresponding to the target historical content is obtained; generating content storage information corresponding to updated content through a main thread, and determining a content storage thread corresponding to the updated content according to the content storage information; and synchronously storing the updated content to a preset storage space through a content storage thread.
The application relates to content display and content storage, in particular to a method for synchronously storing updated content corresponding to target historical content into at least two preset storage spaces by utilizing independent content storage threads outside a main thread under the condition of not interfering the display of the content interaction page by the main thread when the update of the target historical content in the content interaction page is detected after the display of the content interaction page comprising the target historical content, so that the blocking of the content interaction page can be reduced and the storage efficiency of the updated content can be improved.
It will be appreciated that, in the specific embodiment of the present application, related data such as historical content, updated content, etc. are related, when the following embodiments of the present application are applied to specific products or technologies, permission or agreement is required, and collection, use and processing of related data are required to comply with related laws and regulations and standards of related countries and regions.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
The present embodiment will be described from the viewpoint of a content processing apparatus, which may be integrated in an electronic device, which may be a server or a terminal, or the like; the terminal may include a tablet computer, a notebook computer, a personal computer (PC, personal Computer), a wearable device, a virtual reality device, or other devices that may obtain data.
The application provides a content processing method, which comprises the following steps:
Acquiring a page display request containing a content identifier, and respectively inquiring historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request; when the history content exists, reading at least one history content in a preset storage space for storing the history content to obtain target history content, and displaying a content interaction page comprising the target history content through a main thread; when the fact that the target historical content in the content interaction page is updated is detected, updated content corresponding to the target historical content is obtained; generating content storage information corresponding to updated content through a main thread, and determining a content storage thread corresponding to the updated content according to the content storage information; and synchronously storing the updated content to a preset storage space through a content storage thread.
Specifically, as shown in fig. 2, the specific flow of the content processing method is shown in steps S201 to S205:
S201, acquiring a page display request containing a content identifier, and respectively inquiring historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request.
Wherein the content identification may refer to a unique identification of the historical content. Historical content may refer to content that was generated over a historical time and for which the content identification corresponds. The same content identification may correspond to a plurality of the same historical content, or the same content identification may correspond to a plurality of historical content of different periods.
The application can respectively store a plurality of same historical contents corresponding to the same content identifier into each preset storage space; for example, the preset storage space comprises a first preset storage space and a second preset storage space, the history content comprises a first history content and a second history content, the first history content and the second history content are the same, and the corresponding history content is identified for the same content.
According to the application, the historical contents in different periods corresponding to the same content identifier can be stored in the same preset storage space; for example, the plurality of different historical contents corresponding to the same content identifier comprise a historical content A and a historical content B, the preset storage space can comprise a preset storage space A and a preset storage space B, and the historical content A and the historical content B can be stored in the preset storage space A; similarly, the history content A and the history content B are also backed up in the preset storage space B.
The preset storage space may include at least one local storage space, or at least one remote storage space at the server, or at least one local storage space and at least one remote storage space at the server. The server may have a plurality of servers, and each server may correspond to at least one remote storage space. It is understood herein that the remote storage space is relative to the local storage space of the electronic device, and the remote storage space may specifically refer to a storage space in the server.
When the preset storage space is included in the remote storage space of the server, the server may be in an internal network of the electronic device, and in this case, it may be understood that the server and the electronic device may be nodes in the internal network, and communication may be performed between the server and the electronic device through the internal network, so as to improve data interaction efficiency. The internal network may be referred to as a local area network, such as a 5G local area network.
For step S201, there are various ways of "obtaining a page display request containing a content identifier", for example, displaying an initial content interaction page, where the initial content interaction page includes a content display control; and responding to clicking operation for the content display control, and acquiring a page display request containing the content identification.
The initial content interaction page may be an instant messaging session page or a web page. When the initial content interaction page is an instant conversation page, the content display control may be contained within a message displayed in a conversation box of the instant conversation page.
Wherein the content display control may include a page link of the content interaction page.
Specifically, the step of "obtaining a page display request including a content identifier in response to a click operation on a content display control" may be: responding to clicking operation for a content display control, acquiring an identification set and object identifications of objects logged in an initial content interaction page, wherein the identification set comprises a plurality of identifications; querying a content identifier corresponding to the object identifier in the identifier set; when a content identification exists, a page display request including the content identification is generated based on the content identification. Wherein the object may refer to an account number.
Further, after the step of "querying the content identifier corresponding to the object identifier in the identifier set", when the content identifier does not exist, directly displaying a target content interaction page which does not include the history content through the main thread, wherein the target content interaction page may include a target content input control. Then, generating page content in response to an input operation for the target content input control; and the page content is used as historical content and synchronously stored into each preset storage space through the content storage thread.
It can be understood that when the content identifier exists in the identifier set, it is indicated that in the history time, the history content corresponding to the content identifier is stored in the preset storage space; when the content identifier does not exist in the identifier set, the fact that the historical content corresponding to the content identifier is not stored in the preset storage space in the historical time is indicated.
Here, it can be understood that after the step of storing the page contents as history contents and synchronizing them to each preset storage space by the content storage thread, when the target content interaction page is to be opened again, the steps S201 to S202 of executing the present application may be returned and the content interaction page may be regarded as the target content interaction page. Further, when the presence update of the target history content is detected in the target content interaction page, steps S203 to S205 are performed.
For another example, the manner of "obtaining a page display request containing a content identifier" may be: acquiring a content identifier and a content display record, and inquiring a target display record in the content display record based on the content identifier, wherein the target display record is a display record of candidate content corresponding to the content identifier; when a target display record exists, a page display request is generated based on the content identification.
The candidate content may refer to content displayed in the content interaction page. The content display record may refer to a display record of all content displayed in a display interface of the electronic device.
Specifically, the manner of the step of "acquiring the content identification and the content display record" may be: displaying an interaction page, wherein the interaction page comprises a content display link; and responding to the triggering operation for the content display link, and acquiring the content identification and the content display record.
After the page display request is acquired, the historical content can be acquired so as to further display the content interaction page requested by the page display request, specifically, the mode of respectively inquiring the historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request can be divided into three cases, such as a case one, a case two and a case three:
It should be noted that, the history content acquired from each preset storage space according to the present application may be the latest history content.
Case one: when the preset storage space comprises local storage spaces, respectively inquiring historical content corresponding to the content identification in each local storage space based on the page display request.
And a second case: when the preset storage space comprises a remote storage space of the server, sending a page display request to the server so as to inquire the remote storage space of the content identification corresponding historical content based on the page display request through the server.
And a third case: when the preset storage space comprises a local storage space and a remote storage space of the server, respectively inquiring historical contents corresponding to the content identifications in each local storage space based on the page display request, and sending the page display request to the server so as to inquire the historical contents corresponding to the content identifications in the remote storage space based on the page display request through the server.
It should be noted here that the electronic device may include a main thread through which the electronic device processes tasks related to page display and a data storage thread through which the electronic device processes tasks related to content storage. Wherein, the page can comprise a content interaction page, a candidate content interaction page and a target content interaction page; the so-called content may include updated content, target content, and page content.
When the electronic device includes a main thread, step S201 may be performed by the electronic device through the main thread.
S202, when the historical content exists, at least one historical content is read from a preset storage space for storing the historical content to obtain target historical content, and a content interaction page comprising the target historical content is displayed through a main thread.
When the electronic device includes a main thread, step S202 may be performed by the electronic device through the main thread.
For step S202, the manner of "reading at least one history content in the preset storage space where the history content is stored to obtain the target history content" may be various: for example, at least one history content may be read in a preset storage space in which the history content is stored; when only one history content exists, the history content is taken as target history content; when the history content includes a plurality of history contents, the plurality of history contents may be combined to obtain the target history content. As another example, as shown in step S2021 to step S2023:
S2021, determining at least one target storage space in which historical contents exist in the preset storage space.
When the history content is queried in the preset storage space, the preset storage space with the history content is taken as a target storage space.
S2022, at least one historical content and content attribute information corresponding to the historical content are read from the target storage space.
Wherein the content attribute information may be information characterizing attributes of the history content; the attributes may include, but are not limited to, at least one of storage time, update time, data size, storage location.
The target storage space may include a local storage space, or a remote storage space of the server, or the local storage space and the remote storage space corresponding to the server. On this basis, for step S2022, the concrete manner of "reading at least one history content and content attribute information corresponding to the history content from the target storage space" may have three cases, such as case a, case B, and case C:
In the case A, when the target storage space comprises a local storage space and a remote storage space corresponding to the server, the local history content and local content attribute information corresponding to the local history content can be read from the local storage space; acquiring remote history content and remote content attribute information corresponding to the remote history content from a remote storage space through a server; the local history content and the remote history content are taken as history content, and the local content attribute information and the remote content attribute information are taken as content attribute information.
The local content attribute information may refer to content attribute information carried by local historical content; the remote content attribute information may refer to content attribute information carried by remote history content.
The method comprises the steps that when a target storage space comprises a local storage space, local historical content and local content attribute information corresponding to the local historical content are read from the local storage space; taking the local content attribute information as content attribute information; the local history content is taken as history content.
C, when the target storage space comprises a remote storage space corresponding to the server, acquiring remote history content and remote content attribute information corresponding to the remote history content from the remote storage space through the server; taking the remote history content as history content; the remote content attribute information is taken as content attribute information.
S2023, based on the content attribute information, screening out target historical content from the historical content.
After the content attribute information is acquired, the application can acquire the target historical content based on the content attribute information, specifically, the mode of screening the target historical content from the historical content based on the content attribute information can be as follows in steps S1 to S2:
s1, determining the display priority of the historical content based on the content attribute information.
Wherein, the display priority may refer to the priority of the history content displayed on the content interaction page.
Specifically, for step S1, the manner of "determining the display priority of the history content based on the content attribute information" may be as follows:
In the first mode, when the history content includes the local history content and the remote history content, the local content attribute information and the remote content attribute information are compared to determine the display priority of the local content attribute information and the remote content attribute information.
Specifically, the manner of comparing the local content attribute information and the remote content attribute information to determine the display priority of the local content attribute information and the remote content attribute information may be: when the content attribute information is the storage time, the local content attribute information is the local storage time, and the remote content attribute information is the remote storage time, so that the local storage time and the remote storage time can be compared; when the local storage time is earlier than the remote storage time, it is determined that the remote content attribute information is prioritized over the local content attribute information. It will be appreciated herein that the present application is arranged so as to enable the display of up-to-date target historical content onto a content interaction page.
When the remote storage time is earlier than the local storage time, determining that the local content attribute information is prior to the remote content attribute information; when the remote storage time is the same as the local storage time, it may be determined that the local content attribute information is prioritized over the remote content attribute information.
It will be understood herein that when the remote storage time is the same as the local storage time, the purpose of setting the local content attribute information in preference to the remote content attribute information is to facilitate that the local history content can be subsequently taken as the target history content and displayed, so that the acquisition efficiency of the target history content and the display efficiency of the target history content can be improved.
Or the manner of comparing the local content attribute information and the remote content attribute information to determine the display priority of the local content attribute information and the remote content attribute information may be: when the content attribute information is the update time of the historical content in the page, the local content attribute information is the first update time, and the remote content attribute information is the second update time, so that the first update time and the second update time can be compared; when the first updating time is earlier than the second updating time, determining that the remote content attribute information is prior to the local content attribute information; when the second update time is earlier than the first update time, determining that the local content attribute information is prioritized over the remote content attribute information; when the first update time is the same as the second update time, the local content attribute information is determined to be prioritized over the remote content attribute information.
In a second mode, when the history content comprises local history content, the content attribute information comprises local storage time corresponding to each local history content; based on the above, the local storage time can be sequenced from late to early to obtain a sequencing result, and the priority corresponding to each local history content is determined according to the sequencing result.
For example, the local history content includes a first local history content and a second local history content, and the content attribute information includes a first storage time corresponding to the first local history content and a second storage time corresponding to the second local history content; the first storage time is later than the second storage time, which indicates that the first local history content is newer than the second local history content, and based on the first storage time, the first local history content can be determined to be prioritized over the second local history content.
When the content attribute information includes an update time corresponding to each local history content, the manner of "determining a display priority of the history content based on the content attribute information" may specifically refer to a processing manner when the content attribute information includes an update time corresponding to each local history content, which is not described herein.
In a third mode, when the history content comprises remote history content, the content attribute information comprises target update time corresponding to each remote history content; based on the above, the target update time can be sequenced in the order from late to early, a target sequencing result is obtained, and the priority corresponding to each remote history content is determined according to the target sequencing result.
For example, the remote history content includes a first remote history content and a second remote history content, and the content attribute information includes a first target update time corresponding to the first remote history content and a second target update time corresponding to the first remote history content; the first target update time is later than the second target update time, which indicates that the first remote history content is newer than the second remote history content, based on which it can be determined that the first remote history content is prioritized over the second remote history content.
When the content attribute information includes a storage time corresponding to each remote history content, the manner of "determining a display priority of the history content based on the content attribute information" may specifically refer to a processing manner when the content attribute information includes a target update time corresponding to each remote history content, which is not described herein.
S2, extracting target historical content from the historical content according to the display priority.
In step S2, there are various ways of extracting the target history content from the history content according to the display priority, as follows:
for the first mode, correspondingly, the method of extracting the target historical content from the historical content according to the display priority in the step "may be: when the local content attribute information is prior to the remote content attribute information, taking the local content attribute information as target historical content; when the remote content attribute information is prioritized over the local content attribute information, the remote content attribute information is taken as target history content.
For the second mode, correspondingly, the mode of extracting the target historical content from the historical content according to the display priority in the step "may be: extracting the local historical content with the highest display priority from the local historical content; and taking the local history content with the highest display priority as target history content.
For the third mode, correspondingly, the mode of extracting the target historical content from the historical content according to the display priority in the step "may be: extracting far-end historical contents with highest display priority from the far-end historical contents; and taking the remote history content with the highest display priority as target history content.
After the target historical content is obtained, the content interaction page containing the target historical content can be displayed, and in particular, the mode of displaying the content interaction page containing the target historical content through the main thread can be as follows: determining an editing area of the target historical content on the content interaction page through a main thread; and rendering and displaying the content interaction page through the main thread, and displaying the target historical content in the editing area.
And S203, when the fact that the target historical content in the content interaction page is updated is detected, acquiring updated content corresponding to the target historical content.
When the electronic device includes a main thread, step S203 may be performed by the electronic device through the main thread.
The updated content may include, but is not limited to, the target history content and the newly added content, or the content left after the target history content is deleted.
Before step S203, the method may detect whether the target historical content in the content interaction page is updated, specifically, the method for detecting whether the target historical content in the content interaction page is updated may include the following steps: detecting a content update event corresponding to the target historical content in the content interaction page through the main thread to obtain a detection result; when a content update event is detected, determining that the target historical content is updated; when no content update event is detected, it is determined that there is no update to the target historical content.
Wherein, the content update event may refer to an event in which the target historical content in the content interaction page is updated.
Specifically, the step of detecting, by the main thread, a content update event corresponding to the target historical content in the content interaction page, to obtain a detection result may be: detecting an update operation for target historical content in a content interaction page through a main thread; when the updating operation is detected, determining that the detection result is that a content updating event is detected; when the update operation is not detected, it is determined that the detection result is that the content update event is not detected. In the present application, the content interaction page may be presented in a form.
For example, when the electronic device is a terminal, the content interaction page may be displayed on a display interface of the terminal. When the terminal is a smart phone, the content interaction page is displayed on the smart phone as shown in fig. 3, and the content interaction page may include an editing area 11, a content editing control 12 and content input prompt information.
Wherein the content input prompt information is used for indicating editing of the content in the editing area; specifically, the content input prompt is "01 input text" as shown in fig. 3.
The editing area 11 may display the target history text, and as shown in fig. 3, the articles displayed in the editing area 11 are the target history text.
Wherein the content editing control 12 may be a control for editing the text displayed in the editing area 11. Specifically, the terminal may initiate an editing mode for the target history text displayed in the editing area 11 in response to a trigger operation for the content editing control 12; in the edit mode, when an update operation to the target history content is detected by the main thread, it may be determined that the detection result is that a content update event is detected.
For another example, when the terminal is a notebook computer, the content interaction page may be displayed on the notebook computer as shown in fig. 5, and the content interaction page may include an editing area 11, a content editing control 12, content input prompt information such as "01 input text", and a submit control 13.
The editing area 11, the content editing control 12, and the content input prompt information in fig. 4 may be specifically referred to the explanation of fig. 3, and are not described herein.
Further, when the terminal detects a click operation for the submit control 13, the edit mode is ended, and it is determined that the detection result is that a content update event is detected.
The method of detecting the update operation for the target historical content in the content interaction page by the main thread in the step of: detecting the content state of the target historical content through the main thread; determining that an update operation for the target historical content in the content interaction page is detected when the content state is changed; when the content state is unchanged, it is determined that an update operation for the target history content in the content interaction page is not detected.
For step S203, the manner of "obtaining updated content corresponding to the target history content" may be: searching interactive contents of the content identifier corresponding to the target historical content in a temporary storage space corresponding to the content interactive page; when the interactive content is retrieved, the interactive content is taken as updated content corresponding to the target historical content.
S204, generating content storage information corresponding to the updated content through the main thread, and determining the content storage thread corresponding to the updated content according to the content storage information.
When the electronic device includes a main thread, step S204 may be performed by the electronic device through the main thread.
For step S204, the manner of generating, by the main thread, the content storage information corresponding to the updated content may be: and calling an information generating function through the main thread, and generating content storage information based on the information generating function.
The information generation function may be a function that causes the main thread to generate content storage information.
After the content storage information is acquired, the content storage thread can be determined, so that updated content can be stored through the content storage thread, specifically, the mode of determining the content storage thread corresponding to the updated content according to the content storage information can be as follows: transmitting content storage information through a main thread; when the thread receives the content storage information, the thread is determined to be the content storage thread corresponding to the updated content.
S205, synchronously storing updated contents to a preset storage space through a content storage thread.
After determining the content storage thread, the method of "synchronously storing updated content to the preset storage space through the content storage thread" in step S205 may be as shown in steps S2051 to S2052:
S2051, preprocessing the updated content through a content storage thread to obtain preprocessed content.
For step S2051, the manner of "preprocessing the updated content by the content storage thread to obtain the preprocessed content" may be: performing dirty data inspection on updated contents through a content storage thread to obtain inspected contents; and removing redundant fields from the checked content to obtain removed content, and taking the removed content as preprocessed content.
Specifically, the manner of "performing dirty data inspection on updated content by the content storage thread to obtain inspected content" may be: comparing the data format of the updated content with a preset format through a content storage thread; when the data format is different from the preset format, extracting candidate content corresponding to the data format different from the preset format from the updated content, and deleting the candidate content from the updated content to obtain checked content.
Specifically, the manner of "removing redundant fields from checked content to obtain removed content" may be: and identifying repeated content in the checked content, deleting the repeated content from the checked content, and obtaining the content after being removed.
S2052, storing the preprocessed content in a local storage space, and sending the preprocessed content to the server so that the server stores the preprocessed content in a remote storage space.
Specifically, after the pre-processed content is obtained, the pre-processed content can be stored, and specifically, the mode of storing the pre-processed content in the local storage space can be: detecting historical content corresponding to the updated content in a local storage space; when the history content is detected, replacing the history content of the local storage space with the preprocessed content, and taking the preprocessed content stored in the local storage space as the history content; when the history content is not detected, the preprocessed content is stored in the local storage space, and the preprocessed content stored in the local storage space is used as the history content.
Specifically, the manner of "sending the preprocessed content to the server so that the server stores the preprocessed content in the remote storage space" may be: searching historical content corresponding to the updated content in a remote storage space through a server; when the history content is retrieved, replacing the history content in the remote storage space with the preprocessed content through the server, and taking the preprocessed content stored in the remote storage space as the history content; when the history content is not retrieved, the preprocessed content is stored in the remote storage space, and the preprocessed content stored in the remote storage space is used as the history content.
When the preprocessed content is stored in the local storage space, the remote storage space, or the local storage space and the remote storage space, acquiring content attribute information, storing the content attribute information in a preset storage space of the corresponding preprocessed content, and binding the content attribute information with the corresponding preprocessed content.
In addition, in the step of "based on the page display request, after the at least two preset storage spaces query the historical content corresponding to the content identifier respectively", when there is no historical content, the present application may further store new target content in the preset storage spaces, specifically: when the historical content does not exist, displaying a candidate content interaction page through a main thread based on the page display request, wherein the candidate content interaction page comprises a content editing area; generating target content in response to an input operation for the content editing area; and synchronously storing the target content into a preset storage space through the content storage thread.
Here, it can be understood that the candidate content interaction page is different from the content interaction page in that when the candidate content interaction page is just displayed, there is no history content in the content editing area of the candidate content interaction page, and when the content interaction page is just displayed, there is history content in the editing area of the content interaction page.
Specifically, the manner of "displaying the candidate content interaction page based on the page display request through the main thread" may be: and acquiring page data based on the page display request through the main thread, and rendering and displaying the candidate content interaction page based on the page data through the main thread.
Specifically, the method of "synchronously storing the target content into the preset storage space through the content storage thread" may refer to the process of "synchronously storing the updated content into the preset storage space through the content storage thread", which is not described herein.
Here, it should be noted that, when the target content is synchronously stored in the preset storage space, the target content is synchronously stored as the history content in the preset storage space.
The storage of updated content is further described herein. In the present application, when storing updated contents, specifically, updated contents corresponding to target history contents, content identifiers of the updated contents, and content attribute information corresponding to the updated contents may be recorded and stored by a data structure as shown in fig. 5, and the interpretation of the data structure is as follows:
Key: the character string type is used for recording the unique identifier of the updated content, namely the content identifier;
creation time CREATETIME: the digital type represents the time when the historical content corresponding to the content identifier is created for the first time;
Last update time Updatetime: a digital type representing a last update time of the pair of target history contents;
The Data is an object type and can be used for recording updated content and content attribute information;
Backup data Backdata: the optional object type is used for backing up updated content and content attribute information;
The Data may include two Data attributes, namely, an update time Updatetime and a Data content Value;
update time Updatetime1: a digital type representing an update time of the updated content;
data content Value: any type for recording updated content.
The backup data Backdata may include three data attributes, namely, an update time Updatetime1, a data content Value, and a backup reason Status, and the update time Updatetime and the data content Value may be specifically referred to the foregoing explanation and will not be repeated herein.
Backup reason Status: the digital type, which indicates the reason why the updated content is moved into the backup, can be defined according to the actual situation.
Through the data structure, updated contents are stored in each preset storage space as historical contents, and reading, updating and backup operations are performed from the preset storage space according to the need. Each preset storage space is provided with a unique content identifier, and historical content retrieval and operation can be carried out according to the content identifier. Meanwhile, the data structure comprises the creation time and the last update time, so that time-related operation and data management are convenient to carry out. The field Backdata for backup data may be used to store additional data backups for restore or rollback operations when needed.
The application can acquire the page display request containing the content identifier, and respectively inquire the historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request; when the history content exists, reading at least one history content in a preset storage space for storing the history content to obtain target history content, and displaying a content interaction page comprising the target history content through a main thread; when the fact that the target historical content in the content interaction page is updated is detected, updated content corresponding to the target historical content is obtained; generating content storage information corresponding to updated content through a main thread, and determining a content storage thread corresponding to the updated content according to the content storage information; and synchronously storing the updated content to a preset storage space through a content storage thread. According to the method and the device, the historical contents can be queried in at least two preset storage spaces, so that when the historical contents exist in the preset storage spaces, the target historical contents are obtained, and the main thread displays a content interaction page comprising the target historical contents, so that the availability and reliability of the historical contents stored in the preset storage spaces can be improved; after the content interaction page is displayed, when the fact that the target historical content in the content interaction page is updated is detected, under the condition that the display of the content interaction page by a main thread is not interfered, the updated content corresponding to the target historical content is synchronously stored into at least two preset storage spaces by using an independent content storage thread outside the main thread, so that the clamping of the content interaction page can be reduced, and the storage efficiency of the updated content is improved.
According to the method described in the above embodiments, examples are described in further detail below.
In this embodiment, the content processing apparatus is specifically integrated in an electronic device, which may be a terminal.
As shown in fig. 6, a specific flow of the content processing method is shown in steps S501 to S508:
S501, the terminal obtains a page display request containing a content identifier through a main thread, and queries historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request.
Specifically, the terminal can display an initial content interaction page through a main thread, wherein the initial content interaction page comprises a content display control; and responding to clicking operation for the content display control, and acquiring a page display request containing the content identification.
Specifically, the terminal can query the historical content in a preset storage space through the main thread, and specifically, when the preset storage space comprises a local storage space, the terminal respectively queries the historical content corresponding to the content identifier in each local storage space based on the page display request; when the preset storage space comprises a remote storage space of the server, sending a page display request to the server so as to inquire historical content corresponding to the content identification in the remote storage space based on the page display request through the server; when the preset storage space comprises a local storage space and a remote storage space of the server, respectively inquiring historical contents corresponding to the content identifications in each local storage space based on the page display request, and sending the page display request to the server so as to inquire the historical contents corresponding to the content identifications in the remote storage space based on the page display request through the server.
S502, when the history content exists, the terminal determines at least one target storage space with the history content in the preset storage space through the main thread.
S503, the terminal reads at least one history content and content attribute information corresponding to the history content from the target storage space through the main thread.
For step S503, when the target storage space includes a local storage space and a remote storage space corresponding to the server, the terminal may read, by the main thread, local history content and local content attribute information corresponding to the local history content from the local storage space; the terminal can acquire remote history content and remote content attribute information corresponding to the remote history content from a remote storage space by using the main thread through the server; the local history content and the remote history content are taken as history content, and the local content attribute information and the remote content attribute information are taken as content attribute information.
For step S503, when the target storage space includes a local storage space, the terminal may read, by the main thread, local history content and local content attribute information corresponding to the local history content from the local storage space; taking the local content attribute information as content attribute information; the local history content is taken as history content.
For step S503, when the target storage space includes a remote storage space corresponding to the server, the terminal may obtain, by using the main thread, remote history content and remote content attribute information corresponding to the remote history content from the remote storage space through the server; taking the remote history content as history content; the remote content attribute information is taken as content attribute information.
S504, the terminal screens out target historical contents from the historical contents based on the content attribute information through the main thread.
For step S504, the terminal may determine, through the main thread, a display priority of the historical content based on the content attribute information; and extracting target historical content from the historical content according to the display priority.
The method of determining the display priority of the historical content based on the content attribute information by the main thread in the step of: when the history content includes local history content and remote history content, the local content attribute information and the remote content attribute information are compared by the main thread to determine display priorities of the local content attribute information and the remote content attribute information.
For example, when the content attribute information is a storage time, the local content attribute information is a local storage time, and the remote content attribute information is a remote storage time, based on which the terminal can compare the local storage time with the remote storage time through the main thread; when the local storage time is earlier than the remote storage time, determining that the remote content attribute information is prior to the local content attribute information through the main thread; when the remote storage time is earlier than the local storage time, determining that the local content attribute information is prior to the remote content attribute information through the main thread; when the remote storage time is the same as the local storage time, it may be determined that the local content attribute information is prioritized over the remote content attribute information by the main thread.
The method of extracting the target historical content from the historical content according to the display priority in the step may be: when the local content attribute information is prior to the remote content attribute information, taking the local content attribute information as target historical content; when the remote content attribute information is prioritized over the local content attribute information, the remote content attribute information is taken as target history content.
S505, the terminal displays a content interaction page comprising target historical content through the main thread.
Specifically, the manner of "the terminal displaying the content interaction page including the target history content through the main thread" may be: the terminal determines an editing area of the target historical content on the content interaction page through a main thread; and rendering and displaying the content interaction page through the main thread, and displaying the target historical content in the editing area.
S506, when the fact that the target historical content in the content interaction page is updated is detected, the terminal obtains updated content corresponding to the target historical content through the main thread.
Specifically, the terminal can detect a content update event corresponding to the target historical content in the content interaction page through the main thread to obtain a detection result; when a content update event is detected, determining that the target historical content is updated; when no content update event is detected, it is determined that there is no update to the target historical content.
The method for detecting, by the terminal, the content update event corresponding to the target historical content in the content interaction page through the main thread to obtain the detection result may be, for example: detecting an update operation for target historical content in a content interaction page through a main thread; when the updating operation is detected, determining that the detection result is that a content updating event is detected; when the update operation is not detected, it is determined that the detection result is that the content update event is not detected.
S507, the terminal generates content storage information corresponding to the updated content through the main thread, and determines the content storage thread corresponding to the updated content according to the content storage information.
Specifically, the manner of "the terminal generates the content storage information corresponding to the updated content" by the main thread may be: and the terminal calls the information generating function through the main thread, and generates content storage information based on the information generating function.
Specifically, the manner of determining the content storage thread corresponding to the updated content according to the content storage information may be: transmitting content storage information through a main thread; when the existing thread receives the content storage information, the thread is determined to be the content storage thread corresponding to the updated content through the main thread.
S508, the terminal synchronously stores the updated content into a preset storage space through the content storage thread.
Specifically, the mode of the terminal synchronously storing the updated content into the preset storage space through the content storage thread may be: the terminal can preprocess the updated content through a content storage thread to obtain preprocessed content; the terminal stores the preprocessed content in the local storage space, and sends the preprocessed content to the server, so that the server stores the preprocessed content in the remote storage space.
The manner of storing the preprocessed content in the local storage space by the terminal may be: detecting historical content corresponding to the updated content in a local storage space; when the history content is detected, replacing the history content of the local storage space with the preprocessed content, and taking the preprocessed content stored in the local storage space as the history content; when the history content is not detected, the preprocessed content is stored in the local storage space, and the preprocessed content stored in the local storage space is used as the history content.
The manner of "sending the preprocessed content to the server so that the server stores the preprocessed content in the remote storage space" may be: searching historical content corresponding to the updated content in a remote storage space through a server; when the history content is retrieved, replacing the history content in the remote storage space with the preprocessed content through the server, and taking the preprocessed content stored in the remote storage space as the history content; when the history content is not retrieved, the preprocessed content is stored in the remote storage space, and the preprocessed content stored in the remote storage space is used as the history content.
The storage of local storage is described herein in specific examples. It can be understood herein that the local storage space synchronous storage of the present application is a synchronous manner based on the database system by the terminal, and does not depend on the server. The local storage space, as a supplement and enhancement to server synchronization, provides a better input experience, especially when the user is not changing devices.
The database system may adopt IndexedDB system, indexedDB system is a built-in database system of a browser, and is used for storing a large amount of structured data at a client. IndexedDB provides an asynchronous, transactional manner for storing and retrieving data that can be used in an offline state.
The database system can also adopt LocalStorage system, and LocalStorage system has the characteristics of simplicity and easiness in use, and is suitable for storing a small amount of data.
In synchronizing updated content to local storage space, a content storage thread, such as a WebWorker or Service Worker implementation, may be used. When the user triggers the target historical content update and needs to update the local storage, the independent content storage thread can be used for processing, so that the storage process can not interfere with the main thread, and the user experience is not affected.
The WebWorker is a JavaScript script running in the background, and can execute computationally intensive tasks while loading and user interaction in a page. Webworkbench can improve the response performance of pages and avoid blocking user interfaces.
In addition to native IndexedDB and WebWorker, the application can also consider that other terminal frameworks or libraries are used to simplify development and improve performance, for example, the use of exact or vue.js can more conveniently manage component states and data flows, providing better user interfaces and interaction experiences.
The Service workbench is a script running in the background of the browser, and can intercept and process network requests. The Service Worker may be used to process preprocessing and local storage of data, similar to the function of WebWorker. The Service workbench can better control caching and offline access, and better user experience is provided.
The storage of the local storage space may be, for example: the user modifies the target historical content and triggers the content update event of the terminal. Then, the terminal can acquire updated content through the main thread, and determine a content storage thread. And then, the terminal preprocesses the updated content through the content storage thread to obtain preprocessed content, and the preprocessed content is stored in the local storage system through the content storage thread.
The storage of remote storage space is described herein in specific examples. Server storage is critical to achieving cross-end synchronization. In this synchronization manner, the server provides a stored HTTP request interface, and the terminal may send a storage request by calling the HTTP request interface, so that the server may store the updated content sent by the terminal in a remote storage space, such as a cloud database.
Wherein, to relieve the main thread pressure, the process of sending HTTP requests is also handled using the content storage thread.
The storage for the remote storage space may be, for example: the user modifies the target historical content and triggers the content update event of the terminal. Then, the terminal can acquire updated content through the main thread, and determine a content storage thread. And then, the terminal preprocesses the updated content through the content storage thread to obtain preprocessed content, and sends the updated content to the server through the content storage thread by using an HTTP request. After receiving the updated content, the server stores the updated content in the remote storage space.
For the above steps S501 to S508, the preset storage space includes the local storage space and the remote storage space of the server, as shown in fig. 7, specifically, as shown in steps S601 to S615:
S601, the terminal acquires a page display request containing a content identifier through a main thread.
S602, the terminal queries the historical content corresponding to the content identifier in the local storage space based on the page display request through the main thread.
S603, the terminal sends a page display request to the server by using the main thread.
S604, the server receives the page display request, and queries the remote storage space for the history content corresponding to the content identifier based on the page display request.
S605, when the local storage space has the history content, the terminal reads the local history content and the local content attribute information corresponding to the local history content in the local storage space.
S606, when the remote storage space has the history content, the server reads the remote history content and remote content attribute information corresponding to the remote history content in the remote storage space.
S607, the server returns the remote history content and the remote content attribute information to the terminal.
S608, when the terminal obtains the local historical content, the local content attribute information, the far-end historical content and the far-end content attribute information through the main thread, the terminal compares the local content attribute information and the far-end content attribute information through the main thread so as to determine the display priority of the local content attribute information and the far-end content attribute information.
S609, when the local content attribute information has priority over the remote content attribute information, the terminal takes the local history as the target history content through the main thread.
And S610, the terminal displays a content interaction page comprising the target historical content through the main thread.
S611, when the fact that the target historical content in the content interaction page is updated is detected, the terminal obtains updated content corresponding to the target historical content through the main thread.
And S612, the terminal generates content storage information corresponding to the updated content through the main thread, and determines the content storage thread corresponding to the updated content according to the content storage information.
And S613, the terminal stores the updated content into a local storage space through a content storage thread.
S614, the terminal sends updated content to the server through the content storage thread.
S615, the server receives the updated content and stores the updated content in a remote storage space.
Wherein, step S602 and step S603 may be performed simultaneously; step S613 and step S614 may be performed simultaneously.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
In summary, the present application has many advantages, such as:
High performance: the application adopts the WebWorker technology, and an independent content storage thread is started outside the main thread and can be used for storing updated content. Therefore, the performance of a system in the electronic equipment can be improved, and the main thread is prevented from being blocked, so that the user experience is improved.
The method has high availability: to ensure availability of updated content, we have established a two-way spam mechanism between the terminal and the server. This means that whenever one party's history content is abnormal, the other party can provide backup data to guarantee the availability of the history content to the maximum extent, whether at the terminal or at the server.
Backing up data: in some cases, the present application requires purging of history content, such as submitting updated content, modifying target history content or modifying topics within a form, etc. However, the present application does not actually remove updated content, but rather modifies its state to backup data to ensure that the data is not lost. This may provide the ability for data recovery to prevent user mishandling or other unexpected situations.
Ensuring that the data is up to date: in order to ensure that updated content applied to a form is up-to-date, the present application initiates a request to both the server and the local storage space upon acquisition of the updated content. The present application then compares the update times of each of the historic content to ensure that the most current copy of the historic content is used. Thus, the target historical content displayed on the content interaction page can be ensured to be up to date, and inconsistency of data is avoided.
The application not only provides high performance and high availability, but also furthest protects the safety and the integrity of the data through the measures of data backup and data update assurance. The scheme aims at realizing a real-time draft function when a user fills in a form, namely, when the target historical content in the content interaction page is detected to be updated, updated content can be stored in a content storage thread.
The application can acquire the page display request containing the content identifier, and respectively inquire the historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request; when the history content exists, reading at least one history content in a preset storage space for storing the history content to obtain target history content, and displaying a content interaction page comprising the target history content through a main thread; when the fact that the target historical content in the content interaction page is updated is detected, updated content corresponding to the target historical content is obtained; generating content storage information corresponding to updated content through a main thread, and determining a content storage thread corresponding to the updated content according to the content storage information; and synchronously storing the updated content to a preset storage space through a content storage thread. According to the method and the device, the historical contents can be queried in at least two preset storage spaces, so that when the historical contents exist in the preset storage spaces, the target historical contents are obtained, and the main thread displays a content interaction page comprising the target historical contents, so that the availability and reliability of the historical contents stored in the preset storage spaces can be improved; after the content interaction page is displayed, when the fact that the target historical content in the content interaction page is updated is detected, under the condition that the display of the content interaction page by a main thread is not interfered, the updated content corresponding to the target historical content is synchronously stored into at least two preset storage spaces by using an independent content storage thread outside the main thread, so that the clamping of the content interaction page can be reduced, and the storage efficiency of the updated content is improved.
In order to better implement the above method, the embodiment of the present application further provides a content processing apparatus, where the content processing apparatus may be integrated into an electronic device, such as a server or a terminal, where the terminal may include a tablet computer, a notebook computer, and/or a personal computer.
For example, as shown in fig. 8, the content processing apparatus may include a query unit 301, a reading unit 302, an acquisition unit 303, a determination unit 304, and a storage unit 305, as follows:
(1) A query unit 301;
the query unit 301 may be configured to obtain a page display request including a content identifier, and query, based on the page display request, historical content corresponding to the content identifier in at least two preset storage spaces, respectively.
For example, the query unit 301 may be specifically configured to display an initial content interaction page, where the initial content interaction page includes a content display control; and responding to clicking operation for the content display control, and acquiring a page display request containing the content identification.
(2) A reading unit 302;
the reading unit 302 may be configured to, when there is a history content, read at least one history content in a preset storage space storing the history content, so as to obtain a target history content, and display, by a main thread, a content interaction page including the target history content.
For example, the reading unit 302 may be specifically configured to determine at least one target storage space in which the history content exists in the preset storage space; reading at least one historical content and content attribute information corresponding to the historical content from a target storage space; and screening target historical contents from the historical contents based on the content attribute information.
For example, the reading unit 302 may be specifically configured to determine, based on the content attribute information, a display priority of the history content; and extracting target historical content from the historical content according to the display priority.
(3) An acquisition unit 303;
The obtaining unit 303 may be configured to obtain updated content corresponding to the target historical content when it is detected that there is an update of the target historical content in the content interaction page.
For example, the obtaining unit 303 may be further specifically configured to detect, by using the main thread, a content update event corresponding to the target historical content in the content interaction page, to obtain a detection result; when a content update event is detected, determining that the target historical content is updated; when no content update event is detected, it is determined that there is no update to the target historical content.
(4) A determination unit 304;
The determining unit 304 may be configured to generate, by using the main thread, content storage information corresponding to the updated content, and determine, according to the content storage information, a content storage thread corresponding to the updated content.
(5) A storage unit 305;
the storage unit 305 may be configured to store the updated content to a preset storage space synchronously through a content storage thread.
For example, the storage unit 305 may be specifically configured to perform preprocessing on the updated content through a content storage thread to obtain preprocessed content; and storing the preprocessed content in a local storage space, and sending the preprocessed content to the server so that the server stores the preprocessed content in a remote storage space.
As can be seen from the above, the query unit 301 of the present application may be configured to obtain a page display request including a content identifier, and query, based on the page display request, historical content corresponding to the content identifier in at least two preset storage spaces respectively; the reading unit 302 may be configured to, when there is a history content, read at least one history content in a preset storage space storing the history content to obtain a target history content, and display, by a main thread, a content interaction page including the target history content; an obtaining unit 303, configured to obtain updated content corresponding to the target historical content when it is detected that there is an update of the target historical content in the content interaction page; the determining unit 304 may be configured to generate content storage information corresponding to the updated content through the main thread, and determine a content storage thread corresponding to the updated content according to the content storage information; the storage unit 305 may be configured to store the updated content to a preset storage space synchronously through a content storage thread. According to the method and the device, the historical contents can be queried in at least two preset storage spaces, so that when the historical contents exist in the preset storage spaces, the target historical contents are obtained, and the main thread displays a content interaction page comprising the target historical contents, so that the availability and reliability of the historical contents stored in the preset storage spaces can be improved; after the content interaction page is displayed, when the fact that the target historical content in the content interaction page is updated is detected, under the condition that the display of the content interaction page by a main thread is not interfered, the updated content corresponding to the target historical content is synchronously stored into at least two preset storage spaces by using an independent content storage thread outside the main thread, so that the clamping of the content interaction page can be reduced, and the storage efficiency of the updated content is improved.
The embodiment of the application also provides an electronic device, as shown in fig. 9, which shows a schematic structural diagram of the electronic device according to the embodiment of the application, specifically:
The electronic device may include one or more processing cores 'processors 401, one or more computer-readable storage media's memory 402, power supply 403, and input unit 404, among other components. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 9 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
The processor 401 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, etc., and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device, etc. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, preferably the power supply 403 may be logically connected to the processor 401 by a power management system, so that functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 403 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may further comprise an input unit 404, which input unit 404 may be used for receiving input digital or character information and generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 401 in the electronic device loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 executes the application programs stored in the memory 402, so as to implement various functions as follows:
Acquiring a page display request containing a content identifier, and respectively inquiring historical content corresponding to the content identifier in at least two preset storage spaces based on the page display request; when the history content exists, reading at least one history content in a preset storage space for storing the history content to obtain target history content, and displaying a content interaction page comprising the target history content through a main thread; when the fact that the target historical content in the content interaction page is updated is detected, updated content corresponding to the target historical content is obtained; generating content storage information corresponding to updated content through a main thread, and determining a content storage thread corresponding to the updated content according to the content storage information; and synchronously storing the updated content to a preset storage space through a content storage thread.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of the various methods of the above embodiments may be performed by a computer program, or by computer program control related hardware, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a computer-readable storage medium in which a computer program is stored, the computer program being capable of being loaded by a processor to perform any of the content processing methods provided by the embodiment of the present application.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Because the instructions stored in the computer readable storage medium may execute the steps in any content processing method provided by the embodiments of the present application, the beneficial effects that any content processing method provided by the embodiments of the present application can be achieved, which are detailed in the previous embodiments and are not described herein.
Wherein according to an aspect of the application, a computer program product or a computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the electronic device to perform the methods provided in the various alternative implementations provided by the above embodiments.
The foregoing has described in detail a content processing method, apparatus, electronic device, storage medium and program product provided by embodiments of the present application, and specific examples are applied to illustrate the principles and embodiments of the present application, and the above description of the embodiments is only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will vary in the specific embodiments and application scope according to the ideas of the present application, the present description should not be construed as limiting the present application in summary.

Claims (13)

1. A content processing method, applied to a terminal, comprising:
Acquiring a page display request containing a content identifier, and simultaneously respectively inquiring historical content corresponding to the content identifier from at least two preset storage spaces based on the page display request through a main thread;
Determining, by the main thread, at least one target storage space in which the history content exists in the preset storage space when the history content exists; reading at least two historical contents and content attribute information corresponding to the historical contents from the target storage space; determining a display priority of the history content based on the content attribute information; extracting target historical content from the historical content according to the display priority, and displaying a content interaction page comprising the target historical content through a main thread, wherein the historical content comprises historical contents respectively stored in different preset storage spaces, the preset storage spaces comprise a local storage space in the terminal and a remote storage space in a server, and the target historical content comprises the historical content of the local storage space or the historical content of the remote storage space;
Obtaining a detection result through a content update event corresponding to the target historical content in the content interaction page by a main line Cheng Jiance, wherein the content update event is an event determined when a content update operation for the target historical content in the content interaction page is detected;
Determining that the target historical content is updated when the content update event is detected by the main thread;
When the content update event is not detected through the main thread, determining that the target historical content is not updated;
when the main thread detects that the target historical content in the content interaction page is updated, updated content corresponding to the target historical content is detected through the main thread Cheng Huoqu;
generating content storage information corresponding to the updated content through the main thread, and determining a content storage thread corresponding to the updated content according to the content storage information;
And synchronously storing the updated content to the local storage space and the remote storage space through the content storage thread.
2. The content processing method according to claim 1, wherein the target storage space includes a local storage space and a remote storage space corresponding to the server; the reading at least two historical contents and content attribute information corresponding to the historical contents from the target storage space includes:
Reading local history content and local content attribute information corresponding to the local history content from the local storage space;
Acquiring remote history content and remote content attribute information corresponding to the remote history content from the remote storage space through the server;
The local historical content and the remote historical content are taken as the historical content, and the local content attribute information and the remote content attribute information are taken as content attribute information.
3. The content processing method according to claim 1, wherein the history content includes local history content and remote history content, and the content attribute information includes local content attribute information and remote content attribute information; the determining, based on the content attribute information, a display priority of the historical content includes:
Comparing the local content attribute information with the remote content attribute information to determine the display priority of the local content attribute information and the remote content attribute information;
The extracting the target historical content from the historical content according to the display priority comprises the following steps:
When the local content attribute information is prioritized over the remote content attribute information, taking the local content attribute information as the target historical content;
When the remote content attribute information is prioritized over the local content attribute information, the remote content attribute information is regarded as the target history content.
4. The content processing method according to claim 1, wherein the preset storage space includes a local storage space and a remote storage space corresponding to the server; the step of synchronously storing the updated content to the preset storage space through the content storage thread comprises the following steps:
Preprocessing the updated content through the content storage thread to obtain preprocessed content;
and storing the preprocessed content to the local storage space, and sending the preprocessed content to the server, so that the server stores the preprocessed content in the remote storage space.
5. The content processing method according to claim 4, wherein the storing the preprocessed content to the local storage space comprises:
detecting the historical content corresponding to the updated content in the local storage space;
When the history content is detected, replacing the history content of the local storage space with the preprocessed content;
and when the history content is not detected, storing the preprocessed content into the local storage space.
6. The content processing method according to claim 1, wherein the detecting, by the main thread, a content update event corresponding to a target history content in the content interaction page, to obtain a detection result includes:
detecting, by the main thread, an update operation for target historical content in the content interaction page;
When an updating operation is detected, determining that the detection result is that the content updating event is detected;
and when the updating operation is not detected, determining that the detection result is that the content updating event is not detected.
7. The content processing method according to claim 1, wherein the method further comprises, based on the page display request, after at least two preset storage spaces query for the history content corresponding to the content identifier, respectively:
when the history content does not exist, displaying a candidate content interaction page through the main thread based on the page display request, wherein the candidate content interaction page comprises a content editing area;
generating target content in response to an input operation for the content editing area;
and synchronously storing the target content to the preset storage space through the content storage thread.
8. The content processing method according to claim 1, wherein the acquiring the page display request containing the content identification includes:
Displaying an initial content interaction page, wherein the initial content interaction page comprises a content display control;
and responding to clicking operation for the content display control, and acquiring a page display request containing the content identifier.
9. The content processing method according to claim 1, wherein the preset storage space includes a local storage space and a remote storage space of a server; based on the page display request, respectively inquiring historical content corresponding to the content identifier in at least two preset storage spaces, wherein the method comprises the following steps:
Based on a page display request, respectively inquiring historical content corresponding to the content identifier in each local storage space;
And sending a page display request to the server so as to inquire the remote storage space of the historical content corresponding to the content identifier based on the page display request through the server.
10. A content processing apparatus, characterized by being applied to a terminal, comprising:
the query unit is used for acquiring a page display request containing a content identifier, and simultaneously respectively querying at least two preset storage spaces for historical content corresponding to the content identifier based on the page display request through a main thread;
A reading unit configured to determine, when the history content exists, at least one target storage space in which the history content exists, from among the preset storage spaces, through the main thread; reading at least two historical contents and content attribute information corresponding to the historical contents from the target storage space; determining a display priority of the history content based on the content attribute information; extracting target historical content from the historical content according to the display priority, and displaying a content interaction page comprising the target historical content through a main thread, wherein the historical content comprises historical contents respectively stored in different preset storage spaces; the preset storage space comprises a local storage space in the terminal and a remote storage space in the server, wherein the target historical content comprises the historical content of the local storage space or the historical content of the remote storage space;
The acquisition unit is used for acquiring a detection result through a content update event corresponding to the target historical content in the content interaction page by the main line Cheng Jiance; determining that the target historical content is updated when the content update event is detected by the main thread; when the content update event is not detected through the main thread, determining that the target historical content is not updated; when the main thread detects that the target historical content in the content interaction page is updated, the updated content corresponding to the target historical content is detected through the main thread Cheng Huoqu, wherein the content update event is an event determined when a content update operation for the target historical content in the content interaction page is detected;
The determining unit is used for generating content storage information corresponding to the updated content through the main thread and determining the content storage thread corresponding to the updated content according to the content storage information;
and the storage unit is used for synchronously storing the updated content to the local storage space and the remote storage space through the content storage thread.
11. An electronic device comprising a processor and a memory, the memory storing an application, the processor being configured to run the application in the memory to perform the steps in the content processing method of any one of claims 1 to 9.
12. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded by a processor for performing the content processing method of any one of claims 1 to 9.
13. A computer program product, characterized in that the computer program product stores a computer program adapted to be loaded by a processor for performing the content processing method of any of claims 1 to 9.
CN202311428715.2A 2023-10-31 2023-10-31 Content processing method, device, electronic apparatus, storage medium, and program product Active CN117171419B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311428715.2A CN117171419B (en) 2023-10-31 2023-10-31 Content processing method, device, electronic apparatus, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311428715.2A CN117171419B (en) 2023-10-31 2023-10-31 Content processing method, device, electronic apparatus, storage medium, and program product

Publications (2)

Publication Number Publication Date
CN117171419A CN117171419A (en) 2023-12-05
CN117171419B true CN117171419B (en) 2024-04-30

Family

ID=88939716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311428715.2A Active CN117171419B (en) 2023-10-31 2023-10-31 Content processing method, device, electronic apparatus, storage medium, and program product

Country Status (1)

Country Link
CN (1) CN117171419B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6163779A (en) * 1997-09-29 2000-12-19 International Business Machines Corporation Method of saving a web page to a local hard drive to enable client-side browsing
CN110457614A (en) * 2019-07-03 2019-11-15 南方电网数字电网研究院有限公司 Reduce data increment update method, device and the computer equipment of Data Concurrent amount
CN112799948A (en) * 2021-02-03 2021-05-14 网易(杭州)网络有限公司 Webpage data processing method and device, electronic equipment and storage medium
CN112905920A (en) * 2019-12-04 2021-06-04 腾讯科技(深圳)有限公司 Page display method and device
CN113032078A (en) * 2021-03-30 2021-06-25 深圳市中科明望通信软件有限公司 Page display method and device, electronic equipment and computer readable storage medium
CN113761054A (en) * 2021-01-22 2021-12-07 北京沃东天骏信息技术有限公司 Data calling method and device, electronic equipment and storage medium
CN114117280A (en) * 2021-11-30 2022-03-01 平安壹钱包电子商务有限公司 Page static resource using method and device, terminal equipment and storage medium
CN116842298A (en) * 2023-07-27 2023-10-03 山石网科通信技术股份有限公司 Data read-write management method and device, storage medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764682B (en) * 2018-07-27 2022-09-30 北京京东尚科信息技术有限公司 Page control method, page control device and computer-readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6163779A (en) * 1997-09-29 2000-12-19 International Business Machines Corporation Method of saving a web page to a local hard drive to enable client-side browsing
CN110457614A (en) * 2019-07-03 2019-11-15 南方电网数字电网研究院有限公司 Reduce data increment update method, device and the computer equipment of Data Concurrent amount
CN112905920A (en) * 2019-12-04 2021-06-04 腾讯科技(深圳)有限公司 Page display method and device
CN113761054A (en) * 2021-01-22 2021-12-07 北京沃东天骏信息技术有限公司 Data calling method and device, electronic equipment and storage medium
CN112799948A (en) * 2021-02-03 2021-05-14 网易(杭州)网络有限公司 Webpage data processing method and device, electronic equipment and storage medium
CN113032078A (en) * 2021-03-30 2021-06-25 深圳市中科明望通信软件有限公司 Page display method and device, electronic equipment and computer readable storage medium
CN114117280A (en) * 2021-11-30 2022-03-01 平安壹钱包电子商务有限公司 Page static resource using method and device, terminal equipment and storage medium
CN116842298A (en) * 2023-07-27 2023-10-03 山石网科通信技术股份有限公司 Data read-write management method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN117171419A (en) 2023-12-05

Similar Documents

Publication Publication Date Title
US9785664B2 (en) Gathering transaction data associated with locally stored data files
CN109739815B (en) File processing method, system, device, equipment and storage medium
CN107992537B (en) Service attribute transmission method, device, computer equipment and storage medium
US9075722B2 (en) Clustered and highly-available wide-area write-through file system cache
CN110784498B (en) Personalized data disaster tolerance method and device
CN108491163B (en) Big data processing method and device and storage medium
CN112231108A (en) Task processing method and device, computer readable storage medium and server
CN109766317B (en) File deletion method, device, equipment and storage medium
CN112988777B (en) Object processing method and device, computer equipment and storage medium
CN113986936A (en) Data processing method and device, electronic equipment and storage medium
CN117171419B (en) Content processing method, device, electronic apparatus, storage medium, and program product
CN111753141B (en) Data management method and related equipment
CN108959548B (en) Service request processing method and device
CN115098537B (en) Transaction execution method and device, computing equipment and storage medium
CN114416689A (en) Data migration method and device, computer equipment and storage medium
CN113806309A (en) Metadata deleting method, system, terminal and storage medium based on distributed lock
CN115113989A (en) Transaction execution method and device, computing equipment and storage medium
CN116893834B (en) Load updating method, device, system, electronic equipment and readable storage medium
US20210294676A1 (en) Data consumer api for data delivered via message broker
CN117193671B (en) Data processing method, apparatus, computer device, and computer readable storage medium
CN114615287B (en) File backup method and device, computer equipment and storage medium
US11868800B1 (en) System and method for enhancing content collaboration by conflict detection and resolution in a hybrid cloud cache
CN117407077A (en) Configuration editing method and device, storage medium and electronic equipment
JPH07175641A (en) Distributed program development integration update managing system
CN116414772A (en) Data dump method, device, equipment and storage 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