Webpage static publishing method and device, computer equipment, readable storage medium and program product
Through the automated static web page publishing method in the content management system, the problem of relying on professionals during the content update process of traditional static websites is solved, the release efficiency and accuracy are improved, and the performance and security of the website are improved.
Patent Information
- Application Number
- CN202411902312.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-01
AI Technical Summary
During the content update process of traditional static websites, it is necessary to rely on programmers with front-end development skills to support it. It is difficult for ordinary operators to directly operate and manage website content, resulting in extended content update cycle, increased labor costs and inefficient releases.
Provide a static web page publishing method, including responding to user's saving and publishing operation instructions in the content management system, automatically obtaining and storing web pages to be published, executing approval processes, performing static processing, and publishing static web page files to preset server nodes.
Through automated content preservation, approval, static processing and publishing processes, operators' dependence on front-end development skills is reduced, management is simplified, content release efficiency and accuracy, and website performance and security are improved.
Smart Images

Figure CN119739939A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for statically publishing a web page. Background Art
[0002] With the rapid development of the Internet, static websites are widely used in scenarios such as corporate official websites, product display pages, and content management systems due to their advantages such as fast loading speed and high security. However, the content publishing and updating process of static websites faces great challenges. The content update of traditional static websites usually requires the support of programmers with front-end development skills. It is difficult for ordinary operators to directly operate and manage the website content. This high-threshold operation mode significantly prolongs the content update cycle and increases labor costs, making the content publishing efficiency of static websites low. Summary of the invention
[0003] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for static web page publishing that can improve the efficiency of static web page publishing in response to the above technical problems.
[0004] In a first aspect, the present application provides a method for statically publishing a web page, comprising:
[0005] In response to a save operation instruction triggered by a user in a content management system, acquiring and storing a webpage to be published edited by the user in the content management system;
[0006] In response to a publishing operation instruction triggered by the user in the content management system, executing an approval process for the web page to be published;
[0007] When the approval result of the approval process indicates that the approval is passed, static processing is performed on the web page to be published to obtain a static web page file of the web page to be published;
[0008] The static web page file is published to a preset server node.
[0009] In one embodiment, the static processing of the web page to be published to obtain a static web page file of the web page to be published includes:
[0010] Pre-rendering the dynamic content in the web page to be published to generate a corresponding static web page structure file;
[0011] Extracting the resource files referenced in the webpage to be published, and associating the paths of the static webpage structure files with the resource files according to a preset rule, to obtain the static webpage structure files after resource association;
[0012] Merging, compressing and updating the resource files to obtain updated resource files;
[0013] The static webpage structure file associated with the resource and the updated resource file are packaged to obtain a file package of the static webpage file.
[0014] In one embodiment, the obtaining and storing the webpage to be published edited by the user in the content management system includes:
[0015] Acquire the web page to be published, and assign a corresponding version identifier to the web page to be published;
[0016] The web page to be published and the corresponding version identifier are stored.
[0017] In one embodiment, the method further comprises:
[0018] In response to an instruction to compare any two versions of a web page, obtaining the any two versions of the web pages to be published;
[0019] The two versions of the web pages to be published are displayed, and the difference between the two versions of the web pages to be published is highlighted.
[0020] In one embodiment, the step of executing the approval process for the web page to be published includes:
[0021] In the preset approval node, displaying a preview page of the web page to be published;
[0022] Obtaining the approval operation instruction of the approval personnel corresponding to the approval node for the web page to be published;
[0023] In the case where the approval operation instruction is an approval pass instruction, determining that the approval result of the webpage to be published indicates approval pass;
[0024] In the case where the approval operation instruction is a withdrawal instruction, the publishing process for the web page to be published is withdrawn.
[0025] In one embodiment, publishing the static web page file to a preset server node includes:
[0026] Upload the static web page file to a preset object storage service;
[0027] Acquire each preset server node in the content distribution network, and synchronize the static web page files stored in the object storage service to each preset server node.
[0028] In a second aspect, the present application also provides a static web page publishing device, comprising:
[0029] A webpage acquisition and saving module, used for acquiring and storing a webpage to be published edited by the user in the content management system in response to a save operation instruction triggered by the user in the content management system;
[0030] A web page publishing approval module, configured to execute an approval process for the web page to be published in response to a publishing operation instruction triggered by the user in the content management system;
[0031] A web page staticization module, used for, when the approval result of the approval process indicates that the approval is passed, performing static processing on the web page to be published to obtain a static web page file of the web page to be published;
[0032] The web page static publishing module is used to publish the static web page file to a preset server node.
[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0034] In response to a save operation instruction triggered by a user in a content management system, acquiring and storing a webpage to be published edited by the user in the content management system;
[0035] In response to a publishing operation instruction triggered by the user in the content management system, executing an approval process for the web page to be published;
[0036] When the approval result of the approval process indicates that the approval is passed, static processing is performed on the web page to be published to obtain a static web page file of the web page to be published;
[0037] The static web page file is published to a preset server node.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0039] In response to a save operation instruction triggered by a user in a content management system, acquiring and storing a webpage to be published edited by the user in the content management system;
[0040] In response to a publishing operation instruction triggered by the user in the content management system, executing an approval process for the web page to be published;
[0041] When the approval result of the approval process indicates that the approval is passed, static processing is performed on the web page to be published to obtain a static web page file of the web page to be published;
[0042] The static web page file is published to a preset server node.
[0043] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0044] In response to a save operation instruction triggered by a user in a content management system, acquiring and storing a webpage to be published edited by the user in the content management system;
[0045] In response to a publishing operation instruction triggered by the user in the content management system, executing an approval process for the web page to be published;
[0046] When the approval result of the approval process indicates that the approval is passed, static processing is performed on the web page to be published to obtain a static web page file of the web page to be published;
[0047] The static web page file is published to a preset server node.
[0048] The above-mentioned web page static publishing method, device, computer equipment, computer-readable storage medium and computer program product firstly obtain and store the web page to be published edited by the user in the content management system in response to the save operation instruction triggered by the user in the content management system. By automatically obtaining and storing the web page to be published edited by the user in the content management system, the operation personnel can directly operate without relying on the front-end developers; then, in response to the publishing operation instruction triggered by the user in the content management system, the approval process for the web page to be published is executed. Before the content is published, the approval process is automatically triggered to ensure that there is appropriate review and confirmation before each content is published, so as to avoid publishing erroneous content, improve work efficiency and reduce the risk of operation errors; then , when the approval result of the approval process indicates that the approval is passed, the web page to be published is statically processed to obtain the static web page file of the web page to be published. After the approval is passed, the static processing is automatically performed to convert the dynamic web page content into a static file, which can reduce the page loading time and improve the user experience. The static file does not need to rely on dynamic content generation, which reduces the server load and improves the security and stability of the website; finally, the static web page file is published to the preset server node. By automatically publishing the generated static web page file to the preset server node, the manual upload and synchronization process is avoided, the publishing efficiency and accuracy are improved, and all static files can be distributed efficiently, providing a better user access experience. In the above method, through the automated content storage, approval, static processing and publishing process, not only the management of static website content is simplified, but also the publishing efficiency and accuracy are greatly improved. It reduces the dependence of operators on front-end development skills, reduces manual operations, and ensures the timeliness and accuracy of the publishing process. Static processing significantly improves the performance and security of the website, and multi-server node distribution ensures a fast and stable access experience worldwide. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A schematic diagram of a process of a method for statically publishing a web page in one embodiment;
[0051] Figure 2 A schematic diagram of a flow chart of steps for obtaining a static web page file in one embodiment;
[0052] Figure 3A flowchart of a method for statically publishing a web page in another embodiment;
[0053] Figure 4 A system architecture diagram of a web page static publishing system in one embodiment;
[0054] Figure 5 A structural block diagram of a static web page publishing device in one embodiment;
[0055] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0057] In one embodiment, Figure 1 As shown, a method for statically publishing a web page is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. In this embodiment, the method includes the following steps:
[0058] Step S101 , in response to a save operation instruction triggered by a user in a content management system, obtaining and storing a web page to be published edited by the user in the content management system.
[0059] Among them, the web pages to be published refer to the web page content that has been edited and modified by the user in the content management system and has not yet been published to the front end of the website. The content can include multiple elements such as text, images, videos, styles, etc.
[0060] Exemplarily, the terminal receives the user's editing operation through the interface of the content management system. When the user completes editing the webpage content and clicks the "Save" button, the terminal automatically captures the user's edited content and converts it into a storable format. After the save operation is triggered, the terminal stores the webpage content in a local or cloud storage system and assigns a unique version identifier to the content. This identifier is used for subsequent version control and management to ensure that content updates are traceable.
[0061] Specifically, when a user modifies or adds content in the content management system, the terminal will immediately save these changes. Whether it is text, pictures, videos or styles, all content will be collected and packaged into a complete web page data structure. When saving, the terminal will also record metadata such as the modified timestamp, editor, and modified content, and store it together with the web page content. In order to ensure efficient and secure operations, the system will regularly back up data and generate backup logs to prevent data loss.
[0062] Step S102, in response to a publishing operation instruction triggered by a user in the content management system, executing an approval process for the web page to be published.
[0063] The publishing operation instruction refers to the operation command that the user chooses to publish a web page in the content management system, which usually includes clicking the publish button or other confirmation operations. This instruction is used to trigger the subsequent approval process to ensure that the content is properly reviewed before being published.
[0064] Exemplarily, the terminal will respond to the publishing operation instruction triggered by the user and automatically start the approval mechanism according to the preset process. After the user clicks the "Publish" button, the terminal will first check whether the latest version of the current web page to be published has been saved to ensure that the final version is published. Then, the terminal will automatically generate an approval task according to the configuration of the content management system and assign it to the designated approver or approval group. The approval task contains all relevant information of the web page to be published, including web page content, version number, modification history, and editors. The terminal then sends the approval task to the approval node and provides the approver with a review interface to display the content and related data of the web page to be published. The approver can view the web page content and make modification suggestions or approvals as needed. If the approver finds that the web page content is not compliant or needs further modification, the terminal will record the approval opinion and return the task to the content editor for modification. After the approval is passed, the terminal will record the approval result and update the status of the web page to be published to "approved", and prepare for subsequent staticization and publishing operations. The execution of the entire approval process ensures that the content is strictly reviewed before publication to ensure the quality and compliance of the content.
[0065] Step S103, when the approval result of the approval process indicates that the approval is passed, static processing is performed on the web page to be published to obtain a static web page file of the web page to be published.
[0066] Among them, static processing refers to converting dynamically generated web page content into static files for efficient loading and distribution. Static web page files are processed HTML files and their related resources (such as CSS, JavaScript, and images), which no longer rely on real-time calculations of the backend server.
[0067] Exemplarily, first, the terminal will generate a static HTML file based on the content of the web page to be published, including all approved texts, images, media files, etc. Next, the terminal will archive the resource files (such as style sheets, script files, pictures, etc.) in the page, package them together with the HTML file, and assign a separate storage path to each file. During the static processing, the terminal will ensure that all externally referenced resources are correctly integrated into the static web page file to avoid the page from being displayed normally due to missing resources. The terminal may perform some optimization operations, such as compressing and merging JavaScript files, CSS files, etc., to reduce page loading time and network bandwidth consumption. After the staticization is completed, the static web page file generated by the terminal will be stored as an independent file package, including a static HTML file and related resource files. After the static web page file is ready, it will enter the next step of publishing and distribution.
[0068] Step S104: publish the static web page file to a preset server node.
[0069] Among them, the server node can refer to a storage unit in a content delivery network (CDN) or a cloud storage service, which is responsible for storing, caching and distributing static web page files.
[0070] Exemplarily, first, the terminal determines the storage target of the static web page file, which is usually a cloud storage service (such as object storage service, OBS) or a preset content distribution network (CDN) node. The terminal uploads the static web page file and related resource files (such as HTML, CSS, JavaScript, pictures, etc.) to these storage nodes to ensure that the files can be quickly accessed globally. During the file upload process, the terminal distributes the static web page file to multiple distributed server nodes to ensure that each node has the latest version of the web page file. After uploading to the server node, the terminal will also configure the content cache policy to control the storage period, update frequency and cache refresh mechanism of the file. In this way, the static web page file can be efficiently synchronized and updated between various nodes to ensure that users always get the latest version of the web page. At the same time, the terminal will use CDN technology to automatically distribute static web page files worldwide. When a user visits a website, the CDN will automatically select the nearest node for content loading based on its geographical location, thereby greatly shortening the page loading time and improving the user access experience.
[0071] In the above-mentioned static web page publishing method, first, in response to the save operation instruction triggered by the user in the content management system, the web page to be published edited by the user in the content management system is obtained and stored. By automatically obtaining and storing the web page to be published edited by the user in the content management system, the operation personnel can directly operate without relying on the front-end developers; then, in response to the publishing operation instruction triggered by the user in the content management system, the approval process for the web page to be published is executed. Before the content is published, the approval process is automatically triggered to ensure that there is appropriate review and confirmation before each content is published, avoid publishing erroneous content, improve work efficiency, and reduce the risk of operational errors; then, in the approval result representation of the approval process, In the case of approval, the web page to be published is statically processed to obtain the static web page file of the web page to be published. After approval, the static processing is automatically performed to convert the dynamic web page content into a static file, which can reduce the page loading time and improve the user experience. The static files do not need to rely on dynamic content generation, which reduces the server load and improves the security and stability of the website. Finally, the static web page file is published to the preset server node. By automatically publishing the generated static web page file to the preset server node, the manual upload and synchronization process is avoided, the publishing efficiency and accuracy are improved, and all static files can be distributed efficiently, providing a better user access experience. In the above method, through the automated content preservation, approval, static processing and publishing process, not only the management of static website content is simplified, but also the publishing efficiency and accuracy are greatly improved. It reduces the dependence of operators on front-end development skills, reduces manual operations, and ensures the timeliness and accuracy of the publishing process. Static processing significantly improves the performance and security of the website, and multi-server node distribution ensures a fast and stable access experience worldwide.
[0072] In an exemplary embodiment, Figure 2 As shown, the above step S103 performs static processing on the web page to be published to obtain a static web page file of the web page to be published, which can also be achieved by the following steps:
[0073] Step S201, pre-rendering the dynamic content in the web page to be published, and generating a corresponding static web page structure file;
[0074] Step S202, extracting the resource files referenced in the web page to be published, and associating the static web page structure file with the resource files by path according to a preset rule, to obtain the static web page structure file after resource association;
[0075] Step S203, merging, compressing and updating the resource files to obtain updated resource files;
[0076] Step S204: Pack the resource-associated static web page structure file and the updated resource file to obtain a file package of the static web page file.
[0077] Among them, static web page files refer to file packages that contain web page content and related resources after static processing, usually including HTML files and static resource files such as CSS, JavaScript, and pictures.
[0078] Exemplarily, first, the terminal pre-renders the dynamic content in the web page to be published and generates the corresponding static web page structure file. The terminal converts the dynamic page into a static HTML page according to the web page content, and staticizes the content that originally depends on the background database or real-time processing (such as user input data, dynamically generated text, images or tables, etc.), and converts it into a complete static web page without background support; specifically, the Nuxt.js framework is used to convert the dynamically generated web page content into a static HTML file through server-side rendering (SSR), avoiding the web page content from relying on real-time generation when the user visits. Next, the terminal extracts all resource files referenced in the web page to be published, including CSS style files, JavaScript script files, pictures, fonts, etc. The terminal associates the static web page structure file with these resource files according to preset rules. The preset rules may include replacing the external resource link in the static web page with the local path, updating the file version number, optimizing the path of the file, etc., to ensure that each resource in the static web page can be loaded normally without dynamic background support. Then, the terminal merges, compresses and updates the extracted resource files. For example, multiple JavaScript files and CSS files can be combined into a single file to reduce the number of HTTP requests when loading a page; at the same time, the file content can be compressed through a compression algorithm to reduce the file size, thereby speeding up the loading of the web page. In addition, the terminal will ensure that all resource files are the latest version, such as by clearing the old version cache and updating the file version to ensure that the static web page files do not reference expired or damaged resources. After completing these operations, the terminal will package the generated resource-associated static web page structure file with the updated resource file to obtain a file package for the static web page file. The file package includes static resources such as HTML files, CSS, JavaScript files, images, etc., and is organized according to a reasonable directory structure to ensure that the path of each file is correct and can be loaded.
[0079] In this embodiment, the dynamic content of the web page to be published is pre-rendered and a static web page structure file is generated, combined with the extraction, merging, compression and update processing of the resource files, which significantly improves the web page loading speed and performance. After the static processing, the web page no longer relies on the dynamic generation of the background, which reduces the burden on the server, thereby improving the stability and security of the website. Through path association, it is ensured that the static web page files and resource files can be loaded correctly, and the file size is optimized by merging and compression, which further speeds up the web page response speed and reduces bandwidth consumption. In addition, the generated static web page file package can be efficiently distributed to the preset server nodes, ensuring that users around the world can quickly access the latest web page content.
[0080] In an exemplary embodiment, the above step S101 acquires and stores the webpage to be published edited by the user in the content management system, and further includes: acquiring the webpage to be published and assigning a corresponding version identifier to the webpage to be published; and storing the webpage to be published and the corresponding version identifier.
[0081] Exemplarily, the terminal first obtains the content of the web page to be published, including all elements edited by the user in the content management system. After obtaining, the terminal will assign a unique version identifier to the web page to be published, which is used to distinguish different versions of the web page and provide a basis for subsequent version management, comparison and rollback. Each time the content of the web page is updated, the terminal will generate a new version identifier to ensure that the user can trace and manage the content of each version. If the web page to be published is edited for the first time, the terminal will assign an initial version identifier 1.0 to the web page. This version identifier indicates that the web page is published for the first time, and the identifier is 1.0. At this time, the web page content will be stored together with the version identifier. If the web page to be published has been updated many times, the terminal needs to determine the version number based on the previous version stored in the content management system. The terminal will find and obtain the previous version identifier of the web page, and then increment the version number. For example, if the previous version is 2.3, the new version number will be 2.4; if the previous version is 1.9, the new version number will be 2.0. This method ensures that the version number can be automatically superimposed after each update, and accurately records the updated content of each version. Next, the terminal will store the content of the web page to be published and its corresponding version identifier in the content management system, and save it together with other relevant metadata of the web page (such as editing time, editor, etc.). This ensures the persistence of the web page content and provides a reliable data foundation for subsequent version management, approval, static processing and publishing.
[0082] In this embodiment, the version management problem is solved by assigning a unique version identifier to the web page to be published when obtaining it, and storing the version identifier together with the web page content. After each web page is updated, the new version identifier ensures the history record and change traceability of the content. It ensures the real-time preservation of the web page content, and provides accurate version control for subsequent approval, static processing and publishing, thereby improving the efficiency and operability of content management.
[0083] In an exemplary embodiment, the above-mentioned static web page publishing method also includes: in response to an instruction to compare any two versions of a web page, obtaining any two versions of the web page to be published; displaying any two versions of the web page to be published, and highlighting the difference content between any two versions of the web page to be published.
[0084] Exemplarily, the terminal responds to the comparison instruction issued by the user and obtains any two versions of the web page to be published according to the instruction. First, the user selects two different version numbers (such as 1.0 and 2.0) and submits a comparison request. The terminal extracts the web page content of the two versions from the storage according to the version identifier specified by the user and loads them for comparison. The obtained web page content includes all elements such as text, images, styles, scripts, etc. Next, the terminal will display the two versions of the web page to be published. The display method is usually side by side, which is convenient for users to clearly compare the differences between the two versions. The terminal will compare text, images, styles and other multimedia elements one by one according to the changes in the web page content. If there are differences, the terminal will highlight the comparison results and highlight different parts (for example, modified text, added or deleted content, style changes, etc.) to help users quickly identify the specific changes between different versions. In addition, the terminal will also display the specific details of each modification, such as the timestamp of the modification, the modifier, and the specific modification content, etc., to help users better understand the background and significance of each change.
[0085] In this embodiment, by comparing any two versions of web page content, users can quickly and intuitively understand the changes and updates of web page content, effectively improving the transparency of version management and ensuring that users can clearly see the specific content and changes of each update. Highlighting the difference further improves the user's operating efficiency, especially when the content is frequently updated, which can effectively reduce the time for manual inspection of differences. In addition, the version comparison function also provides support for content rollback and approval, allowing users to make more accurate decisions based on version differences.
[0086] In an exemplary embodiment, the above-mentioned step S102 executes the approval process for the web page to be published, and also includes: displaying a preview page of the web page to be published in a preset approval node; obtaining the approval operation instruction of the approver corresponding to the approval node for the web page to be published; when the approval operation instruction is an approval pass instruction, determining that the approval result of the web page to be published indicates approval pass; when the approval operation instruction is a withdrawal instruction, withdrawing the publishing process for the web page to be published.
[0087] The approval process refers to the review process to ensure that the webpage to be published meets the publishing standards and content quality, which usually includes content review, modification suggestions and final approval. This process can ensure that the webpage content complies with the regulations of the company or platform before publishing, and avoid erroneous or non-compliant content from being released online.
[0088] Exemplarily, first, the terminal will display a preview page of the web page to be published in the preset approval node, so that the approver can view the content of the web page without actually publishing it. The preview page includes all elements of the web page, such as text, images, videos, styles, and interactive functions, etc., to ensure that the approver can comprehensively and intuitively review the final effect of the web page. Next, the terminal will wait for the approver's approval operation instructions for the web page to be published. After viewing the preview content on the page, the approver can choose to execute an approval operation instruction. Common approval operation instructions include:
[0089] Approval passed instruction: If the approver believes that the webpage to be published meets the publishing standards and quality requirements, the approver will select the "Approval passed" instruction, indicating that the webpage is ready for publication. After receiving the "Approval passed instruction", the terminal will determine that the approval result of the webpage to be published is "Approval passed" and update the status to the system, indicating that the webpage has passed the review and is ready for static processing and publication.
[0090] Withdrawal instruction: If the reviewer believes that the content of the webpage is incorrect or needs further modification, the reviewer can select "Withdrawal instruction" to request to stop the current publishing process. After receiving the "Withdrawal instruction", the terminal will immediately stop the publishing process of the webpage and notify the content editor to make modifications. At this time, the approval status of the webpage to be published will be updated to "Withdrawn", and the status will be fed back to the relevant personnel for subsequent modification and resubmission for approval. After the withdrawal instruction is executed, the terminal will check whether there is an old version of the webpage to be published that has been approved. If it exists, the old version will be automatically restored and continue to be published. Specifically, the terminal will retrieve and confirm that the status of the old version is "Approved", and then mark the old version as the current version to be published, and use it for subsequent static processing and publishing. The terminal ensures that after the current version is withdrawn, the old version that has been approved can continue to be published uninterruptedly, thereby avoiding publishing interruptions and delays in content updates.
[0091] During this process, the terminal will record the operation instructions, reviewers and their opinions of each approval, ensuring the traceability of the entire approval process. Through the reviewer's instructions, the terminal can accurately control the progress and status of the web page release and make appropriate operations based on the approval results.
[0092] In this embodiment, by displaying the preview page of the web page to be published in the preset approval node and obtaining the operating instructions of the approver, it is ensured that the content of the web page to be published is fully reviewed. The introduction of approval instructions and withdrawal instructions makes the approval process more flexible and efficient, and can ensure that only web pages that meet the publishing standards are published, avoiding the release of erroneous or non-compliant content. By recording the instructions and opinions of the approvers, the transparency and traceability of the approval process are improved, providing a basis for subsequent web page modifications, rollbacks, and resubmissions. The quality and accuracy of content publishing are improved, ensuring that the published content meets the requirements of the company or platform.
[0093] In an exemplary embodiment, the above step S104 publishes the static web page file to the preset server node, and also includes: uploading the static web page file to the preset object storage service; obtaining each preset server node in the content distribution network, and synchronizing the static web page file stored in the object storage service to each preset server node.
[0094] Exemplarily, the terminal first uploads the static web page file to a preset object storage service (for example, using an object storage service (OBS)). The object storage service is used to store static files and provides high reliability, high availability, and high scalability. The terminal uploads the static web page file to the object storage system by calling the API of the storage service. These files are stored in the cloud to ensure data security and can be quickly accessed worldwide. Each file is assigned a unique identifier and storage path to facilitate subsequent retrieval, access, and management. By uploading static files to cloud storage, the terminal achieves long-term storage of data and prepares for subsequent content distribution. Once the static web page file is successfully uploaded to the object storage service, the terminal obtains each preset server node in the content delivery network (CDN). CDN is a distribution network composed of multiple cache server nodes distributed in different regions of the world, which aims to improve the access speed of web pages and reduce server load through a caching mechanism. The terminal obtains a list of all preset server nodes by accessing the CDN service, and synchronizes static files according to these nodes. The terminal synchronizes the static web page files stored in the object storage service to each preset CDN node. The synchronization process is usually carried out through CDN caching. The CDN node will cache the static web page files to its local storage so that subsequent users can obtain the content more quickly when accessing. The specific steps are as follows:
[0095] File synchronization: The terminal sends a file synchronization request to each preset node through the CDN interface, pushing the latest version of the static web page files from the object storage service to each CDN node. These files include static resources such as HTML, CSS, JavaScript, and images, ensuring that each node has the latest web page content.
[0096] Cache distribution: Once the file synchronization is completed, the CDN node will cache these static files locally and set the cache time of the files according to the predetermined cache rules. CDN nodes will give priority to caching static web page files to ensure that users get content from the nearest node, thereby improving loading speed.
[0097] Intelligent Scheduling: When a user requests a web page, CDN will intelligently select the best cache node to respond to the user's request based on the user's geographic location, network conditions, and the current node load. By selecting the node closest to the user, access delays are reduced and page loading speeds are increased.
[0098] The terminal will also refresh the cache in the CDN node regularly or according to specific rules to ensure that the cache content is consistent with the latest version of the static web page file. This cache refresh mechanism can be executed regularly or based on trigger events of content updates. For example, when the web page content is updated, the system can automatically clear the old cache and synchronize the latest content to the CDN node.
[0099] In this embodiment, by uploading static web page files to the object storage service and synchronizing them to the preset CDN server nodes, efficient file storage and distribution are achieved. The object storage service ensures the security and high availability of files, while the CDN distribution mechanism improves the speed and stability of web page access. By distributing and synchronizing static web page files to multiple preset nodes, it can ensure that users obtain static web page files from the nearest server node, thereby reducing loading time, optimizing bandwidth usage, and improving user access experience. At the same time, it also reduces the load on the source server and improves the scalability and maintainability of the website.
[0100] In an exemplary embodiment, the present application provides another method for statically publishing a web page. The method flow is as follows: Figure 3 As shown, including:
[0101] 1. Editors enter the CMS platform to write content
[0102] •Login and permission verification: Editors first need to log in to the content management platform (CMS platform) through identity authentication to ensure that only authorized users can access and edit content.
[0103] •Content editing interface: After logging in, editors will see an intuitive content editing interface that supports the input and editing of multiple formats such as text, images, and videos.
[0104] •Real-time saving function: In order to prevent accidental data loss, the CMS platform provides a real-time saving function, allowing editors to save drafts at any time to avoid data loss.
[0105] 2. Save and preview after writing
[0106] •Save operation: After editing is completed, the editor clicks the Save button, the system will save the content to the database and generate an initial version (such as 1.0).
[0107] • Preview function: After saving successfully, editors can click the preview button to view the actual effect of the content. The preview interface should be as close as possible to the final published effect so that editors can make adjustments.
[0108] 3. After previewing and confirming that everything is correct, if you need to publish it, submit it for approval
[0109] • Submit for approval: After the preview is correct, the editor clicks the publish button and the system will prompt to submit for approval. The approval process may include multiple steps, such as superior approval, security approval, etc.
[0110] • Approval process: The approval process should be transparent and efficient. Supervisors and security personnel can view the content to be approved in the system and give their approval opinions. After approval, the system will notify the editor to publish it.
[0111] 4. If the superior or administrator confirms that the published content is not compliant, it can be manually withdrawn or rolled back to the previous version
[0112] •Manual withdrawal: If a superior or administrator finds that the published content is non-compliant or erroneous, they can manually withdraw the content so that it is no longer displayed to the public.
[0113] • Version rollback: In addition to manual withdrawal, the system also supports version rollback. Editors or administrators can choose to roll back to the previous version or a specified version to ensure the accuracy and stability of the content.
[0114] 5. If editors need to obtain the difference between the newly edited content and the previous version, they can select the version for comparison
[0115] •Version comparison function: The CMS platform provides a version comparison function. Editors can select two versions for comparison, and the system will display the differences between the two versions in an intuitive way (such as marking in red).
[0116] •Difference highlighting: The comparison results should be clear and the differences should be highlighted so that editors can quickly locate and understand the modifications.
[0117] 6. During the publishing process, the CMS platform uses nuxt.js to edit the dynamic content to static content, and then uploads the static content to OBS (object storage service) for static hosting.
[0118] •Nuxt.js staticization: During the publishing process, the CMS platform will use the Nuxt.js framework to staticize dynamic content. This means that the content will be pre-rendered into HTML files, which will speed up page loading and improve security.
[0119] •OBS static hosting: Staticized content will be uploaded to OBS for hosting. OBS provides a highly available and scalable storage solution to ensure the stability and security of content.
[0120] 7. Cache acceleration through CDN
[0121] •CDN cache acceleration: In order to speed up the loading of images and videos, the CMS platform will use CDN (Content Distribution Network) for cache acceleration. CDN will distribute content to nodes around the world, and users will get content from the nearest node when accessing, thereby shortening the loading time.
[0122] • Intelligent Scheduling: CDN has intelligent scheduling capabilities, which can select the optimal node for content distribution based on factors such as the user’s geographic location and network conditions.
[0123] Furthermore, in a specific example, Figure 4 As shown, in an example, is an architecture diagram of a web page static publishing system that executes the above-mentioned web page static publishing method.
[0124] Among them, domain name access: users access the website through the domain name and enter the traffic entrance of the entire system.
[0125] Website frontend: As the first-level access interface for users, it is used to receive user access requests and direct traffic to subsequent modules.
[0126] Ingress module: The core module for traffic management and distribution. After receiving the traffic forwarded by the front-end, the Ingress module routes the request to different internal service instances according to the path or rule. It provides basic reverse proxy, routing and load balancing functions.
[0127] Content delivery network service instance: As a service layer for dynamic and static resource distribution, it is used to process requests related to front-end display. It is further forwarded to the object storage service to obtain resources, or returns data based on user requests.
[0128] Object cloud storage service instance: used to store static web page files (HTML, CSS, JavaScript) and resource files (images, videos, etc.). The external network service provides fast file distribution services through it.
[0129] Single Sign-On Management (SSO): Provides unified identity authentication services to ensure that users can access multiple subsystems with just one login. It ensures the security of background content management and static processing permissions.
[0130] Content Management System (CMS): The core content processing module used to manage articles, columns, and various content resources. System administrators can add, edit, review, and publish content here, and complete all content-related operations.
[0131] Static site generation (based on Nuxt.js): The core static module. It receives content submitted by the content management system and generates static web page files from dynamic content based on the Nuxt.js framework.
[0132] The static files are uploaded to the object storage service for external network access.
[0133] Database: used to store all data of the content management system, including article content, user information, operation records, permission configuration, etc.
[0134] In addition to the main process of user access, it also includes the "traffic management and system monitoring" module. It is responsible for real-time monitoring of the traffic distribution and operating status of the entire system to ensure the efficiency and security of traffic routing and content distribution. This can be achieved using Istio-GW (Istio Gateway).
[0135] A table view showing management articles in a content management system, where the content includes column names: title, sender, status, article time, news position, latest operator, latest operation time and operation.
[0136] In the interface for adding new articles, users can enter a title: an input box. Summary: an input box. Time: a date picker that allows users to select the time when the article will be published. Cover: supports users to upload pictures. Body editor: a rich text editor that supports users to enter the body of the article and provides basic formatting options such as bold, underline, list, insert pictures, etc. Operation buttons at the bottom: including "Save", "PC Preview", "Mobile Preview" and "Submit" buttons. Users can choose to save the draft, preview the effect of the article on different terminals or submit the article directly.
[0137] In this embodiment, an efficient and stable method for statically publishing web pages is provided, which optimizes content editing, publishing processes and website performance by combining technologies such as content management system (CMS), static processing of Nuxt.js framework, CDN acceleration, version control and traffic management. Editors use the CMS platform to write, save, preview and version content to ensure the accuracy and security of the content. Static processing converts dynamic content into static web page files, which not only improves the page loading speed, but also reduces the system load and enhances security. Through CDN acceleration, static web page files and resources are distributed to global nodes, shortening the loading time and improving access efficiency. Traffic management and load balancing are implemented through the Ingress module and Istio-GW to ensure refined traffic control and high availability, and to ensure stable system operation by real-time monitoring of the system health status. The overall architecture is efficient and secure, provides flexible permission management and version control functions, supports rapid content updates and releases, and greatly improves the user experience and system scalability.
[0138] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0139] Based on the same inventive concept, the embodiment of the present application also provides a static web page publishing device for implementing the static web page publishing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the static web page publishing device provided below can refer to the limitations of the static web page publishing method above, and will not be repeated here.
[0140] In an exemplary embodiment, Figure 5 As shown, a web page static publishing device is provided, including: a web page acquisition and storage module 501, a web page publishing and approval module 502, a web page staticization module 503 and a web page static publishing module 504, wherein:
[0141] The webpage acquisition and storage module 501 is used to acquire and store the webpage to be published edited by the user in the content management system in response to the save operation instruction triggered by the user in the content management system;
[0142] The web page publishing approval module 502 is used to execute the approval process for the web page to be published in response to the publishing operation instruction triggered by the user in the content management system;
[0143] The webpage staticization module 503 is used to staticize the webpage to be published when the approval result of the approval process indicates that the approval is passed, and obtain a static webpage file of the webpage to be published;
[0144] The web page static publishing module 504 is used to publish the static web page file to a preset server node.
[0145] In one of the embodiments, the web page staticization module 503 is also used to pre-render the dynamic content in the web page to be published to generate a corresponding static web page structure file; extract the resource files referenced in the web page to be published, and path-associate the static web page structure file with the resource file according to preset rules to obtain the static web page structure file after resource association; merge, compress and update the resource files to obtain the updated resource files; package the static web page structure file after resource association and the updated resource files to obtain a file package of the static web page file.
[0146] In one embodiment, the web page acquisition and storage module 501 is further used to acquire the web page to be published, assign a corresponding version identifier to the web page to be published, and store the web page to be published and the corresponding version identifier.
[0147] In one of the embodiments, the above-mentioned web page static publishing device also includes a version comparison module, which is used to respond to a web page comparison instruction for any two versions, obtain any two versions of the web page to be published; display any two versions of the web page to be published, and highlight the difference content between any two versions of the web page to be published.
[0148] In one of the embodiments, the web page publishing approval module 502 is also used to display a preview page of the web page to be published in a preset approval node; obtain the approval operation instructions of the approver corresponding to the approval node for the web page to be published; when the approval operation instruction is an approval pass instruction, determine that the approval result of the web page to be published indicates approval pass; when the approval operation instruction is a withdrawal instruction, withdraw the publishing process for the web page to be published.
[0149] In one of the embodiments, the web page static publishing module 504 is also used to upload static web page files to a preset object storage service; obtain each preset server node in the content distribution network, and synchronize the static web page files stored in the object storage service to each preset server node.
[0150] Each module in the above-mentioned web page static publishing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0151] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a static publishing method for a web page is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0152] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0153] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0154] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0155] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0156] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0157] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0158] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0159] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for statically publishing a web page, characterized in that: The method comprises: In response to a save operation instruction triggered by a user in a content management system, acquiring and storing a webpage to be published edited by the user in the content management system; In response to a publishing operation instruction triggered by the user in the content management system, executing an approval process for the web page to be published; When the approval result of the approval process indicates that the approval is passed, static processing is performed on the web page to be published to obtain a static web page file of the web page to be published; The static web page file is published to a preset server node.
2. The method according to claim 1, characterized in that: The step of performing static processing on the web page to be published to obtain a static web page file of the web page to be published includes: Pre-rendering the dynamic content in the web page to be published to generate a corresponding static web page structure file; Extracting the resource files referenced in the webpage to be published, and associating the paths of the static webpage structure files with the resource files according to a preset rule, to obtain the static webpage structure files after resource association; Merging, compressing and updating the resource files to obtain updated resource files; The static webpage structure file associated with the resource and the updated resource file are packaged to obtain a file package of the static webpage file.
3. The method according to claim 1, characterized in that The obtaining and storing the webpage to be published edited by the user in the content management system includes: Acquire the web page to be published, and assign a corresponding version identifier to the web page to be published; The web page to be published and the corresponding version identifier are stored.
4. The method according to claim 3, characterized in that: The method further comprises: In response to an instruction to compare any two versions of a web page, obtaining the any two versions of the web pages to be published; The two versions of the web pages to be published are displayed, and the difference between the two versions of the web pages to be published is highlighted.
5. The method according to claim 1, characterized in that The executing of the approval process for the web page to be published includes: In the preset approval node, displaying a preview page of the web page to be published; Obtaining the approval operation instruction of the approval personnel corresponding to the approval node for the web page to be published; In the case where the approval operation instruction is an approval pass instruction, determining that the approval result of the webpage to be published indicates approval pass; In the case where the approval operation instruction is a withdrawal instruction, the publishing process for the web page to be published is withdrawn.
6. The method according to any one of claims 1 to 5, characterized in that: Publishing the static web page file to a preset server node includes: Upload the static web page file to a preset object storage service; Acquire each preset server node in the content distribution network, and synchronize the static web page files stored in the object storage service to each preset server node.
7. A static web page publishing device, characterized in that: The device comprises: A webpage acquisition and saving module, used for acquiring and storing a webpage to be published edited by the user in the content management system in response to a save operation instruction triggered by the user in the content management system; A web page publishing approval module, configured to execute an approval process for the web page to be published in response to a publishing operation instruction triggered by the user in the content management system; A web page staticization module, used for, when the approval result of the approval process indicates that the approval is passed, performing static processing on the web page to be published to obtain a static web page file of the web page to be published; The web page static publishing module is used to publish the static web page file to a preset server node.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.