Website data updating method, device, equipment and computer medium
By monitoring changes in website content and dynamically generating and updating metadata tags, the problem that traditional SEO methods cannot respond to dynamic changes in the website in real time is solved, thereby improving search engine rankings and website traffic.
Patent Information
- Application Number
- CN202411427221.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-10-12
AI Technical Summary
Traditional SEO methods cannot respond to dynamic changes in website content in real time, resulting in outdated website SEO data, affecting search engine rankings and website traffic.
By monitoring the content of the target website, generating and updating metadata tags, we ensure that search engines use the latest content information, including monitoring DOM changes, extracting the latest titles, descriptions and keywords, and dynamically generating and inserting metadata tags into the header of web page files.
It enables timely updating of metadata tags when website content changes, improves search engine rankings, and increases website visibility and traffic. Especially for modern web applications with rich and dynamically changing content, it responds to content changes in real time to avoid ranking drops.
Smart Images

Figure CN119226590B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a website data updating method, apparatus, device, and computer-readable medium. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the present application that are recited in the claims. Nothing herein is admitted to be prior art by virtue of its inclusion in this section.
[0003] Search Engine Optimization (SEO) is an online marketing strategy that aims to improve a website's ranking in search engines' natural (non-paid) search results by understanding and applying search engine principles and preferences. The goal of SEO is to make a website more discoverable by search engines and to appear higher in search results when users search for keywords related to the website's content, thereby increasing the website's visibility and traffic.
[0004] Traditional SEO methods rely on static HTML elements and server configurations. These methods are not flexible enough in modern web applications with rich and dynamically changing content. They often cannot respond to dynamic changes in website content in real time, especially on social media, news sites, and video platforms. Due to the frequent content updates and ever-changing hot topics, if the website's SEO information is not updated in a timely manner, search engines may continue to use outdated information for indexing, causing the website to drop in search engine rankings, affecting user search results and website traffic.
[0005] In view of the above problems, there is an urgent need to provide a technical solution that can dynamically and timely update website SEO data. Summary of the Invention
[0006] Various aspects of the present application provide a website data updating method, apparatus, device, and computer-readable storage medium for dynamically and timely updating website SEO data.
[0007] In one aspect of the present application, a method for updating website data is provided, wherein the method comprises:
[0008] Monitor the content of the target website;
[0009] If a content change of the target website is detected, a metadata tag of the target website is generated according to the changed website content, wherein the metadata tag is used to describe the content information of the target website and is used by search engines for indexing and retrieval;
[0010] The webpage file of the target website is updated according to the newly generated metadata tag.
[0011] Another aspect of the present application provides a website data updating device, wherein the device comprises:
[0012] Content monitoring module, used to monitor the content of the target website;
[0013] A metadata tag generation module is configured to generate a metadata tag for the target website based on the changed website content if a content change is detected on the target website, wherein the metadata tag is used to describe the content information of the target website and is used by search engines for indexing and retrieval;
[0014] The metadata tag updating module is used to update the web page file of the target website according to the newly generated metadata tag.
[0015] Another aspect of the present application provides an electronic device, comprising:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the website data updating method as described above.
[0019] In another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the website data updating method as described above.
[0020] In the solution provided by the embodiment of the present application, by monitoring the content of the target website, if the target website detects that the content has changed, a metadata tag of the target website is generated according to the changed website content, wherein the metadata tag is used to describe the content information of the target website and is used by the search engine for indexing and retrieval, and then the web page file of the target website is updated according to the newly generated metadata tag, so that by dynamically monitoring the content changes of the target website, new metadata tags can be generated in time when the content changes, and the web page files of the website can be updated, thereby ensuring that the search engine uses the latest metadata tags when indexing and retrieving the website content, thereby improving the ranking of the website in the search engine's natural search results. Among them, by dynamically updating the metadata tags, the solution of the present application can make the website easier to be discovered by the search engine, and ensure that the website can appear at the forefront of the search results when the user searches for keywords related to the website content, thereby increasing the visibility and traffic of the website, especially for modern web applications with rich and dynamically changing content. This method can respond to changes in website content in real time, avoid the problem of ranking decline in search engines due to outdated metadata tags, thereby effectively improving the user's search experience and the website's traffic performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0023] Figure 1 A flowchart of a website data updating method provided in one embodiment of the present application;
[0024] Figure 2 A schematic diagram of the structure of a website data updating device provided in one embodiment of the present application;
[0025] Figure 3 A schematic diagram of the structure of an electronic device suitable for implementing the solution in the embodiments of the present application;
[0026] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0027] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0028] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPUs), input / output interfaces, network interfaces and memories.
[0029] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0030] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology for information storage. The information can be computer program instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc-read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0031] In response to the problem in the prior art that website SEO data cannot be dynamically updated in response to dynamic changes in website content in real time due to the reliance on static HTML elements and server configuration for search engine optimization, thereby causing the website's ranking in search engines to drop due to outdated website SEO data, the embodiments of the present application provide a website data updating method, device, equipment and computer-readable storage medium for dynamically and timely updating website SEO data. It monitors the content of a target website. If a content change of the target website is detected, a metadata tag for the target website is generated based on the changed website content, wherein the metadata tag is used to describe the content information of the target website and is used for indexing and retrieval by a search engine. Then, based on the newly generated metadata tag, the web page file of the target website is updated. Therefore, by dynamically monitoring the content changes of the target website, new metadata tags can be generated in a timely manner when the content changes, and the web page files of the website can be updated. This can ensure that the search engine uses the latest metadata tags when indexing and retrieving website content, thereby improving the website's ranking in the search engine's natural search results. Among them, by dynamically updating metadata tags, the application solution can make the website easier to be discovered by search engines, and ensure that the website can appear at the forefront of search results when users search for keywords related to the website content, thereby increasing the website's visibility and traffic. Especially for modern Web applications with rich and dynamically changing content, this method can respond to changes in website content in real time, avoiding the problem of declining rankings in search engines due to outdated metadata tags, thereby effectively improving users' search experience and website traffic performance.
[0032] The following is an exemplary description of the website data updating method, apparatus, device, and computer-readable storage medium provided in this application.
[0033] In actual scenarios, the execution subject of the website data update method provided in the embodiment of the present application can be a user device, a network device, or a device formed by integrating a user device and a network device through a network, or it can also be an application running on the above device (such as an SEO data update software system). The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablets, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer collections. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[0034] Figure 1The following is a processing flow of a website data updating method provided by an embodiment of the present application, wherein the method includes at least the following processing steps:
[0035] Step S101: monitoring the content of a target website.
[0036] The target website is a website that needs SEO. For example, the target website can be any one of a website and a webpage. For example, the target website can also be replaced by a target application (Application, APP), that is, the search engine optimization method provided by this application is used to optimize the application. For example, the target website can be a website, or a main website and several sub-websites.
[0037] One of the goals of this step is to monitor content changes on the target website in real time through specific technical means. For example, front-end programming techniques such as the MutationObserver API in JavaScript or other DOM (Document Object Model) monitoring technologies can be used to capture changes to any DOM elements on the page. By monitoring changes to DOM elements, the system can capture any changes to the website content in real time, ensuring that it can respond immediately to any changes.
[0038] This step can be implemented by integrating JavaScript into the target website to implement content monitoring. For example, the MutationObserver API can be used to monitor changes in the DOM tree. The MutationObserver API allows developers to register an observer object that triggers a callback function when the DOM tree changes. By defining specific logic in the callback function, the system can identify which DOM elements have changed and further determine whether these changes affect metadata tags that need to be updated. Furthermore, other front-end technologies, such as event delegation, can be combined to enhance the flexibility and accuracy of content monitoring.
[0039] Step S102: if it is detected that the target website has a content change, a metadata tag of the target website is generated according to the changed website content, wherein the metadata tag is used to describe the content information of the target website and is used for indexing and retrieval by a search engine.
[0040] Meta tags refer to a series of HTML tags used to describe the content of a web page. Common metadata tags include: <title> (title),< / title> <meta name="description"> (description) and <meta name="keywords">(Keywords). These tags contain key information about the content of the web page. Search engines refer to these tags when indexing and retrieving web pages to determine the relevance and ranking of the web page.
[0041] One of the purposes of this step is to generate metadata tags describing the target website's content information based on the new content when changes are detected in the target website's content. Metadata tags are mainly used to describe the target website's content information and are used by search engines for indexing and retrieval, thereby ensuring that search engines can obtain the latest content description information, thereby improving the website's ranking in the search engine's natural search results.
[0042] When this step is implemented, when changes are detected in the content of the target website, the latest content description information can be extracted through front-end technologies such as JavaScript. For example, DOM operations can be used to read the new values of elements such as the title, description, and keywords on the page. Once this information is obtained, the system will generate new metadata tags based on the latest content description information. The generated metadata tags will contain the latest title, description, keywords and other information to ensure that search engines can obtain the most accurate content description.
[0043] Step S103: updating the webpage file of the target website according to the newly generated metadata tag.
[0044] One of the purposes of this step is to update the target website's web page files through front-end technologies such as JavaScript after generating new metadata tags to ensure that the metadata tags in the web page files are the latest, thereby ensuring that search engines can use the latest metadata tags when indexing and retrieving web pages, thereby improving the website's ranking in search engine natural search results.
[0045] In the specific implementation of this step, after generating the new metadata tags, the target website's web page files can be updated through DOM (Document Object Model) operations, such as using JavaScript code to operate the DOM and insert the newly generated metadata tags into the header area of the web page files to replace the original metadata tags. For example, when the system detects that the title, description, or keywords of the web page have changed, it will generate new metadata tags and insert these new tags into the header area of the web page files through DOM operations, thereby completing the update of the web page files.
[0046] The website data update method provided in the embodiment of the present application monitors the content of the target website. If the target website detects that the content has changed, a metadata tag of the target website is generated based on the changed website content, wherein the metadata tag is used to describe the content information of the target website and is used by the search engine for indexing and retrieval. Then, based on the newly generated metadata tag, the web page file of the target website is updated. This allows the target website to be dynamically monitored for content changes, and new metadata tags are generated in a timely manner when the content changes, and the web page files of the website are updated. This ensures that the search engine uses the latest metadata tags when indexing and retrieving the website content, thereby improving the ranking of the website in the search engine's natural search results. By dynamically updating the metadata tags, the present application solution can make the website easier to be discovered by the search engine, and ensure that the website appears at the forefront of the search results when the user searches for keywords related to the website content, thereby increasing the visibility and traffic of the website. In particular, for modern web applications with rich and dynamically changing content, this method can respond to changes in website content in real time, avoiding the problem of ranking decline in search engines due to outdated metadata tags, thereby effectively improving the user's search experience and the website's traffic performance.
[0047] In some implementation variations, monitoring the content of the target website may include:
[0048] By monitoring the content change event of the document object model corresponding to the target website, the content monitoring of the target website is achieved.
[0049] The Document Object Model (DOM) is a standard model that defines web documents. It describes the logical structure of a document and how to access and manipulate its components through programming languages like JavaScript. The DOM tree is a tree-like structure composed of nodes, including element nodes, attribute nodes, and text nodes. DOM events are events that occur within the DOM tree, such as clicks, input, and changes.
[0050] One of the purposes of this embodiment is to monitor content changes in the DOM in real time by listening to content change events of the document object model corresponding to the target website, thereby capturing any changes in page content and making corresponding responses accordingly.
[0051] In practice, this embodiment can monitor DOM content change events by installing a JavaScript script in the service. For example, the MutationObserver API can be used to monitor changes in the DOM tree. The MutationObserver API allows developers to register an observer object that triggers a callback function when the DOM tree changes. By defining specific logic in the callback function, the system can identify which DOM elements have changed and further determine whether these changes affect metadata tags that need to be updated. In addition, it can be combined with other front-end technologies, such as event delegation, to enhance the flexibility and accuracy of content monitoring.
[0052] This embodiment monitors the content of the target website by monitoring the content change events of the document object model. It can capture the changes in the website content in real time and generate new metadata tags based on the changed website content. Therefore, it can respond immediately when the content changes, generate new metadata tags, and apply them to the website's web page files.
[0053] In some modified implementations, generating the metadata tag of the target website based on the changed website content may include:
[0054] Extracting the latest content description information from the document object model corresponding to the target website, wherein the content description information may include at least one of a title, a description, and a keyword;
[0055] A new metadata tag is generated according to the latest content description information.
[0056] One of the purposes of this embodiment is to ensure that metadata tags can be dynamically generated based on the latest content changes, thereby improving the ranking of the website in the search engine's natural search results.
[0057] In the specific implementation of this embodiment, JavaScript code can be used to extract the latest content description information from the document object model corresponding to the target website. For example, a DOM selector (such as document.querySelector) can be used to select the DOM element containing the latest content description information and extract information such as title, description and keywords from it. Once this information is obtained, the system can generate new metadata tags based on the latest content description information. Specifically, the system can create a new <title>、< / title> <meta name="description"> and<metaname="keywords"> etc., and fill them with the extracted content to generate new metadata tags.
[0058] This embodiment extracts content description information through DOM and generates metadata tags, which can achieve the following technical effects:
[0059] First, as a front-end technology, DOM provides powerful capabilities for accessing and manipulating page elements. Through DOM, it's possible to accurately locate elements on a page that contain information such as titles, descriptions, and keywords. This means the system can immediately identify changes in content and extract the latest content description information. For example, when the title or description of a web page changes, the system can quickly locate the corresponding DOM element using a DOM selector (such as document.querySelector) and extract the latest title and description text from it.
[0060] Secondly, the DOM's selection and manipulation capabilities enable the system to flexibly handle a variety of different web page structures. Even for complex single-page applications (SPAs) or dynamically loaded content, the DOM can capture content changes in real time by monitoring DOM tree change events (such as the MutationObserver API). Therefore, no matter how dynamically the website content changes, the system can generate new metadata tags in real time through DOM manipulation, ensuring that search engines use the latest information during indexing and retrieval.
[0061] Thirdly, generating metadata tags through DOM is highly efficient. The system can generate new metadata tags directly on the client and insert them into the header of the web page file through DOM operations, replacing the original metadata tags. This approach reduces server-side pressure because the task of updating metadata tags is completed on the client, and the server only needs to respond to necessary requests. It also speeds up metadata tag updates because DOM operations can be completed in milliseconds.
[0062] Finally, generating metadata tags through DOM can improve a website's SEO performance. When search engine crawlers visit a web page, they read the metadata tags in the page to determine the page's relevance and importance. By dynamically generating metadata tags through DOM, the system can ensure that search engine crawlers can obtain the latest content description information every time they visit a web page, thereby improving the page's ranking in search engines. For example, when a news website publishes a new article, the system can immediately detect changes in the title, description, or keywords and generate corresponding metadata tags to ensure that the search engine can update the index information in a timely manner, so that the website can gain higher visibility in relevant search results.
[0063] In some modified implementations, updating the webpage file of the target website according to the newly generated metadata tag may include:
[0064] Through the document object model operation, the newly generated metadata tag is inserted into the header of the web page file of the target website to replace the old metadata tag, thereby realizing the update of the web page file.
[0065] Document Object Model (DOM) operations refer to modifying or manipulating elements in the DOM tree through technologies such as JavaScript to update web page content.
[0066] One of the purposes of this embodiment is to insert the newly generated metadata tag into the header of the web page file of the target website to replace the old metadata tag through the document object model operation, thereby updating the web page file.
[0067] When this embodiment is implemented, JavaScript code can be used to implement DOM operations to insert the newly generated metadata tag into the header of the web page file of the target website to replace the old metadata tag. Specifically, after the system generates a new metadata tag, DOM operations will be used to delete the old metadata tag and insert the new metadata tag into the header of the web page file. For example, the system can first find the existing metadata tag through a DOM selector (such as document.querySelectorAll) and use DOM methods (such as remove) to delete the old metadata tag. Then, the system can use DOM methods (such as createElement and appendChild) to create a new metadata tag and insert it into the header of the web page file, thereby completing the update of the web page file.
[0068] In this embodiment, since DOM operations are highly flexible and real-time and can be completed within milliseconds, it can respond to content changes in real time and immediately update metadata tags, ensuring that metadata tags can be quickly updated after content changes. Through document object model operations, newly generated metadata tags are inserted into the header of the target website's web page file to replace the old metadata tags, ensuring that the metadata tags in the web page file are always up to date.
[0069] In some implementation variations, the method may further include:
[0070] Detecting website status information of the target website according to a preset detection cycle, where the website status information may include operation status information and / or content status information;
[0071] After detecting a change in the website status information, generating an accessibility rule for the target website according to the changed website status information, the accessibility rule being used to indicate the search engine's access rights to the target website;
[0072] The accessibility profile of the target website is updated according to the newly generated accessibility rule.
[0073] Website status information can include operational status information and content status information. Operational status information can cover indicators such as the website's indexing strategy, crawler frequency, and server load, while content status information involves information such as page content, page type, and dynamic content. Accessibility rules are the rules used to control search engine access to a website, usually defined through accessibility configuration files (such as robots.txt files).
[0074] One of the purposes of this embodiment is to dynamically adjust the search engine's access rights according to the status changes of the target website, thereby optimizing the search engine's indexing and retrieval behavior of the website.
[0075] During the specific implementation of this embodiment, the website status information of the target website can be detected through a periodic task or timer according to a preset detection cycle. For example, the website's operational status information such as indexing strategy, crawler frequency and server load, as well as content status information such as page content, page type and dynamic content can be checked once every hour or every day. Once a change in the website status information is detected, new accessibility rules are generated based on the changed website status information. These rules can define which pages should be indexed and which pages should be prohibited from indexing, etc. Subsequently, the system will update the accessibility profile of the target website according to the newly generated accessibility rules to ensure that the search engine can follow the latest access permission rules.
[0076] In this embodiment, by detecting the website status information of the target website according to a preset detection cycle and generating new accessibility rules based on the changed website status information, the system can ensure that the search engine follows the latest access permission rules when indexing and retrieving website content. For example, when the server load of the website is high, the system can generate new accessibility rules to reduce the frequency of search engine visits to certain pages, thereby reducing the pressure on the server. Conversely, when the website has new content that needs to be indexed, the system can generate new accessibility rules to increase the frequency of search engine visits to these pages, thereby improving the visibility of these pages. In this way, not only can the search engine's indexing and retrieval behavior of the website be optimized, but the overall performance and user experience of the website can also be improved. Especially in modern Web applications with rich and dynamically changing content, this embodiment can respond to changes in website status in real time, avoid search engine indexing problems caused by outdated access permission rules, and thus effectively improve the user's search experience and website traffic performance.
[0077] Considering that in dynamic websites, especially those using a single-page application (SPA) architecture, content is often loaded dynamically via JavaScript, search engines have difficulty crawling such dynamic content because they can usually only parse static HTML pages. In addition, when website content changes, if metadata tags (such as titles, descriptions, and keywords) are not updated in a timely manner, search engines may continue to use outdated information for indexing, resulting in a drop in search engine rankings, affecting user experience and website traffic. In this regard, in some modified implementations, the target website is a single-page application;
[0078] Generating the metadata tag of the target website according to the changed website content may include:
[0079] Obtaining the dynamic page content of the single-page application, and generating multiple static snapshot pages according to the dynamic page content;
[0080] Generating a corresponding metadata tag for each of the static snapshot pages;
[0081] Accordingly, updating the webpage file of the target website according to the newly generated metadata tag may include:
[0082] The newly generated metadata tags are written into the headers of their corresponding static snapshot page files, respectively. The static snapshot page files are designated in the accessibility configuration file as replacing the single page application for search engine access.
[0083] A single-page application (SPA) is a web application architecture that dynamically updates portions of the page's content rather than reloading the entire page when a user interacts with it. This architecture typically relies on JavaScript to dynamically load content, which poses challenges for search engine indexing, as search engine crawlers typically only parse static HTML pages.
[0084] One of the purposes of this implementation is to solve the SEO problem of single-page applications and ensure that search engines can correctly index and retrieve the content of single-page applications.
[0085] During implementation, this embodiment can use crawler technology or pre-rendering tools to obtain the dynamic page content of a single-page application, and generate multiple static snapshot pages based on this content. These static snapshot pages contain dynamically loaded content, allowing search engine crawlers to correctly index these pages. Next, corresponding metadata tags are generated for each static snapshot page, including information such as title, description, and keywords. These metadata tags can reflect the latest page content. Finally, the newly generated metadata tags are written into the header of their corresponding static snapshot page files. These static snapshot page files are specified in the accessibility configuration file (such as robots.txt) as alternative single-page applications for search engine access, ensuring that search engines can access and index these static snapshot pages instead of only accessing the initial loading page of the SPA.
[0086] This embodiment, by obtaining the dynamic page content of a single-page application and generating multiple static snapshot pages, can ensure that search engines use static snapshot pages containing the latest content when indexing and retrieving website content. For example, when the content of a page in a single-page application changes, the system can immediately generate a new static snapshot page, update the corresponding metadata tags, and then write these new metadata tags into the header of the static snapshot page file. In this way, the system can ensure that search engines can correctly index and retrieve the content of the single-page application, thereby improving the website's ranking in search engine organic search results and making the website more discoverable by search engines, ensuring that the website appears at the top of search results, thereby increasing the website's visibility and traffic. Especially in modern web applications with rich and dynamically changing content, this embodiment can respond to changes in the content of the single-page application in real time, avoiding ranking issues caused by the search engine's inability to index dynamic content, thereby effectively improving the user's search experience and the website's traffic performance.
[0087] Based on any of the foregoing implementations, in some modified implementations, the website data updating method is executed using a JavaScript script integrated into a content management system.
[0088] A Content Management System (CMS) is an application that helps users create, manage, and publish digital content. It typically includes editing, reviewing, and publishing features, allowing users to create and manage website content without requiring in-depth knowledge of web technologies. JavaScript is a widely used front-end programming language that can be embedded in web pages to implement features such as dynamic content generation and page interactivity.
[0089] One of the purposes of this embodiment is to implement website data updates by integrating JavaScript scripts into the content management system, so that the content management system can monitor changes in website content in real time and dynamically generate and update metadata tags based on these changes, thereby improving the website's ranking in search engine organic search results.
[0090] During the specific implementation of this embodiment, JavaScript scripts can be integrated into the content management system to monitor changes in website content in real time. For example, when a user edits and publishes new content through the CMS, the integrated JavaScript script will automatically monitor changes in the content and generate new metadata tags based on the changed website content. These metadata tags include information such as title, description, and keywords, which are used to describe the key features of the web page content. After generating the new metadata tags, the JavaScript script will further operate the document object model (DOM) to insert the newly generated metadata tags into the header of the web page file, replacing the original metadata tags, thereby updating the web page file. In addition, the JavaScript script can also be used to regularly detect the status information of the website and generate accessibility rules based on this information to control the search engine's access rights to the website.
[0091] This embodiment, by integrating a JavaScript script in a content management system to execute a website data update method, can utilize the content management system to monitor changes in website content in real time, and dynamically generate and update metadata tags based on these changes. For example, when the content in the CMS changes, the integrated JavaScript script can immediately generate new metadata tags, and insert these new metadata tags into the header of the web page file through DOM operations, thereby ensuring that the search engine uses the latest metadata tags when indexing and retrieving website content. In this way, the ranking of the website in the search engine's natural search results can be improved, and the website can be made easier to be discovered by the search engine, ensuring that the website can appear at the forefront of the search results, thereby increasing the website's visibility and traffic. Especially for websites with frequently updated content, using a content management system (CMS) in combination with a dynamic SEO optimization strategy can significantly improve search rankings and user experience.
[0092] For ease of understanding, the website data updating method of the present application is further described with reference to several specific examples. The description of the above implementation methods can be understood with reference to the content of the following specific examples. It should be noted that in the following exemplary descriptions, although some of the terms have changed, this does not affect the expression of their meanings. The following description will provide a correspondence between some of the terms and the terms in the above embodiment descriptions. The corresponding relationship expressed in the correspondence description can include both an equivalent relationship and a hierarchical relationship. Those skilled in the art can understand it in light of the actual situation.
[0093] Specific example 1:
[0094] You can dynamically update metadata tags by following these steps:
[0095] S11. Use JavaScript scripts to monitor content change events of the target website.
[0096] For example, you can use the MutationObserver API to monitor changes in the Document Object Model (DOM). MutationObserver allows developers to be notified when the DOM changes, including the addition or removal of nodes, or changes to attributes or data.
[0097] S12. When a content change event is detected, new metadata tags are dynamically generated, including the updated title, description, and keywords.
[0098] For example, when a DOM change is detected, the logic for updating Meta Tags is executed, the latest title, description, and keywords are extracted from the DOM, and then new Meta Tags are generated based on the extracted data.
[0099] S13. Insert the newly generated Meta Tags into the head of the HTML (ie, web page file) through DOM operation to replace the old metadata tags.
[0100] For example, use DOM operations to update or replace existing Meta Tags, or insert newly generated Meta Tags into the HTML head when necessary.
[0101] Specific example 2:
[0102] Dynamic update of the accessibility configuration file Robot.txt can be achieved by following the steps below:
[0103] On dynamic websites, the robots.txt file is used to tell search engines which pages can be crawled and which pages should be blocked. As website content is constantly updated, the content of robots.txt needs to be adjusted dynamically to more accurately control search engine crawling behavior.
[0104] S21. Design a JavaScript function to generate new Robot.txt rules based on the current state and content of the website.
[0105] To automate the crawlability of a website, you can develop a JavaScript function that generates new robots.txt rules based on the current structure and content of the website. This function first analyzes the website's website status information, including but not limited to the indexing strategy and page metadata, to determine which pages should be visible to search engines and which should be blocked.
[0106] S22. Store the new Robot.txt rules on the server or dynamically update them through the API interface.
[0107] Updating the robots.txt file on the server can be done by writing directly to the file or using the API interface. The advantage of the latter is that it is more secure and easier to manage permissions.
[0108] S23. Use JavaScript to regularly check website status and content changes and update Robot.txt rules as needed.
[0109] To ensure that robots.txt always reflects the latest status of the website, you can set up a script that runs regularly to monitor changes in the website's structure and content. When a change is detected, the script will call the above function to regenerate the robots.txt rules and update the file on the server through the API.
[0110] Specific example three:
[0111] You can improve your SPA’s SEO by leveraging Ajax and server-side rendering (SSR):
[0112] For modern single-page applications (SPAs), traditional SEO methods may not be enough for search engines to fully understand the content and structure of the page, as these applications often rely on JavaScript to dynamically load and render content. However, by combining Ajax and server-side rendering (SSR) technology, the search engine optimization (SEO) effect of SPAs can be significantly improved.
[0113] Specific steps:
[0114] S31. For single-page applications (SPAs), use Ajax to obtain dynamic page content and generate static HTML snapshots (i.e., static snapshot pages) through server-side rendering (SSR) technology.
[0115] In SPA, dynamic content is usually loaded asynchronously through Ajax requests. In order to ensure that search engines can see the complete page content, these dynamic contents need to be pre-rendered on the server side to generate static HTML snapshots.
[0116] For example, use Ajax requests to obtain dynamic data, and then render and fill this data into the HTML template on the server side. The prerendering tool will generate a series of static HTML snapshot files (ie static snapshot page files) during the construction process.
[0117] S32. Dynamically generate metadata tags for each page or state, and insert them into the header of the HTML (i.e., the static snapshot page file) during the SSR process.
[0118] To optimize SEO, each page should have unique Meta Tags, such as title, description, and keywords. During the SSR process, these Meta Tags are dynamically generated and inserted into the HTML head.
[0119] S33. Through server configuration, such as accessibility profiles, provide static snapshot page files to search engine crawlers while maintaining dynamic interactivity for user access.
[0120] Specific example 4: Dynamic SEO optimization can be achieved by combining with a content management system (CMS):
[0121] For websites with frequently updated content, using a content management system (CMS) combined with dynamic SEO optimization strategies can significantly improve search rankings and user experience.
[0122] Specific steps:
[0123] S41. Integrate JavaScript SEO optimization module into CMS to automatically generate MetaTags and adjust Robot.txt based on content updates.
[0124] S42. Provide a CMS backend interface that allows administrators to manually configure key SEO parameters and rules.
[0125] S43.CMS automatically monitors content changes and updates SEO-related settings in real time through an integrated JavaScript module.
[0126] Based on the same inventive concept, a website data update device is also provided in an embodiment of the present application. The method corresponding to the device may be the website data update method in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The website data update device provided in an embodiment of the present application can implement the aforementioned website data update method, and the website data update device can be implemented by software, hardware, or a combination of software and hardware. For example, the website data update device may include integrated or separate functional modules or units to perform the corresponding steps in the aforementioned methods. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described below is merely illustrative. Please refer to Figure 2 , the website data updating device may include:
[0127] Content monitoring module 101, used to monitor the content of the target website;
[0128] The metadata tag generation module 102 is configured to generate a metadata tag for the target website based on the changed website content if a content change is detected on the target website. The metadata tag is used to describe the content information of the target website and is used by search engines for indexing and retrieval.
[0129] The metadata tag updating module 103 is configured to update the web page file of the target website according to the newly generated metadata tag.
[0130] In some modified implementations, the content monitoring module 101 may include:
[0131] The DOM monitoring unit is used to monitor the content of the target website by monitoring the content change event of the document object model corresponding to the target website.
[0132] In some implementation variations, the metadata tag generation module 102 may include:
[0133] a content description information extraction unit, configured to extract the latest content description information from a document object model corresponding to the target website, wherein the content description information includes at least one of a title, a description, and keywords;
[0134] The metadata tag generating unit is configured to generate a new metadata tag according to the latest content description information.
[0135] In some modified implementations, the metadata tag updating module 103 may include:
[0136] The DOM operation unit is used to insert the newly generated metadata tag into the header of the web page file of the target website to replace the old metadata tag through document object model operation, thereby updating the web page file.
[0137] In some variations, the device may further include:
[0138] A website status detection module, configured to detect website status information of the target website according to a preset detection period, wherein the website status information includes operation status information and / or content status information;
[0139] an accessibility rule generating module, configured to generate, upon detecting a change in the website status information, an accessibility rule for the target website based on the changed website status information, wherein the accessibility rule is used to indicate the search engine's access rights to the target website;
[0140] An accessibility profile updating module is configured to update the accessibility profile of the target website according to the newly generated accessibility rule.
[0141] In some modified implementations, the target website is a single-page application;
[0142] The metadata tag generation module 102 may include:
[0143] A static snapshot generating unit, configured to obtain the dynamic page content of the single-page application and generate a plurality of static snapshot pages according to the dynamic page content;
[0144] a static tag generating unit, configured to generate a corresponding metadata tag for each of the static snapshot pages;
[0145] Accordingly, the metadata tag updating module 103 may include:
[0146] The static tag writing unit is used to write the newly generated metadata tags into the header of the corresponding static snapshot page file, wherein the static snapshot page file is specified in the accessibility configuration file as a replacement for the single page application for search engine access.
[0147] In some variations, the device may further include:
[0148] The script execution module is used to drive the device to run using a JavaScript script integrated in the content management system.
[0149] The website data updating device provided in the embodiment of the present application is based on the same inventive concept as the website data updating method provided in the aforementioned embodiment of the present application and has the same beneficial effects.
[0150] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application. The method corresponding to the electronic device may be the website data updating method in the aforementioned embodiment, and the principle of solving the problem is similar to that of the aforementioned embodiment. The electronic device provided in an embodiment of the present application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the website data updating method and / or technical solution of the aforementioned multiple embodiments of the present application.
[0151] The electronic device may be a user device, or a device formed by integrating a user device and a network device via a network, or an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablets, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer collections, and can be used to implement some of the processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computers.
[0152] Figure 3 The structure of an electronic device suitable for implementing the method and / or technical solution in the embodiment of the present application is shown. The electronic device 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 into the random access memory (RAM) 1203. In RAM 1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM 1203 are connected to each other through a bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.
[0153] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, a touch screen, a microphone, an infrared sensor, and the like; an output section 1207 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, and a speaker; a storage section 1208 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, and a semiconductor memory; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 1209 performs communication processing via a network such as the Internet.
[0154] In particular, the methods and / or embodiments of the present application can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the method shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 1201, the above-mentioned functions defined in the method of the present application are performed.
[0155] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application.
[0156] Specifically, the present embodiment can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by an instruction execution system, device or device or used in combination with it.
[0157] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0158] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0159] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0160] The flow chart or block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the equipment, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code include one or more executable instructions for realizing the logical function of the specification. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs the function or operation of the specification, or can be implemented with a combination of dedicated hardware and computer instructions.
[0161] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0162] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0163] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0164] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0165] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code.
[0166] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0167] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. Terms such as "first" and "second" are used to indicate names and do not imply any particular order.
Claims
1. A website data updating method, wherein: The method comprises: Monitoring the content of the target website; wherein, monitoring the content of the target website includes: monitoring the content change event of the document object model corresponding to the target website, thereby monitoring the content of the target website; If a content change of the target website is detected, a metadata tag of the target website is generated according to the changed website content, wherein the metadata tag is used to describe the content information of the target website and is used by search engines for indexing and retrieval; The webpage file of the target website is updated according to the newly generated metadata tag.
2. The website data updating method according to claim 1, wherein: Generating the metadata tag of the target website according to the changed website content includes: Extracting the latest content description information from the document object model corresponding to the target website, wherein the content description information includes at least one of a title, a description, and a keyword; A new metadata tag is generated according to the latest content description information.
3. The website data updating method according to claim 1, wherein: The updating of the webpage file of the target website according to the newly generated metadata tag includes: Through the document object model operation, the newly generated metadata tag is inserted into the header of the web page file of the target website to replace the old metadata tag, thereby realizing the update of the web page file.
4. The website data updating method according to claim 1, wherein: The method further comprises: Detecting website status information of the target website according to a preset detection cycle, wherein the website status information includes operation status information and / or content status information; After detecting a change in the website status information, generating an accessibility rule for the target website according to the changed website status information, the accessibility rule being used to indicate the search engine's access rights to the target website; The accessibility profile of the target website is updated according to the newly generated accessibility rule.
5. The website data updating method according to claim 1, wherein: The target website is a single-page application; Generating the metadata tag of the target website according to the changed website content includes: Obtaining the dynamic page content of the single-page application, and generating multiple static snapshot pages according to the dynamic page content; Generating a corresponding metadata tag for each of the static snapshot pages; Accordingly, updating the webpage file of the target website according to the newly generated metadata tag includes: The newly generated metadata tags are written into the headers of their corresponding static snapshot page files, respectively. The static snapshot page files are designated in the accessibility configuration file as replacing the single page application for search engine access.
6. The website data updating method according to any one of claims 1 to 5, wherein: The website data updating method is executed by using a JavaScript script integrated into a content management system.
7. A website data updating device, wherein: The device comprises: The content monitoring module is used to monitor the content of the target website; wherein, the monitoring of the content of the target website includes: monitoring the content change event of the document object model corresponding to the target website, thereby monitoring the content of the target website; A metadata tag generation module is configured to generate a metadata tag for the target website based on the changed website content if a content change is detected on the target website, wherein the metadata tag is used to describe the content information of the target website and is used by search engines for indexing and retrieval; The metadata tag updating module is used to update the web page file of the target website according to the newly generated metadata tag.
8. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
System and method for content selection for web page indexing
US20100287462A1
System and method for exposing the dynamic web server-side
US8527860B1