Website data updating method, device and equipment and computer medium
By monitoring the website content and dynamically updating the metadata tags, the problem that traditional SEO methods cannot respond to website changes in real time is solved, and the website's ranking and visibility in search engines is improved, and it is suitable for dynamically changing Web applications.
Patent Information
- Application Number
- CN202411427221.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-10-12
AI Technical Summary
Traditional SEO methods rely on static HTML elements and server configuration, and cannot respond to dynamic changes in website content in real time, resulting in a decline in the ranking of the website in search engines, affecting user search results and traffic.
By monitoring the target website content, generating and updating metadata tags, ensure that search engines use the latest content information and dynamically update web page files to improve search engine rankings.
It has achieved the improvement of the website's ranking in search engine organic search results, increased the visibility and traffic of the website, and is especially suitable for modern web applications with rich content and dynamic changes, avoiding the problem of ranking decline caused by outdated metadata tags.
Smart Images

Figure CN119226590A_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, device, equipment and computer-readable medium. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
[0003] Search Engine Optimization (SEO) is an Internet marketing strategy that aims to improve the ranking of a website in the search engine's natural (non-paid) search results by understanding and applying the working principles and preferences of search engines. The goal of SEO is to make the website more easily discovered by search engines and to make the website appear at the top of the 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, and often cannot respond to dynamic changes in website content in real time, especially on social media, news sites, and video platforms. Since their content is updated frequently and hot topics change rapidly, if the website's SEO information is not updated in time, search engines may continue to use outdated information for indexing, causing the website's ranking in search engines to drop, 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] Multiple 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 website data updating method is provided, wherein the method comprises:
[0008] Monitor the content of the target website;
[0009] If it is monitored 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;
[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, for generating a metadata tag of the target website according to the changed website content if a content change of the target website is detected, 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;
[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, the 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 so that the at least one processor can execute 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 is monitored to have content changes, 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 when the user searches for keywords related to the website content, ensure that the website can appear at the forefront of the search results, thereby increasing the visibility and traffic of the website, especially for modern Web applications with rich content and dynamic changes, the method can respond to changes in the website content in real time, avoid the problem of ranking decline in the search engine 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 the description 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 paying any creative labor.
[0022] Other features, objects and advantages of the present application will become more apparent by 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] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work 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 (CPU), input / output interface, network interface and memory.
[0029] The 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. The memory is an example of a computer-readable medium.
[0030] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer program instructions, data structures, modules of programs 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, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0031] In view of the problem that the website SEO data existing in the prior art that relies on static HTML elements and server configuration for search engine optimization cannot be dynamically updated in real time in response to the dynamic changes of website content, thereby causing the website ranking in the search engine to drop due to outdated website SEO data, the embodiment of the present application provides a website data updating method, device, equipment and computer-readable storage medium for dynamically and timely updating website SEO data, which monitors the content of a target website. If it is monitored that the content of the target website 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 for search engines to index and retrieve, 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 website content, thereby improving the ranking of the website in the search engine's natural search results. Among them, by dynamically updating metadata tags, the present application scheme 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 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, 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, device, equipment and computer-readable storage medium provided in the present 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, tablet computers, 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 sets. 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. The method at least includes the following processing steps:
[0035] Step S101, monitoring the content of the target website.
[0036] The target website is a website that needs SEO. Exemplarily, the target website can be any one of a website and a webpage. Exemplarily, the target website can also be replaced by a target application (Application, APP), that is, the application is optimized using the search engine optimization method provided by this application. Exemplarily, the target website can be a website, or a main website and several sub-websites.
[0037] One of the purposes of this step is to monitor the content changes of the target website in real time through specific technical means, such as using front-end programming technology, such as MutationObserver API in JavaScript or other DOM (Document Object Model) monitoring technology to capture changes in any DOM elements on the page. By monitoring changes in DOM elements, the system can capture any changes in the website content in real time, thereby ensuring that it can respond immediately when the content changes.
[0038] In the specific implementation of this step, the content monitoring function can be implemented by integrating JavaScript scripts in the target website. 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 can trigger 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 the metadata tags that need to be updated. In addition, 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 monitored 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, and 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 content information based on the new content when changes are detected in the target website content. The metadata tags are mainly used to describe the target website content information and are used by search engines for indexing and retrieval, thereby ensuring that the search engine 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 in the content of the target website are detected, the latest content description information can be extracted through front-end technologies such as JavaScript. For example, DOM operations can be used to read 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 the search engine 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 up to date, thereby ensuring that search engines can use the latest metadata tags when indexing and retrieving web pages, thereby improving the website's ranking in the search engine's natural search results.
[0045] When this step is implemented, after generating new metadata tags, the web page files of the target website can be updated through DOM (Document Object Model) operations, such as using JavaScript code to operate DOM, inserting 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 above-mentioned website data updating method provided in the embodiment of the present application monitors the content of the target website. If the target website is monitored to have content changes, 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. Then, according to the newly generated metadata tag, the web page file of the target website is updated, so that the content changes of the target website can be dynamically monitored, and 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 present application scheme can make the website easier to be discovered by the search engine, and when the user searches for keywords related to the website content, ensure that the website can appear at the forefront of the search results, thereby increasing the visibility and traffic of the website, especially for modern Web applications with rich content and dynamic changes. The 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.
[0047] In some modified implementations, 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] Among them, Document Object Model (DOM) is a set of standard models that define web documents. It describes the logical structure of documents and how to access and operate the various components in documents through programming languages such as JavaScript. The DOM tree is a tree structure composed of nodes, including element nodes, attribute nodes, text nodes, etc. DOM events are events that occur in the DOM tree, such as clicks, inputs, changes, etc.
[0050] One of the purposes of this implementation 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 the specific implementation of this embodiment, JavaScript scripts can be installed in the service to monitor DOM content change events. 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, which can trigger 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 the metadata tags that need to be updated. In addition, other front-end technologies, such as event delegation, can be combined to enhance the flexibility and accuracy of content monitoring.
[0052] This implementation method 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. This allows it to 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 according to 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 implementation is to ensure that metadata tags can be dynamically generated according to 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 a new metadata tag 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 implementation method extracts content description information through DOM and generates metadata tags, which can have the following technical effects:
[0059] First, as a front-end technology, DOM provides powerful page element access and manipulation capabilities. Through DOM, it is possible to accurately locate elements on the page that contain information such as titles, descriptions, and keywords. This means that the system can immediately identify these changes when the content changes 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 through a DOM selector (such as document.querySelector) and extract the latest title and description text from it.
[0060] Secondly, the selection and operation capabilities of DOM enable the system to flexibly handle a variety of different web page structures. Even for complex single-page applications (SPA) or dynamically loaded content, DOM can capture content changes in real time by monitoring DOM tree change events (such as MutationObserver API). Therefore, no matter how dynamically the website content changes, the system can generate new metadata tags in real time through DOM operations to ensure that search engines use the latest information when indexing and retrieving.
[0061] Again, the operation of generating metadata tags through DOM is very efficient. The system can directly generate new metadata tags on the client side and insert them into the header of the web page file through DOM operations to replace the original metadata tags. This method reduces the pressure on the server side because the task of updating metadata tags is completed on the client side, and the server only needs to respond to necessary requests. At the same time, this method also speeds up the update of metadata tags because DOM operations can be completed within milliseconds.
[0062] Finally, generating metadata tags through DOM can improve the SEO performance of the website. When search engine crawlers visit a web page, they read the metadata tags in the web page to determine the relevance and importance of the web page. By dynamically generating metadata tags through DOM, the system can ensure that the search engine crawler can obtain the latest content description information every time it visits the web page, thereby improving the ranking of the web page in the search engine. For example, when a news website publishes a new report, 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] The document object model operation refers to modifying or operating the elements in the DOM tree through technologies such as JavaScript to achieve the purpose of updating the content of the web page.
[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 insert the newly generated metadata tag into the header of the web page file of the target website through DOM operation to replace the old metadata tag. Specifically, when the system generates a new metadata tag, DOM operation 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 implementation, since DOM operations are highly flexible and real-time and can be completed within milliseconds, it is possible to 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 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 that the website status information has changed, generating an accessibility rule for the target website according to the changed website status information, wherein the accessibility rule is 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] Among them, website status information can include operational status information and content status information. The operational status information can cover indicators such as the website's indexing strategy, crawler frequency, and server load, while the content status information involves information such as page content, page type, and dynamic content. Accessibility rules refer to the rules used to control search engines' access rights to websites, which are usually defined through accessibility configuration files (such as robots.txt files).
[0074] One of the purposes of this implementation is to dynamically adjust the search engine's access rights according to the state changes of the target website, thereby optimizing the search engine's indexing and retrieval behavior of the website.
[0075] In the specific implementation of this embodiment, the website status information of the target website can be detected through periodic tasks or timers according to a preset detection cycle. For example, the website's indexing strategy, crawler frequency, server load and other operational status information, 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 not be indexed, 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 access to certain pages, thereby reducing the pressure on the server. On the contrary, 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 access 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 content and dynamic changes, this embodiment can respond to changes in website status in real time, avoid search engine indexing problems caused by outdated access permission rules, and 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 usually loaded dynamically through JavaScript, search engines will have difficulty in crawling these dynamic contents because they can usually only parse static HTML pages. In addition, when the website content changes, if the metadata tags (such as titles, descriptions, and keywords) are not updated in time, 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] Acquire the dynamic page content of the single page application, and generate 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 the corresponding static snapshot page files, respectively, wherein the static snapshot page files are designated in the accessibility configuration file as replacing the single page application for search engine access.
[0083] Among them, Single Page Application (SPA) is a web application architecture that does not reload the entire web page when users interact with the application, but implements the page's functionality by dynamically updating part of the content. This architecture usually relies on JavaScript to dynamically load content, which poses a challenge to search engine indexing because search engine crawlers usually 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] In the specific implementation of this embodiment, the dynamic page content of the single-page application can be obtained through crawler technology or pre-rendering tools, and multiple static snapshot pages are generated based on these contents. These static snapshot pages contain dynamically loaded content, so that the search engine crawler can correctly index these pages. Then, 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 headers of their corresponding static snapshot page files. These static snapshot page files are specified as alternative single-page applications in the accessibility configuration file (such as robots.txt) 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] In this embodiment, by obtaining the dynamic page content of the single-page application and generating multiple static snapshot pages, the system can ensure that the search engine uses the static snapshot page containing the latest content when indexing and retrieving the website content. For example, when the content of a page in the single-page application changes, the system can immediately generate a new static snapshot page and 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 the search engine can correctly index and retrieve the content of the single-page application, thereby improving the ranking of the website in the search engine's natural search results, and making the website easier to be discovered by the search engine, ensuring that the website can appear at the forefront of the search results, thereby increasing the visibility and traffic of the website. In particular, 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 problems 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] Among them, the Content Management System (CMS) is an application that helps users create, manage and publish digital content. CMS usually includes functions such as editing, reviewing and publishing, allowing users to create and manage website content without having to have a deep understanding of Web technology. JavaScript scripts are a widely used front-end programming language that can be embedded in web pages to implement functions such as dynamic content generation and page interaction.
[0089] One of the purposes of this embodiment is to implement website data updates by integrating JavaScript scripts in the content management system, so that the content management system can be used to 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 natural search results.
[0090] When the present embodiment is implemented, a JavaScript script 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] In this embodiment, by integrating a JavaScript script in a content management system to execute a website data update method, the content management system can be used 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 visibility and traffic of the website. 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 in conjunction with several specific examples. The description of the above implementation methods can be understood with reference to the contents of the following specific examples. It should be noted that in the following exemplary description, although some words have changed, this does not affect the expression of their meanings. The following description will provide a correspondence description of some words with the words in the previous embodiment description. The corresponding relationship expressed by the correspondence description can include both an equivalent relationship and a superior and subordinate relationship. Those skilled in the art can understand it in combination with actual conditions.
[0093] Specific example 1:
[0094] You can dynamically update the metadata tags by following the steps below:
[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, removal, and modification of properties or data of nodes.
[0097] S12. When a content change event is detected, new metadata tags Meta Tags are dynamically generated, including updated title, description, and keywords.
[0098] For example, when a DOM change is detected, the logic of 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. Through DOM operation, the newly generated Meta Tags are inserted into the head of the HTML (ie, the web page file) to replace the old metadata tags.
[0100] For example, use DOM manipulation 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 accessibility configuration file Robot.txt can be achieved by following the steps below:
[0103] In a dynamic website, the robots.txt file is used to tell search engines which pages can be crawled and which pages should be blocked. As the website content is constantly updated, the content of robots.txt needs to be adjusted dynamically in order to more accurately control the search engine's 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] In order to automate the crawlability control of the website, a JavaScript function can be developed that generates new robots.txt rules based on the current structure and content of the website. This function first analyzes the website status information of the website, 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 easy 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 changes are detected, the script will call the above function to regenerate 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 (SPA), traditional SEO methods may not be enough for search engines to fully understand the content and structure of the page, because these applications usually 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 SPA can be significantly improved.
[0113] Specific steps:
[0114] S31. For single-page applications (SPA), 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 these data into HTML templates on the server side. The prerendering tool will generate a series of static HTML snapshot files (ie, static snapshot page files) during the build process.
[0117] S32. Dynamically generate metadata tags Meta Tags for each page or state, and insert them into the header of HTML (i.e., 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 configuration files, static snapshot page files are provided to search engine crawlers while maintaining the dynamic interactivity of user access.
[0120] Specific example 4: Dynamic SEO optimization can be achieved in combination with the 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 in CMS to automatically generate MetaTags and adjust Robot.txt based on content updates.
[0124] S42. Provides 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 the integrated JavaScript module.
[0126] Based on the same inventive concept, a website data update device is also provided in the 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 the 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 may refer 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 for monitoring the content of the target website;
[0128] The metadata tag generation module 102 is used to generate a metadata tag of the target website according to the changed website content if it is detected that the target website has a content change, 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;
[0129] The metadata tag updating module 103 is used 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 modified implementations, 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 a keyword;
[0134] The metadata tag generating unit is used 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, so as to update the web page file.
[0137] In some modified implementations, the device may further include:
[0138] A website status detection module, used 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, for generating an accessibility rule for the target website according to the changed website status information after detecting a change in the website status information, wherein the accessibility rule is used to indicate the search engine's access rights to the target website;
[0140] The accessibility profile updating module is used 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 generation unit, used 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, used 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 replacing the single page application for search engine access.
[0147] In some modified implementations, 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, and the method corresponding to the electronic device may be the website data update method in the aforementioned embodiment, and the principle of solving the problem is similar to that of the method. The electronic device provided in an embodiment of the present application includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the website data update 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 through a network, or may be an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, 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 sets, which can be used to implement some processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[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, and the electronic device 1200 includes a central processing unit (CPU, Central Processing Unit) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM, Read Only Memory) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM, Random Access Memory) 1203. In RAM 1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM1203 are connected to each other through bus 1204. Input / output (I / O, Input / Output) 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, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker, etc.; a storage section 1208 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, a semiconductor memory, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet.
[0154] In particular, the methods and / or embodiments in the embodiments of the present application may be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes 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 functions defined in the method of the present application are executed.
[0155] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application described above.
[0156] Specifically, the present embodiment may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination therewith.
[0157] Computer readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit 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 may 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 may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0160] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0161] Those skilled in the art can 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 the present 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 separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0164] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit 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, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[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 it. 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] In addition, 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 stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A website data updating method, wherein: The method comprises: Monitor the content of the target website; If it is monitored 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; The web page 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: The monitoring of the content of the target website includes: 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.
3. 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.
4. 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.
5. 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 that the website status information has changed, generating an accessibility rule for the target website according to the changed website status information, wherein the accessibility rule is 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.
6. 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: Acquire the dynamic page content of the single page application, and generate multiple static snapshot pages according to the dynamic page content; Generating a corresponding metadata tag for each of the static snapshot pages; Correspondingly, 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 the corresponding static snapshot page files, respectively, wherein the static snapshot page files are designated in the accessibility configuration file as replacing the single page application for search engine access.
7. The website data updating method according to any one of claims 1 to 6, wherein: The website data updating method is executed by using a JavaScript script integrated in a content management system.
8. A website data updating device, wherein: The device comprises: Content monitoring module, used to monitor the content of the target website; A metadata tag generation module, for generating a metadata tag of the target website according to the changed website content if a content change of the target website is detected, 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; The metadata tag updating module is used to update the web page file of the target website according to the newly generated metadata tag.
9. 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 7.
10. 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 7.
Citation Information
Patent Citations
Search engine optimization method and device, electronic equipment and readable storage medium
CN114528513A
Dynamic webpage content capturing system, method and equipment and storage medium
CN118349716A
System and method for content selection for web page indexing
US20100287462A1
Client-side generation of lossless object model representations of dynamic webpages
US20240037174A1
System and method for exposing the dynamic web server-side
US8527860B1